ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
LVL1::PeriodicScaler Class Reference

#include <PeriodicScaler.h>

Inheritance diagram for LVL1::PeriodicScaler:
Collaboration diagram for LVL1::PeriodicScaler:

Public Member Functions

 PeriodicScaler ()
 
virtual ~PeriodicScaler ()
 
virtual bool decision (float factor)
 make decision based on given factor More...
 
void reset ()
 Reset scaler to initial state. More...
 

Protected Attributes

unsigned int m_counter
 event counter More...
 
unsigned int m_last
 last integer More...
 

Detailed Description

Utility class to determine if a chain should be prescaled/passed-through using its PS/PT factor, implemented with a periodic algorithm (take every [factor] event).

Author
Nicolas Berger Nicol.nosp@m.as.B.nosp@m.erger.nosp@m.@cer.nosp@m.n.ch

Utility class to determine if a chain should be prescaled/passed-through using its PS/PT factor, implemented with a periodic algorithm (take every [factor] event and always 1st event)

Author
Frank Winklmeier

Definition at line 43 of file PeriodicScaler.h.

Constructor & Destructor Documentation

◆ PeriodicScaler()

LVL1::PeriodicScaler::PeriodicScaler ( )

Definition at line 22 of file PeriodicScaler.cxx.

22  {
23  reset();
24 }

◆ ~PeriodicScaler()

virtual LVL1::PeriodicScaler::~PeriodicScaler ( )
inlinevirtual

Definition at line 48 of file PeriodicScaler.h.

50 :
51  unsigned int m_counter;

Member Function Documentation

◆ decision()

bool LVL1::PeriodicScaler::decision ( float  factor)
virtual

make decision based on given factor

Parameters
factortake every [factor] event
Returns
true if event is taken

Reimplemented in LVL1::PeriodicScalerTake1st.

Definition at line 26 of file PeriodicScaler.cxx.

26  {
27  m_counter++;
28  unsigned N = static_cast<unsigned>(m_counter/factor);
29  if ( m_last != N ) {
30  m_last = N;
31  return true;
32  }
33  return false;
34 }

◆ reset()

void LVL1::PeriodicScaler::reset ( )

Reset scaler to initial state.

Definition at line 36 of file PeriodicScaler.cxx.

36  {
37  m_counter = 0;
38  m_last = 0;
39 }

Member Data Documentation

◆ m_counter

unsigned int LVL1::PeriodicScaler::m_counter
protected

event counter

Definition at line 61 of file PeriodicScaler.h.

◆ m_last

unsigned int LVL1::PeriodicScaler::m_last
protected

last integer

Definition at line 62 of file PeriodicScaler.h.


The documentation for this class was generated from the following files:
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
LVL1::PeriodicScaler::m_last
unsigned int m_last
last integer
Definition: PeriodicScaler.h:62
LVL1::PeriodicScaler::reset
void reset()
Reset scaler to initial state.
Definition: PeriodicScaler.cxx:36
LVL1::PeriodicScaler::m_counter
unsigned int m_counter
event counter
Definition: PeriodicScaler.h:61