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 (int adc, int capid, int fiber, int fiberchan, bool dv=true, bool er=false)
 
constexpr HcalQIESample (uint16_t data)
 
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 32 of file HcalQIESample.h.

Constructor & Destructor Documentation

◆ HcalQIESample() [1/3]

constexpr HcalQIESample::HcalQIESample ( )
inlineconstexpr

Definition at line 34 of file HcalQIESample.h.

34 : theSample{0} {}

◆ HcalQIESample() [2/3]

constexpr HcalQIESample::HcalQIESample ( uint16_t  data)
inlineconstexpr

Definition at line 35 of file HcalQIESample.h.

35 : theSample{data} {}

References data.

◆ HcalQIESample() [3/3]

constexpr HcalQIESample::HcalQIESample ( int  adc,
int  capid,
int  fiber,
int  fiberchan,
bool  dv = true,
bool  er = false 
)
inlineconstexpr

Definition at line 36 of file HcalQIESample.h.

37  : theSample((uint16_t)((adc & 0x7f) | ((capid & 0x3) << 7) | (((fiber - 1) & 0x7) << 13) |
38  ((fiberchan & 0x3) << 11) | ((dv) ? (0x0200) : (0)) | ((er) ? (0x0400) : (0)))) {}

Member Function Documentation

◆ adc()

constexpr int HcalQIESample::adc ( ) const
inlineconstexpr

◆ capid()

constexpr int HcalQIESample::capid ( ) const
inlineconstexpr

◆ dv()

constexpr bool HcalQIESample::dv ( ) const
inlineconstexpr

is the Data Valid bit set?

Definition at line 49 of file HcalQIESample.h.

49 { return (theSample & 0x0200) != 0; }

References theSample.

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

◆ er()

constexpr bool HcalQIESample::er ( ) const
inlineconstexpr

is the error bit set?

Definition at line 51 of file HcalQIESample.h.

51 { return (theSample & 0x0400) != 0; }

References theSample.

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

◆ fiber()

constexpr int HcalQIESample::fiber ( ) const
inlineconstexpr

get the fiber number

Definition at line 53 of file HcalQIESample.h.

53 { return ((theSample >> 13) & 0x7) + 1; }

References theSample.

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

◆ fiberAndChan()

constexpr int HcalQIESample::fiberAndChan ( ) const
inlineconstexpr

get the id channel

Definition at line 57 of file HcalQIESample.h.

57 { return (theSample >> 11) & 0x1F; }

References theSample.

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

◆ fiberChan()

constexpr int HcalQIESample::fiberChan ( ) const
inlineconstexpr

get the fiber channel number

Definition at line 55 of file HcalQIESample.h.

55 { return (theSample >> 11) & 0x3; }

References theSample.

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

◆ nominal_fC()

constexpr double HcalQIESample::nominal_fC ( ) const
inlineconstexpr

get the nominal FC (no calibrations applied)

Definition at line 45 of file HcalQIESample.h.

45 { return nominal_adc2fc[adc()]; }

References adc(), and nominal_adc2fc.

Referenced by HFRaddamTask::_process(), LaserTask::_process(), JetToDigiDump::analyze(), and ZDCDigiStudy::analyze().

◆ operator()()

constexpr uint16_t HcalQIESample::operator() ( )
inlineconstexpr

for streaming

Definition at line 60 of file HcalQIESample.h.

60 { return theSample; }

References theSample.

◆ raw()

constexpr uint16_t HcalQIESample::raw ( ) const
inlineconstexpr

get the raw word

Definition at line 41 of file HcalQIESample.h.

41 { return theSample; }

References theSample.

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

Member Data Documentation

◆ theSample

uint16_t HcalQIESample::theSample
private

Definition at line 63 of file HcalQIESample.h.

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

HcalQIESample::adc
constexpr int adc() const
get the ADC sample
Definition: HcalQIESample.h:43
HcalQIESample::er
constexpr bool er() const
is the error bit set?
Definition: HcalQIESample.h:51
nominal_adc2fc
static constexpr float nominal_adc2fc[128]
Definition: HcalQIESample.h:13
HcalQIESample::fiber
constexpr int fiber() const
get the fiber number
Definition: HcalQIESample.h:53
HcalQIESample::capid
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:47
HcalQIESample::dv
constexpr bool dv() const
is the Data Valid bit set?
Definition: HcalQIESample.h:49
HcalQIESample::theSample
uint16_t theSample
Definition: HcalQIESample.h:63
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79