Skip to content
Snippets Groups Projects
Commit 61fd73af authored by Peter Onyisi's avatar Peter Onyisi Committed by Walter Lampl
Browse files

Merge branch '21.0-atlasg-1450' into '21.0'

Backport ATLASG-1450 fix to 21.0

See merge request atlas/athena!25182
parent 80d4e5e2
8 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!28528Revert 63f845ae,!27054Atr20369 210,!26342Monopole: Handle fractionally charged particles
......@@ -13,6 +13,7 @@ atlas_depends_on_subdirs( PUBLIC
PhysicsAnalysis/AnalysisCommon/PATCore
PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces
Trigger/TrigAnalysis/TrigDecisionTool
Event/xAOD/xAODEventInfo
PRIVATE
Control/AthenaKernel
PhysicsAnalysis/CommonTools/ExpressionEvaluation )
......@@ -25,7 +26,7 @@ atlas_add_library( DerivationFrameworkToolsLib
src/*.cxx
PUBLIC_HEADERS DerivationFrameworkTools
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 )
atlas_add_component( DerivationFrameworkTools
......
......@@ -13,6 +13,7 @@
#include "AthenaBaseComps/AthAlgTool.h"
#include "DerivationFrameworkInterfaces/ISkimmingTool.h"
#include "xAODEventInfo/EventInfo.h"
namespace DerivationFramework {
......@@ -25,7 +26,7 @@ namespace DerivationFramework {
virtual bool eventPassesFilter() const;
private:
mutable int m_prescale, m_eventCounter;
Gaudi::Property<unsigned int> m_prescale {this, "Prescale", 1};
};
}
......
......@@ -11,27 +11,24 @@
// Use of ExpressionParsing to analyse a more complex string
#include "DerivationFrameworkTools/PrescaleTool.h"
#include "xAODEventInfo/EventInfo.h"
namespace DerivationFramework {
PrescaleTool::PrescaleTool(const std::string& t,
const std::string& n,
const IInterface* p) :
AthAlgTool(t,n,p),
m_prescale(1),
m_eventCounter(0)
AthAlgTool(t,n,p)
{
declareInterface<DerivationFramework::ISkimmingTool>(this);
declareProperty("Prescale", m_prescale);
}
StatusCode PrescaleTool::initialize()
{
if (m_prescale < 1) {
if (m_prescale < 1u) {
ATH_MSG_FATAL("Prescale of less than 1 makes no sense");
return StatusCode::FAILURE;
}
m_eventCounter = 0;
return StatusCode::SUCCESS;
}
......@@ -42,10 +39,7 @@ namespace DerivationFramework {
bool PrescaleTool::eventPassesFilter() const
{
bool accept(false);
if (m_eventCounter % m_prescale == 0) accept = true;
++m_eventCounter;
return accept;
return (Gaudi::Hive::currentContext().eventID().event_number() % m_prescale == 0);
}
}
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