diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/BremFind.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/BremFind.h index 95139fe6de4c9a2b45321f68069aa66d97c83111..f29b2797cca7df7f4cff3fc9e601ae8d65583805 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/BremFind.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/BremFind.h @@ -30,6 +30,9 @@ description : Class for finding brem points in the inner detector using the GSF #include "GeoPrimitives/GeoPrimitives.h" +#include "StoreGate/ReadHandleKey.h" +#include "xAODEventInfo/EventInfo.h" + #include <vector> //class ITrackingGeometrySvc; @@ -217,6 +220,8 @@ class BremFind : public AthAlgTool, virtual public IBremsstrahlungFinder{ QoverPBremFit *m_forwardBremFit; QoverPBremFit *m_smoothedBremFit; + SG::ReadHandleKey<xAOD::EventInfo> m_readKey; + }; } diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h index 67c949f49571877b25b473563902a8895cfbdd8b..48f0a41ae5f0a9e08bda9e8d425b70c165549e54 100755 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/GaussianSumFitter.h @@ -24,6 +24,7 @@ decription : Class for fitting according to the Gaussian Sum Filter #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/IChronoStatSvc.h" +#include "xAODEventInfo/EventInfo.h" #include "TTree.h" @@ -213,6 +214,9 @@ class GaussianSumFitter : virtual public ITrackFitter, public AthAlgTool { mutable float m_surfaceErrPhiS[TRKFGSF_VALSURFACES][TRKGSF_VALSTATES]; //!< Track phi error on Surface mutable float m_surfaceErrQoverPS[TRKFGSF_VALSURFACES][TRKGSF_VALSTATES]; //!< Track q over p error on Surface mutable int m_event_ID; + + SG::ReadHandleKey<xAOD::EventInfo> m_readKey; + }; } // end Trk namespace diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/BremFind.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/BremFind.cxx index 76c74ef8eca94074300680bf48d512d9d9bee7ba..88733889ac8814888cee8ebf807088822d53bcb0 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/BremFind.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/BremFind.cxx @@ -40,8 +40,6 @@ description : Class for finding brem points in the inner detector using the GSF #include "TTree.h" -#include "xAODEventInfo/EventInfo.h" - Trk::BremFind::BremFind(const std::string& type, const std::string& name, const IInterface* parent): @@ -116,6 +114,7 @@ Trk::BremFind::BremFind(const std::string& type, const std::string& name, const declareProperty("UseSurfacePropagation", m_usePropagate=false); declareProperty("TreeFolderName", m_validationTreeFolder); declareProperty("TreeFolderName2", m_validationTreeFolder2); + declareProperty("EventInfoKey", m_readKey = "EventInfo"); } @@ -248,6 +247,9 @@ StatusCode Trk::BremFind::initialize() //---------------------------- end of validation mode ------------------------------------ + + ATH_CHECK( m_readKey.initialize() ); + ATH_MSG_DEBUG( "Initialisation of " << name() << " was successful" ); return StatusCode::SUCCESS; @@ -414,11 +416,11 @@ void Trk::BremFind::BremFinder(const Trk::ForwardTrajectory& forwardTrajectory, //* Retrieve the event info for later syncrinization - const xAOD::EventInfo* eventInfo; - if ((evtStore()->retrieve(eventInfo)).isFailure()) { + SG::ReadHandle< xAOD::EventInfo> eventInfo (m_readKey); + if (!eventInfo.isValid()) { msg(MSG::ERROR) << "Could not retrieve event info" << endmsg; } - + m_event_ID = eventInfo->eventNumber(); //Fill the TanH coefficients and graph values diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx index c5a5f110212e6bf58ae63fc338db9227da66f011..90ccf045011dc3c2e724f89f21db2e9ce507054b 100755 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx @@ -42,7 +42,6 @@ decription : Implementation code for Gaussian Sum Fitter class #include "GaudiKernel/ToolFactory.h" #include <vector> -#include "xAODEventInfo/EventInfo.h" // Validation mode - TTree includes #include "GaudiKernel/ITHistSvc.h" @@ -139,6 +138,7 @@ Trk::GaussianSumFitter::GaussianSumFitter(const std::string& type, const std::st declareProperty("runBremFinder", m_runBremFinder ); declareProperty("GsfSmoother",m_gsfSmoother); declareProperty("ForwardGsfFitter",m_forwardGsfFitter); + declareProperty("EventInfoKey", m_readKey="EventInfo"); // Estrablish reference point as origin m_sortingReferencePoint.push_back(0.); @@ -286,6 +286,8 @@ StatusCode Trk::GaussianSumFitter::initialize() m_inputPreparator = new TrackFitInputPreparator(); + ATH_CHECK( m_readKey.initialize() ); + msg(MSG::INFO) << "Initialisation of " << name() << " was successful" << endmsg; return StatusCode::SUCCESS; @@ -1023,8 +1025,8 @@ void Trk::GaussianSumFitter::SaveMCSOSF(const Trk::ForwardTrajectory& forwardTra m_surfaceCounterF = 0; //* Retrieve the event info for later syncrinization - const xAOD::EventInfo* eventInfo; - if ((evtStore()->retrieve(eventInfo)).isFailure()) { + SG::ReadHandle<xAOD::EventInfo> eventInfo (m_readKey); + if (!eventInfo.isValid()) { msg(MSG::ERROR) << "Could not retrieve event info" << endmsg; }