CMS 3D CMS Logo

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

#include <CastorQIECoder.h>

Public Member Functions

unsigned adc (const CastorQIEShape &fShape, float fCharge, unsigned fCapId) const
 fC + capid [0..3] -> ADC conversion More...
 
 CastorQIECoder (unsigned long fId=0)
 
float charge (const CastorQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
 ADC [0..127] + capid [0..3] -> fC conversion. More...
 
float offset (unsigned fCapId, unsigned fRange) const
 
uint32_t rawId () const
 
void setOffset (unsigned fCapId, unsigned fRange, float fValue)
 
void setSlope (unsigned fCapId, unsigned fRange, float fValue)
 
float slope (unsigned fCapId, unsigned fRange) const
 

Private Member Functions

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

Private Attributes

uint32_t mId
 
float mOffset00
 
float mOffset01
 
float mOffset02
 
float mOffset03
 
float mOffset10
 
float mOffset11
 
float mOffset12
 
float mOffset13
 
float mOffset20
 
float mOffset21
 
float mOffset22
 
float mOffset23
 
float mOffset30
 
float mOffset31
 
float mOffset32
 
float mOffset33
 
float mSlope00
 
float mSlope01
 
float mSlope02
 
float mSlope03
 
float mSlope10
 
float mSlope11
 
float mSlope12
 
float mSlope13
 
float mSlope20
 
float mSlope21
 
float mSlope22
 
float mSlope23
 
float mSlope30
 
float mSlope31
 
float mSlope32
 
float mSlope33
 

Friends

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

Detailed Description

Author
Panos Katsas (UoA) POOL object to store calibration mode QIE coder parameters for one channel $Id
Fedor Ratnikov (UMd) POOL object to store QIE coder parameters for one channel $Author: ratnikov
Date
2008/03/05 10:38:03
Revision
1.9

Modified for CASTOR by L. Mundim

Definition at line 21 of file CastorQIECoder.h.

Constructor & Destructor Documentation

◆ CastorQIECoder()

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

Definition at line 23 of file CastorQIECoder.h.

24  : mId(fId),
25  mOffset00(0),
26  mOffset01(0),
27  mOffset02(0),
28  mOffset03(0),
29  mOffset10(0),
30  mOffset11(0),
31  mOffset12(0),
32  mOffset13(0),
33  mOffset20(0),
34  mOffset21(0),
35  mOffset22(0),
36  mOffset23(0),
37  mOffset30(0),
38  mOffset31(0),
39  mOffset32(0),
40  mOffset33(0),
41  mSlope00(0),
42  mSlope01(0),
43  mSlope02(0),
44  mSlope03(0),
45  mSlope10(0),
46  mSlope11(0),
47  mSlope12(0),
48  mSlope13(0),
49  mSlope20(0),
50  mSlope21(0),
51  mSlope22(0),
52  mSlope23(0),
53  mSlope30(0),
54  mSlope31(0),
55  mSlope32(0),
56  mSlope33(0){};

Member Function Documentation

◆ adc()

unsigned CastorQIECoder::adc ( const CastorQIEShape fShape,
float  fCharge,
unsigned  fCapId 
) const

fC + capid [0..3] -> ADC conversion

Definition at line 22 of file CastorQIECoder.cc.

22  {
23  // search for the range
24  for (unsigned range = 0; range < 4; range++) {
25  float qieCharge = fCharge * slope(fCapId, range) + offset(fCapId, range);
26  unsigned minBin = 32 * range;
27  float qieChargeMax = fShape.highEdge(minBin + 31);
28  if (qieCharge <= qieChargeMax) {
29  for (unsigned bin = minBin; bin <= minBin + 31; bin++) {
30  if (qieCharge < fShape.highEdge(bin)) {
31  return bin;
32  }
33  }
34  return minBin; // underflow
35  } else if (range == 3) {
36  return 127; // overflow
37  }
38  }
39  return 0; //should never get here
40 }

References newFWLiteAna::bin, CastorQIEShape::highEdge(), cms::cuda::allocator::minBin, offset(), FastTimerService_cff::range, and slope().

Referenced by CastorCoderDb::fC2adc_().

◆ charge()

float CastorQIECoder::charge ( const CastorQIEShape fShape,
unsigned  fAdc,
unsigned  fCapId 
) const

◆ offset()

float CastorQIECoder::offset ( unsigned  fCapId,
unsigned  fRange 
) const

Definition at line 42 of file CastorQIECoder.cc.

42 { return *((&mOffset00) + index(fRange, fCapId)); }

References mOffset00.

Referenced by adc(), charge(), and CastorDbASCIIIO::dumpObject().

◆ rawId()

uint32_t CastorQIECoder::rawId ( ) const
inline

Definition at line 70 of file CastorQIECoder.h.

70 { return mId; }

References mId.

◆ serialize()

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

◆ setOffset()

void CastorQIECoder::setOffset ( unsigned  fCapId,
unsigned  fRange,
float  fValue 
)

Definition at line 46 of file CastorQIECoder.cc.

46  {
47  if (fCapId < 4U && fRange < 4U) { // fCapId >= 0 and fRange >= 0, since fCapId and fRange are unsigned
48  *((&mOffset00) + index(fRange, fCapId)) = fValue;
49  } else {
50  std::cerr << "CastorQIECoder::setOffset-> Wrong parameters capid/range: " << fCapId << '/' << fRange << std::endl;
51  }
52 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, mOffset00, and mitigatedMETSequence_cff::U.

Referenced by CastorDbASCIIIO::getObject().

◆ setSlope()

void CastorQIECoder::setSlope ( unsigned  fCapId,
unsigned  fRange,
float  fValue 
)

Definition at line 54 of file CastorQIECoder.cc.

54  {
55  if (fCapId < 4U && fRange < 4U) { // fCapId >= 0 and fRange >= 0, since fCapId and fRange are unsigned
56  *((&mSlope00) + index(fRange, fCapId)) = fValue;
57  } else {
58  std::cerr << "CastorQIECoder::setSlope-> Wrong parameters capid/range: " << fCapId << '/' << fRange << std::endl;
59  }
60 }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, mSlope00, and mitigatedMETSequence_cff::U.

Referenced by CastorDbASCIIIO::getObject().

◆ slope()

float CastorQIECoder::slope ( unsigned  fCapId,
unsigned  fRange 
) const

Definition at line 44 of file CastorQIECoder.cc.

44 { return *((&mSlope00) + index(fRange, fCapId)); }

References mSlope00.

Referenced by adc(), charge(), and CastorDbASCIIIO::dumpObject().

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 107 of file CastorQIECoder.h.

◆ cond::serialization::access

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

Definition at line 107 of file CastorQIECoder.h.

Member Data Documentation

◆ mId

uint32_t CastorQIECoder::mId
private

Definition at line 73 of file CastorQIECoder.h.

Referenced by rawId().

◆ mOffset00

float CastorQIECoder::mOffset00
private

Definition at line 74 of file CastorQIECoder.h.

Referenced by offset(), and setOffset().

◆ mOffset01

float CastorQIECoder::mOffset01
private

Definition at line 75 of file CastorQIECoder.h.

◆ mOffset02

float CastorQIECoder::mOffset02
private

Definition at line 76 of file CastorQIECoder.h.

◆ mOffset03

float CastorQIECoder::mOffset03
private

Definition at line 77 of file CastorQIECoder.h.

◆ mOffset10

float CastorQIECoder::mOffset10
private

Definition at line 78 of file CastorQIECoder.h.

◆ mOffset11

float CastorQIECoder::mOffset11
private

Definition at line 79 of file CastorQIECoder.h.

◆ mOffset12

float CastorQIECoder::mOffset12
private

Definition at line 80 of file CastorQIECoder.h.

◆ mOffset13

float CastorQIECoder::mOffset13
private

Definition at line 81 of file CastorQIECoder.h.

◆ mOffset20

float CastorQIECoder::mOffset20
private

Definition at line 82 of file CastorQIECoder.h.

◆ mOffset21

float CastorQIECoder::mOffset21
private

Definition at line 83 of file CastorQIECoder.h.

◆ mOffset22

float CastorQIECoder::mOffset22
private

Definition at line 84 of file CastorQIECoder.h.

◆ mOffset23

float CastorQIECoder::mOffset23
private

Definition at line 85 of file CastorQIECoder.h.

◆ mOffset30

float CastorQIECoder::mOffset30
private

Definition at line 86 of file CastorQIECoder.h.

◆ mOffset31

float CastorQIECoder::mOffset31
private

Definition at line 87 of file CastorQIECoder.h.

◆ mOffset32

float CastorQIECoder::mOffset32
private

Definition at line 88 of file CastorQIECoder.h.

◆ mOffset33

float CastorQIECoder::mOffset33
private

Definition at line 89 of file CastorQIECoder.h.

◆ mSlope00

float CastorQIECoder::mSlope00
private

Definition at line 90 of file CastorQIECoder.h.

Referenced by setSlope(), and slope().

◆ mSlope01

float CastorQIECoder::mSlope01
private

Definition at line 91 of file CastorQIECoder.h.

◆ mSlope02

float CastorQIECoder::mSlope02
private

Definition at line 92 of file CastorQIECoder.h.

◆ mSlope03

float CastorQIECoder::mSlope03
private

Definition at line 93 of file CastorQIECoder.h.

◆ mSlope10

float CastorQIECoder::mSlope10
private

Definition at line 94 of file CastorQIECoder.h.

◆ mSlope11

float CastorQIECoder::mSlope11
private

Definition at line 95 of file CastorQIECoder.h.

◆ mSlope12

float CastorQIECoder::mSlope12
private

Definition at line 96 of file CastorQIECoder.h.

◆ mSlope13

float CastorQIECoder::mSlope13
private

Definition at line 97 of file CastorQIECoder.h.

◆ mSlope20

float CastorQIECoder::mSlope20
private

Definition at line 98 of file CastorQIECoder.h.

◆ mSlope21

float CastorQIECoder::mSlope21
private

Definition at line 99 of file CastorQIECoder.h.

◆ mSlope22

float CastorQIECoder::mSlope22
private

Definition at line 100 of file CastorQIECoder.h.

◆ mSlope23

float CastorQIECoder::mSlope23
private

Definition at line 101 of file CastorQIECoder.h.

◆ mSlope30

float CastorQIECoder::mSlope30
private

Definition at line 102 of file CastorQIECoder.h.

◆ mSlope31

float CastorQIECoder::mSlope31
private

Definition at line 103 of file CastorQIECoder.h.

◆ mSlope32

float CastorQIECoder::mSlope32
private

Definition at line 104 of file CastorQIECoder.h.

◆ mSlope33

float CastorQIECoder::mSlope33
private

Definition at line 105 of file CastorQIECoder.h.

cms::cuda::allocator::minBin
constexpr unsigned int minBin
Definition: getCachingDeviceAllocator.h:18
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
CastorQIECoder::mOffset11
float mOffset11
Definition: CastorQIECoder.h:79
CastorQIECoder::mSlope01
float mSlope01
Definition: CastorQIECoder.h:91
CastorQIECoder::slope
float slope(unsigned fCapId, unsigned fRange) const
Definition: CastorQIECoder.cc:44
CastorQIECoder::mSlope22
float mSlope22
Definition: CastorQIECoder.h:100
CastorQIECoder::mSlope23
float mSlope23
Definition: CastorQIECoder.h:101
CastorQIECoder::mSlope32
float mSlope32
Definition: CastorQIECoder.h:104
CastorQIECoder::mSlope02
float mSlope02
Definition: CastorQIECoder.h:92
CastorQIECoder::mOffset22
float mOffset22
Definition: CastorQIECoder.h:84
CastorQIECoder::mOffset31
float mOffset31
Definition: CastorQIECoder.h:87
CastorQIECoder::mOffset33
float mOffset33
Definition: CastorQIECoder.h:89
CastorQIECoder::mId
uint32_t mId
Definition: CastorQIECoder.h:73
CastorQIEShape::highEdge
float highEdge(unsigned fAdc) const
Definition: CastorQIEShape.cc:50
CastorQIEShape::center
float center(unsigned fAdc) const
Definition: CastorQIEShape.cc:40
CastorQIEShape::range
unsigned range(unsigned fAdc) const
Definition: CastorQIEShape.h:22
CastorQIECoder::mOffset01
float mOffset01
Definition: CastorQIECoder.h:75
CastorQIECoder::mSlope21
float mSlope21
Definition: CastorQIECoder.h:99
CastorQIECoder::mOffset20
float mOffset20
Definition: CastorQIECoder.h:82
CastorQIECoder::mOffset13
float mOffset13
Definition: CastorQIECoder.h:81
CastorQIECoder::mSlope20
float mSlope20
Definition: CastorQIECoder.h:98
CastorQIECoder::mSlope31
float mSlope31
Definition: CastorQIECoder.h:103
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
CastorQIECoder::mSlope10
float mSlope10
Definition: CastorQIECoder.h:94
CastorQIECoder::mSlope11
float mSlope11
Definition: CastorQIECoder.h:95
CastorQIECoder::mOffset12
float mOffset12
Definition: CastorQIECoder.h:80
CastorQIECoder::mOffset32
float mOffset32
Definition: CastorQIECoder.h:88
CastorQIECoder::mSlope33
float mSlope33
Definition: CastorQIECoder.h:105
CastorQIECoder::mSlope30
float mSlope30
Definition: CastorQIECoder.h:102
CastorQIECoder::mSlope12
float mSlope12
Definition: CastorQIECoder.h:96
CastorQIECoder::mOffset00
float mOffset00
Definition: CastorQIECoder.h:74
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
CastorQIECoder::mSlope03
float mSlope03
Definition: CastorQIECoder.h:93
CastorQIECoder::mOffset23
float mOffset23
Definition: CastorQIECoder.h:85
CastorQIECoder::mSlope13
float mSlope13
Definition: CastorQIECoder.h:97
CastorQIECoder::mOffset02
float mOffset02
Definition: CastorQIECoder.h:76
CastorQIECoder::mOffset21
float mOffset21
Definition: CastorQIECoder.h:83
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
CastorQIECoder::offset
float offset(unsigned fCapId, unsigned fRange) const
Definition: CastorQIECoder.cc:42
CastorQIECoder::mOffset03
float mOffset03
Definition: CastorQIECoder.h:77
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
CastorQIECoder::mOffset10
float mOffset10
Definition: CastorQIECoder.h:78
CastorQIECoder::mSlope00
float mSlope00
Definition: CastorQIECoder.h:90
CastorQIECoder::mOffset30
float mOffset30
Definition: CastorQIECoder.h:86