CMS 3D CMS Logo

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

#include <HcalCalibrationQIECoder.h>

Public Member Functions

unsigned adc (const float fCharge) const
 fC -> ADC conversion More...
 
float charge (const unsigned fAdc) const
 ADC [0..31] -> fC conversion. More...
 
 HcalCalibrationQIECoder (unsigned long fId=0)
 
float minCharge (unsigned fBin) const
 
const float * minCharges () const
 
uint32_t rawId () const
 
void setMinCharge (unsigned fBin, float fValue)
 
void setMinCharges (const float fValue[32])
 

Private Member Functions

const float * base () const
 
float * base ()
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

float bin0
 
float bin1
 
float bin10
 
float bin11
 
float bin12
 
float bin13
 
float bin14
 
float bin15
 
float bin16
 
float bin17
 
float bin18
 
float bin19
 
float bin2
 
float bin20
 
float bin21
 
float bin22
 
float bin23
 
float bin24
 
float bin25
 
float bin26
 
float bin27
 
float bin28
 
float bin29
 
float bin3
 
float bin30
 
float bin31
 
float bin4
 
float bin5
 
float bin6
 
float bin7
 
float bin8
 
float bin9
 
uint32_t mId
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 17 of file HcalCalibrationQIECoder.h.

Constructor & Destructor Documentation

◆ HcalCalibrationQIECoder()

HcalCalibrationQIECoder::HcalCalibrationQIECoder ( unsigned long  fId = 0)
inline

Definition at line 19 of file HcalCalibrationQIECoder.h.

19 : mId(fId) {}

Member Function Documentation

◆ adc()

unsigned HcalCalibrationQIECoder::adc ( const float  fCharge) const

fC -> ADC conversion

Definition at line 19 of file HcalCalibrationQIECoder.cc.

References base(), and data.

19  {
20  const float* data = base();
21  unsigned adc = 1;
22  for (; adc < 32; adc++) {
23  if (fCharge < data[adc])
24  return adc - 1;
25  }
26  return 31; // overflow
27 }
const float * base() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
unsigned adc(const float fCharge) const
fC -> ADC conversion

◆ base() [1/2]

const float* HcalCalibrationQIECoder::base ( ) const
inlineprivate

Definition at line 67 of file HcalCalibrationQIECoder.h.

References bin0.

Referenced by adc(), charge(), minCharge(), minCharges(), setMinCharge(), and setMinCharges().

67 { return &bin0; }

◆ base() [2/2]

float* HcalCalibrationQIECoder::base ( )
inlineprivate

Definition at line 68 of file HcalCalibrationQIECoder.h.

References bin0.

68 { return &bin0; }

◆ charge()

float HcalCalibrationQIECoder::charge ( const unsigned  fAdc) const

ADC [0..31] -> fC conversion.

Definition at line 12 of file HcalCalibrationQIECoder.cc.

References base(), and data.

12  {
13  const float* data = base();
14  if (fAdc >= 31)
15  return (3 * data[31] - data[30]) / 2.; // extrapolation
16  return (data[fAdc] + data[fAdc + 1]) / 2;
17 }
const float * base() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ minCharge()

float HcalCalibrationQIECoder::minCharge ( unsigned  fBin) const

Definition at line 29 of file HcalCalibrationQIECoder.cc.

References base(), and data.

29  {
30  const float* data = base();
31  return fBin < 32 ? data[fBin] : data[31];
32 }
const float * base() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ minCharges()

const float * HcalCalibrationQIECoder::minCharges ( ) const

Definition at line 34 of file HcalCalibrationQIECoder.cc.

References base(), and data.

34  {
35  const float* data = base();
36  return data;
37 }
const float * base() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ rawId()

uint32_t HcalCalibrationQIECoder::rawId ( ) const
inline

Definition at line 31 of file HcalCalibrationQIECoder.h.

References mId.

31 { return mId; }

◆ serialize()

template<class Archive >
void HcalCalibrationQIECoder::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ setMinCharge()

void HcalCalibrationQIECoder::setMinCharge ( unsigned  fBin,
float  fValue 
)

Definition at line 39 of file HcalCalibrationQIECoder.cc.

References base(), and data.

39  {
40  float* data = base();
41  if (fBin < 32)
42  data[fBin] = fValue;
43 }
const float * base() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ setMinCharges()

void HcalCalibrationQIECoder::setMinCharges ( const float  fValue[32])

Definition at line 45 of file HcalCalibrationQIECoder.cc.

References base(), data, and mps_fire::i.

45  {
46  float* data = base();
47  for (int i = 0; i < 32; i++)
48  data[i] = fValue[i];
49 }
const float * base() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 70 of file HcalCalibrationQIECoder.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 70 of file HcalCalibrationQIECoder.h.

Member Data Documentation

◆ bin0

float HcalCalibrationQIECoder::bin0
private

Definition at line 35 of file HcalCalibrationQIECoder.h.

Referenced by base().

◆ bin1

float HcalCalibrationQIECoder::bin1
private

Definition at line 36 of file HcalCalibrationQIECoder.h.

◆ bin10

float HcalCalibrationQIECoder::bin10
private

Definition at line 45 of file HcalCalibrationQIECoder.h.

◆ bin11

float HcalCalibrationQIECoder::bin11
private

Definition at line 46 of file HcalCalibrationQIECoder.h.

◆ bin12

float HcalCalibrationQIECoder::bin12
private

Definition at line 47 of file HcalCalibrationQIECoder.h.

◆ bin13

float HcalCalibrationQIECoder::bin13
private

Definition at line 48 of file HcalCalibrationQIECoder.h.

◆ bin14

float HcalCalibrationQIECoder::bin14
private

Definition at line 49 of file HcalCalibrationQIECoder.h.

◆ bin15

float HcalCalibrationQIECoder::bin15
private

Definition at line 50 of file HcalCalibrationQIECoder.h.

◆ bin16

float HcalCalibrationQIECoder::bin16
private

Definition at line 51 of file HcalCalibrationQIECoder.h.

◆ bin17

float HcalCalibrationQIECoder::bin17
private

Definition at line 52 of file HcalCalibrationQIECoder.h.

◆ bin18

float HcalCalibrationQIECoder::bin18
private

Definition at line 53 of file HcalCalibrationQIECoder.h.

◆ bin19

float HcalCalibrationQIECoder::bin19
private

Definition at line 54 of file HcalCalibrationQIECoder.h.

◆ bin2

float HcalCalibrationQIECoder::bin2
private

Definition at line 37 of file HcalCalibrationQIECoder.h.

◆ bin20

float HcalCalibrationQIECoder::bin20
private

Definition at line 55 of file HcalCalibrationQIECoder.h.

◆ bin21

float HcalCalibrationQIECoder::bin21
private

Definition at line 56 of file HcalCalibrationQIECoder.h.

◆ bin22

float HcalCalibrationQIECoder::bin22
private

Definition at line 57 of file HcalCalibrationQIECoder.h.

◆ bin23

float HcalCalibrationQIECoder::bin23
private

Definition at line 58 of file HcalCalibrationQIECoder.h.

◆ bin24

float HcalCalibrationQIECoder::bin24
private

Definition at line 59 of file HcalCalibrationQIECoder.h.

◆ bin25

float HcalCalibrationQIECoder::bin25
private

Definition at line 60 of file HcalCalibrationQIECoder.h.

◆ bin26

float HcalCalibrationQIECoder::bin26
private

Definition at line 61 of file HcalCalibrationQIECoder.h.

◆ bin27

float HcalCalibrationQIECoder::bin27
private

Definition at line 62 of file HcalCalibrationQIECoder.h.

◆ bin28

float HcalCalibrationQIECoder::bin28
private

Definition at line 63 of file HcalCalibrationQIECoder.h.

◆ bin29

float HcalCalibrationQIECoder::bin29
private

Definition at line 64 of file HcalCalibrationQIECoder.h.

◆ bin3

float HcalCalibrationQIECoder::bin3
private

Definition at line 38 of file HcalCalibrationQIECoder.h.

◆ bin30

float HcalCalibrationQIECoder::bin30
private

Definition at line 65 of file HcalCalibrationQIECoder.h.

◆ bin31

float HcalCalibrationQIECoder::bin31
private

Definition at line 66 of file HcalCalibrationQIECoder.h.

◆ bin4

float HcalCalibrationQIECoder::bin4
private

Definition at line 39 of file HcalCalibrationQIECoder.h.

◆ bin5

float HcalCalibrationQIECoder::bin5
private

Definition at line 40 of file HcalCalibrationQIECoder.h.

◆ bin6

float HcalCalibrationQIECoder::bin6
private

Definition at line 41 of file HcalCalibrationQIECoder.h.

◆ bin7

float HcalCalibrationQIECoder::bin7
private

Definition at line 42 of file HcalCalibrationQIECoder.h.

◆ bin8

float HcalCalibrationQIECoder::bin8
private

Definition at line 43 of file HcalCalibrationQIECoder.h.

◆ bin9

float HcalCalibrationQIECoder::bin9
private

Definition at line 44 of file HcalCalibrationQIECoder.h.

◆ mId

uint32_t HcalCalibrationQIECoder::mId
private

Definition at line 34 of file HcalCalibrationQIECoder.h.

Referenced by rawId().