diff --git a/PhysicsAnalysis/AnalysisCommon/EventUtils/src/EventQualityFilterAlg.cxx b/PhysicsAnalysis/AnalysisCommon/EventUtils/src/EventQualityFilterAlg.cxx index 86e11806ff28db10d4c370901464c7324493341a..6e312add2394750d696576caa5dd2962ee3447ee 100644 --- a/PhysicsAnalysis/AnalysisCommon/EventUtils/src/EventQualityFilterAlg.cxx +++ b/PhysicsAnalysis/AnalysisCommon/EventUtils/src/EventQualityFilterAlg.cxx @@ -1,9 +1,9 @@ ///////////////////////// -*- C++ -*- ///////////////////////////// - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + // EventQualityFilterAlg.cxx // Implementation file for class EventQualityFilterAlg // Author: Karsten Koeneke <karsten.koeneke@cern.ch> @@ -16,6 +16,10 @@ // EDM includes #include "xAODEventInfo/EventInfo.h" +// FrameWork includes +#include "AsgDataHandles/ReadHandle.h" +#include "AsgTools/CurrentContext.h" + /////////////////////////////////////////////////////////////////// // Public methods: @@ -62,6 +66,7 @@ StatusCode EventQualityFilterAlg::initialize() ATH_MSG_DEBUG( "Using: " << m_useSCTError ); ATH_MSG_DEBUG( "Using: " << m_useCoreError ); // ATH_MSG_DEBUG( "Using: " << m_useTileTripReader ); + ATH_CHECK(m_eventInfo.initialize()); return StatusCode::SUCCESS; } @@ -79,10 +84,15 @@ StatusCode EventQualityFilterAlg::execute() { ATH_MSG_DEBUG ("Executing " << name() << "..."); + const EventContext& ctx = Gaudi::Hive::currentContext(); // Get the EventInfo object - const xAOD::EventInfo* eventInfo = nullptr; - ATH_CHECK( evtStore()->retrieve(eventInfo) ); + SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfo, ctx); + if (!eventInfo.isValid()) { + ATH_MSG_ERROR("Could not retrieve EventInfo!"); + return StatusCode::FAILURE; + } + // Only do the event vetoing on data diff --git a/PhysicsAnalysis/AnalysisCommon/EventUtils/src/EventQualityFilterAlg.h b/PhysicsAnalysis/AnalysisCommon/EventUtils/src/EventQualityFilterAlg.h index b62e0516700163d82933c99fd9a18eb40a611e31..f38e3b77781b2004dfb2324bf16d05462ae33503 100644 --- a/PhysicsAnalysis/AnalysisCommon/EventUtils/src/EventQualityFilterAlg.h +++ b/PhysicsAnalysis/AnalysisCommon/EventUtils/src/EventQualityFilterAlg.h @@ -17,6 +17,7 @@ // FrameWork includes #include "AthenaBaseComps/AthFilterAlgorithm.h" +#include "AsgDataHandles/ReadHandleKey.h" @@ -69,6 +70,9 @@ class EventQualityFilterAlg // /// Flag to turn on/off checking of tile trip information // BooleanProperty m_useTileTripReader; + /// EventInfo read handle + SG::ReadHandleKey<xAOD::EventInfo> m_eventInfo {this, "EventInfo", "EventInfo", "EventInfo key"}; + };