CMS 3D CMS Logo

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

#include <HcalQIESample.h>

Public Member Functions

constexpr int adc () const
 get the ADC sample More...
 
constexpr int capid () const
 get the Capacitor id More...
 
constexpr bool dv () const
 is the Data Valid bit set? More...
 
constexpr bool er () const
 is the error bit set? More...
 
constexpr int fiber () const
 get the fiber number More...
 
constexpr int fiberAndChan () const
 get the id channel More...
 
constexpr int fiberChan () const
 get the fiber channel number More...
 
constexpr HcalQIESample ()
 
constexpr HcalQIESample (uint16_t data)
 
constexpr HcalQIESample (int adc, int capid, int fiber, int fiberchan, bool dv=true, bool er=false)
 
constexpr double nominal_fC () const
 get the nominal FC (no calibrations applied) More...
 
constexpr uint16_t operator() ()
 for streaming More...
 
constexpr 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 41 of file HcalQIESample.h.

Constructor & Destructor Documentation

constexpr HcalQIESample::HcalQIESample ( )
inline

Definition at line 43 of file HcalQIESample.h.

44  : theSample{0}
45  {}
uint16_t theSample
Definition: HcalQIESample.h:81
constexpr HcalQIESample::HcalQIESample ( uint16_t  data)
inline

Definition at line 46 of file HcalQIESample.h.

47  : theSample{data}
48  {}
uint16_t theSample
Definition: HcalQIESample.h:81
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
constexpr HcalQIESample::HcalQIESample ( int  adc,
int  capid,
int  fiber,
int  fiberchan,
bool  dv = true,
bool  er = false 
)
inline

Definition at line 49 of file HcalQIESample.h.

51  : theSample((uint16_t)((adc&0x7f) | ((capid&0x3)<<7) |
52  (((fiber-1)&0x7)<<13) | ((fiberchan&0x3)<<11) |
53  ((dv)?(0x0200):(0)) | ((er)?(0x0400):(0))))
54  {}
constexpr bool er() const
is the error bit set?
Definition: HcalQIESample.h:69
uint16_t theSample
Definition: HcalQIESample.h:81
constexpr int adc() const
get the ADC sample
Definition: HcalQIESample.h:59
constexpr bool dv() const
is the Data Valid bit set?
Definition: HcalQIESample.h:67
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:65
constexpr int fiber() const
get the fiber number
Definition: HcalQIESample.h:71

Member Function Documentation

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

is the Data Valid bit set?

Definition at line 67 of file HcalQIESample.h.

References theSample.

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

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

is the error bit set?

Definition at line 69 of file HcalQIESample.h.

References theSample.

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

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

get the fiber number

Definition at line 71 of file HcalQIESample.h.

References theSample.

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

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

get the id channel

Definition at line 75 of file HcalQIESample.h.

References theSample.

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

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

get the fiber channel number

Definition at line 73 of file HcalQIESample.h.

References theSample.

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

73 { return (theSample>>11)&0x3; }
uint16_t theSample
Definition: HcalQIESample.h:81
constexpr double HcalQIESample::nominal_fC ( ) const
inline

get the nominal FC (no calibrations applied)

Definition at line 61 of file HcalQIESample.h.

References adc(), and nominal_adc2fc.

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

61  {
62  return nominal_adc2fc[adc()];
63  }
static constexpr float nominal_adc2fc[128]
Definition: HcalQIESample.h:14
constexpr int adc() const
get the ADC sample
Definition: HcalQIESample.h:59
constexpr uint16_t HcalQIESample::operator() ( )
inline

for streaming

Definition at line 78 of file HcalQIESample.h.

References theSample.

78 { return theSample; }
uint16_t theSample
Definition: HcalQIESample.h:81
constexpr uint16_t HcalQIESample::raw ( ) const
inline

get the raw word

Definition at line 57 of file HcalQIESample.h.

References theSample.

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

57 { return theSample; }
uint16_t theSample
Definition: HcalQIESample.h:81

Member Data Documentation

uint16_t HcalQIESample::theSample
private

Definition at line 81 of file HcalQIESample.h.

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