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,
kColumnMask
= 0x1f,
18
kRowMask
= 0x3f,
kToAMask
= 0x7ff,
kDataMask
= 0xff };
19
enum
ETLSampleShifts
{
kThreshShift
= 31,
kModeShift
= 30,
kColumnShift
= 25,
20
kRowShift
= 19,
kToAShift
= 8,
kDataShift
= 0 };
21
25
ETLSample
() :
value_
(0) { }
26
ETLSample
(uint32_t
value
) :
value_
(value) { }
27
ETLSample
(
const
ETLSample
&
o
) :
value_
(o.
value_
) { }
28
32
void
setThreshold
(
bool
thr) {
setWord
(thr,
kThreshMask
,
kThreshShift
); }
33
void
setMode
(
bool
mode
) {
setWord
(mode,
kModeMask
,
kModeShift
); }
34
void
setColumn
(uint8_t
col
) {
setWord
(col,
kColumnMask
,
kColumnShift
); }
35
void
setRow
(uint8_t
row
) {
setWord
(row,
kRowMask
,
kRowShift
); }
36
void
setToA
(uint16_t
toa
) {
setWord
(toa,
kToAMask
,
kToAShift
); }
37
void
setData
(uint16_t
data
) {
setWord
(data,
kDataMask
,
kDataShift
); }
38
void
set
(
bool
thr,
bool
mode
, uint16_t
toa
, uint16_t
data
, uint8_t
row
, uint8_t
col
)
39
{
40
value_
= ( ( (uint32_t)thr &
kThreshMask
) <<
kThreshShift
|
41
( (uint32_t)mode &
kModeMask
) <<
kModeShift
|
42
( (uint32_t)
col
&
kColumnMask
) <<
kColumnShift
|
43
( (uint32_t)row &
kRowMask
) <<
kRowShift
|
44
( (uint32_t)toa &
kToAMask
) <<
kToAShift
|
45
( (uint32_t)data &
kDataMask
) <<
kDataShift
);
46
}
47
void
print
(std::ostream &
out
=
std::cout
)
48
{
49
out
<<
"(row,col) : ("
<<
row
() <<
','
<<
column
() <<
") "
50
<<
"THR: "
<<
threshold
()
51
<<
" Mode: "
<<
mode
()
52
<<
" ToA: "
<<
toa
()
53
<<
" Data: "
<<
data
()
54
<<
" Raw=0x"
<< std::hex <<
raw
() <<
std::dec
<< std::endl;
55
}
56
60
uint32_t
raw
()
const
{
return
value_
; }
61
bool
threshold
()
const
{
return
( (
value_
>>
kThreshShift
) &
kThreshMask
); }
62
bool
mode
()
const
{
return
( (
value_
>>
kModeShift
) &
kModeMask
); }
63
uint32_t
column
()
const
{
return
( (
value_
>>
kColumnShift
) &
kColumnMask
); }
64
uint32_t
row
()
const
{
return
( (
value_
>>
kRowShift
) &
kRowMask
); }
65
uint32_t
toa
()
const
{
return
( (
value_
>>
kToAShift
) &
kToAMask
); }
66
uint32_t
data
()
const
{
return
( (
value_
>>
kDataShift
) &
kDataMask
); }
67
uint32_t
operator()
() {
return
value_
; }
68
69
private
:
70
74
void
setWord
(uint32_t word, uint32_t
mask
, uint32_t
pos
)
75
{
76
//clear required bits
77
value_
&= ~(mask << pos);
78
//now set the new value
79
value_
|= ( (word &
mask
) << pos );
80
}
81
82
// a 32-bit word
83
uint32_t
value_
;
84
};
85
86
87
#endif
ETLSample::ETLSample
ETLSample(uint32_t value)
Definition:
ETLSample.h:26
ETLSample::kDataMask
Definition:
ETLSample.h:18
ETLSample::kRowMask
Definition:
ETLSample.h:18
ETLSample::print
void print(std::ostream &out=std::cout)
Definition:
ETLSample.h:47
ETLSample::operator()
uint32_t operator()()
Definition:
ETLSample.h:67
ETLSample::kColumnMask
Definition:
ETLSample.h:17
ETLSample::column
uint32_t column() const
Definition:
ETLSample.h:63
ETLSample::ETLSample
ETLSample()
CTOR.
Definition:
ETLSample.h:25
ETLSample::mode
bool mode() const
Definition:
ETLSample.h:62
ETLSample
wrapper for a data word
Definition:
ETLSample.h:13
ETLSample::threshold
bool threshold() const
Definition:
ETLSample.h:61
ETLSample::setToA
void setToA(uint16_t toa)
Definition:
ETLSample.h:36
ETLSample::kModeMask
Definition:
ETLSample.h:17
ETLSample::kModeShift
Definition:
ETLSample.h:19
ETLSample::ETLSampleShifts
ETLSampleShifts
Definition:
ETLSample.h:19
ETLSample::raw
uint32_t raw() const
getters
Definition:
ETLSample.h:60
RecoTauDiscriminantConfiguration.mask
mask
Definition:
RecoTauDiscriminantConfiguration.py:73
ETLSample::setData
void setData(uint16_t data)
Definition:
ETLSample.h:37
value
Definition:
value.py:1
ETLSample::kToAShift
Definition:
ETLSample.h:20
pos
Definition:
PixelAliasList.h:18
ETLSample::ETLSampleMasks
ETLSampleMasks
Definition:
ETLSample.h:17
ETLSample::toa
uint32_t toa() const
Definition:
ETLSample.h:65
connectstrParser.o
o
Definition:
connectstrParser.py:72
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
ETLSample::setMode
void setMode(bool mode)
Definition:
ETLSample.h:33
ETLSample::setColumn
void setColumn(uint8_t col)
Definition:
ETLSample.h:34
ETLSample::setThreshold
void setThreshold(bool thr)
setters
Definition:
ETLSample.h:32
ETLSample::kDataShift
Definition:
ETLSample.h:20
ETLSample::kRowShift
Definition:
ETLSample.h:20
TauDecayModes.dec
dec
Definition:
TauDecayModes.py:143
ETLSample::kThreshShift
Definition:
ETLSample.h:19
ETLSample::setRow
void setRow(uint8_t row)
Definition:
ETLSample.h:35
cuy.col
col
Definition:
cuy.py:1010
ETLSample::setWord
void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition:
ETLSample.h:74
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
ETLSample::kColumnShift
Definition:
ETLSample.h:19
ETLSample::ETLSample
ETLSample(const ETLSample &o)
Definition:
ETLSample.h:27
ETLSample::value_
uint32_t value_
Definition:
ETLSample.h:83
ETLSample::row
uint32_t row() const
Definition:
ETLSample.h:64
ETLSample::data
uint32_t data() const
Definition:
ETLSample.h:66
ETLSample::kToAMask
Definition:
ETLSample.h:18
ETLSample::kThreshMask
Definition:
ETLSample.h:17
Generated for CMSSW Reference Manual by
1.8.11