CMS 3D CMS Logo

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

◆ FTLSampleMasks

Enumerator
kThreshMask 
kModeMask 
kToAMask 
kDataMask 

Definition at line 15 of file FTLSample.h.

◆ FTLSampleShifts

Enumerator
kThreshShift 
kModeShift 
kToAShift 
kDataShift 

Definition at line 16 of file FTLSample.h.

Constructor & Destructor Documentation

◆ FTLSample() [1/3]

FTLSample::FTLSample ( )
inline

CTOR.

Definition at line 21 of file FTLSample.h.

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

◆ FTLSample() [2/3]

FTLSample::FTLSample ( uint32_t  value)
inline

Definition at line 22 of file FTLSample.h.

22 : value_(value) {}
uint32_t value_
Definition: FTLSample.h:64
Definition: value.py:1

◆ FTLSample() [3/3]

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

◆ data()

uint32_t FTLSample::data ( ) const
inline

Definition at line 48 of file FTLSample.h.

References kDataMask, kDataShift, and value_.

Referenced by print(), set(), and setData().

◆ mode()

bool FTLSample::mode ( ) const
inline

Definition at line 46 of file FTLSample.h.

References kModeMask, kModeShift, and value_.

Referenced by print(), set(), and setMode().

◆ operator()()

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

◆ print()

void FTLSample::print ( std::ostream &  out = std::cout)
inline

Definition at line 36 of file FTLSample.h.

References data(), TauDecayModes::dec, mode(), MillePedeFileConverter_cfg::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  }
uint32_t data() const
Definition: FTLSample.h:48
uint32_t toa() const
Definition: FTLSample.h:47
bool threshold() const
Definition: FTLSample.h:45
bool mode() const
Definition: FTLSample.h:46
uint32_t raw() const
getters
Definition: FTLSample.h:44

◆ raw()

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

◆ set()

void FTLSample::set ( bool  thr,
bool  mode,
uint16_t  toa,
uint16_t  data 
)
inline

Definition at line 32 of file FTLSample.h.

References data(), kDataMask, kDataShift, kModeMask, kModeShift, kThreshMask, kThreshShift, kToAMask, kToAShift, mode(), toa(), 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  }
uint32_t data() const
Definition: FTLSample.h:48
uint32_t value_
Definition: FTLSample.h:64
uint32_t toa() const
Definition: FTLSample.h:47
bool mode() const
Definition: FTLSample.h:46

◆ setData()

void FTLSample::setData ( uint16_t  data)
inline

Definition at line 31 of file FTLSample.h.

References data(), kDataMask, kDataShift, and setWord().

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

◆ setMode()

void FTLSample::setMode ( bool  mode)
inline

Definition at line 29 of file FTLSample.h.

References kModeMask, kModeShift, mode(), 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

◆ setThreshold()

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

◆ setToA()

void FTLSample::setToA ( uint16_t  toa)
inline

Definition at line 30 of file FTLSample.h.

References kToAMask, kToAShift, setWord(), and toa().

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

◆ setWord()

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 gpuClustering::pixelStatus::mask, and 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
constexpr uint32_t mask
Definition: gpuClustering.h:26
uint64_t word

◆ threshold()

bool FTLSample::threshold ( ) const
inline

Definition at line 45 of file FTLSample.h.

References kThreshMask, kThreshShift, and value_.

Referenced by print().

◆ toa()

uint32_t FTLSample::toa ( ) const
inline

Definition at line 47 of file FTLSample.h.

References kToAMask, kToAShift, and value_.

Referenced by print(), set(), and setToA().

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

Member Data Documentation

◆ value_

uint32_t FTLSample::value_
private

Definition at line 64 of file FTLSample.h.

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