CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
FTLSample Class Reference

wrapper for a data word More...

#include <FTLSample.h>

Public Types

enum  FTLSampleMasks { kThreshMask = 0x1, kModeMask = 0x1, kToAMask = 0xfff, kDataMask = 0xfff }
 
enum  FTLSampleShifts { kThreshShift = 31, kModeShift = 30, kToAShift = 13, kDataShift = 0 }
 

Public Member Functions

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

Member Enumeration Documentation

Enumerator
kThreshMask 
kModeMask 
kToAMask 
kDataMask 

Definition at line 15 of file FTLSample.h.

Enumerator
kThreshShift 
kModeShift 
kToAShift 
kDataShift 

Definition at line 16 of file FTLSample.h.

Constructor & Destructor Documentation

FTLSample::FTLSample ( )
inline

CTOR.

Definition at line 21 of file FTLSample.h.

21 : value_(0) {}
uint32_t value_
Definition: FTLSample.h:64
FTLSample::FTLSample ( uint32_t  value)
inline

Definition at line 22 of file FTLSample.h.

22 : value_(value) {}
uint32_t value_
Definition: FTLSample.h:64
FTLSample::FTLSample ( const FTLSample o)
inline

Definition at line 23 of file FTLSample.h.

23 : value_(o.value_) {}
uint32_t value_
Definition: FTLSample.h:64

Member Function Documentation

uint32_t FTLSample::data ( ) const
inline

Definition at line 48 of file FTLSample.h.

References kDataMask, kDataShift, and value_.

Referenced by print().

bool FTLSample::mode ( ) const
inline

Definition at line 46 of file FTLSample.h.

References kModeMask, kModeShift, and value_.

Referenced by print().

uint32_t FTLSample::operator() ( )
inline

Definition at line 49 of file FTLSample.h.

References value_.

49 { return value_; }
uint32_t value_
Definition: FTLSample.h:64
void FTLSample::print ( std::ostream &  out = std::cout)
inline

Definition at line 36 of file FTLSample.h.

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

36  {
37  out << "THR: " << threshold() << " Mode: " << mode() << " ToA: " << toa() << " Data: " << data() << " Raw=0x"
38  << std::hex << raw() << std::dec << std::endl;
39  }
bool mode() const
Definition: FTLSample.h:46
uint32_t raw() const
getters
Definition: FTLSample.h:44
bool threshold() const
Definition: FTLSample.h:45
uint32_t toa() const
Definition: FTLSample.h:47
uint32_t data() const
Definition: FTLSample.h:48
uint32_t FTLSample::raw ( ) const
inline

getters

Definition at line 44 of file FTLSample.h.

References value_.

Referenced by print().

44 { return value_; }
uint32_t value_
Definition: FTLSample.h:64
void FTLSample::set ( bool  thr,
bool  mode,
uint16_t  toa,
uint16_t  data 
)
inline

Definition at line 32 of file FTLSample.h.

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

32  {
33  value_ = (((uint32_t)thr & kThreshMask) << kThreshShift | ((uint32_t)mode & kModeMask) << kModeShift |
34  ((uint32_t)toa & kToAMask) << kToAShift | ((uint32_t)data & kDataMask) << kDataShift);
35  }
bool mode() const
Definition: FTLSample.h:46
uint32_t value_
Definition: FTLSample.h:64
uint32_t toa() const
Definition: FTLSample.h:47
uint32_t data() const
Definition: FTLSample.h:48
void FTLSample::setData ( uint16_t  data)
inline

Definition at line 31 of file FTLSample.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: FTLSample.h:55
uint32_t data() const
Definition: FTLSample.h:48
void FTLSample::setMode ( bool  mode)
inline

Definition at line 29 of file FTLSample.h.

References kModeMask, kModeShift, and setWord().

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

setters

Definition at line 28 of file FTLSample.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: FTLSample.h:55
void FTLSample::setToA ( uint16_t  toa)
inline

Definition at line 30 of file FTLSample.h.

References kToAMask, kToAShift, and setWord().

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

wrapper to reset words at a given position

Definition at line 55 of file FTLSample.h.

References value_.

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

55  {
56  //clear required bits
57  const uint32_t masked_word = (word & mask) << pos;
58  value_ &= ~(masked_word);
59  //now set the new value
60  value_ |= (masked_word);
61  }
uint32_t value_
Definition: FTLSample.h:64
uint64_t word
bool FTLSample::threshold ( ) const
inline

Definition at line 45 of file FTLSample.h.

References kThreshMask, kThreshShift, and value_.

Referenced by print().

uint32_t FTLSample::toa ( ) const
inline

Definition at line 47 of file FTLSample.h.

References kToAMask, kToAShift, and value_.

Referenced by print().

47 { return ((value_ >> kToAShift) & kToAMask); }
uint32_t value_
Definition: FTLSample.h:64

Member Data Documentation

uint32_t FTLSample::value_
private

Definition at line 64 of file FTLSample.h.

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