CMS 3D CMS Logo

TriggerExpressionPrescaler.cc
Go to the documentation of this file.
3 
4 namespace triggerExpression {
5 
6  bool Prescaler::operator()(const Data& data) const {
7  // if the prescale factor is 0, we never need to run any dependent module,
8  // so we can safely skip the rest of the processing
9  if (m_prescale == 0)
10  return false;
11 
12  bool result = ((*m_arg)(data));
13  if (not result)
14  return false;
15 
16  // if the prescale factor is 1, we do not need to keep track of the event counter
17  if (m_prescale == 1)
18  return true;
19 
20  return (++m_counter % m_prescale) == 0;
21  }
22 
23  void Prescaler::init(const Data& data) {
24  // initialize the depending modules
26 
27  // initialize the counter to the first event number seen,
28  // in order to avoid all prescalers on different FUs to be synchronous
29  m_counter = data.eventNumber();
30  }
31 
32 } // namespace triggerExpression
void init(const Data &data) override
bool operator()(const Data &data) const override
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
void init(const Data &data) override