ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::PeriodicScaler Class Reference

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). More...

#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
void reset ()
 Reset scaler to initial state.

Protected Attributes

unsigned int m_counter
 event counter
unsigned int m_last
 last integer

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).

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
Nicolas Berger Nicol.nosp@m.as.B.nosp@m.erger.nosp@m.@cer.nosp@m.n.ch
Frank Winklmeier

Definition at line 33 of file PeriodicScaler.h.

Constructor & Destructor Documentation

◆ PeriodicScaler()

LVL1::PeriodicScaler::PeriodicScaler ( )

Definition at line 22 of file PeriodicScaler.cxx.

22 {
23 reset();
24}
void reset()
Reset scaler to initial state.

◆ ~PeriodicScaler()

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

Definition at line 38 of file PeriodicScaler.h.

38{ }

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}
unsigned int m_last
last integer
unsigned int m_counter
event counter

◆ 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 51 of file PeriodicScaler.h.

◆ m_last

unsigned int LVL1::PeriodicScaler::m_last
protected

last integer

Definition at line 52 of file PeriodicScaler.h.


The documentation for this class was generated from the following files: