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