test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 = 16, kDataShift = 0 }
 

Public Member Functions

uint32_t data () const
 
 HGCSample ()
 CTOR. More...
 
 HGCSample (uint32_t value)
 
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:73
HGCSample::HGCSample ( uint32_t  value)
inline

Definition at line 24 of file HGCSample.h.

24 : value_(value) { }
uint32_t value_
Definition: HGCSample.h:73

Member Function Documentation

uint32_t HGCSample::data ( ) const
inline

Definition at line 56 of file HGCSample.h.

References value_.

Referenced by cuy.FindIssue::__init__(), HGCalDigiValidation::analyze(), and print().

56 { return ((value_ >> 0) & 0xfff); }
uint32_t value_
Definition: HGCSample.h:73
bool HGCSample::mode ( ) const
inline

Definition at line 54 of file HGCSample.h.

References value_.

Referenced by print().

54 { return ((value_ >> 30) & 0x1 ); }
uint32_t value_
Definition: HGCSample.h:73
uint32_t HGCSample::operator() ( )
inline

Definition at line 57 of file HGCSample.h.

References value_.

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

Definition at line 40 of file HGCSample.h.

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

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

getters

Definition at line 52 of file HGCSample.h.

References value_.

Referenced by print().

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

Definition at line 33 of file HGCSample.h.

References setData(), setMode(), setThreshold(), and setToA().

Referenced by betterConfigParser.BetterConfigParser::getGeneral(), HGCFEElectronics< DFr >::runShaperWithToT(), HGCFEElectronics< DFr >::runSimpleShaper(), HGCFEElectronics< DFr >::runTrivialShaper(), and HGCDigitizerBase< DFr >::updateOutput().

34  {
35  setThreshold(thr);
36  setMode(mode);
37  setToA(toa);
38  setData(data);
39  }
uint32_t data() const
Definition: HGCSample.h:56
bool mode() const
Definition: HGCSample.h:54
void setMode(bool mode)
Definition: HGCSample.h:30
void setThreshold(bool thr)
setters
Definition: HGCSample.h:29
void setToA(uint16_t toa)
Definition: HGCSample.h:31
uint32_t toa() const
Definition: HGCSample.h:55
void setData(uint16_t data)
Definition: HGCSample.h:32
void HGCSample::setData ( uint16_t  data)
inline

Definition at line 32 of file HGCSample.h.

References kDataMask, kDataShift, and setWord().

Referenced by set().

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

Definition at line 30 of file HGCSample.h.

References kModeMask, kModeShift, and setWord().

Referenced by set().

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

setters

Definition at line 29 of file HGCSample.h.

References kThreshMask, kThreshShift, and setWord().

Referenced by set().

void setWord(uint32_t word, uint32_t mask, uint32_t pos)
wrapper to reset words at a given position
Definition: HGCSample.h:64
void HGCSample::setToA ( uint16_t  toa)
inline

Definition at line 31 of file HGCSample.h.

References kToAMask, kToAShift, and setWord().

Referenced by set().

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

wrapper to reset words at a given position

Definition at line 64 of file HGCSample.h.

References value_.

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

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

Definition at line 53 of file HGCSample.h.

References value_.

Referenced by print().

53 { return ((value_ >> 31) & 0x1 ); }
uint32_t value_
Definition: HGCSample.h:73
uint32_t HGCSample::toa ( ) const
inline

Definition at line 55 of file HGCSample.h.

References value_.

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

55 { return ((value_ >> 16) & 0x3ff); }
uint32_t value_
Definition: HGCSample.h:73

Member Data Documentation

uint32_t HGCSample::value_
private

Definition at line 73 of file HGCSample.h.

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