CMS 3D CMS Logo

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

#include <CastorCalibrationQIECoder.h>

Public Member Functions

unsigned adc (const float fCharge) const
 fC -> ADC conversion More...
 
 CastorCalibrationQIECoder (unsigned long fId=0)
 
float charge (const unsigned fAdc) const
 ADC [0..31] -> fC conversion. More...
 
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 CastorCalibrationQIECoder.h.

Constructor & Destructor Documentation

◆ CastorCalibrationQIECoder()

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

Definition at line 19 of file CastorCalibrationQIECoder.h.

Member Function Documentation

◆ adc()

unsigned CastorCalibrationQIECoder::adc ( const float  fCharge) const

fC -> ADC conversion

Definition at line 20 of file CastorCalibrationQIECoder.cc.

References base(), and data.

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

◆ base() [1/2]

const float* CastorCalibrationQIECoder::base ( ) const
inlineprivate

Definition at line 67 of file CastorCalibrationQIECoder.h.

References bin0.

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

◆ base() [2/2]

float* CastorCalibrationQIECoder::base ( )
inlineprivate

Definition at line 68 of file CastorCalibrationQIECoder.h.

References bin0.

◆ charge()

float CastorCalibrationQIECoder::charge ( const unsigned  fAdc) const

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

Definition at line 13 of file CastorCalibrationQIECoder.cc.

References base(), and data.

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

◆ minCharge()

float CastorCalibrationQIECoder::minCharge ( unsigned  fBin) const

Definition at line 30 of file CastorCalibrationQIECoder.cc.

References base(), and data.

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

◆ minCharges()

const float * CastorCalibrationQIECoder::minCharges ( ) const

Definition at line 35 of file CastorCalibrationQIECoder.cc.

References base(), and data.

Referenced by CastorDbASCIIIO::dumpObject().

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

◆ rawId()

uint32_t CastorCalibrationQIECoder::rawId ( ) const
inline

Definition at line 31 of file CastorCalibrationQIECoder.h.

References mId.

31 { return mId; }

◆ serialize()

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

◆ setMinCharge()

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

Definition at line 40 of file CastorCalibrationQIECoder.cc.

References base(), and data.

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

◆ setMinCharges()

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

Definition at line 46 of file CastorCalibrationQIECoder.cc.

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

Referenced by CastorDbASCIIIO::getObject().

46  {
47  float* data = base();
48  for (int i = 0; i < 32; i++)
49  data[i] = fValue[i];
50 }
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 CastorCalibrationQIECoder.h.

◆ cond::serialization::access

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

Definition at line 70 of file CastorCalibrationQIECoder.h.

Member Data Documentation

◆ bin0

float CastorCalibrationQIECoder::bin0
private

Definition at line 35 of file CastorCalibrationQIECoder.h.

Referenced by base().

◆ bin1

float CastorCalibrationQIECoder::bin1
private

Definition at line 36 of file CastorCalibrationQIECoder.h.

◆ bin10

float CastorCalibrationQIECoder::bin10
private

Definition at line 45 of file CastorCalibrationQIECoder.h.

◆ bin11

float CastorCalibrationQIECoder::bin11
private

Definition at line 46 of file CastorCalibrationQIECoder.h.

◆ bin12

float CastorCalibrationQIECoder::bin12
private

Definition at line 47 of file CastorCalibrationQIECoder.h.

◆ bin13

float CastorCalibrationQIECoder::bin13
private

Definition at line 48 of file CastorCalibrationQIECoder.h.

◆ bin14

float CastorCalibrationQIECoder::bin14
private

Definition at line 49 of file CastorCalibrationQIECoder.h.

◆ bin15

float CastorCalibrationQIECoder::bin15
private

Definition at line 50 of file CastorCalibrationQIECoder.h.

◆ bin16

float CastorCalibrationQIECoder::bin16
private

Definition at line 51 of file CastorCalibrationQIECoder.h.

◆ bin17

float CastorCalibrationQIECoder::bin17
private

Definition at line 52 of file CastorCalibrationQIECoder.h.

◆ bin18

float CastorCalibrationQIECoder::bin18
private

Definition at line 53 of file CastorCalibrationQIECoder.h.

◆ bin19

float CastorCalibrationQIECoder::bin19
private

Definition at line 54 of file CastorCalibrationQIECoder.h.

◆ bin2

float CastorCalibrationQIECoder::bin2
private

Definition at line 37 of file CastorCalibrationQIECoder.h.

◆ bin20

float CastorCalibrationQIECoder::bin20
private

Definition at line 55 of file CastorCalibrationQIECoder.h.

◆ bin21

float CastorCalibrationQIECoder::bin21
private

Definition at line 56 of file CastorCalibrationQIECoder.h.

◆ bin22

float CastorCalibrationQIECoder::bin22
private

Definition at line 57 of file CastorCalibrationQIECoder.h.

◆ bin23

float CastorCalibrationQIECoder::bin23
private

Definition at line 58 of file CastorCalibrationQIECoder.h.

◆ bin24

float CastorCalibrationQIECoder::bin24
private

Definition at line 59 of file CastorCalibrationQIECoder.h.

◆ bin25

float CastorCalibrationQIECoder::bin25
private

Definition at line 60 of file CastorCalibrationQIECoder.h.

◆ bin26

float CastorCalibrationQIECoder::bin26
private

Definition at line 61 of file CastorCalibrationQIECoder.h.

◆ bin27

float CastorCalibrationQIECoder::bin27
private

Definition at line 62 of file CastorCalibrationQIECoder.h.

◆ bin28

float CastorCalibrationQIECoder::bin28
private

Definition at line 63 of file CastorCalibrationQIECoder.h.

◆ bin29

float CastorCalibrationQIECoder::bin29
private

Definition at line 64 of file CastorCalibrationQIECoder.h.

◆ bin3

float CastorCalibrationQIECoder::bin3
private

Definition at line 38 of file CastorCalibrationQIECoder.h.

◆ bin30

float CastorCalibrationQIECoder::bin30
private

Definition at line 65 of file CastorCalibrationQIECoder.h.

◆ bin31

float CastorCalibrationQIECoder::bin31
private

Definition at line 66 of file CastorCalibrationQIECoder.h.

◆ bin4

float CastorCalibrationQIECoder::bin4
private

Definition at line 39 of file CastorCalibrationQIECoder.h.

◆ bin5

float CastorCalibrationQIECoder::bin5
private

Definition at line 40 of file CastorCalibrationQIECoder.h.

◆ bin6

float CastorCalibrationQIECoder::bin6
private

Definition at line 41 of file CastorCalibrationQIECoder.h.

◆ bin7

float CastorCalibrationQIECoder::bin7
private

Definition at line 42 of file CastorCalibrationQIECoder.h.

◆ bin8

float CastorCalibrationQIECoder::bin8
private

Definition at line 43 of file CastorCalibrationQIECoder.h.

◆ bin9

float CastorCalibrationQIECoder::bin9
private

Definition at line 44 of file CastorCalibrationQIECoder.h.

◆ mId

uint32_t CastorCalibrationQIECoder::mId
private

Definition at line 34 of file CastorCalibrationQIECoder.h.

Referenced by rawId().