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
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 17 of file FTLSample.h.

Enumerator
kThreshShift 
kModeShift 
kToAShift 
kDataShift 

Definition at line 18 of file FTLSample.h.

Constructor & Destructor Documentation

FTLSample::FTLSample ( )
inline

CTOR.

Definition at line 23 of file FTLSample.h.

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

Definition at line 24 of file FTLSample.h.

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

Definition at line 25 of file FTLSample.h.

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

Member Function Documentation

uint32_t FTLSample::data ( ) const
inline

Definition at line 57 of file FTLSample.h.

References kDataMask, kDataShift, and value_.

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

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

Definition at line 55 of file FTLSample.h.

References kModeMask, kModeShift, and value_.

Referenced by print().

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

Definition at line 58 of file FTLSample.h.

References value_.

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

Definition at line 41 of file FTLSample.h.

References data(), TauDecayModes::dec, mode(), GenerateHcalLaserBadRunList::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: FTLSample.h:55
uint32_t raw() const
getters
Definition: FTLSample.h:53
bool threshold() const
Definition: FTLSample.h:54
uint32_t toa() const
Definition: FTLSample.h:56
uint32_t data() const
Definition: FTLSample.h:57
uint32_t FTLSample::raw ( ) const
inline

getters

Definition at line 53 of file FTLSample.h.

References value_.

Referenced by print().

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

Definition at line 34 of file FTLSample.h.

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

Referenced by SimpleElectronicsSimInMIPs::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: FTLSample.h:55
uint32_t value_
Definition: FTLSample.h:75
uint32_t toa() const
Definition: FTLSample.h:56
uint32_t data() const
Definition: FTLSample.h:57
void FTLSample::setData ( uint16_t  data)
inline

Definition at line 33 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:65
uint32_t data() const
Definition: FTLSample.h:57
void FTLSample::setMode ( bool  mode)
inline

Definition at line 31 of file FTLSample.h.

References kModeMask, kModeShift, and setWord().

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

setters

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

Definition at line 32 of file FTLSample.h.

References kToAMask, kToAShift, and setWord().

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

References 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: FTLSample.h:75
bool FTLSample::threshold ( ) const
inline

Definition at line 54 of file FTLSample.h.

References kThreshMask, kThreshShift, and value_.

Referenced by print().

uint32_t FTLSample::toa ( ) const
inline

Definition at line 56 of file FTLSample.h.

References kToAMask, kToAShift, and value_.

Referenced by print().

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

Member Data Documentation

uint32_t FTLSample::value_
private

Definition at line 75 of file FTLSample.h.

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