ATLAS Offline Software
Loading...
Searching...
No Matches
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
25
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
37 m_counter = 0;
38 m_last = 0;
39}
40
41
45
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
virtual bool decision(float factor) override
make decision based on given factor (but always take first event)
virtual bool decision(float factor)
make decision based on given factor
unsigned int m_last
last integer
void reset()
Reset scaler to initial state.
unsigned int m_counter
event counter