diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/CMakeLists.txt b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/CMakeLists.txt index d0fbaa21d62c69420433b40323df6f3f1e9abfb4..15e683fde41ad68a5a9eae374d010e7ffd4acb0f 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/CMakeLists.txt +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/CMakeLists.txt @@ -14,6 +14,7 @@ atlas_depends_on_subdirs( PhysicsAnalysis/AnalysisCommon/PATCore PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces Trigger/TrigAnalysis/TrigDecisionTool + Event/xAOD/xAODEventInfo PRIVATE Control/AthenaKernel PhysicsAnalysis/CommonTools/ExpressionEvaluation ) @@ -26,7 +27,7 @@ atlas_add_library( DerivationFrameworkToolsLib DerivationFrameworkTools/*.h src/*.cxx PUBLIC_HEADERS DerivationFrameworkTools PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES AthenaBaseComps xAODBase GaudiKernel PATCoreLib + LINK_LIBRARIES AthenaBaseComps xAODBase GaudiKernel PATCoreLib xAODEventInfo TrigDecisionToolLib ExpressionEvaluationLib DerivationFrameworkInterfacesLib PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel ) diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/DerivationFrameworkTools/PrescaleTool.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/DerivationFrameworkTools/PrescaleTool.h index 33dab780dcc32f41834af74e74960a35a4df9d89..b5db6fe041bc08c5462cd27b1981ab87e0e0be90 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/DerivationFrameworkTools/PrescaleTool.h +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/DerivationFrameworkTools/PrescaleTool.h @@ -25,7 +25,7 @@ namespace DerivationFramework { virtual bool eventPassesFilter() const; private: - mutable int m_prescale, m_eventCounter; + unsigned int m_prescale; }; } diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/src/PrescaleTool.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/src/PrescaleTool.cxx index abb82535c52d0ba2ded9d461cfde94594630c74f..150742540a0a2d2b5e5871215da2b571e2bb828c 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/src/PrescaleTool.cxx +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/src/PrescaleTool.cxx @@ -11,6 +11,7 @@ // Use of ExpressionParsing to analyse a more complex string #include "DerivationFrameworkTools/PrescaleTool.h" +#include "xAODEventInfo/EventInfo.h" namespace DerivationFramework { @@ -30,7 +31,6 @@ namespace DerivationFramework { ATH_MSG_FATAL("Prescale of less than 1 makes no sense"); return StatusCode::FAILURE; } - m_eventCounter = 0; return StatusCode::SUCCESS; } @@ -41,9 +41,11 @@ namespace DerivationFramework { bool PrescaleTool::eventPassesFilter() const { + const xAOD::EventInfo* ei = 0; + CHECK( evtStore()->retrieve( ei , "EventInfo" ) ); + uint32_t eventNumber ei->eventNumber(); bool accept(false); - if (m_eventCounter % m_prescale == 0) accept = true; - ++m_eventCounter; + if (eventNumber % m_prescale == 0) accept = true; return accept; }