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, kToAMask = 0xfff, kDataMask = 0xfff }
 
enum  ETLSampleShifts { kThreshShift = 31, kModeShift = 30, kToAShift = 13, kDataShift = 0 }
 

Public Member Functions

uint32_t data () const
 
 ETLSample ()
 CTOR. More...
 
 ETLSample (uint32_t value)
 
 ETLSample (const ETLSample &o)
 
bool mode () const
 
uint32_t operator() ()
 
void print (std::ostream &out=std::cout)
 
uint32_t raw () const
 getters More...
 
void set (bool thr, bool mode, uint16_t toa, uint16_t data)
 
void setData (uint16_t data)
 
void setMode (bool mode)
 
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

Enumerator
kThreshMask 
kModeMask 
kToAMask 
kDataMask 

Definition at line 17 of file ETLSample.h.

Enumerator
kThreshShift 
kModeShift 
kToAShift 
kDataShift 

Definition at line 18 of file ETLSample.h.

Constructor & Destructor Documentation

ETLSample::ETLSample ( )
inline

CTOR.

Definition at line 23 of file ETLSample.h.

23 : value_(0) { }
uint32_t value_
Definition: ETLSample.h:74
ETLSample::ETLSample ( uint32_t  value)
inline

Definition at line 24 of file ETLSample.h.

24 : value_(value) { }
Definition: value.py:1
uint32_t value_
Definition: ETLSample.h:74
ETLSample::ETLSample ( const ETLSample o)
inline

Definition at line 25 of file ETLSample.h.

25 : value_(o.value_) { }
uint32_t value_
Definition: ETLSample.h:74

Member Function Documentation

uint32_t ETLSample::data ( ) const
inline

Definition at line 57 of file ETLSample.h.

References kDataMask, kDataShift, and value_.

Referenced by print(), and set().

57 { return ( (value_ >> kDataShift) & kDataMask ); }
uint32_t value_
Definition: ETLSample.h:74
bool ETLSample::mode ( ) const
inline

Definition at line 55 of file ETLSample.h.

References kModeMask, kModeShift, and value_.

Referenced by print().

55 { return ( (value_ >> kModeShift) & kModeMask ); }
uint32_t value_
Definition: ETLSample.h:74
uint32_t ETLSample::operator() ( )
inline

Definition at line 58 of file ETLSample.h.

References value_.

58 { return value_; }
uint32_t value_
Definition: ETLSample.h:74
void ETLSample::print ( std::ostream &  out = std::cout)
inline

Definition at line 41 of file ETLSample.h.

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

42  {
43  out << "THR: " << threshold()
44  << " Mode: " << mode()
45  << " ToA: " << toa()
46  << " Data: " << data()
47  << " Raw=0x" << std::hex << raw() << std::dec << std::endl;
48  }
bool mode() const
Definition: ETLSample.h:55
bool threshold() const
Definition: ETLSample.h:54
uint32_t raw() const
getters
Definition: ETLSample.h:53
uint32_t toa() const
Definition: ETLSample.h:56
uint32_t data() const
Definition: ETLSample.h:57
uint32_t ETLSample::raw ( ) const
inline

getters

Definition at line 53 of file ETLSample.h.

References value_.

Referenced by print().

53 { return value_; }
uint32_t value_
Definition: ETLSample.h:74
void ETLSample::set ( bool  thr,
bool  mode,
uint16_t  toa,
uint16_t  data 
)
inline

Definition at line 34 of file ETLSample.h.

References data(), kDataMask, kDataShift, kModeMask, kModeShift, kThreshMask, kThreshShift, kToAMask, kToAShift, and value_.

Referenced by ETLElectronicsSim::runTrivialShaper().

35  {
36  value_ = ( ( (uint32_t)thr & kThreshMask ) << kThreshShift |
37  ( (uint32_t)mode & kModeMask ) << kModeShift |
38  ( (uint32_t)toa & kToAMask ) << kToAShift |
39  ( (uint32_t)data & kDataMask ) << kDataShift );
40  }
bool mode() const
Definition: ETLSample.h:55
uint32_t toa() const
Definition: ETLSample.h:56
uint32_t value_
Definition: ETLSample.h:74
uint32_t data() const
Definition: ETLSample.h:57
void ETLSample::setData ( uint16_t  data)
inline

Definition at line 33 of file ETLSample.h.

References kDataMask, kDataShift, and setWord().

void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: ETLSample.h:65
uint32_t data() const
Definition: ETLSample.h:57
void ETLSample::setMode ( bool  mode)
inline

Definition at line 31 of file ETLSample.h.

References kModeMask, kModeShift, and setWord().

bool mode() const
Definition: ETLSample.h:55
void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: ETLSample.h:65
void ETLSample::setThreshold ( bool  thr)
inline

setters

Definition at line 30 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:65
void ETLSample::setToA ( uint16_t  toa)
inline

Definition at line 32 of file ETLSample.h.

References kToAMask, kToAShift, and setWord().

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

wrapper to reset words at a given position

Definition at line 65 of file ETLSample.h.

References RecoTauDiscriminantConfiguration::mask, and value_.

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

66  {
67  //clear required bits
68  value_ &= ~(mask << pos);
69  //now set the new value
70  value_ |= ( (word & mask) << pos );
71  }
uint32_t value_
Definition: ETLSample.h:74
bool ETLSample::threshold ( ) const
inline

Definition at line 54 of file ETLSample.h.

References kThreshMask, kThreshShift, and value_.

Referenced by print().

uint32_t ETLSample::toa ( ) const
inline

Definition at line 56 of file ETLSample.h.

References kToAMask, kToAShift, and value_.

Referenced by print().

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

Member Data Documentation

uint32_t ETLSample::value_
private

Definition at line 74 of file ETLSample.h.

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