Main Page
Namespaces
Classes
Package Documentation
DataFormats
FTLDigi
interface
ETLSample.h
Go to the documentation of this file.
1
#ifndef DIGIFTL_ETLSAMPLE_H
2
#define DIGIFTL_ETLSAMPLE_H
3
4
#include <iostream>
5
#include <ostream>
6
#include <cstdint>
7
13
class
ETLSample
{
14
15
public
:
16
17
enum
ETLSampleMasks
{
kThreshMask
= 0x1,
kModeMask
= 0x1,
kToAMask
= 0xfff,
kDataMask
= 0xfff};
18
enum
ETLSampleShifts
{
kThreshShift
= 31,
kModeShift
= 30,
kToAShift
= 13,
kDataShift
= 0};
19
23
ETLSample
() :
value_
(0) { }
24
ETLSample
(uint32_t
value
) :
value_
(value) { }
25
ETLSample
(
const
ETLSample
&
o
) :
value_
(o.
value_
) { }
26
30
void
setThreshold
(
bool
thr) {
setWord
(thr,
kThreshMask
,
kThreshShift
); }
31
void
setMode
(
bool
mode
) {
setWord
(mode,
kModeMask
,
kModeShift
); }
32
void
setToA
(uint16_t
toa
) {
setWord
(toa,
kToAMask
,
kToAShift
); }
33
void
setData
(uint16_t
data
) {
setWord
(data,
kDataMask
,
kDataShift
); }
34
void
set
(
bool
thr,
bool
mode
,uint16_t
toa
, uint16_t
data
)
35
{
36
value_
= ( ( (uint32_t)thr &
kThreshMask
) <<
kThreshShift
|
37
( (uint32_t)mode &
kModeMask
) <<
kModeShift
|
38
( (uint32_t)toa &
kToAMask
) <<
kToAShift
|
39
( (uint32_t)
data
&
kDataMask
) <<
kDataShift
);
40
}
41
void
print
(std::ostream &
out
=
std::cout
)
42
{
43
out
<<
"THR: "
<<
threshold
()
44
<<
" Mode: "
<<
mode
()
45
<<
" ToA: "
<<
toa
()
46
<<
" Data: "
<<
data
()
47
<<
" Raw=0x"
<< std::hex <<
raw
() <<
std::dec
<< std::endl;
48
}
49
53
uint32_t
raw
()
const
{
return
value_
; }
54
bool
threshold
()
const
{
return
( (
value_
>>
kThreshShift
) &
kThreshMask
); }
55
bool
mode
()
const
{
return
( (
value_
>>
kModeShift
) &
kModeMask
); }
56
uint32_t
toa
()
const
{
return
( (
value_
>>
kToAShift
) &
kToAMask
); }
57
uint32_t
data
()
const
{
return
( (
value_
>>
kDataShift
) &
kDataMask
); }
58
uint32_t
operator()
() {
return
value_
; }
59
60
private
:
61
65
void
setWord
(uint32_t word, uint32_t
mask
, uint32_t
pos
)
66
{
67
//clear required bits
68
value_
&= ~(mask << pos);
69
//now set the new value
70
value_
|= ( (word &
mask
) << pos );
71
}
72
73
// a 32-bit word
74
uint32_t
value_
;
75
};
76
77
78
#endif
ETLSample::ETLSample
ETLSample(uint32_t value)
Definition:
ETLSample.h:24
ETLSample::kDataMask
Definition:
ETLSample.h:17
ETLSample::print
void print(std::ostream &out=std::cout)
Definition:
ETLSample.h:41
ETLSample::operator()
uint32_t operator()()
Definition:
ETLSample.h:58
ETLSample::ETLSample
ETLSample()
CTOR.
Definition:
ETLSample.h:23
ETLSample::mode
bool mode() const
Definition:
ETLSample.h:55
ETLSample
wrapper for a data word
Definition:
ETLSample.h:13
ETLSample::threshold
bool threshold() const
Definition:
ETLSample.h:54
ETLSample::setToA
void setToA(uint16_t toa)
Definition:
ETLSample.h:32
ETLSample::kModeMask
Definition:
ETLSample.h:17
ETLSample::kModeShift
Definition:
ETLSample.h:18
ETLSample::ETLSampleShifts
ETLSampleShifts
Definition:
ETLSample.h:18
ETLSample::raw
uint32_t raw() const
getters
Definition:
ETLSample.h:53
RecoTauDiscriminantConfiguration.mask
mask
Definition:
RecoTauDiscriminantConfiguration.py:72
ETLSample::setData
void setData(uint16_t data)
Definition:
ETLSample.h:33
value
Definition:
value.py:1
ETLSample::kToAShift
Definition:
ETLSample.h:18
pos
Definition:
PixelAliasList.h:18
ETLSample::ETLSampleMasks
ETLSampleMasks
Definition:
ETLSample.h:17
ETLSample::toa
uint32_t toa() const
Definition:
ETLSample.h:56
connectstrParser.o
o
Definition:
connectstrParser.py:71
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
ETLSample::setMode
void setMode(bool mode)
Definition:
ETLSample.h:31
ETLSample::setThreshold
void setThreshold(bool thr)
setters
Definition:
ETLSample.h:30
ETLSample::kDataShift
Definition:
ETLSample.h:18
TauDecayModes.dec
dec
Definition:
TauDecayModes.py:143
ETLSample::kThreshShift
Definition:
ETLSample.h:18
ETLSample::setWord
void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition:
ETLSample.h:65
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
ETLSample::ETLSample
ETLSample(const ETLSample &o)
Definition:
ETLSample.h:25
ETLSample::value_
uint32_t value_
Definition:
ETLSample.h:74
ETLSample::data
uint32_t data() const
Definition:
ETLSample.h:57
ETLSample::kToAMask
Definition:
ETLSample.h:17
ETLSample::kThreshMask
Definition:
ETLSample.h:17
Generated for CMSSW Reference Manual by
1.8.11