#include <CondFormats/CastorObjects/interface/CastorQIECoder.h>
Public Member Functions | |
unsigned | adc (const CastorQIEShape &fShape, float fCharge, unsigned fCapId) const |
fC + capid [0..3] -> ADC conversion | |
CastorQIECoder (unsigned long fId=0) | |
float | charge (const CastorQIEShape &fShape, unsigned fAdc, unsigned fCapId) const |
ADC [0..127] + capid [0..3] -> fC conversion. | |
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 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 |
Definition at line 17 of file CastorQIECoder.h.
CastorQIECoder::CastorQIECoder | ( | unsigned long | fId = 0 |
) | [inline] |
unsigned CastorQIECoder::adc | ( | const CastorQIEShape & | fShape, | |
float | fCharge, | |||
unsigned | fCapId | |||
) | const |
fC + capid [0..3] -> ADC conversion
Definition at line 24 of file CastorQIECoder.cc.
References CastorQIEShape::highEdge(), offset(), range, and slope().
Referenced by CastorCoderDb::fC2adc_().
00024 { 00025 // search for the range 00026 for (unsigned range = 0; range < 4; range++) { 00027 float qieCharge = fCharge * slope (fCapId, range) + offset (fCapId, range); 00028 unsigned minBin = 32*range; 00029 float qieChargeMax = fShape.highEdge (minBin + 31); 00030 if (qieCharge <= qieChargeMax) { 00031 for (unsigned bin = minBin; bin <= minBin + 31; bin++) { 00032 if (qieCharge < fShape.highEdge (bin)) { 00033 return bin; 00034 } 00035 } 00036 return minBin; // underflow 00037 } 00038 else if (range == 3) { 00039 return 127; // overflow 00040 } 00041 } 00042 return 0; //should never get here 00043 }
float CastorQIECoder::charge | ( | const CastorQIEShape & | fShape, | |
unsigned | fAdc, | |||
unsigned | fCapId | |||
) | const |
ADC [0..127] + capid [0..3] -> fC conversion.
Definition at line 19 of file CastorQIECoder.cc.
References CastorQIEShape::center(), offset(), range, CastorQIEShape::range(), and slope().
Referenced by CastorCoderDb::adc2fC_(), and getLinearizedADC().
00019 { 00020 unsigned range = fShape.range (fAdc); 00021 return (fShape.center (fAdc) - offset (fCapId, range)) / slope (fCapId, range); 00022 }
float CastorQIECoder::offset | ( | unsigned | fCapId, | |
unsigned | fRange | |||
) | const |
Definition at line 45 of file CastorQIECoder.cc.
References index, and mOffset00.
Referenced by adc(), CastorQIEData::addCoder(), and charge().
uint32_t CastorQIECoder::rawId | ( | ) | const [inline] |
void CastorQIECoder::setOffset | ( | unsigned | fCapId, | |
unsigned | fRange, | |||
float | fValue | |||
) |
Definition at line 53 of file CastorQIECoder.cc.
References TestMuL1L2Filter_cff::cerr, lat::endl(), index, and mOffset00.
00053 { 00054 if (fCapId >= 0 && fRange >= 0 && fCapId < 4 && fRange < 4) { 00055 *((&mOffset00) + index (fRange, fCapId)) = fValue; 00056 } 00057 else { 00058 std::cerr << "CastorQIECoder::setOffset-> Wrong parameters capid/range: " << fCapId << '/' << fRange << std::endl; 00059 } 00060 }
void CastorQIECoder::setSlope | ( | unsigned | fCapId, | |
unsigned | fRange, | |||
float | fValue | |||
) |
Definition at line 62 of file CastorQIECoder.cc.
References TestMuL1L2Filter_cff::cerr, lat::endl(), index, and mSlope00.
00062 { 00063 if (fCapId >= 0 && fRange >= 0 && fCapId < 4 && fRange < 4) { 00064 *((&mSlope00) + index (fRange, fCapId)) = fValue; 00065 } 00066 else { 00067 std::cerr << "CastorQIECoder::setSlope-> Wrong parameters capid/range: " << fCapId << '/' << fRange << std::endl; 00068 } 00069 }
float CastorQIECoder::slope | ( | unsigned | fCapId, | |
unsigned | fRange | |||
) | const |
Definition at line 49 of file CastorQIECoder.cc.
References index, and mSlope00.
Referenced by adc(), CastorQIEData::addCoder(), and charge().
uint32_t CastorQIECoder::mId [private] |
float CastorQIECoder::mOffset00 [private] |
float CastorQIECoder::mOffset01 [private] |
Definition at line 39 of file CastorQIECoder.h.
float CastorQIECoder::mOffset02 [private] |
Definition at line 40 of file CastorQIECoder.h.
float CastorQIECoder::mOffset03 [private] |
Definition at line 41 of file CastorQIECoder.h.
float CastorQIECoder::mOffset10 [private] |
Definition at line 42 of file CastorQIECoder.h.
float CastorQIECoder::mOffset11 [private] |
Definition at line 43 of file CastorQIECoder.h.
float CastorQIECoder::mOffset12 [private] |
Definition at line 44 of file CastorQIECoder.h.
float CastorQIECoder::mOffset13 [private] |
Definition at line 45 of file CastorQIECoder.h.
float CastorQIECoder::mOffset20 [private] |
Definition at line 46 of file CastorQIECoder.h.
float CastorQIECoder::mOffset21 [private] |
Definition at line 47 of file CastorQIECoder.h.
float CastorQIECoder::mOffset22 [private] |
Definition at line 48 of file CastorQIECoder.h.
float CastorQIECoder::mOffset23 [private] |
Definition at line 49 of file CastorQIECoder.h.
float CastorQIECoder::mOffset30 [private] |
Definition at line 50 of file CastorQIECoder.h.
float CastorQIECoder::mOffset31 [private] |
Definition at line 51 of file CastorQIECoder.h.
float CastorQIECoder::mOffset32 [private] |
Definition at line 52 of file CastorQIECoder.h.
float CastorQIECoder::mOffset33 [private] |
Definition at line 53 of file CastorQIECoder.h.
float CastorQIECoder::mSlope00 [private] |
float CastorQIECoder::mSlope01 [private] |
Definition at line 55 of file CastorQIECoder.h.
float CastorQIECoder::mSlope02 [private] |
Definition at line 56 of file CastorQIECoder.h.
float CastorQIECoder::mSlope03 [private] |
Definition at line 57 of file CastorQIECoder.h.
float CastorQIECoder::mSlope10 [private] |
Definition at line 58 of file CastorQIECoder.h.
float CastorQIECoder::mSlope11 [private] |
Definition at line 59 of file CastorQIECoder.h.
float CastorQIECoder::mSlope12 [private] |
Definition at line 60 of file CastorQIECoder.h.
float CastorQIECoder::mSlope13 [private] |
Definition at line 61 of file CastorQIECoder.h.
float CastorQIECoder::mSlope20 [private] |
Definition at line 62 of file CastorQIECoder.h.
float CastorQIECoder::mSlope21 [private] |
Definition at line 63 of file CastorQIECoder.h.
float CastorQIECoder::mSlope22 [private] |
Definition at line 64 of file CastorQIECoder.h.
float CastorQIECoder::mSlope23 [private] |
Definition at line 65 of file CastorQIECoder.h.
float CastorQIECoder::mSlope30 [private] |
Definition at line 66 of file CastorQIECoder.h.
float CastorQIECoder::mSlope31 [private] |
Definition at line 67 of file CastorQIECoder.h.
float CastorQIECoder::mSlope32 [private] |
Definition at line 68 of file CastorQIECoder.h.
float CastorQIECoder::mSlope33 [private] |
Definition at line 69 of file CastorQIECoder.h.