CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
ETLSample Class Reference

wrapper for a data word More...

#include <ETLSample.h>

Public Types

enum  ETLSampleMasks {
  kThreshMask = 0x1, kModeMask = 0x1, kColumnMask = 0x1f, kRowMask = 0x3f,
  kToAMask = 0x7ff, kDataMask = 0xff
}
 
enum  ETLSampleShifts {
  kThreshShift = 31, kModeShift = 30, kColumnShift = 25, kRowShift = 19,
  kToAShift = 8, kDataShift = 0
}
 

Public Member Functions

uint32_t column () const
 
uint32_t data () const
 
 ETLSample ()
 CTOR. More...
 
 ETLSample (const ETLSample &o)
 
 ETLSample (uint32_t value)
 
bool mode () const
 
uint32_t operator() ()
 
void print (std::ostream &out=std::cout)
 
uint32_t raw () const
 getters More...
 
uint32_t row () const
 
void set (bool thr, bool mode, uint16_t toa, uint16_t data, uint8_t row, uint8_t col)
 
void setColumn (uint8_t col)
 
void setData (uint16_t data)
 
void setMode (bool mode)
 
void setRow (uint8_t row)
 
void setThreshold (bool thr)
 setters More...
 
void setToA (uint16_t toa)
 
bool threshold () const
 
uint32_t toa () const
 

Private Member Functions

void setWord (uint32_t word, uint32_t mask, uint32_t pos)
 wrapper to reset words at a given position More...
 

Private Attributes

uint32_t value_
 

Detailed Description

wrapper for a data word

Definition at line 13 of file ETLSample.h.

Member Enumeration Documentation

◆ ETLSampleMasks

Enumerator
kThreshMask 
kModeMask 
kColumnMask 
kRowMask 
kToAMask 
kDataMask 

Definition at line 15 of file ETLSample.h.

15  {
16  kThreshMask = 0x1,
17  kModeMask = 0x1,
18  kColumnMask = 0x1f,
19  kRowMask = 0x3f,
20  kToAMask = 0x7ff,
21  kDataMask = 0xff
22  };

◆ ETLSampleShifts

Enumerator
kThreshShift 
kModeShift 
kColumnShift 
kRowShift 
kToAShift 
kDataShift 

Definition at line 23 of file ETLSample.h.

23  {
24  kThreshShift = 31,
25  kModeShift = 30,
26  kColumnShift = 25,
27  kRowShift = 19,
28  kToAShift = 8,
29  kDataShift = 0
30  };

Constructor & Destructor Documentation

◆ ETLSample() [1/3]

ETLSample::ETLSample ( )
inline

CTOR.

Definition at line 35 of file ETLSample.h.

35 : value_(0) {}

◆ ETLSample() [2/3]

ETLSample::ETLSample ( uint32_t  value)
inline

Definition at line 36 of file ETLSample.h.

36 : value_(value) {}

◆ ETLSample() [3/3]

ETLSample::ETLSample ( const ETLSample o)
inline

Definition at line 37 of file ETLSample.h.

37 : value_(o.value_) {}

Member Function Documentation

◆ column()

uint32_t ETLSample::column ( ) const
inline

Definition at line 65 of file ETLSample.h.

65 { return ((value_ >> kColumnShift) & kColumnMask); }

References kColumnMask, kColumnShift, and value_.

Referenced by print().

◆ data()

uint32_t ETLSample::data ( ) const
inline

Definition at line 68 of file ETLSample.h.

68 { return ((value_ >> kDataShift) & kDataMask); }

References kDataMask, kDataShift, and value_.

Referenced by print(), set(), and setData().

◆ mode()

bool ETLSample::mode ( ) const
inline

Definition at line 64 of file ETLSample.h.

64 { return ((value_ >> kModeShift) & kModeMask); }

References kModeMask, kModeShift, and value_.

Referenced by print(), set(), and setMode().

◆ operator()()

uint32_t ETLSample::operator() ( )
inline

Definition at line 69 of file ETLSample.h.

69 { return value_; }

References value_.

◆ print()

void ETLSample::print ( std::ostream &  out = std::cout)
inline

Definition at line 53 of file ETLSample.h.

53  {
54  out << "(row,col) : (" << row() << ',' << column() << ") "
55  << "THR: " << threshold() << " Mode: " << mode() << " ToA: " << toa() << " Data: " << data() << " Raw=0x"
56  << std::hex << raw() << std::dec << std::endl;
57  }

References column(), data(), TauDecayModes::dec, mode(), MillePedeFileConverter_cfg::out, raw(), row(), threshold(), and toa().

◆ raw()

uint32_t ETLSample::raw ( ) const
inline

getters

Definition at line 62 of file ETLSample.h.

62 { return value_; }

References value_.

Referenced by print().

◆ row()

uint32_t ETLSample::row ( ) const
inline

Definition at line 66 of file ETLSample.h.

66 { return ((value_ >> kRowShift) & kRowMask); }

References kRowMask, kRowShift, and value_.

Referenced by print(), set(), and setRow().

◆ set()

void ETLSample::set ( bool  thr,
bool  mode,
uint16_t  toa,
uint16_t  data,
uint8_t  row,
uint8_t  col 
)
inline

Definition at line 48 of file ETLSample.h.

48  {
49  value_ = (((uint32_t)thr & kThreshMask) << kThreshShift | ((uint32_t)mode & kModeMask) << kModeShift |
50  ((uint32_t)col & kColumnMask) << kColumnShift | ((uint32_t)row & kRowMask) << kRowShift |
51  ((uint32_t)toa & kToAMask) << kToAShift | ((uint32_t)data & kDataMask) << kDataShift);
52  }

References cuy::col, data(), kColumnMask, kColumnShift, kDataMask, kDataShift, kModeMask, kModeShift, kRowMask, kRowShift, kThreshMask, kThreshShift, kToAMask, kToAShift, mode(), row(), toa(), and value_.

Referenced by ETLElectronicsSim::runTrivialShaper().

◆ setColumn()

void ETLSample::setColumn ( uint8_t  col)
inline

Definition at line 44 of file ETLSample.h.

References cuy::col, kColumnMask, kColumnShift, and setWord().

◆ setData()

void ETLSample::setData ( uint16_t  data)
inline

Definition at line 47 of file ETLSample.h.

References data(), kDataMask, kDataShift, and setWord().

◆ setMode()

void ETLSample::setMode ( bool  mode)
inline

Definition at line 43 of file ETLSample.h.

References kModeMask, kModeShift, mode(), and setWord().

◆ setRow()

void ETLSample::setRow ( uint8_t  row)
inline

Definition at line 45 of file ETLSample.h.

References kRowMask, kRowShift, row(), and setWord().

◆ setThreshold()

void ETLSample::setThreshold ( bool  thr)
inline

setters

Definition at line 42 of file ETLSample.h.

References kThreshMask, kThreshShift, and setWord().

◆ setToA()

void ETLSample::setToA ( uint16_t  toa)
inline

Definition at line 46 of file ETLSample.h.

References kToAMask, kToAShift, setWord(), and toa().

◆ setWord()

void ETLSample::setWord ( uint32_t  word,
uint32_t  mask,
uint32_t  pos 
)
inlineprivate

wrapper to reset words at a given position

Definition at line 75 of file ETLSample.h.

75  {
76  //clear required bits
77  value_ &= ~(mask << pos);
78  //now set the new value
79  value_ |= ((word & mask) << pos);
80  }

References value_.

Referenced by setColumn(), setData(), setMode(), setRow(), setThreshold(), and setToA().

◆ threshold()

bool ETLSample::threshold ( ) const
inline

Definition at line 63 of file ETLSample.h.

63 { return ((value_ >> kThreshShift) & kThreshMask); }

References kThreshMask, kThreshShift, and value_.

Referenced by print().

◆ toa()

uint32_t ETLSample::toa ( ) const
inline

Definition at line 67 of file ETLSample.h.

67 { return ((value_ >> kToAShift) & kToAMask); }

References kToAMask, kToAShift, and value_.

Referenced by print(), set(), and setToA().

Member Data Documentation

◆ value_

uint32_t ETLSample::value_
private

Definition at line 83 of file ETLSample.h.

Referenced by column(), data(), mode(), operator()(), raw(), row(), set(), setWord(), threshold(), and toa().

ETLSample::kThreshMask
Definition: ETLSample.h:16
ETLSample::kModeShift
Definition: ETLSample.h:25
ETLSample::kDataMask
Definition: ETLSample.h:21
cuy.col
col
Definition: cuy.py:1010
pos
Definition: PixelAliasList.h:18
ETLSample::kColumnShift
Definition: ETLSample.h:26
ETLSample::toa
uint32_t toa() const
Definition: ETLSample.h:67
ETLSample::value_
uint32_t value_
Definition: ETLSample.h:83
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
ETLSample::threshold
bool threshold() const
Definition: ETLSample.h:63
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
ETLSample::kThreshShift
Definition: ETLSample.h:24
ETLSample::kToAMask
Definition: ETLSample.h:20
ETLSample::kDataShift
Definition: ETLSample.h:29
ETLSample::row
uint32_t row() const
Definition: ETLSample.h:66
ETLSample::mode
bool mode() const
Definition: ETLSample.h:64
ETLSample::column
uint32_t column() const
Definition: ETLSample.h:65
value
Definition: value.py:1
ETLSample::kModeMask
Definition: ETLSample.h:17
ETLSample::kColumnMask
Definition: ETLSample.h:18
ETLSample::kRowShift
Definition: ETLSample.h:27
ETLSample::data
uint32_t data() const
Definition: ETLSample.h:68
ETLSample::kToAShift
Definition: ETLSample.h:28
ETLSample::raw
uint32_t raw() const
getters
Definition: ETLSample.h:62
ETLSample::setWord
void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: ETLSample.h:75
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
ETLSample::kRowMask
Definition: ETLSample.h:19
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143