diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/CMakeLists.txt b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/CMakeLists.txt index e94a65f344dc0de7584f5b744603659387af72be..61d949c1c910101647e0f4453121b24657f8ee2b 100644 --- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/CMakeLists.txt +++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/CMakeLists.txt @@ -31,11 +31,11 @@ atlas_add_library( SiSpacePointFormationLib src/*.cxx PUBLIC_HEADERS SiSpacePointFormation INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthContainers GeoPrimitives Identifier GaudiKernel InDetReadoutGeometry InDetPrepRawData TrkSpacePoint VxVertex SiSpacePointToolLib + LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthContainers GeoPrimitives Identifier GaudiKernel InDetReadoutGeometry InDetPrepRawData TrkSpacePoint VxVertex SiSpacePointToolLib BeamSpotConditionsData PRIVATE_LINK_LIBRARIES AtlasDetDescr xAODEventInfo InDetIdentifier ) atlas_add_component( SiSpacePointFormation src/components/*.cxx INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthContainers GeoPrimitives Identifier GaudiKernel InDetReadoutGeometry InDetPrepRawData SiSpacePointToolLib TrkSpacePoint VxVertex AtlasDetDescr xAODEventInfo InDetIdentifier SiSpacePointFormationLib ) + LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthContainers GeoPrimitives Identifier GaudiKernel InDetReadoutGeometry InDetPrepRawData SiSpacePointToolLib TrkSpacePoint VxVertex AtlasDetDescr xAODEventInfo InDetIdentifier SiSpacePointFormationLib BeamSpotConditionsData ) diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h index 823c20ef610514c6b4b7d3f6a748d5a96285c3f2..1ebf0e96642bd386d3bf18d9b84bcd0857e2ed9a 100755 --- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h +++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h @@ -62,21 +62,18 @@ #include "StoreGate/ReadCondHandleKey.h" #include "TrkSpacePoint/SpacePoint.h" #include "TrkSpacePoint/SpacePointContainer.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "BeamSpotConditionsData/BeamSpotData.h" -#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" #include <string> -class Event; class SpacePointCollection; class SpacePointOverlapCollection; class SpacePointContainer; -class SvcLocator; -class SCT_NeighboursTable; class SCT_ID; class PixelID; -class IBeamCondSvc; namespace InDet { @@ -153,7 +150,7 @@ namespace InDet { float m_xVertex; float m_yVertex; float m_zVertex; - ServiceHandle<IBeamCondSvc> m_iBeamCondSvc; + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; mutable std::atomic<int> m_numberOfEvents; mutable std::atomic<int> m_numberOfPixel; diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx index 2e3ecf2eb40b2f7bdad6ee97008f597dd70e7080..47e994e724e548be206570c4546c90c183ef7994 100755 --- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx +++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx @@ -52,7 +52,6 @@ namespace InDet { m_xVertex(0.), m_yVertex(0.), m_zVertex(0.), - m_iBeamCondSvc("BeamCondSvc",name), m_numberOfEvents(0), m_numberOfPixel(0), m_numberOfSCT(0), m_sctCacheHits(0), m_pixCacheHits(0), m_cachemode(false), @@ -77,7 +76,7 @@ namespace InDet { declareProperty("SiSpacePointMakerTool", m_SiSpacePointMakerTool); - declareProperty("BeamPositionSvc", m_iBeamCondSvc); + declareProperty("BeamPositionKey", m_beamSpotKey); declareProperty("ProcessPixels", m_selectPixels); declareProperty("ProcessSCTs", m_selectSCTs); declareProperty("ProcessOverlaps", m_overlap); @@ -151,7 +150,7 @@ StatusCode SiTrackerSpacePointFinder::initialize() ATH_CHECK(m_SiSpacePointMakerTool.retrieve()); if (!m_overrideBS){ - if (m_iBeamCondSvc.retrieve().isFailure()) { + if (m_beamSpotKey.initialize().isFailure()) { m_overrideBS = true; ATH_MSG_WARNING( "Could not retrieve Beam Conditions Service. " ); ATH_MSG_WARNING( "Using instead pre-set beam spot at ( " << m_xVertex @@ -192,7 +191,9 @@ StatusCode SiTrackerSpacePointFinder::execute_r (const EventContext& ctx) const } SPFCache r_cache(ctx); if (! m_overrideBS){ - r_cache.vertex = m_iBeamCondSvc->beamVtx().position(); + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey, ctx }; + const InDet::BeamSpotData* beamSpot = *beamSpotHandle; + r_cache.vertex = beamSpot->beamVtx().position(); } else { r_cache.vertex = Amg::Vector3D(m_xVertex,m_yVertex,m_zVertex); }