ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoSimulation
src
PeriodicScaler.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/**********************************************************************************
6
* @Project: HLT Steering
7
* @Package: TrigSteering
8
* @Class : PeriodicScaler
9
*
10
* @brief periodic prescale/FA engine
11
*
12
* @author Nicolas Berger <Nicolas.Berger@cern.ch> - CERN
13
* @author Tomasz Bold <Tomasz.Bold@cern.ch> - UST-AGH changed to float prescale factor (enjoy understanding how it works)
14
*
15
* File and Version Information:
16
* $Id: PeriodicScaler.cxx,v 1.3 2008-05-06 09:19:19 tbold Exp $
17
**********************************************************************************/
18
19
#include "
./PeriodicScaler.h
"
20
21
22
LVL1::PeriodicScaler::PeriodicScaler
() {
23
reset
();
24
}
25
26
bool
LVL1::PeriodicScaler::decision
(
float
factor) {
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
}
35
36
void
LVL1::PeriodicScaler::reset
() {
37
m_counter
= 0;
38
m_last
= 0;
39
}
40
41
42
LVL1::PeriodicScalerTake1st::PeriodicScalerTake1st
() {
43
reset
();
44
}
45
46
bool
LVL1::PeriodicScalerTake1st::decision
(
float
factor) {
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
}
56
PeriodicScaler.h
LVL1::PeriodicScalerTake1st::decision
virtual bool decision(float factor) override
make decision based on given factor (but always take first event)
Definition
PeriodicScaler.cxx:46
LVL1::PeriodicScalerTake1st::PeriodicScalerTake1st
PeriodicScalerTake1st()
Definition
PeriodicScaler.cxx:42
LVL1::PeriodicScaler::decision
virtual bool decision(float factor)
make decision based on given factor
Definition
PeriodicScaler.cxx:26
LVL1::PeriodicScaler::PeriodicScaler
PeriodicScaler()
Definition
PeriodicScaler.cxx:22
LVL1::PeriodicScaler::m_last
unsigned int m_last
last integer
Definition
PeriodicScaler.h:52
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:51
Generated on
for ATLAS Offline Software by
1.14.0