Skip to content
Snippets Groups Projects
Commit c7b08550 authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'manualSweep25182' into 'master'

Forward port ATLASG-1450 to master (supersedes !25206)

See merge request atlas/athena!25220
parents 80d4e5e2 61fd73af
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ atlas_depends_on_subdirs( PUBLIC ...@@ -13,6 +13,7 @@ atlas_depends_on_subdirs( PUBLIC
PhysicsAnalysis/AnalysisCommon/PATCore PhysicsAnalysis/AnalysisCommon/PATCore
PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces
Trigger/TrigAnalysis/TrigDecisionTool Trigger/TrigAnalysis/TrigDecisionTool
Event/xAOD/xAODEventInfo
PRIVATE PRIVATE
Control/AthenaKernel Control/AthenaKernel
PhysicsAnalysis/CommonTools/ExpressionEvaluation ) PhysicsAnalysis/CommonTools/ExpressionEvaluation )
...@@ -25,7 +26,7 @@ atlas_add_library( DerivationFrameworkToolsLib ...@@ -25,7 +26,7 @@ atlas_add_library( DerivationFrameworkToolsLib
src/*.cxx src/*.cxx
PUBLIC_HEADERS DerivationFrameworkTools PUBLIC_HEADERS DerivationFrameworkTools
PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES AthenaBaseComps xAODBase GaudiKernel PATCoreLib TrigDecisionToolLib ExpressionEvaluationLib LINK_LIBRARIES AthenaBaseComps xAODBase GaudiKernel PATCoreLib TrigDecisionToolLib ExpressionEvaluationLib xAODEventInfo
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel ) PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel )
atlas_add_component( DerivationFrameworkTools atlas_add_component( DerivationFrameworkTools
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "AthenaBaseComps/AthAlgTool.h" #include "AthenaBaseComps/AthAlgTool.h"
#include "DerivationFrameworkInterfaces/ISkimmingTool.h" #include "DerivationFrameworkInterfaces/ISkimmingTool.h"
#include "xAODEventInfo/EventInfo.h"
namespace DerivationFramework { namespace DerivationFramework {
...@@ -25,7 +26,7 @@ namespace DerivationFramework { ...@@ -25,7 +26,7 @@ namespace DerivationFramework {
virtual bool eventPassesFilter() const; virtual bool eventPassesFilter() const;
private: private:
mutable int m_prescale, m_eventCounter; Gaudi::Property<unsigned int> m_prescale {this, "Prescale", 1};
}; };
} }
......
...@@ -11,27 +11,24 @@ ...@@ -11,27 +11,24 @@
// Use of ExpressionParsing to analyse a more complex string // Use of ExpressionParsing to analyse a more complex string
#include "DerivationFrameworkTools/PrescaleTool.h" #include "DerivationFrameworkTools/PrescaleTool.h"
#include "xAODEventInfo/EventInfo.h"
namespace DerivationFramework { namespace DerivationFramework {
PrescaleTool::PrescaleTool(const std::string& t, PrescaleTool::PrescaleTool(const std::string& t,
const std::string& n, const std::string& n,
const IInterface* p) : const IInterface* p) :
AthAlgTool(t,n,p), AthAlgTool(t,n,p)
m_prescale(1),
m_eventCounter(0)
{ {
declareInterface<DerivationFramework::ISkimmingTool>(this); declareInterface<DerivationFramework::ISkimmingTool>(this);
declareProperty("Prescale", m_prescale);
} }
StatusCode PrescaleTool::initialize() StatusCode PrescaleTool::initialize()
{ {
if (m_prescale < 1) { if (m_prescale < 1u) {
ATH_MSG_FATAL("Prescale of less than 1 makes no sense"); ATH_MSG_FATAL("Prescale of less than 1 makes no sense");
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
m_eventCounter = 0;
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -42,10 +39,7 @@ namespace DerivationFramework { ...@@ -42,10 +39,7 @@ namespace DerivationFramework {
bool PrescaleTool::eventPassesFilter() const bool PrescaleTool::eventPassesFilter() const
{ {
bool accept(false); return (Gaudi::Hive::currentContext().eventID().event_number() % m_prescale == 0);
if (m_eventCounter % m_prescale == 0) accept = true;
++m_eventCounter;
return accept;
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment