CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HcalQIESample Class Reference

#include <HcalQIESample.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...
 
 HcalQIESample ()
 
 HcalQIESample (uint16_t data)
 
 HcalQIESample (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 HcalQIESample.h.

Constructor & Destructor Documentation

HcalQIESample::HcalQIESample ( )
inline

Definition at line 15 of file HcalQIESample.h.

References theSample.

Referenced by HcalQIESample().

15 { theSample=0; }
uint16_t theSample
Definition: HcalQIESample.h:42
HcalQIESample::HcalQIESample ( uint16_t  data)
inline

Definition at line 16 of file HcalQIESample.h.

References adc(), capid(), data, dv(), er(), fiber(), HcalQIESample(), and theSample.

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

Definition at line 24 of file HcalQIESample.cc.

References theSample.

24  {
25  theSample=(adc&0x7f) | ((capid&0x3)<<7) |
26  (((fiber-1)&0x7)<<13) | ((fiberchan&0x3)<<11) |
27  ((dv)?(0x0200):(0)) | ((er)?(0x0400):(0));
28 }
int adc() const
get the ADC sample
Definition: HcalQIESample.h:22
bool dv() const
is the Data Valid bit set?
Definition: HcalQIESample.h:28
uint16_t theSample
Definition: HcalQIESample.h:42
int fiber() const
get the fiber number
Definition: HcalQIESample.h:32
int capid() const
get the Capacitor id
Definition: HcalQIESample.h:26
bool er() const
is the error bit set?
Definition: HcalQIESample.h:30

Member Function Documentation

int HcalQIESample::adc ( ) const
inline
int HcalQIESample::capid ( ) const
inline
bool HcalQIESample::dv ( ) const
inline

is the Data Valid bit set?

Definition at line 28 of file HcalQIESample.h.

References theSample.

Referenced by HcalQIESample(), operator<<(), CastorDigiMonitor::processEvent(), and L1Analysis::L1AnalysisL1HO::SetHO().

28 { return (theSample&0x0200)!=0; }
uint16_t theSample
Definition: HcalQIESample.h:42
bool HcalQIESample::er ( ) const
inline

is the error bit set?

Definition at line 30 of file HcalQIESample.h.

References theSample.

Referenced by HcalQIESample(), operator<<(), UHTRpacker::packQIE8header(), CastorDigiMonitor::processEvent(), and L1Analysis::L1AnalysisL1HO::SetHO().

30 { return (theSample&0x0400)!=0; }
uint16_t theSample
Definition: HcalQIESample.h:42
int HcalQIESample::fiber ( ) const
inline

get the fiber number

Definition at line 32 of file HcalQIESample.h.

References theSample.

Referenced by HcalQIESample(), CastorUnpacker_impl::unpack(), HcalUnpacker_impl::unpack(), CastorUnpacker::unpack(), and HcalUnpacker::unpackVME().

32 { return ((theSample>>13)&0x7)+1; }
uint16_t theSample
Definition: HcalQIESample.h:42
int HcalQIESample::fiberAndChan ( ) const
inline

get the id channel

Definition at line 36 of file HcalQIESample.h.

References theSample.

Referenced by CastorUnpacker_impl::unpack(), HcalUnpacker_impl::unpack(), CastorUnpacker::unpack(), and HcalUnpacker::unpackVME().

36 { return (theSample>>11)&0x1F; }
uint16_t theSample
Definition: HcalQIESample.h:42
int HcalQIESample::fiberChan ( ) const
inline

get the fiber channel number

Definition at line 34 of file HcalQIESample.h.

References theSample.

Referenced by CastorUnpacker_impl::unpack(), HcalUnpacker_impl::unpack(), CastorUnpacker::unpack(), and HcalUnpacker::unpackVME().

34 { return (theSample>>11)&0x3; }
uint16_t theSample
Definition: HcalQIESample.h:42
double HcalQIESample::nominal_fC ( ) const

get the nominal FC (no calibrations applied)

Definition at line 30 of file HcalQIESample.cc.

References adc(), and nominal_adc2fc.

Referenced by HFRaddamTask::_process(), adc(), JetToDigiDump::analyze(), ZDCDigiStudy::analyze(), HBHETimeProfileStatusBitSetter::compare_digi_energy::operator()(), and HBHETimeProfileStatusBitSetter::TotalEnergyInDataFrame().

30  {
31  return nominal_adc2fc[adc()];
32 }
int adc() const
get the ADC sample
Definition: HcalQIESample.h:22
static const float nominal_adc2fc[128]
Definition: HcalQIESample.cc:3
uint16_t HcalQIESample::operator() ( )
inline

for streaming

Definition at line 39 of file HcalQIESample.h.

References theSample.

39 { return theSample; }
uint16_t theSample
Definition: HcalQIESample.h:42
uint16_t HcalQIESample::raw ( ) const
inline

get the raw word

Definition at line 20 of file HcalQIESample.h.

References theSample.

Referenced by CastorPacker::pack(), HcalPacker::pack(), CastorUnpacker::unpack(), and HcalUnpacker::unpackVME().

20 { return theSample; }
uint16_t theSample
Definition: HcalQIESample.h:42

Member Data Documentation

uint16_t HcalQIESample::theSample
private

Definition at line 42 of file HcalQIESample.h.

Referenced by adc(), capid(), dv(), er(), fiber(), fiberAndChan(), fiberChan(), HcalQIESample(), operator()(), and raw().