diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/CMakeLists.txt b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/CMakeLists.txt index 8c79e8ebac42b42a92a98d23f8331986ab40fc41..b073049c071e1494c8bebb3ac9a7cdeb3a77010e 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/CMakeLists.txt +++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/CMakeLists.txt @@ -15,7 +15,6 @@ atlas_depends_on_subdirs( PRIVATE Event/EventPrimitives Event/FourMomUtils Event/xAOD/xAODCaloEvent - Event/xAOD/xAODEventInfo Event/xAOD/xAODMuon Event/xAOD/xAODMuonCnv Event/xAOD/xAODTracking @@ -55,7 +54,8 @@ atlas_depends_on_subdirs( PRIVATE Tracking/TrkEvent/TrkTrack Tracking/TrkEvent/TrkTrackSummary Tracking/TrkExtrapolation/TrkExInterfaces - Tracking/TrkTools/TrkToolInterfaces ) + Tracking/TrkTools/TrkToolInterfaces + InnerDetector/InDetConditions/InDetBeamSpotService) # External dependencies: find_package( CLHEP ) @@ -67,5 +67,5 @@ atlas_add_component( MuonCombinedBaseTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} CaloEvent AthLinks AthenaBaseComps Identifier EventPrimitives FourMomUtils xAODCaloEvent xAODEventInfo xAODMuon xAODTracking xAODTruth GaudiKernel MagFieldInterfaces MuonReadoutGeometry MuonIdHelpersLib MuonCompetingRIOsOnTrack MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces MuonSegmentMakerUtils MuonSelectorToolsLib ICaloTrkMuIdTools MuGirlInterfaces MuidInterfaces MuonCombinedEvent MuonCombinedToolInterfaces muonEvent MuidEvent ParticleTruth RecoToolInterfaces TrackToCaloLib TrkGeometry TrkSurfaces TrkCaloExtension TrkEventPrimitives TrkEventUtils TrkMaterialOnTrack TrkParameters TrkParametersIdentificationHelpers TrkSegment TrkTrack TrkTrackSummary TrkExInterfaces TrkToolInterfaces ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} CaloEvent AthLinks AthenaBaseComps Identifier EventPrimitives FourMomUtils xAODCaloEvent xAODEventInfo xAODMuon xAODTracking xAODTruth GaudiKernel MagFieldInterfaces MuonReadoutGeometry MuonIdHelpersLib MuonCompetingRIOsOnTrack MuonRIO_OnTrack MuonSegment MuonRecHelperToolsLib MuonRecToolInterfaces MuonSegmentMakerUtils MuonSelectorToolsLib ICaloTrkMuIdTools MuGirlInterfaces MuidInterfaces MuonCombinedEvent MuonCombinedToolInterfaces muonEvent MuidEvent ParticleTruth RecoToolInterfaces TrackToCaloLib TrkGeometry TrkSurfaces TrkCaloExtension TrkEventPrimitives TrkEventUtils TrkMaterialOnTrack TrkParameters TrkParametersIdentificationHelpers TrkSegment TrkTrack TrkTrackSummary TrkExInterfaces TrkToolInterfaces InDetBeamSpotServiceLib ) diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx index 5f5a25d5acad6e70137374f63abe7b272615fe5a..bbcb2f5fce7850e98ecbdf23b7bfa3766c9a2cc2 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx +++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.cxx @@ -15,7 +15,7 @@ #include "MuonRecHelperTools/MuonEDMPrinterTool.h" #include "TrkToolInterfaces/ITrackAmbiguityProcessorTool.h" #include "MuonRecToolInterfaces/IMuonTrackExtrapolationTool.h" -#include "xAODEventInfo/EventInfo.h" +#include "InDetBeamSpotService/IBeamCondSvc.h" namespace MuonCombined { @@ -26,7 +26,8 @@ namespace MuonCombined { m_printer("Muon::MuonEDMPrinterTool/MuonEDMPrinterTool"), m_trackBuilder("Rec::CombinedMuonTrackBuilder/CombinedMuonTrackBuilder"), m_trackExtrapolationTool("ExtrapolateMuonToIPTool/ExtrapolateMuonToIPTool"), - m_ambiguityProcessor("Trk::TrackSelectionProcessorTool/MuonAmbiProcessor") + m_ambiguityProcessor("Trk::TrackSelectionProcessorTool/MuonAmbiProcessor"), + m_beamService("BeamCondSvc", name) { declareInterface<IMuonCandidateTool>(this); declareProperty("Printer",m_printer ); @@ -34,6 +35,7 @@ namespace MuonCombined { declareProperty("TrackBuilder",m_trackBuilder ); declareProperty("TrackExtrapolationTool",m_trackExtrapolationTool ); declareProperty("AmbiguityProcessor",m_ambiguityProcessor ); + declareProperty("BeamSpotSvc", m_beamService); } MuonCandidateTool::~MuonCandidateTool() @@ -46,6 +48,7 @@ namespace MuonCombined { if( !m_trackBuilder.empty() ) ATH_CHECK(m_trackBuilder.retrieve()); if( !m_trackExtrapolationTool.empty() ) ATH_CHECK(m_trackExtrapolationTool.retrieve()); ATH_CHECK(m_ambiguityProcessor.retrieve()); + ATH_CHECK(m_beamService.retrieve()); return StatusCode::SUCCESS; } @@ -56,16 +59,11 @@ namespace MuonCombined { void MuonCandidateTool::create( const xAOD::TrackParticleContainer& tracks, MuonCandidateCollection& outputCollection ) const { ATH_MSG_DEBUG("Producing MuonCandidates for " << tracks.size() ); unsigned int ntracks = 0; - const xAOD::EventInfo* eventInfo; - float beamSpotX = 0.; - float beamSpotY = 0.; - float beamSpotZ = 0.; - - if(evtStore()->retrieve(eventInfo).isSuccess()){ - beamSpotX = eventInfo->beamPosX(); - beamSpotY = eventInfo->beamPosY(); - beamSpotZ = eventInfo->beamPosZ(); - } + + float beamSpotX = m_beamService->beamPos()[Amg::x]; + float beamSpotY = m_beamService->beamPos()[Amg::y]; + float beamSpotZ = m_beamService->beamPos()[Amg::z]; + ATH_MSG_DEBUG( " Beamspot position bs_x " << beamSpotX << " bs_y " << beamSpotY << " bs_z " << beamSpotZ); diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.h b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.h index a814d9c7dded99704f3563ad43db54fd56bc785a..bcea19f076ea48f4975372f0436a12c23a398e86 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.h +++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCandidateTool.h @@ -11,6 +11,8 @@ #include "xAODTracking/TrackParticleContainer.h" #include "MuonCombinedEvent/InDetCandidateCollection.h" +class IBeamCondSvc; + namespace Trk { class ITrackAmbiguityProcessorTool; } @@ -43,6 +45,7 @@ namespace MuonCombined { ToolHandle<Rec::ICombinedMuonTrackBuilder> m_trackBuilder; ToolHandle<Muon::IMuonTrackExtrapolationTool> m_trackExtrapolationTool; ToolHandle<Trk::ITrackAmbiguityProcessorTool> m_ambiguityProcessor; + ServiceHandle< IBeamCondSvc > m_beamService; unsigned int m_extrapolationStrategy; };