CMS 3D CMS Logo

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

#include <HcalUpgradeQIESample.h>

Public Member Functions

int adc () const
 get the ADC sample More...
 
int capid () const
 get the Capacitor id More...
 
bool dv () const
 is the Data Valid bit set? More...
 
bool er () const
 is the error bit set? More...
 
int fiber () const
 get the fiber number More...
 
int fiberAndChan () const
 get the id channel More...
 
int fiberChan () const
 get the fiber channel number More...
 
 HcalUpgradeQIESample ()
 
 HcalUpgradeQIESample (uint16_t data)
 
 HcalUpgradeQIESample (int adc, int capid, int fiber, int fiberchan, bool dv=true, bool er=false)
 
double nominal_fC () const
 get the nominal FC (no calibrations applied) More...
 
uint16_t operator() ()
 for streaming More...
 
uint16_t raw () const
 get the raw word More...
 

Private Attributes

uint16_t theSample
 

Detailed Description

Simple container packer/unpacker for a single QIE data word

Author
J. Mans - Minnesota

Definition at line 13 of file HcalUpgradeQIESample.h.

Constructor & Destructor Documentation

HcalUpgradeQIESample::HcalUpgradeQIESample ( )
inline

Definition at line 15 of file HcalUpgradeQIESample.h.

References theSample.

15 { theSample=0; }
HcalUpgradeQIESample::HcalUpgradeQIESample ( uint16_t  data)
inline

Definition at line 16 of file HcalUpgradeQIESample.h.

References data, and theSample.

16 { theSample=data; }
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
HcalUpgradeQIESample::HcalUpgradeQIESample ( int  adc,
int  capid,
int  fiber,
int  fiberchan,
bool  dv = true,
bool  er = false 
)

Definition at line 26 of file HcalUpgradeQIESample.cc.

References theSample.

26  {
27  theSample=(adc&0xff) | ((capid&0x3)<<8) |
28  (((fiber-1)&0x7)<<14) | ((fiberchan&0x3)<<12) |
29  ((dv)?(0x0400):(0)) | ((er)?(0x0800):(0));
30 }
int fiber() const
get the fiber number
bool dv() const
is the Data Valid bit set?
bool er() const
is the error bit set?
int adc() const
get the ADC sample
int capid() const
get the Capacitor id

Member Function Documentation

int HcalUpgradeQIESample::adc ( ) const
inline

get the ADC sample

Definition at line 22 of file HcalUpgradeQIESample.h.

References theSample.

Referenced by nominal_fC(), and operator<<().

22 { return theSample&0xFF; }
int HcalUpgradeQIESample::capid ( ) const
inline

get the Capacitor id

Definition at line 26 of file HcalUpgradeQIESample.h.

References theSample.

Referenced by operator<<().

26 { return (theSample>>8)&0x3; }
bool HcalUpgradeQIESample::dv ( ) const
inline

is the Data Valid bit set?

Definition at line 28 of file HcalUpgradeQIESample.h.

References theSample.

Referenced by operator<<().

28 { return (theSample&0x0400)!=0; }
bool HcalUpgradeQIESample::er ( ) const
inline

is the error bit set?

Definition at line 30 of file HcalUpgradeQIESample.h.

References theSample.

Referenced by operator<<().

30 { return (theSample&0x0800)!=0; }
int HcalUpgradeQIESample::fiber ( ) const
inline

get the fiber number

Definition at line 32 of file HcalUpgradeQIESample.h.

References theSample.

32 { return ((theSample>>14)&0x7)+1; }
int HcalUpgradeQIESample::fiberAndChan ( ) const
inline

get the id channel

Definition at line 36 of file HcalUpgradeQIESample.h.

References theSample.

36 { return (theSample>>11)&0x1F; }
int HcalUpgradeQIESample::fiberChan ( ) const
inline

get the fiber channel number

Definition at line 34 of file HcalUpgradeQIESample.h.

References theSample.

34 { return (theSample>>12)&0x3; }
double HcalUpgradeQIESample::nominal_fC ( ) const

get the nominal FC (no calibrations applied)

Definition at line 32 of file HcalUpgradeQIESample.cc.

References adc(), and nominal_adc2fc.

32  {
33  return nominal_adc2fc[adc()];
34 }
int adc() const
get the ADC sample
static const float nominal_adc2fc[256]
uint16_t HcalUpgradeQIESample::operator() ( )
inline

for streaming

Definition at line 39 of file HcalUpgradeQIESample.h.

References theSample.

39 { return theSample; }
uint16_t HcalUpgradeQIESample::raw ( ) const
inline

get the raw word

Definition at line 20 of file HcalUpgradeQIESample.h.

References theSample.

20 { return theSample; }

Member Data Documentation

uint16_t HcalUpgradeQIESample::theSample
private