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 (uint32_t value, uint16_t flag, uint8_t row, uint8_t col)
 
 BTLSample (const BTLSample &o)
 
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

Enumerator
kToA2Mask 
kToAMask 
kDataMask 

Definition at line 17 of file BTLSample.h.

Enumerator
kToA2Shift 
kToAShift 
kDataShift 

Definition at line 18 of file BTLSample.h.

Enumerator
kThreshMask 
kModeMask 

Definition at line 20 of file BTLSample.h.

Enumerator
kThreshShift 
kModeShift 

Definition at line 21 of file BTLSample.h.

Constructor & Destructor Documentation

BTLSample::BTLSample ( )
inline

CTOR.

Definition at line 26 of file BTLSample.h.

26 : value_(0), flag_(0), row_(0), col_(0) { }
uint8_t row_
Definition: BTLSample.h:99
uint16_t flag_
Definition: BTLSample.h:98
uint8_t col_
Definition: BTLSample.h:99
uint32_t value_
Definition: BTLSample.h:97
BTLSample::BTLSample ( uint32_t  value,
uint16_t  flag,
uint8_t  row,
uint8_t  col 
)
inline

Definition at line 27 of file BTLSample.h.

27 : value_(value), flag_(flag), row_(row), col_(col) { }
uint8_t row_
Definition: BTLSample.h:99
uint16_t flag_
Definition: BTLSample.h:98
uint8_t col_
Definition: BTLSample.h:99
uint32_t value_
Definition: BTLSample.h:97
Definition: value.py:1
uint8_t row() const
Definition: BTLSample.h:73
col
Definition: cuy.py:1010
BTLSample::BTLSample ( const BTLSample o)
inline

Definition at line 28 of file BTLSample.h.

28 : value_(o.value_), flag_(o.flag_), row_(o.row_), col_(o.col_) { }
uint8_t row_
Definition: BTLSample.h:99
uint16_t flag_
Definition: BTLSample.h:98
uint8_t col_
Definition: BTLSample.h:99
uint32_t value_
Definition: BTLSample.h:97

Member Function Documentation

uint8_t BTLSample::column ( ) const
inline

Definition at line 74 of file BTLSample.h.

References col_.

Referenced by print().

74 { return col_; }
uint8_t col_
Definition: BTLSample.h:99
uint32_t BTLSample::data ( ) const
inline

Definition at line 72 of file BTLSample.h.

References kDataMask, kDataShift, and value_.

Referenced by print().

72 { return ( (value_ >> kDataShift) & kDataMask ); }
uint32_t value_
Definition: BTLSample.h:97
bool BTLSample::mode ( ) const
inline

Definition at line 69 of file BTLSample.h.

References flag_, kModeMask, and kModeShift.

Referenced by print().

69 { return ( (flag_ >> kModeShift) & kModeMask ); }
uint16_t flag_
Definition: BTLSample.h:98
void BTLSample::print ( std::ostream &  out = std::cout)
inline

Definition at line 49 of file BTLSample.h.

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

50  {
51  out << "THR: " << threshold()
52  << " Mode: " << mode()
53  << " ToA2: " << toa2()
54  << " ToA: " << toa()
55  << " Data: " << data()
56  << " Row: " << (uint32_t)row()
57  << " Column: " << (uint32_t)column()
58  << " Raw Flag=0x" << std::hex << raw_flag() << std::dec
59  << " Raw Data=0x" << std::hex << raw_data() << std::dec << std::endl;
60 
61  }
uint16_t raw_flag() const
Definition: BTLSample.h:67
bool threshold() const
Definition: BTLSample.h:68
uint32_t data() const
Definition: BTLSample.h:72
uint32_t toa2() const
Definition: BTLSample.h:71
bool mode() const
Definition: BTLSample.h:69
uint32_t toa() const
Definition: BTLSample.h:70
uint32_t raw_data() const
getters
Definition: BTLSample.h:66
uint8_t row() const
Definition: BTLSample.h:73
uint8_t column() const
Definition: BTLSample.h:74
uint32_t BTLSample::raw_data ( ) const
inline

getters

Definition at line 66 of file BTLSample.h.

References value_.

Referenced by print().

66 { return value_; }
uint32_t value_
Definition: BTLSample.h:97
uint16_t BTLSample::raw_flag ( ) const
inline

Definition at line 67 of file BTLSample.h.

References flag_.

Referenced by print().

67 { return flag_; }
uint16_t flag_
Definition: BTLSample.h:98
uint8_t BTLSample::row ( ) const
inline

Definition at line 73 of file BTLSample.h.

References row_.

Referenced by print(), and set().

73 { return row_; }
uint8_t row_
Definition: BTLSample.h:99
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 38 of file BTLSample.h.

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

Referenced by BTLElectronicsSim::runTrivialShaper().

39  {
40  flag_ = ( ( (uint16_t)thr & kThreshMask ) << kThreshShift |
41  ( (uint16_t)mode & kModeMask ) << kModeShift );
42 
43  value_ = ( ( (uint32_t)toa2 & kToA2Mask ) << kToA2Shift |
44  ( (uint32_t)toa & kToAMask ) << kToAShift |
45  ( (uint32_t)data & kDataMask ) << kDataShift );
46  row_ = row;
47  col_ = col;
48  }
uint8_t row_
Definition: BTLSample.h:99
uint32_t data() const
Definition: BTLSample.h:72
uint32_t toa2() const
Definition: BTLSample.h:71
uint16_t flag_
Definition: BTLSample.h:98
bool mode() const
Definition: BTLSample.h:69
uint32_t toa() const
Definition: BTLSample.h:70
uint8_t col_
Definition: BTLSample.h:99
uint32_t value_
Definition: BTLSample.h:97
uint8_t row() const
Definition: BTLSample.h:73
col
Definition: cuy.py:1010
void BTLSample::setData ( uint16_t  data)
inline

Definition at line 37 of file BTLSample.h.

References kDataMask, kDataShift, and setDataWord().

uint32_t data() const
Definition: BTLSample.h:72
void setDataWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: BTLSample.h:81
void BTLSample::setDataWord ( uint32_t  word,
uint32_t  mask,
uint32_t  pos 
)
inlineprivate

wrapper to reset words at a given position

Definition at line 81 of file BTLSample.h.

References RecoTauDiscriminantConfiguration::mask, and value_.

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

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

Definition at line 88 of file BTLSample.h.

References flag_, and RecoTauDiscriminantConfiguration::mask.

Referenced by setMode(), and setThreshold().

89  {
90  //clear required bits
91  flag_ &= ~(mask << pos);
92  //now set the new value
93  flag_ |= ( (word & mask) << pos );
94  }
uint16_t flag_
Definition: BTLSample.h:98
void BTLSample::setMode ( bool  mode)
inline

Definition at line 34 of file BTLSample.h.

References kModeMask, kModeShift, and setFlagWord().

bool mode() const
Definition: BTLSample.h:69
void setFlagWord(uint16_t word, uint16_t mask, uint16_t pos)
Definition: BTLSample.h:88
void BTLSample::setThreshold ( bool  thr)
inline

setters

Definition at line 33 of file BTLSample.h.

References kThreshMask, kThreshShift, and setFlagWord().

void setFlagWord(uint16_t word, uint16_t mask, uint16_t pos)
Definition: BTLSample.h:88
void BTLSample::setToA ( uint16_t  toa)
inline

Definition at line 35 of file BTLSample.h.

References kToAMask, kToAShift, and setDataWord().

uint32_t toa() const
Definition: BTLSample.h:70
void setDataWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: BTLSample.h:81
void BTLSample::setToA2 ( uint16_t  toa2)
inline

Definition at line 36 of file BTLSample.h.

References kToA2Mask, kToA2Shift, and setDataWord().

uint32_t toa2() const
Definition: BTLSample.h:71
void setDataWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: BTLSample.h:81
bool BTLSample::threshold ( ) const
inline

Definition at line 68 of file BTLSample.h.

References flag_, kThreshMask, and kThreshShift.

Referenced by print().

uint32_t BTLSample::toa ( ) const
inline

Definition at line 70 of file BTLSample.h.

References kToAMask, kToAShift, and value_.

Referenced by print().

70 { return ( (value_ >> kToAShift) & kToAMask ); }
uint32_t value_
Definition: BTLSample.h:97
uint32_t BTLSample::toa2 ( ) const
inline

Definition at line 71 of file BTLSample.h.

References kToA2Mask, kToA2Shift, and value_.

Referenced by print().

71 { return ( (value_ >> kToA2Shift) & kToA2Mask ); }
uint32_t value_
Definition: BTLSample.h:97

Member Data Documentation

uint8_t BTLSample::col_
private

Definition at line 99 of file BTLSample.h.

Referenced by column(), and set().

uint16_t BTLSample::flag_
private

Definition at line 98 of file BTLSample.h.

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

uint8_t BTLSample::row_
private

Definition at line 99 of file BTLSample.h.

Referenced by row(), and set().

uint32_t BTLSample::value_
private

Definition at line 97 of file BTLSample.h.

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