diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/CMakeLists.txt b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/CMakeLists.txt index c2873cde193f988ff52928ec129bfcc0fc9d3367..8b7c9697af27bc8182f6630c3df82d7bfe7d933f 100644 --- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/CMakeLists.txt +++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/CMakeLists.txt @@ -10,7 +10,7 @@ atlas_depends_on_subdirs( PUBLIC Control/AthenaBaseComps Control/StoreGate GaudiKernel - InnerDetector/InDetConditions/InDetBeamSpotService + InnerDetector/InDetConditions/BeamSpotConditionsData InnerDetector/InDetRecTools/InDetRecToolInterfaces Tracking/TrkDetDescr/TrkGeometry Tracking/TrkDetDescr/TrkSurfaces diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/SiSPSeededTrackFinder/SiSPSeededTrackFinder.h b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/SiSPSeededTrackFinder/SiSPSeededTrackFinder.h index bd21c07690d136e181069bfd87931fa3ebbf4091..773d487b91f958cbb477a98d1d99a4f68c9f8d04 100755 --- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/SiSPSeededTrackFinder/SiSPSeededTrackFinder.h +++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/SiSPSeededTrackFinder/SiSPSeededTrackFinder.h @@ -17,7 +17,7 @@ // For new strategy reconstruction #include "TrkTrack/TrackCollection.h" -#include "InDetBeamSpotService/IBeamCondSvc.h" +#include "BeamSpotConditionsData/BeamSpotData.h" #include "TrkExInterfaces/IPatternParametersPropagator.h" #include "TrkGeometry/MagneticFieldProperties.h" #include "TrkSurfaces/PerigeeSurface.h" @@ -114,9 +114,9 @@ namespace InDet { double* m_zhistogram; double* m_phistogram; - std::string m_beamconditions ; + std::string m_fieldmode ; - IBeamCondSvc* m_beam ; + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; ToolHandle<Trk::IPatternParametersPropagator> m_proptool ; Trk::MagneticFieldProperties m_fieldprop; diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/src/SiSPSeededTrackFinder.cxx b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/src/SiSPSeededTrackFinder.cxx index 1714c2d748ff3af04d54f31cbd3a112004fa1cd8..5187f5199c2b6e764a4dd7f30d6654ffe08e28fa 100755 --- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/src/SiSPSeededTrackFinder.cxx +++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/src/SiSPSeededTrackFinder.cxx @@ -35,8 +35,6 @@ InDet::SiSPSeededTrackFinder::SiSPSeededTrackFinder m_fieldmode("MapSolenoid") , m_proptool ("Trk::RungeKuttaPropagator/InDetPropagator" ) { - m_beamconditions = "BeamCondSvc" ; - m_beam = 0 ; m_histsize = 1400 ; m_nvertex = 4 ; m_zcut = 350. ; @@ -69,7 +67,6 @@ InDet::SiSPSeededTrackFinder::SiSPSeededTrackFinder declareProperty("useZBoundFinding" ,m_useZBoundaryFinding ); declareProperty("maxVertices" ,m_nvertex ); declareProperty("PropagatorTool" ,m_proptool ); - declareProperty("BeamConditionsService",m_beamconditions ); declareProperty("HistSize" ,m_histsize ); declareProperty("Zcut" ,m_zcut ); declareProperty("MagneticFieldMode" ,m_fieldmode ); @@ -93,15 +90,11 @@ StatusCode InDet::SiSPSeededTrackFinder::initialize() // ATH_CHECK(m_trackmaker.retrieve()); - if(m_useNewStrategy && m_beamconditions=="") {m_useNewStrategy = false; m_useZBoundaryFinding = false;} + if(m_useNewStrategy && m_beamSpotKey.key().empty()) {m_useNewStrategy = false; m_useZBoundaryFinding = false;} if(m_useNewStrategy || m_useZBoundaryFinding || m_ITKGeometry) { - // Get beam condition service - // - if(m_beamconditions!="") {service(m_beamconditions,m_beam);} - - if(m_beam) { + if(!m_beamSpotKey.key().empty()) { // Get RungeKutta propagator tool // @@ -252,9 +245,8 @@ StatusCode InDet::SiSPSeededTrackFinder::newStrategy() // Get beam information and preparation for z -histogramming // - Amg::Vector3D cb = m_beam->beamPos(); - Amg::Vector3D gBeam(cb.x(),cb.y(),cb.z()); - Trk::PerigeeSurface per(gBeam); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + Trk::PerigeeSurface per(beamSpotHandle->beamPos()); // Initiate histograms // diff --git a/Reconstruction/RecoTools/TrackToVertex/CMakeLists.txt b/Reconstruction/RecoTools/TrackToVertex/CMakeLists.txt index 8dea0f4278dd6220f8447e26d03f9da9e73b47d8..ac0cb682b70560ca1ca5fbdcb6152be62d8c925c 100644 --- a/Reconstruction/RecoTools/TrackToVertex/CMakeLists.txt +++ b/Reconstruction/RecoTools/TrackToVertex/CMakeLists.txt @@ -16,7 +16,6 @@ atlas_depends_on_subdirs( PUBLIC InnerDetector/InDetConditions/BeamSpotConditionsData PRIVATE Control/StoreGate - InnerDetector/InDetConditions/InDetBeamSpotService Reconstruction/Particle Tracking/TrkDetDescr/TrkDetDescrUtils Tracking/TrkDetDescr/TrkSurfaces diff --git a/Reconstruction/RecoTools/TrackToVertex/TrackToVertex/TrackToVertexAssociator.h b/Reconstruction/RecoTools/TrackToVertex/TrackToVertex/TrackToVertexAssociator.h index 4628b886892298b8c23702959f9ff0deb0483c9f..96489c741eb10e76e184e8ac5340c4cff717f335 100644 --- a/Reconstruction/RecoTools/TrackToVertex/TrackToVertex/TrackToVertexAssociator.h +++ b/Reconstruction/RecoTools/TrackToVertex/TrackToVertex/TrackToVertexAssociator.h @@ -30,12 +30,11 @@ #include "TrkNeutralParameters/NeutralParameters.h" #include "GeoPrimitives/GeoPrimitives.h" #include "EventPrimitives/EventPrimitives.h" - +#include "BeamSpotConditionsData/BeamSpotData.h" // Forward declaration class StoreGateSvc; class IIncidentSvc; -class IBeamCondSvc; class VxContainer; namespace Trk { @@ -98,7 +97,7 @@ namespace Reco { // Services ServiceHandle<StoreGateSvc> m_storeGate; //!< Event store - ServiceHandle<IBeamCondSvc> m_beamCondSvc; //!< BeamCondSvc to get the beam parameters + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; //!< BeamCondSvc to get the beam parameters ServiceHandle<IIncidentSvc> m_incidentSvc; //!< IncidentSvc to catch begin of event and end of envent // Tools diff --git a/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertexAssociator.cxx b/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertexAssociator.cxx index 206c734a09579dc47036d34578a675234980d4f0..dc89c07a609e81a607a0293adbc0b36acf7552c9 100644 --- a/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertexAssociator.cxx +++ b/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertexAssociator.cxx @@ -10,8 +10,6 @@ // TrackToVertex includes #include "TrackToVertex/TrackToVertexAssociator.h" -// Inner Detector includes -#include "InDetBeamSpotService/IBeamCondSvc.h" // Tracking includes #include "TrkTrack/Track.h" #include "TrkParticleBase/TrackParticleBase.h" @@ -33,7 +31,6 @@ Reco::TrackToVertexAssociator::TrackToVertexAssociator( const std::string& type, const IInterface* parent ) : ::AthAlgTool ( type, name, parent ), m_storeGate( "StoreGateSvc", name ), - m_beamCondSvc("BeamCondSvc", name), m_incidentSvc("IncidentSvc", name), m_extrapolator("Trk::Extrapolator/AtlasExtrapolator"), m_primaryVertexContainer("VxPrimaryVertices"), @@ -46,7 +43,6 @@ Reco::TrackToVertexAssociator::TrackToVertexAssociator( const std::string& type, // Property declaration // Services declareProperty( "EventStore", m_storeGate ); - declareProperty( "BeamConditionsService", m_beamCondSvc ); declareProperty( "IncidentService", m_incidentSvc ); // Tools declareProperty( "Extrapolator", m_extrapolator ); @@ -69,10 +65,7 @@ StatusCode Reco::TrackToVertexAssociator::initialize() ATH_MSG_WARNING("Can not retrieve " << m_storeGate << ". Exiting."); return StatusCode::FAILURE; } - if (m_beamCondSvc.retrieve().isFailure()){ - ATH_MSG_WARNING("Can not retrieve " << m_beamCondSvc << ". Exiting."); - return StatusCode::FAILURE; - } + ATH_CHECK(m_beamSpotKey.initialize()); if (m_incidentSvc.retrieve().isFailure()){ ATH_MSG_WARNING("Can not retrieve " << m_incidentSvc << ". Exiting."); return StatusCode::FAILURE; @@ -146,10 +139,10 @@ StatusCode Reco::TrackToVertexAssociator::updateCache() const delete m_beamLine; m_beamLine = 0; // get the transform - - Amg::Transform3D* beamTransform = new Amg::Transform3D(Amg::AngleAxis3D(m_beamCondSvc->beamTilt(0),Amg::Vector3D(0.,1.,0.))); - (*beamTransform) *= Amg::AngleAxis3D(m_beamCondSvc->beamTilt(1),Amg::Vector3D(1.,0.,0.)); - beamTransform->pretranslate(m_beamCondSvc->beamPos()); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + Amg::Transform3D* beamTransform = new Amg::Transform3D(Amg::AngleAxis3D(beamSpotHandle->beamTilt(0),Amg::Vector3D(0.,1.,0.))); + (*beamTransform) *= Amg::AngleAxis3D(beamSpotHandle->beamTilt(1),Amg::Vector3D(1.,0.,0.)); + beamTransform->pretranslate(beamSpotHandle->beamPos()); m_beamLine = new Trk::StraightLineSurface(beamTransform);