CMS 3D CMS Logo

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

wrapper for a data word More...

#include <HGCSample.h>

Public Types

enum  HGCSampleMasks { kThreshMask = 0x1, kModeMask = 0x1, kToAMask = 0x3ff, kDataMask = 0xfff }
 
enum  HGCSampleShifts { kThreshShift = 31, kModeShift = 30, kToAShift = 13, kDataShift = 0 }
 

Public Member Functions

uint32_t data () const
 
 HGCSample ()
 CTOR. More...
 
 HGCSample (uint32_t value)
 
 HGCSample (const HGCSample &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 HGCSample.h.

Member Enumeration Documentation

Enumerator
kThreshMask 
kModeMask 
kToAMask 
kDataMask 

Definition at line 17 of file HGCSample.h.

Enumerator
kThreshShift 
kModeShift 
kToAShift 
kDataShift 

Definition at line 18 of file HGCSample.h.

Constructor & Destructor Documentation

HGCSample::HGCSample ( )
inline

CTOR.

Definition at line 23 of file HGCSample.h.

23 : value_(0) { }
uint32_t value_
Definition: HGCSample.h:75
HGCSample::HGCSample ( uint32_t  value)
inline

Definition at line 24 of file HGCSample.h.

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

Definition at line 25 of file HGCSample.h.

25 : value_(o.value_) { }
uint32_t value_
Definition: HGCSample.h:75

Member Function Documentation

uint32_t HGCSample::data ( ) const
inline

Definition at line 57 of file HGCSample.h.

References kDataMask, kDataShift, and value_.

Referenced by HGCalDigiValidation::analyze(), HGCalTBAnalyzer::analyze(), print(), and set().

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

Definition at line 55 of file HGCSample.h.

References kModeMask, kModeShift, and value_.

Referenced by print().

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

Definition at line 58 of file HGCSample.h.

References value_.

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

Definition at line 41 of file HGCSample.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  }
uint32_t data() const
Definition: HGCSample.h:57
bool mode() const
Definition: HGCSample.h:55
bool threshold() const
Definition: HGCSample.h:54
uint32_t raw() const
getters
Definition: HGCSample.h:53
uint32_t toa() const
Definition: HGCSample.h:56
uint32_t HGCSample::raw ( ) const
inline

getters

Definition at line 53 of file HGCSample.h.

References value_.

Referenced by print().

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

Definition at line 33 of file HGCSample.h.

References kDataMask, kDataShift, and setWord().

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

Definition at line 31 of file HGCSample.h.

References kModeMask, kModeShift, and setWord().

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

setters

Definition at line 30 of file HGCSample.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: HGCSample.h:65
void HGCSample::setToA ( uint16_t  toa)
inline

Definition at line 32 of file HGCSample.h.

References kToAMask, kToAShift, and setWord().

void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: HGCSample.h:65
uint32_t toa() const
Definition: HGCSample.h:56
void HGCSample::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 HGCSample.h.

References RecoTauDiscriminantConfiguration::mask, and value_.

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

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

Definition at line 54 of file HGCSample.h.

References kThreshMask, kThreshShift, and value_.

Referenced by print().

uint32_t HGCSample::toa ( ) const
inline

Definition at line 56 of file HGCSample.h.

References kToAMask, kToAShift, and value_.

Referenced by HGCalDigiValidation::analyze(), and print().

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

Member Data Documentation

uint32_t HGCSample::value_
private

Definition at line 75 of file HGCSample.h.

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