CMS 3D CMS Logo

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

wrapper for a data word More...

#include <BTLSample.h>

Public Types

enum  BTLSampleDataMasks { kToA2Mask = 0x3ff, kToAMask = 0x3ff, kDataMask = 0x3ff }
 
enum  BTLSampleDataShifts { kToA2Shift = 20, kToAShift = 10, kDataShift = 0 }
 
enum  BTLSampleFlagMasks { kThreshMask = 0x1, kModeMask = 0x1 }
 
enum  BTLSampleFlagShifts { kThreshShift = 1, kModeShift = 0 }
 

Public Member Functions

 BTLSample ()
 CTOR. More...
 
 BTLSample (const BTLSample &o)
 
 BTLSample (uint32_t value, uint16_t flag, uint8_t row, uint8_t col)
 
uint8_t column () const
 
uint32_t data () const
 
bool mode () const
 
void print (std::ostream &out=std::cout)
 
uint32_t raw_data () const
 getters More...
 
uint16_t raw_flag () const
 
uint8_t row () const
 
void set (bool thr, bool mode, uint16_t toa2, uint16_t toa, uint16_t data, uint8_t row, uint8_t col)
 
void setData (uint16_t data)
 
void setMode (bool mode)
 
void setThreshold (bool thr)
 setters More...
 
void setToA (uint16_t toa)
 
void setToA2 (uint16_t toa2)
 
bool threshold () const
 
uint32_t toa () const
 
uint32_t toa2 () const
 

Private Member Functions

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

Private Attributes

uint8_t col_
 
uint16_t flag_
 
uint8_t row_
 
uint32_t value_
 

Detailed Description

wrapper for a data word

Definition at line 13 of file BTLSample.h.

Member Enumeration Documentation

◆ BTLSampleDataMasks

Enumerator
kToA2Mask 
kToAMask 
kDataMask 

Definition at line 15 of file BTLSample.h.

15 { kToA2Mask = 0x3ff, kToAMask = 0x3ff, kDataMask = 0x3ff };

◆ BTLSampleDataShifts

Enumerator
kToA2Shift 
kToAShift 
kDataShift 

Definition at line 16 of file BTLSample.h.

16 { kToA2Shift = 20, kToAShift = 10, kDataShift = 0 };

◆ BTLSampleFlagMasks

Enumerator
kThreshMask 
kModeMask 

Definition at line 18 of file BTLSample.h.

18 { kThreshMask = 0x1, kModeMask = 0x1 };

◆ BTLSampleFlagShifts

Enumerator
kThreshShift 
kModeShift 

Definition at line 19 of file BTLSample.h.

19 { kThreshShift = 1, kModeShift = 0 };

Constructor & Destructor Documentation

◆ BTLSample() [1/3]

BTLSample::BTLSample ( )
inline

CTOR.

Definition at line 24 of file BTLSample.h.

24 : value_(0), flag_(0), row_(0), col_(0) {}

◆ BTLSample() [2/3]

BTLSample::BTLSample ( uint32_t  value,
uint16_t  flag,
uint8_t  row,
uint8_t  col 
)
inline

Definition at line 25 of file BTLSample.h.

26  : value_(value), flag_(flag), row_(row), col_(col) {}

◆ BTLSample() [3/3]

BTLSample::BTLSample ( const BTLSample o)
inline

Definition at line 27 of file BTLSample.h.

27 : value_(o.value_), flag_(o.flag_), row_(o.row_), col_(o.col_) {}

Member Function Documentation

◆ column()

uint8_t BTLSample::column ( ) const
inline

Definition at line 62 of file BTLSample.h.

62 { return col_; }

References col_.

Referenced by print().

◆ data()

uint32_t BTLSample::data ( ) const
inline

Definition at line 60 of file BTLSample.h.

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

References kDataMask, kDataShift, and value_.

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

◆ mode()

bool BTLSample::mode ( ) const
inline

Definition at line 57 of file BTLSample.h.

57 { return ((flag_ >> kModeShift) & kModeMask); }

References flag_, kModeMask, and kModeShift.

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

◆ print()

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

Definition at line 45 of file BTLSample.h.

45  {
46  out << "THR: " << threshold() << " Mode: " << mode() << " ToA2: " << toa2() << " ToA: " << toa()
47  << " Data: " << data() << " Row: " << (uint32_t)row() << " Column: " << (uint32_t)column() << " Raw Flag=0x"
48  << std::hex << raw_flag() << std::dec << " Raw Data=0x" << std::hex << raw_data() << std::dec << std::endl;
49  }

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

◆ raw_data()

uint32_t BTLSample::raw_data ( ) const
inline

getters

Definition at line 54 of file BTLSample.h.

54 { return value_; }

References value_.

Referenced by print().

◆ raw_flag()

uint16_t BTLSample::raw_flag ( ) const
inline

Definition at line 55 of file BTLSample.h.

55 { return flag_; }

References flag_.

Referenced by print().

◆ row()

uint8_t BTLSample::row ( ) const
inline

Definition at line 61 of file BTLSample.h.

61 { return row_; }

References row_.

Referenced by print(), and set().

◆ set()

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

Definition at line 37 of file BTLSample.h.

37  {
38  flag_ = (((uint16_t)thr & kThreshMask) << kThreshShift | ((uint16_t)mode & kModeMask) << kModeShift);
39 
40  value_ = (((uint32_t)toa2 & kToA2Mask) << kToA2Shift | ((uint32_t)toa & kToAMask) << kToAShift |
41  ((uint32_t)data & kDataMask) << kDataShift);
42  row_ = row;
43  col_ = col;
44  }

References cuy::col, col_, data(), flag_, kDataMask, kDataShift, kModeMask, kModeShift, kThreshMask, kThreshShift, kToA2Mask, kToA2Shift, kToAMask, kToAShift, mode(), row(), row_, toa(), toa2(), and value_.

Referenced by BTLElectronicsSim::runTrivialShaper().

◆ setData()

void BTLSample::setData ( uint16_t  data)
inline

Definition at line 36 of file BTLSample.h.

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

◆ setDataWord()

void BTLSample::setDataWord ( uint32_t  word,
uint32_t  mask,
uint32_t  pos 
)
inlineprivate

wrapper to reset words at a given position

Definition at line 68 of file BTLSample.h.

68  {
69  //clear required bits
70  value_ &= ~(mask << pos);
71  //now set the new value
72  value_ |= ((word & mask) << pos);
73  }

References value_.

Referenced by setData(), setToA(), and setToA2().

◆ setFlagWord()

void BTLSample::setFlagWord ( uint16_t  word,
uint16_t  mask,
uint16_t  pos 
)
inlineprivate

Definition at line 74 of file BTLSample.h.

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

References flag_.

Referenced by setMode(), and setThreshold().

◆ setMode()

void BTLSample::setMode ( bool  mode)
inline

Definition at line 33 of file BTLSample.h.

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

◆ setThreshold()

void BTLSample::setThreshold ( bool  thr)
inline

setters

Definition at line 32 of file BTLSample.h.

References kThreshMask, kThreshShift, and setFlagWord().

◆ setToA()

void BTLSample::setToA ( uint16_t  toa)
inline

Definition at line 34 of file BTLSample.h.

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

◆ setToA2()

void BTLSample::setToA2 ( uint16_t  toa2)
inline

Definition at line 35 of file BTLSample.h.

References kToA2Mask, kToA2Shift, setDataWord(), and toa2().

◆ threshold()

bool BTLSample::threshold ( ) const
inline

Definition at line 56 of file BTLSample.h.

56 { return ((flag_ >> kThreshShift) & kThreshMask); }

References flag_, kThreshMask, and kThreshShift.

Referenced by print().

◆ toa()

uint32_t BTLSample::toa ( ) const
inline

Definition at line 58 of file BTLSample.h.

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

References kToAMask, kToAShift, and value_.

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

◆ toa2()

uint32_t BTLSample::toa2 ( ) const
inline

Definition at line 59 of file BTLSample.h.

59 { return ((value_ >> kToA2Shift) & kToA2Mask); }

References kToA2Mask, kToA2Shift, and value_.

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

Member Data Documentation

◆ col_

uint8_t BTLSample::col_
private

Definition at line 84 of file BTLSample.h.

Referenced by column(), and set().

◆ flag_

uint16_t BTLSample::flag_
private

Definition at line 83 of file BTLSample.h.

Referenced by mode(), raw_flag(), set(), setFlagWord(), and threshold().

◆ row_

uint8_t BTLSample::row_
private

Definition at line 84 of file BTLSample.h.

Referenced by row(), and set().

◆ value_

uint32_t BTLSample::value_
private

Definition at line 82 of file BTLSample.h.

Referenced by data(), raw_data(), set(), setDataWord(), toa(), and toa2().

BTLSample::kToA2Mask
Definition: BTLSample.h:15
BTLSample::kModeMask
Definition: BTLSample.h:18
BTLSample::raw_flag
uint16_t raw_flag() const
Definition: BTLSample.h:55
BTLSample::kToAMask
Definition: BTLSample.h:15
cuy.col
col
Definition: cuy.py:1010
pos
Definition: PixelAliasList.h:18
BTLSample::kToA2Shift
Definition: BTLSample.h:16
BTLSample::mode
bool mode() const
Definition: BTLSample.h:57
BTLSample::kModeShift
Definition: BTLSample.h:19
BTLSample::toa
uint32_t toa() const
Definition: BTLSample.h:58
BTLSample::kToAShift
Definition: BTLSample.h:16
BTLSample::row_
uint8_t row_
Definition: BTLSample.h:84
BTLSample::col_
uint8_t col_
Definition: BTLSample.h:84
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
BTLSample::raw_data
uint32_t raw_data() const
getters
Definition: BTLSample.h:54
BTLSample::kDataMask
Definition: BTLSample.h:15
BTLSample::setDataWord
void setDataWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: BTLSample.h:68
BTLSample::kThreshShift
Definition: BTLSample.h:19
BTLSample::toa2
uint32_t toa2() const
Definition: BTLSample.h:59
value
Definition: value.py:1
BTLSample::column
uint8_t column() const
Definition: BTLSample.h:62
BTLSample::kDataShift
Definition: BTLSample.h:16
BTLSample::flag_
uint16_t flag_
Definition: BTLSample.h:83
BTLSample::setFlagWord
void setFlagWord(uint16_t word, uint16_t mask, uint16_t pos)
Definition: BTLSample.h:74
BTLSample::data
uint32_t data() const
Definition: BTLSample.h:60
BTLSample::value_
uint32_t value_
Definition: BTLSample.h:82
BTLSample::row
uint8_t row() const
Definition: BTLSample.h:61
BTLSample::threshold
bool threshold() const
Definition: BTLSample.h:56
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
BTLSample::kThreshMask
Definition: BTLSample.h:18