File indexing completed on 2024-04-06 12:18:26
0001 #include "HLTrigger/HLTcore/interface/TriggerExpressionPrescaler.h"
0002 #include "HLTrigger/HLTcore/interface/TriggerExpressionData.h"
0003
0004 namespace triggerExpression {
0005
0006 bool Prescaler::operator()(const Data& data) const {
0007
0008
0009 if (m_prescale == 0)
0010 return false;
0011
0012 bool result = ((*m_arg)(data));
0013 if (not result)
0014 return false;
0015
0016
0017 if (m_prescale == 1)
0018 return true;
0019
0020 return (++m_counter % m_prescale) == 0;
0021 }
0022
0023 void Prescaler::init(const Data& data) {
0024
0025 UnaryOperator::init(data);
0026
0027
0028
0029 m_counter = data.eventNumber();
0030 }
0031
0032 }