Jpp
master_rocky-44-g75b7c4f75
the software that should make you happy
Loading...
Searching...
No Matches
software
JTrigger
JPrescaler.hh
Go to the documentation of this file.
1
#ifndef __JTRIGGER__JPRESCALER__
2
#define __JTRIGGER__JPRESCALER__
3
4
#include <istream>
5
#include <ostream>
6
7
#include <TROOT.h>
8
#include <TObject.h>
9
10
11
/**
12
* \author mdejong
13
*/
14
15
namespace
JTRIGGER
{}
16
namespace
JPP
{
using namespace
JTRIGGER
; }
17
18
namespace
JTRIGGER
{
19
20
/**
21
* Auxiliary class for prescaling.
22
*/
23
class
JPrescaler
:
24
public
TObject
25
{
26
public
:
27
/**
28
* Default constructor.
29
*/
30
JPrescaler
() :
31
prescale
(0),
32
counter
(0)
33
{}
34
35
36
/**
37
* Constructor.
38
*
39
* \param value prescale value (0 is off)
40
*/
41
JPrescaler
(
const
long
long
int
value) :
42
prescale
(value),
43
counter
(0)
44
{}
45
46
47
/**
48
* Virtual destructor.
49
*/
50
virtual
~JPrescaler
()
51
{}
52
53
54
/**
55
* Equality
56
*
57
* \param prescaler prescaler
58
* \return true if equals; else false
59
*/
60
bool
equals
(
const
JPrescaler
& prescaler)
const
61
{
62
return
prescale
== prescaler.
prescale
;
63
}
64
65
66
/**
67
* Test operator.
68
*
69
* This operator increments the internal counter and
70
* checks whether this counter complies with the prescale value.
71
*
72
* \return true if this turn not prescaled; else false
73
*/
74
bool
operator()
()
const
75
{
76
++
counter
;
77
78
return
prescale
!= 0 &&
counter
%
prescale
== 0;
79
}
80
81
82
/**
83
* Check status.
84
*
85
* \return true if this turn not prescaled; else false
86
*/
87
operator
bool()
const
88
{
89
return
prescale
!= 0 &&
counter
%
prescale
== 0;
90
}
91
92
93
ClassDef
(
JPrescaler
, 2);
94
95
96
long
long
int
prescale
;
97
mutable
long
long
int
counter
;
98
};
99
};
100
101
102
#endif
JTRIGGER::JPrescaler
Auxiliary class for prescaling.
Definition
JPrescaler.hh:25
JTRIGGER::JPrescaler::equals
bool equals(const JPrescaler &prescaler) const
Equality.
Definition
JPrescaler.hh:60
JTRIGGER::JPrescaler::operator()
bool operator()() const
Test operator.
Definition
JPrescaler.hh:74
JTRIGGER::JPrescaler::prescale
long long int prescale
Definition
JPrescaler.hh:96
JTRIGGER::JPrescaler::ClassDef
ClassDef(JPrescaler, 2)
JTRIGGER::JPrescaler::JPrescaler
JPrescaler(const long long int value)
Constructor.
Definition
JPrescaler.hh:41
JTRIGGER::JPrescaler::counter
long long int counter
Definition
JPrescaler.hh:97
JTRIGGER::JPrescaler::~JPrescaler
virtual ~JPrescaler()
Virtual destructor.
Definition
JPrescaler.hh:50
JTRIGGER::JPrescaler::JPrescaler
JPrescaler()
Default constructor.
Definition
JPrescaler.hh:30
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition
JAAnetToolkit.hh:43
JTRIGGER
Auxiliary classes and methods for triggering.
Definition
JSupport/JSupport.hh:36
TObject
Definition
JRoot.hh:19
Generated by
1.12.0