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, kToTMask = 0x7ff
}
 
enum  ETLSampleShifts {
  kThreshShift = 31, kModeShift = 30, kColumnShift = 25, kRowShift = 19,
  kToAShift = 8, kDataShift = 0, kToTShift = 0
}
 

Public Member Functions

uint32_t column () const
 
uint32_t data () const
 
 ETLSample ()
 CTOR. More...
 
 ETLSample (uint32_t value)
 
 ETLSample (uint32_t value, uint32_t valueToT)
 
 ETLSample (const ETLSample &o)
 
bool mode () const
 
uint32_t operator() ()
 
ETLSampleoperator= (const ETLSample &)=default
 
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 tot, 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)
 
void setToT (uint16_t tot)
 
bool threshold () const
 
uint32_t toa () const
 
uint32_t tot () const
 

Private Member Functions

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

Private Attributes

uint32_t value_
 
uint32_t valueToT_
 

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 
kToTMask 

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  kToTMask = 0x7ff
23  };

◆ ETLSampleShifts

Enumerator
kThreshShift 
kModeShift 
kColumnShift 
kRowShift 
kToAShift 
kDataShift 
kToTShift 

Definition at line 24 of file ETLSample.h.

Constructor & Destructor Documentation

◆ ETLSample() [1/4]

ETLSample::ETLSample ( )
inline

CTOR.

Definition at line 37 of file ETLSample.h.

37 : value_(0), valueToT_(0) {}
uint32_t valueToT_
Definition: ETLSample.h:98
uint32_t value_
Definition: ETLSample.h:97

◆ ETLSample() [2/4]

ETLSample::ETLSample ( uint32_t  value)
inline

Definition at line 38 of file ETLSample.h.

38 : value_(value), valueToT_(0) {}
uint32_t valueToT_
Definition: ETLSample.h:98
Definition: value.py:1
uint32_t value_
Definition: ETLSample.h:97

◆ ETLSample() [3/4]

ETLSample::ETLSample ( uint32_t  value,
uint32_t  valueToT 
)
inline

Definition at line 39 of file ETLSample.h.

39 : value_(value), valueToT_(valueToT) {}
uint32_t valueToT_
Definition: ETLSample.h:98
Definition: value.py:1
uint32_t value_
Definition: ETLSample.h:97

◆ ETLSample() [4/4]

ETLSample::ETLSample ( const ETLSample o)
inline

Definition at line 40 of file ETLSample.h.

40 : value_(o.value_), valueToT_(o.valueToT_) {}
uint32_t valueToT_
Definition: ETLSample.h:98
uint32_t value_
Definition: ETLSample.h:97

Member Function Documentation

◆ column()

uint32_t ETLSample::column ( ) const
inline

Definition at line 71 of file ETLSample.h.

References kColumnMask, kColumnShift, and value_.

Referenced by print().

◆ data()

uint32_t ETLSample::data ( ) const
inline

Definition at line 75 of file ETLSample.h.

References kDataMask, kDataShift, and value_.

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

◆ mode()

bool ETLSample::mode ( ) const
inline

Definition at line 70 of file ETLSample.h.

References kModeMask, kModeShift, and value_.

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

◆ operator()()

uint32_t ETLSample::operator() ( )
inline

Definition at line 76 of file ETLSample.h.

References value_.

76 { return value_; }
uint32_t value_
Definition: ETLSample.h:97

◆ operator=()

ETLSample& ETLSample::operator= ( const ETLSample )
default

◆ print()

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

Definition at line 59 of file ETLSample.h.

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

59  {
60  out << "(row,col) : (" << row() << ',' << column() << ") "
61  << "THR: " << threshold() << " Mode: " << mode() << " ToA: " << toa() << " ToT: " << tot()
62  << " Data: " << data() << " Raw=0x" << std::hex << raw() << std::dec << std::endl;
63  }
bool threshold() const
Definition: ETLSample.h:69
bool mode() const
Definition: ETLSample.h:70
uint32_t toa() const
Definition: ETLSample.h:73
uint32_t data() const
Definition: ETLSample.h:75
uint32_t column() const
Definition: ETLSample.h:71
uint32_t raw() const
getters
Definition: ETLSample.h:68
uint32_t row() const
Definition: ETLSample.h:72
uint32_t tot() const
Definition: ETLSample.h:74

◆ raw()

uint32_t ETLSample::raw ( ) const
inline

getters

Definition at line 68 of file ETLSample.h.

References value_.

Referenced by print().

68 { return value_; }
uint32_t value_
Definition: ETLSample.h:97

◆ row()

uint32_t ETLSample::row ( ) const
inline

Definition at line 72 of file ETLSample.h.

References kRowMask, kRowShift, and value_.

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

72 { return ((value_ >> kRowShift) & kRowMask); }
uint32_t value_
Definition: ETLSample.h:97

◆ set()

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

Definition at line 53 of file ETLSample.h.

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

Referenced by ETLElectronicsSim::runTrivialShaper().

53  {
54  value_ = (((uint32_t)thr & kThreshMask) << kThreshShift | ((uint32_t)mode & kModeMask) << kModeShift |
55  ((uint32_t)col & kColumnMask) << kColumnShift | ((uint32_t)row & kRowMask) << kRowShift |
56  ((uint32_t)toa & kToAMask) << kToAShift | ((uint32_t)data & kDataMask) << kDataShift);
57  valueToT_ = ((uint32_t)tot & kToTMask) << kToTShift;
58  }
bool mode() const
Definition: ETLSample.h:70
uint32_t valueToT_
Definition: ETLSample.h:98
uint32_t toa() const
Definition: ETLSample.h:73
uint32_t data() const
Definition: ETLSample.h:75
col
Definition: cuy.py:1009
uint32_t row() const
Definition: ETLSample.h:72
uint32_t value_
Definition: ETLSample.h:97
uint32_t tot() const
Definition: ETLSample.h:74

◆ setColumn()

void ETLSample::setColumn ( uint8_t  col)
inline

Definition at line 48 of file ETLSample.h.

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

col
Definition: cuy.py:1009
void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: ETLSample.h:82

◆ setData()

void ETLSample::setData ( uint16_t  data)
inline

Definition at line 52 of file ETLSample.h.

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

uint32_t data() const
Definition: ETLSample.h:75
void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: ETLSample.h:82

◆ setMode()

void ETLSample::setMode ( bool  mode)
inline

Definition at line 47 of file ETLSample.h.

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

bool mode() const
Definition: ETLSample.h:70
void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: ETLSample.h:82

◆ setRow()

void ETLSample::setRow ( uint8_t  row)
inline

Definition at line 49 of file ETLSample.h.

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

void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: ETLSample.h:82
uint32_t row() const
Definition: ETLSample.h:72

◆ setThreshold()

void ETLSample::setThreshold ( bool  thr)
inline

setters

Definition at line 46 of file ETLSample.h.

References kThreshMask, kThreshShift, and setWord().

void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: ETLSample.h:82

◆ setToA()

void ETLSample::setToA ( uint16_t  toa)
inline

Definition at line 50 of file ETLSample.h.

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

uint32_t toa() const
Definition: ETLSample.h:73
void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: ETLSample.h:82

◆ setToT()

void ETLSample::setToT ( uint16_t  tot)
inline

Definition at line 51 of file ETLSample.h.

References kToTMask, kToTShift, setWordToT(), and tot().

void setWordToT(uint32_t word, uint32_t mask, uint32_t pos)
Definition: ETLSample.h:89
uint32_t tot() const
Definition: ETLSample.h:74

◆ 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 82 of file ETLSample.h.

References ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask, and value_.

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

82  {
83  //clear required bits
84  value_ &= ~(mask << pos);
85  //now set the new value
86  value_ |= ((word & mask) << pos);
87  }
uint64_t word
uint32_t value_
Definition: ETLSample.h:97

◆ setWordToT()

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

Definition at line 89 of file ETLSample.h.

References ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask, and valueToT_.

Referenced by setToT().

89  {
90  //clear required bits
91  valueToT_ &= ~(mask << pos);
92  //now set the new value
93  valueToT_ |= ((word & mask) << pos);
94  }
uint32_t valueToT_
Definition: ETLSample.h:98
uint64_t word

◆ threshold()

bool ETLSample::threshold ( ) const
inline

Definition at line 69 of file ETLSample.h.

References kThreshMask, kThreshShift, and value_.

Referenced by print().

◆ toa()

uint32_t ETLSample::toa ( ) const
inline

Definition at line 73 of file ETLSample.h.

References kToAMask, kToAShift, and value_.

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

73 { return ((value_ >> kToAShift) & kToAMask); }
uint32_t value_
Definition: ETLSample.h:97

◆ tot()

uint32_t ETLSample::tot ( ) const
inline

Definition at line 74 of file ETLSample.h.

References kToTMask, kToTShift, and valueToT_.

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

74 { return ((valueToT_ >> kToTShift) & kToTMask); }
uint32_t valueToT_
Definition: ETLSample.h:98

Member Data Documentation

◆ value_

uint32_t ETLSample::value_
private

Definition at line 97 of file ETLSample.h.

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

◆ valueToT_

uint32_t ETLSample::valueToT_
private

Definition at line 98 of file ETLSample.h.

Referenced by set(), setWordToT(), and tot().