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

#include <PeriodicScaler.h>

Inheritance diagram for LVL1::PeriodicScalerTake1st:
Collaboration diagram for LVL1::PeriodicScalerTake1st:

Public Member Functions

 PeriodicScalerTake1st ()
 
virtual ~PeriodicScalerTake1st ()
 
virtual bool decision (float factor) override
 make decision based on given factor (but always take first event) 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

Definition at line 73 of file PeriodicScaler.h.

Constructor & Destructor Documentation

◆ PeriodicScalerTake1st()

LVL1::PeriodicScalerTake1st::PeriodicScalerTake1st ( )

Definition at line 42 of file PeriodicScaler.cxx.

42  {
43  reset();
44 }

◆ ~PeriodicScalerTake1st()

virtual LVL1::PeriodicScalerTake1st::~PeriodicScalerTake1st ( )
inlinevirtual

Definition at line 76 of file PeriodicScaler.h.

Member Function Documentation

◆ decision()

bool LVL1::PeriodicScalerTake1st::decision ( float  factor)
overridevirtual

make decision based on given factor (but always take first event)

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

Reimplemented from LVL1::PeriodicScaler.

Definition at line 46 of file PeriodicScaler.cxx.

46  {
47  m_counter++;
48  unsigned offset = static_cast<unsigned>(factor)-1;
49  unsigned N = static_cast<unsigned>((m_counter+offset)/factor);
50  if ( m_last != N ) {
51  m_last = N;
52  return true;
53  }
54  return false;
55 }

◆ reset()

void LVL1::PeriodicScaler::reset ( )
inherited

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
protectedinherited

event counter

Definition at line 61 of file PeriodicScaler.h.

◆ m_last

unsigned int LVL1::PeriodicScaler::m_last
protectedinherited

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
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
LVL1::PeriodicScaler::m_counter
unsigned int m_counter
event counter
Definition: PeriodicScaler.h:61