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
 
bool getToAValid () 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)
 
void setToAValid (bool toaFired)
 
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

bool toaFired_
 
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), toaFired_(false) { }
uint32_t value_
Definition: HGCSample.h:81
bool toaFired_
Definition: HGCSample.h:82
HGCSample::HGCSample ( uint32_t  value)
inline

Definition at line 24 of file HGCSample.h.

24 : value_(value), toaFired_(false) { }
uint32_t value_
Definition: HGCSample.h:81
Definition: value.py:1
bool toaFired_
Definition: HGCSample.h:82
HGCSample::HGCSample ( const HGCSample o)
inline

Definition at line 25 of file HGCSample.h.

25 : value_(o.value_), toaFired_(o.toaFired_) { }
uint32_t value_
Definition: HGCSample.h:81
bool toaFired_
Definition: HGCSample.h:82

Member Function Documentation

uint32_t HGCSample::data ( ) const
inline

Definition at line 62 of file HGCSample.h.

References kDataMask, kDataShift, and value_.

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

62 { return ( (value_ >> kDataShift) & kDataMask ); }
uint32_t value_
Definition: HGCSample.h:81
bool HGCSample::getToAValid ( ) const
inline

Definition at line 60 of file HGCSample.h.

References toaFired_.

60 { return toaFired_; }
bool toaFired_
Definition: HGCSample.h:82
bool HGCSample::mode ( ) const
inline

Definition at line 59 of file HGCSample.h.

References kModeMask, kModeShift, and value_.

Referenced by print().

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

Definition at line 63 of file HGCSample.h.

References value_.

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

Definition at line 45 of file HGCSample.h.

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

46  {
47  out << "THR: " << threshold()
48  << " Mode: " << mode()
49  << " ToA: " << toa()
50  << " Data: " << data()
51  << " Raw=0x" << std::hex << raw() << std::dec << std::endl;
52  }
uint32_t data() const
Definition: HGCSample.h:62
bool mode() const
Definition: HGCSample.h:59
bool threshold() const
Definition: HGCSample.h:58
uint32_t raw() const
getters
Definition: HGCSample.h:57
uint32_t toa() const
Definition: HGCSample.h:61
uint32_t HGCSample::raw ( ) const
inline

getters

Definition at line 57 of file HGCSample.h.

References value_.

Referenced by print().

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

Definition at line 34 of file HGCSample.h.

References kDataMask, kDataShift, and setWord().

uint32_t data() const
Definition: HGCSample.h:62
void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: HGCSample.h:70
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:59
void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: HGCSample.h:70
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:70
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:70
uint32_t toa() const
Definition: HGCSample.h:61
void HGCSample::setToAValid ( bool  toaFired)
inline

Definition at line 33 of file HGCSample.h.

References toaFired_.

Referenced by HGCFEElectronics< DFr >::runShaperWithToT().

33 { toaFired_ = toaFired; }
bool toaFired_
Definition: HGCSample.h:82
void HGCSample::setWord ( uint32_t  word,
uint32_t  mask,
uint32_t  pos 
)
inlineprivate

wrapper to reset words at a given position

Definition at line 70 of file HGCSample.h.

References RecoTauDiscriminantConfiguration::mask, and value_.

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

71  {
72  if( word > mask ) word = mask; // deal with saturation
73  //clear required bits
74  const uint32_t masked_word = (word & mask) << pos;
75  value_ &= ~(masked_word);
76  //now set the new value
77  value_ |= (masked_word);
78  }
uint32_t value_
Definition: HGCSample.h:81
bool HGCSample::threshold ( ) const
inline

Definition at line 58 of file HGCSample.h.

References kThreshMask, kThreshShift, and value_.

Referenced by print().

uint32_t HGCSample::toa ( ) const
inline

Definition at line 61 of file HGCSample.h.

References kToAMask, kToAShift, and value_.

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

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

Member Data Documentation

bool HGCSample::toaFired_
private

Definition at line 82 of file HGCSample.h.

Referenced by getToAValid(), and setToAValid().

uint32_t HGCSample::value_
private

Definition at line 81 of file HGCSample.h.

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