Skip to content
Snippets Groups Projects
Commit d357733b authored by William Axel Leight's avatar William Axel Leight Committed by John Kenneth Anders
Browse files

Migrate the MuonCandidateTool to use the BeamCondSvc

As suggested on ATLPHYSVAL-619, the MuonCandidateTool will now retrieve the beam spot position from the BeamCondSvc, rather than the EventInfo.
parent f72c8c57
No related branches found
No related tags found
No related merge requests found
......@@ -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 )
......@@ -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);
......
......@@ -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;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment