diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/CMakeLists.txt b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/CMakeLists.txt index 2a4554869647bbf6535b6f40f6aad0d0119aeebe..2dc0408e48ccd49002827c902dc6e4097e58b643 100644 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/CMakeLists.txt +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/CMakeLists.txt @@ -9,7 +9,7 @@ atlas_subdir( SiSpacePointsSeedTool_xk ) atlas_depends_on_subdirs( PUBLIC Control/AthenaBaseComps GaudiKernel - InnerDetector/InDetConditions/InDetBeamSpotService + InnerDetector/InDetConditions/BeamSpotConditionsData InnerDetector/InDetDetDescr/InDetReadoutGeometry InnerDetector/InDetRecEvent/InDetPrepRawData InnerDetector/InDetRecEvent/SiSpacePointsSeed diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h index 3da0ff0baeaca1a52ee4e521118bf2dad942b9e4..e7f14a2a95135ee0eef96afee30b465538f47353 100755 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h @@ -24,7 +24,7 @@ #include "InDetRecToolInterfaces/ISiSpacePointsSeedMaker.h" #include "TrkSpacePoint/SpacePointContainer.h" #include "TrkSpacePoint/SpacePointOverlapCollection.h" - +#include "BeamSpotConditionsData/BeamSpotData.h" #include "SiSpacePointsSeedTool_xk/SiSpacePointForSeed.h" #include "SiSpacePointsSeedTool_xk/SiSpacePointsProSeed.h" #include <iosfwd> @@ -34,7 +34,6 @@ #include <vector> class MsgStream ; -class IBeamCondSvc; namespace Trk { class IPRD_AssociationTool; @@ -123,7 +122,7 @@ namespace InDet { ServiceHandle<MagField::IMagFieldSvc> m_fieldServiceHandle ; MagField::IMagFieldSvc* m_fieldService{} ; - IBeamCondSvc* p_beam {} ; + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; bool m_pixel{} ; bool m_sct{} ; bool m_endlist{} ; @@ -247,7 +246,6 @@ namespace InDet { // Space points container /////////////////////////////////////////////////////////////////// - std::string m_beamconditions ; SG::ReadHandle<SpacePointContainer> m_spacepointsSCT ; SG::ReadHandle<SpacePointContainer> m_spacepointsPixel ; SG::ReadHandle<SpacePointOverlapCollection> m_spacepointsOverlap ; diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_BeamGas.h b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_BeamGas.h index 544e2d29618f8998aa328866b368bb1113d20220..c4e7172f663c16a17051a174406994120873d819 100755 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_BeamGas.h +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_BeamGas.h @@ -24,7 +24,7 @@ #include "InDetRecToolInterfaces/ISiSpacePointsSeedMaker.h" #include "TrkSpacePoint/SpacePointContainer.h" #include "TrkSpacePoint/SpacePointOverlapCollection.h" - +#include "BeamSpotConditionsData/BeamSpotData.h" #include "SiSpacePointsSeedTool_xk/SiSpacePointForSeed.h" #include <list> #include <map> @@ -32,7 +32,6 @@ #include <iosfwd> class MsgStream ; -class IBeamCondSvc; namespace Trk { @@ -123,7 +122,7 @@ namespace InDet { MagField::IMagFieldSvc* m_fieldService{} ; ToolHandle<Trk::IPRD_AssociationTool> m_assoTool ; - IBeamCondSvc* p_beam {} ; + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; bool m_pixel {} ; bool m_sct {} ; @@ -218,7 +217,6 @@ namespace InDet { /////////////////////////////////////////////////////////////////// - std::string m_beamconditions ; SG::ReadHandle<SpacePointContainer> m_spacepointsSCT ; SG::ReadHandle<SpacePointContainer> m_spacepointsPixel ; SG::ReadHandle<SpacePointOverlapCollection> m_spacepointsOverlap ; diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_HeavyIon.h b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_HeavyIon.h index e5b53045b474218cfa40e41f3fcba1d1096ad607..edbbf652958d009fbfeaf50fd4e1834ab3990138 100755 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_HeavyIon.h +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_HeavyIon.h @@ -24,7 +24,7 @@ #include "InDetRecToolInterfaces/ISiSpacePointsSeedMaker.h" #include "TrkSpacePoint/SpacePointContainer.h" #include "TrkSpacePoint/SpacePointOverlapCollection.h" - +#include "BeamSpotConditionsData/BeamSpotData.h" #include "SiSpacePointsSeedTool_xk/SiSpacePointForSeed.h" #include <list> #include <vector> @@ -32,7 +32,7 @@ #include <iosfwd> class MsgStream ; -class IBeamCondSvc; + namespace InDet { @@ -120,7 +120,7 @@ namespace InDet { ServiceHandle<MagField::IMagFieldSvc> m_fieldServiceHandle ; MagField::IMagFieldSvc* m_fieldService {} ; - IBeamCondSvc* p_beam{} ; + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; bool m_pixel {} ; bool m_sct {} ; bool m_endlist {} ; @@ -222,7 +222,6 @@ namespace InDet { // Space points container /////////////////////////////////////////////////////////////////// - std::string m_beamconditions ; SG::ReadHandle<SpacePointContainer> m_spacepointsSCT ; SG::ReadHandle<SpacePointContainer> m_spacepointsPixel ; SG::ReadHandle<SpacePointOverlapCollection> m_spacepointsOverlap ; diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ITK.h b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ITK.h index 387b1a65b77443c2a497ffe676f5a142c3a28712..f5ded00128acc43bdf81247c3ed9926614462fce 100755 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ITK.h +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ITK.h @@ -24,7 +24,7 @@ #include "InDetRecToolInterfaces/ISiSpacePointsSeedMaker.h" #include "TrkSpacePoint/SpacePointContainer.h" #include "TrkSpacePoint/SpacePointOverlapCollection.h" - +#include "BeamSpotConditionsData/BeamSpotData.h" #include "SiSpacePointsSeedTool_xk/SiSpacePointForSeedITK.h" #include "SiSpacePointsSeedTool_xk/SiSpacePointsProSeedITK.h" #include <list> @@ -34,7 +34,7 @@ #include <iosfwd> class MsgStream ; -class IBeamCondSvc; + namespace Trk { class IPRD_AssociationTool; @@ -118,7 +118,7 @@ namespace InDet { ServiceHandle<MagField::IMagFieldSvc> m_fieldServiceHandle ; MagField::IMagFieldSvc* m_fieldService{} ; - IBeamCondSvc* p_beam {} ; + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; bool m_pixel {} ; bool m_sct {} ; bool m_endlist {} ; @@ -247,7 +247,6 @@ namespace InDet { // Space points container /////////////////////////////////////////////////////////////////// - std::string m_beamconditions ; SG::ReadHandle<SpacePointContainer> m_spacepointsSCT ; SG::ReadHandle<SpacePointContainer> m_spacepointsPixel ; SG::ReadHandle<SpacePointOverlapCollection> m_spacepointsOverlap ; diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_LowMomentum.h b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_LowMomentum.h index 78e0afef89dc3043cc8747e3866dabbd4af152a3..2d180da3c9b86cfc14421966dbfb94c57f7fdcb9 100755 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_LowMomentum.h +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_LowMomentum.h @@ -24,14 +24,13 @@ #include "InDetRecToolInterfaces/ISiSpacePointsSeedMaker.h" #include "TrkSpacePoint/SpacePointContainer.h" #include "TrkSpacePoint/SpacePointOverlapCollection.h" - +#include "BeamSpotConditionsData/BeamSpotData.h" #include "SiSpacePointsSeedTool_xk/SiSpacePointForSeed.h" #include <list> #include <map> #include <vector> class MsgStream ; -class IBeamCondSvc; namespace Trk { class IPRD_AssociationTool; @@ -123,7 +122,7 @@ namespace InDet { ServiceHandle<MagField::IMagFieldSvc> m_fieldServiceHandle ; MagField::IMagFieldSvc* m_fieldService {} ; - IBeamCondSvc* p_beam {} ; + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; bool m_pixel {} ; bool m_sct {} ; bool m_endlist {} ; @@ -218,7 +217,6 @@ namespace InDet { /////////////////////////////////////////////////////////////////// - std::string m_beamconditions ; SG::ReadHandle<SpacePointContainer> m_spacepointsSCT ; SG::ReadHandle<SpacePointContainer> m_spacepointsPixel ; SG::ReadHandle<SpacePointOverlapCollection> m_spacepointsOverlap ; diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_Trigger.h b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_Trigger.h index 053450e75831957d82f9c485cb0c62c25f54d083..3c8fab6d6f8c3427ba4fd3214df13b45e9491fe3 100755 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_Trigger.h +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_Trigger.h @@ -24,13 +24,12 @@ #include "InDetRecToolInterfaces/ISiSpacePointsSeedMaker.h" #include "TrkSpacePoint/SpacePointContainer.h" #include "TrkSpacePoint/SpacePointOverlapCollection.h" - +#include "BeamSpotConditionsData/BeamSpotData.h" #include "SiSpacePointsSeedTool_xk/SiSpacePointForSeed.h" #include <list> #include <vector> #include <map> class MsgStream ; -class IBeamCondSvc; namespace InDet { @@ -116,7 +115,7 @@ namespace InDet { ServiceHandle<MagField::IMagFieldSvc> m_fieldServiceHandle ; MagField::IMagFieldSvc* m_fieldService {} ; - IBeamCondSvc* p_beam {} ; + SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }; bool m_pixel {} ; bool m_sct {} ; bool m_endlist {} ; @@ -223,7 +222,6 @@ namespace InDet { // Space points container /////////////////////////////////////////////////////////////////// - std::string m_beamconditions ; SG::ReadHandle<SpacePointContainer> m_spacepointsSCT ; SG::ReadHandle<SpacePointContainer> m_spacepointsPixel ; SG::ReadHandle<SpacePointOverlapCollection> m_spacepointsOverlap ; diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx index 4d2b0cd2865b0b51480f819ba6f715d9a11721c1..f33574b7b9e33948e8f673f7ed2962800b7944e5 100755 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx @@ -18,7 +18,6 @@ #include "TrkToolInterfaces/IPRD_AssociationTool.h" #include "SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ATLxk.h" -#include "InDetBeamSpotService/IBeamCondSvc.h" /////////////////////////////////////////////////////////////////// @@ -94,7 +93,6 @@ InDet::SiSpacePointsSeedMaker_ATLxk::SiSpacePointsSeedMaker_ATLxk // m_spacepointsSCTname = "SCT_SpacePoints" ; // m_spacepointsPixelname = "PixelSpacePoints" ; // m_spacepointsOverlapname = "OverlapSpacePoints"; - m_beamconditions = "BeamCondSvc" ; // m_spacepointsSCT = 0 ; // m_spacepointsPixel = 0 ; // m_spacepointsOverlap = 0 ; @@ -140,7 +138,6 @@ InDet::SiSpacePointsSeedMaker_ATLxk::SiSpacePointsSeedMaker_ATLxk declareProperty("SpacePointsSCTName" ,m_spacepointsSCT ); declareProperty("SpacePointsPixelName" ,m_spacepointsPixel ); declareProperty("SpacePointsOverlapName",m_spacepointsOverlap); - declareProperty("BeamConditionsService" ,m_beamconditions ); declareProperty("useOverlapSpCollection", m_useOverlap ); declareProperty("UseAssociationTool" ,m_useassoTool ); declareProperty("MagFieldSvc" , m_fieldServiceHandle ); @@ -189,10 +186,7 @@ StatusCode InDet::SiSpacePointsSeedMaker_ATLxk::initialize() // Get beam geometry // - p_beam = 0; - if(!m_beamconditions.empty()) { - sc = service(m_beamconditions,p_beam); - } + ATH_CHECK(m_beamSpotKey.initialize()); // Get magnetic field service // @@ -705,7 +699,7 @@ MsgStream& InDet::SiSpacePointsSeedMaker_ATLxk::dumpConditions( MsgStream& out ) std::string s3; for(int i=0; i<n; ++i) s3.append(" "); s3.append("|"); n = 42-m_spacepointsOverlap.name().size(); std::string s4; for(int i=0; i<n; ++i) s4.append(" "); s4.append("|"); - n = 42-m_beamconditions.size(); + n = 42-m_beamSpotKey.key().size(); std::string s5; for(int i=0; i<n; ++i) s5.append(" "); s5.append("|"); @@ -717,7 +711,7 @@ MsgStream& InDet::SiSpacePointsSeedMaker_ATLxk::dumpConditions( MsgStream& out ) <<std::endl; out<<"| Overlap space points | "<<m_spacepointsOverlap.name()<<s4 <<std::endl; - out<<"| BeamConditionsService | "<<m_beamconditions<<s5 + out<<"| BeamConditionsService | "<<m_beamSpotKey.key()<<s5 <<std::endl; out<<"| usePixel | " <<std::setw(12)<<m_pixel @@ -1149,11 +1143,11 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::buildFrameWork() void InDet::SiSpacePointsSeedMaker_ATLxk::buildBeamFrameWork() { - if(!p_beam) return; + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; - Amg::Vector3D cb = p_beam->beamPos(); - double tx = tan(p_beam->beamTilt(0)); - double ty = tan(p_beam->beamTilt(1)); + const Amg::Vector3D &cb = beamSpotHandle->beamPos(); + double tx = tan(beamSpotHandle->beamTilt(0)); + double ty = tan(beamSpotHandle->beamTilt(1)); double ph = atan2(ty,tx); double th = acos(1./sqrt(1.+tx*tx+ty*ty)); diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_BeamGas.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_BeamGas.cxx index 6798dd6873e6c5c0927fa705fc4cf918db80c808..0d0a737a4c00f540172ebddc2f88290cb6ddffe4 100755 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_BeamGas.cxx +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_BeamGas.cxx @@ -17,7 +17,6 @@ #include "TrkToolInterfaces/IPRD_AssociationTool.h" #include "SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_BeamGas.h" -#include "InDetBeamSpotService/IBeamCondSvc.h" /////////////////////////////////////////////////////////////////// @@ -82,7 +81,6 @@ InDet::SiSpacePointsSeedMaker_BeamGas::SiSpacePointsSeedMaker_BeamGas m_zbeam[0] = 0. ; m_zbeam[1]= 0.; m_zbeam[2]=0.; m_zbeam[3]=1.; - m_beamconditions = "BeamCondSvc" ; // m_spacepointsSCT = 0 ; // m_spacepointsPixel = 0 ; // m_spacepointsOverlap = 0 ; @@ -116,7 +114,6 @@ InDet::SiSpacePointsSeedMaker_BeamGas::SiSpacePointsSeedMaker_BeamGas declareProperty("SpacePointsSCTName" ,m_spacepointsSCT ); declareProperty("SpacePointsPixelName" ,m_spacepointsPixel ); declareProperty("SpacePointsOverlapName",m_spacepointsOverlap); - declareProperty("BeamConditionsService" ,m_beamconditions ); declareProperty("useOverlapSpCollection", m_useOverlap ); declareProperty("UseAssociationTool" ,m_useassoTool ); declareProperty("MagFieldSvc" , m_fieldServiceHandle ); @@ -164,10 +161,7 @@ StatusCode InDet::SiSpacePointsSeedMaker_BeamGas::initialize() // Get beam geometry // - p_beam = 0; - if(m_beamconditions!="") { - sc = service(m_beamconditions,p_beam); - } + ATH_CHECK(m_beamSpotKey.initialize()); // Get magnetic field service // @@ -542,7 +536,7 @@ MsgStream& InDet::SiSpacePointsSeedMaker_BeamGas::dumpConditions( MsgStream& out std::string s3; for(int i=0; i<n; ++i) s3.append(" "); s3.append("|"); n = 42-m_spacepointsOverlap.name().size(); std::string s4; for(int i=0; i<n; ++i) s4.append(" "); s4.append("|"); - n = 42-m_beamconditions.size(); + n = 42-m_beamSpotKey.key().size(); std::string s5; for(int i=0; i<n; ++i) s5.append(" "); s5.append("|"); @@ -554,7 +548,7 @@ MsgStream& InDet::SiSpacePointsSeedMaker_BeamGas::dumpConditions( MsgStream& out <<std::endl; out<<"| Overlap space points | "<<m_spacepointsOverlap.name() <<s4 <<std::endl; - out<<"| BeamConditionsService | "<<m_beamconditions<<s5 + out<<"| BeamConditionsService | "<<m_beamSpotKey.key()<<s5 <<std::endl; out<<"| usePixel | " <<std::setw(12)<<m_pixel @@ -874,11 +868,11 @@ void InDet::SiSpacePointsSeedMaker_BeamGas::buildFrameWork() void InDet::SiSpacePointsSeedMaker_BeamGas::buildBeamFrameWork() { - if(!p_beam) return; + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; - Amg::Vector3D cb = p_beam->beamPos(); - double tx = tan(p_beam->beamTilt(0)); - double ty = tan(p_beam->beamTilt(1)); + const Amg::Vector3D &cb = beamSpotHandle->beamPos(); + double tx = tan(beamSpotHandle->beamTilt(0)); + double ty = tan(beamSpotHandle->beamTilt(1)); double ph = atan2(ty,tx); double th = acos(1./sqrt(1.+tx*tx+ty*ty)); diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_HeavyIon.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_HeavyIon.cxx index 92937e6fe9b0208b4f040955ae88fb41910e378a..af7d7b0cfeca9fa58d5cf75030f0a52985aae096 100755 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_HeavyIon.cxx +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_HeavyIon.cxx @@ -16,7 +16,6 @@ #include <iomanip> #include "SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_HeavyIon.h" -#include "InDetBeamSpotService/IBeamCondSvc.h" /////////////////////////////////////////////////////////////////// // Constructor @@ -82,7 +81,6 @@ InDet::SiSpacePointsSeedMaker_HeavyIon::SiSpacePointsSeedMaker_HeavyIon m_zbeam[0] = 0. ; m_zbeam[1]= 0.; m_zbeam[2]=0.; m_zbeam[3]=1.; - m_beamconditions = "BeamCondSvc" ; // m_spacepointsSCT = 0 ; // m_spacepointsPixel = 0 ; // m_spacepointsOverlap = 0 ; @@ -121,7 +119,6 @@ InDet::SiSpacePointsSeedMaker_HeavyIon::SiSpacePointsSeedMaker_HeavyIon declareProperty("SpacePointsSCTName" ,m_spacepointsSCT ); declareProperty("SpacePointsPixelName" ,m_spacepointsPixel ); declareProperty("SpacePointsOverlapName",m_spacepointsOverlap); - declareProperty("BeamConditionsService" ,m_beamconditions ); declareProperty("useOverlapSpCollection", m_useOverlap ); declareProperty("MagFieldSvc" , m_fieldServiceHandle ); } @@ -168,10 +165,7 @@ StatusCode InDet::SiSpacePointsSeedMaker_HeavyIon::initialize() // Get beam geometry // - p_beam = 0; - if(m_beamconditions!="") { - sc = service(m_beamconditions,p_beam); - } + ATH_CHECK(m_beamSpotKey.initialize()); // Get magnetic field service // @@ -518,7 +512,7 @@ MsgStream& InDet::SiSpacePointsSeedMaker_HeavyIon::dumpConditions( MsgStream& ou std::string s3; for(int i=0; i<n; ++i) s3.append(" "); s3.append("|"); n = 42-m_spacepointsOverlap.name().size(); std::string s4; for(int i=0; i<n; ++i) s4.append(" "); s4.append("|"); - n = 42-m_beamconditions.size(); + n = 42-m_beamSpotKey.key().size(); std::string s5; for(int i=0; i<n; ++i) s5.append(" "); s5.append("|"); @@ -530,7 +524,7 @@ MsgStream& InDet::SiSpacePointsSeedMaker_HeavyIon::dumpConditions( MsgStream& ou <<std::endl; out<<"| Overlap space points | "<<m_spacepointsOverlap.name()<<s4 <<std::endl; - out<<"| BeamConditionsService | "<<m_beamconditions<<s5 + out<<"| BeamConditionsService | "<<m_beamSpotKey.key()<<s5 <<std::endl; out<<"| usePixel | " <<std::setw(12)<<m_pixel @@ -942,11 +936,11 @@ void InDet::SiSpacePointsSeedMaker_HeavyIon::buildFrameWork() void InDet::SiSpacePointsSeedMaker_HeavyIon::buildBeamFrameWork() { - if(!p_beam) return; + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; - Amg::Vector3D cb = p_beam->beamPos(); - double tx = tan(p_beam->beamTilt(0)); - double ty = tan(p_beam->beamTilt(1)); + const Amg::Vector3D &cb = beamSpotHandle->beamPos(); + double tx = tan(beamSpotHandle->beamTilt(0)); + double ty = tan(beamSpotHandle->beamTilt(1)); double ph = atan2(ty,tx); double th = acos(1./sqrt(1.+tx*tx+ty*ty)); diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ITK.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ITK.cxx index 390085ee4f30dc16fd5072645e9743f43813250b..f7f008d2084f193f78037cdabace1aec840aab5e 100755 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ITK.cxx +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ITK.cxx @@ -18,7 +18,6 @@ #include "TrkToolInterfaces/IPRD_AssociationTool.h" #include "SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_ITK.h" -#include "InDetBeamSpotService/IBeamCondSvc.h" /////////////////////////////////////////////////////////////////// // Constructor @@ -96,8 +95,6 @@ InDet::SiSpacePointsSeedMaker_ITK::SiSpacePointsSeedMaker_ITK m_zbeam[0] = 0. ; m_zbeam[1]= 0.; m_zbeam[2]=0.; m_zbeam[3]=1.; - m_beamconditions = "BeamCondSvc" ; - declareInterface<ISiSpacePointsSeedMaker>(this); @@ -142,7 +139,6 @@ InDet::SiSpacePointsSeedMaker_ITK::SiSpacePointsSeedMaker_ITK declareProperty("SpacePointsSCTName" ,m_spacepointsSCT ); declareProperty("SpacePointsPixelName" ,m_spacepointsPixel ); declareProperty("SpacePointsOverlapName",m_spacepointsOverlap ); - declareProperty("BeamConditionsService" ,m_beamconditions ); declareProperty("useOverlapSpCollection",m_useOverlap ); declareProperty("UseAssociationTool" ,m_useassoTool ); declareProperty("MagFieldSvc" ,m_fieldServiceHandle ); @@ -193,10 +189,7 @@ StatusCode InDet::SiSpacePointsSeedMaker_ITK::initialize() // Get beam geometry // - p_beam = 0; - if(m_beamconditions!="") { - sc = service(m_beamconditions,p_beam); - } + ATH_CHECK(m_beamSpotKey.initialize()); // Get magnetic field service // @@ -665,7 +658,7 @@ MsgStream& InDet::SiSpacePointsSeedMaker_ITK::dumpConditions( MsgStream& out ) c std::string s3; for(int i=0; i<n; ++i) s3.append(" "); s3.append("|"); n = 42-m_spacepointsOverlap.name().size(); std::string s4; for(int i=0; i<n; ++i) s4.append(" "); s4.append("|"); - n = 42-m_beamconditions.size(); + n = 42-m_beamSpotKey.key().size(); std::string s5; for(int i=0; i<n; ++i) s5.append(" "); s5.append("|"); @@ -677,7 +670,7 @@ MsgStream& InDet::SiSpacePointsSeedMaker_ITK::dumpConditions( MsgStream& out ) c <<std::endl; out<<"| Overlap space points | "<<m_spacepointsOverlap.name()<<s4 <<std::endl; - out<<"| BeamConditionsService | "<<m_beamconditions<<s5 + out<<"| BeamConditionsService | "<<m_beamSpotKey.key()<<s5 <<std::endl; out<<"| usePixel | " <<std::setw(12)<<m_pixel @@ -1111,11 +1104,11 @@ void InDet::SiSpacePointsSeedMaker_ITK::buildFrameWork() void InDet::SiSpacePointsSeedMaker_ITK::buildBeamFrameWork() { - if(!p_beam) return; + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; - Amg::Vector3D cb = p_beam->beamPos(); - double tx = tan(p_beam->beamTilt(0)); - double ty = tan(p_beam->beamTilt(1)); + const Amg::Vector3D &cb = beamSpotHandle->beamPos(); + double tx = tan(beamSpotHandle->beamTilt(0)); + double ty = tan(beamSpotHandle->beamTilt(1)); double ph = atan2(ty,tx); double th = acos(1./sqrt(1.+tx*tx+ty*ty)); diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_LowMomentum.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_LowMomentum.cxx index 7bb8d21bb47051dc9e65f3566b55e373a6b23ac5..5f8bf943ce003a6c4afcaabeebdd87d3301764d1 100755 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_LowMomentum.cxx +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_LowMomentum.cxx @@ -17,7 +17,6 @@ #include "TrkToolInterfaces/IPRD_AssociationTool.h" #include "SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_LowMomentum.h" -#include "InDetBeamSpotService/IBeamCondSvc.h" /////////////////////////////////////////////////////////////////// @@ -85,7 +84,6 @@ InDet::SiSpacePointsSeedMaker_LowMomentum::SiSpacePointsSeedMaker_LowMomentum // m_spacepointsSCTname = "SCT_SpacePoints" ; // m_spacepointsPixelname = "PixelSpacePoints" ; // m_spacepointsOverlapname = "OverlapSpacePoints"; - m_beamconditions = "BeamCondSvc" ; // m_spacepointsSCT = 0 ; // m_spacepointsPixel = 0 ; // m_spacepointsOverlap = 0 ; @@ -120,7 +118,6 @@ InDet::SiSpacePointsSeedMaker_LowMomentum::SiSpacePointsSeedMaker_LowMomentum declareProperty("SpacePointsSCTName" ,m_spacepointsSCT ); declareProperty("SpacePointsPixelName" ,m_spacepointsPixel ); declareProperty("SpacePointsOverlapName",m_spacepointsOverlap); - declareProperty("BeamConditionsService" ,m_beamconditions ); declareProperty("useOverlapSpCollection", m_useOverlap ); declareProperty("UseAssociationTool" ,m_useassoTool ); declareProperty("MagFieldSvc" , m_fieldServiceHandle ); @@ -168,10 +165,7 @@ StatusCode InDet::SiSpacePointsSeedMaker_LowMomentum::initialize() // Get beam geometry // - p_beam = 0; - if(m_beamconditions!="") { - sc = service(m_beamconditions,p_beam); - } + ATH_CHECK(m_beamSpotKey.initialize()); // Get magnetic field service // @@ -514,7 +508,7 @@ MsgStream& InDet::SiSpacePointsSeedMaker_LowMomentum::dumpConditions( MsgStream& std::string s3; for(int i=0; i<n; ++i) s3.append(" "); s3.append("|"); n = 42-m_spacepointsOverlap.name().size(); std::string s4; for(int i=0; i<n; ++i) s4.append(" "); s4.append("|"); - n = 42-m_beamconditions.size(); + n = 42-m_beamSpotKey.key().size(); std::string s5; for(int i=0; i<n; ++i) s5.append(" "); s5.append("|"); out<<"|---------------------------------------------------------------------|" @@ -525,7 +519,7 @@ MsgStream& InDet::SiSpacePointsSeedMaker_LowMomentum::dumpConditions( MsgStream& <<std::endl; out<<"| Overlap space points | "<<m_spacepointsOverlap.name()<<s4 <<std::endl; - out<<"| BeamConditionsService | "<<m_beamconditions<<s5 + out<<"| BeamConditionsService | "<<m_beamSpotKey.key()<<s5 <<std::endl; out<<"| usePixel | " <<std::setw(12)<<m_pixel @@ -891,11 +885,11 @@ void InDet::SiSpacePointsSeedMaker_LowMomentum::buildFrameWork() void InDet::SiSpacePointsSeedMaker_LowMomentum::buildBeamFrameWork() { - if(!p_beam) return; + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; - Amg::Vector3D cb = p_beam->beamPos(); - double tx = tan(p_beam->beamTilt(0)); - double ty = tan(p_beam->beamTilt(1)); + const Amg::Vector3D &cb = beamSpotHandle->beamPos(); + double tx = tan(beamSpotHandle->beamTilt(0)); + double ty = tan(beamSpotHandle->beamTilt(1)); double ph = atan2(ty,tx); double th = acos(1./sqrt(1.+tx*tx+ty*ty)); diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_Trigger.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_Trigger.cxx index 55f07888911ec7dc25b8976ed4988eac4837ba19..ac16f482e420aa6a3f6112f6b52822121422a8af 100755 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_Trigger.cxx +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_Trigger.cxx @@ -14,7 +14,6 @@ #include <ostream> #include <iomanip> -#include "InDetBeamSpotService/IBeamCondSvc.h" #include "SiSpacePointsSeedTool_xk/SiSpacePointsSeedMaker_Trigger.h" @@ -84,7 +83,6 @@ InDet::SiSpacePointsSeedMaker_Trigger::SiSpacePointsSeedMaker_Trigger // m_spacepointsSCTname = "SCT_SpacePoints" ; // m_spacepointsPixelname = "PixelSpacePoints" ; // m_spacepointsOverlapname = "OverlapSpacePoints"; - m_beamconditions = "BeamCondSvc" ; // m_spacepointsSCT = 0 ; // m_spacepointsPixel = 0 ; // m_spacepointsOverlap = 0 ; @@ -123,7 +121,6 @@ InDet::SiSpacePointsSeedMaker_Trigger::SiSpacePointsSeedMaker_Trigger declareProperty("SpacePointsSCTName" ,m_spacepointsSCT ); declareProperty("SpacePointsPixelName" ,m_spacepointsPixel ); declareProperty("SpacePointsOverlapName",m_spacepointsOverlap ); - declareProperty("BeamConditionsService" ,m_beamconditions ); declareProperty("useOverlapSpCollection", m_useOverlap ); declareProperty("MagFieldSvc" , m_fieldServiceHandle ); } @@ -170,10 +167,7 @@ StatusCode InDet::SiSpacePointsSeedMaker_Trigger::initialize() // Get beam geometry // - p_beam = 0; - if(m_beamconditions!="") { - sc = service(m_beamconditions,p_beam); - } + ATH_CHECK(m_beamSpotKey.initialize()); // Get magnetic field service // @@ -565,7 +559,7 @@ MsgStream& InDet::SiSpacePointsSeedMaker_Trigger::dumpConditions( MsgStream& out std::string s3; for(int i=0; i<n; ++i) s3.append(" "); s3.append("|"); n = 42-m_spacepointsOverlap.name().size(); std::string s4; for(int i=0; i<n; ++i) s4.append(" "); s4.append("|"); - n = 42-m_beamconditions.size(); + n = 42-m_beamSpotKey.key().size(); std::string s5; for(int i=0; i<n; ++i) s5.append(" "); s5.append("|"); @@ -577,7 +571,7 @@ MsgStream& InDet::SiSpacePointsSeedMaker_Trigger::dumpConditions( MsgStream& out <<std::endl; out<<"| Overlap space points | "<<m_spacepointsOverlap.name() <<s4 <<std::endl; - out<<"| BeamConditionsService | "<<m_beamconditions<<s5 + out<<"| BeamConditionsService | "<<m_beamSpotKey.key()<<s5 <<std::endl; out<<"| usePixel | " <<std::setw(12)<<m_pixel @@ -995,11 +989,11 @@ void InDet::SiSpacePointsSeedMaker_Trigger::buildFrameWork() void InDet::SiSpacePointsSeedMaker_Trigger::buildBeamFrameWork() { - if(!p_beam) return; + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; - Amg::Vector3D cb = p_beam->beamPos(); - double tx = tan(p_beam->beamTilt(0)); - double ty = tan(p_beam->beamTilt(1)); + const Amg::Vector3D &cb = beamSpotHandle->beamPos(); + double tx = tan(beamSpotHandle->beamTilt(0)); + double ty = tan(beamSpotHandle->beamTilt(1)); double ph = atan2(ty,tx); double th = acos(1./sqrt(1.+tx*tx+ty*ty));