#include <CondFormats/CastorObjects/interface/CastorQIEShape.h>
Public Member Functions | |
CastorQIEShape () | |
float | center (unsigned fAdc) const |
float | highEdge (unsigned fAdc) const |
unsigned | local (unsigned fAdc) const |
float | lowEdge (unsigned fAdc) const |
unsigned | range (unsigned fAdc) const |
bool | setLowEdges (const float fValue[32]) |
~CastorQIEShape () | |
Private Member Functions | |
void | expand () |
bool | setLowEdge (float fValue, unsigned fAdc) |
Private Attributes | |
float | mValues [129] |
Definition at line 14 of file CastorQIEShape.h.
CastorQIEShape::CastorQIEShape | ( | ) |
CastorQIEShape::~CastorQIEShape | ( | ) |
float CastorQIEShape::center | ( | unsigned | fAdc | ) | const |
Definition at line 41 of file CastorQIEShape.cc.
References mValues.
Referenced by CastorQIECoder::charge().
00041 { 00042 if (fAdc < 128) { 00043 if (fAdc % 32 == 31) return 0.5 * (3 * mValues [fAdc] - mValues [fAdc - 1]); // extrapolate 00044 else return 0.5 * (mValues [fAdc] + mValues [fAdc + 1]); // interpolate 00045 } 00046 return 0.; 00047 }
void CastorQIEShape::expand | ( | ) | [private] |
Definition at line 23 of file CastorQIEShape.cc.
References i, index, mValues, range(), and scale.
Referenced by CastorQIEShape(), and setLowEdges().
00023 { 00024 int scale = 1; 00025 for (unsigned range = 1; range < 4; range++) { 00026 scale = scale * 5; 00027 unsigned index = range * 32; 00028 mValues [index] = mValues [index - 2]; // link to previous range 00029 for (unsigned i = 1; i < 32; i++) { 00030 mValues [index + i] = mValues [index + i - 1] + scale * (mValues [i] - mValues [i - 1]); 00031 } 00032 } 00033 mValues [128] = 2 * mValues [127] - mValues [126]; // extrapolate 00034 }
float CastorQIEShape::highEdge | ( | unsigned | fAdc | ) | const |
Definition at line 49 of file CastorQIEShape.cc.
References mValues.
Referenced by CastorQIECoder::adc().
00049 { 00050 if (fAdc < 128) return mValues [fAdc+1]; 00051 return 0.; 00052 }
unsigned CastorQIEShape::local | ( | unsigned | fAdc | ) | const [inline] |
float CastorQIEShape::lowEdge | ( | unsigned | fAdc | ) | const |
Definition at line 36 of file CastorQIEShape.cc.
References mValues.
00036 { 00037 if (fAdc < 128) return mValues [fAdc]; 00038 return 0.; 00039 }
unsigned CastorQIEShape::range | ( | unsigned | fAdc | ) | const [inline] |
Definition at line 22 of file CastorQIEShape.h.
Referenced by CastorQIECoder::charge(), and expand().
bool CastorQIEShape::setLowEdge | ( | float | fValue, | |
unsigned | fAdc | |||
) | [private] |
Definition at line 54 of file CastorQIEShape.cc.
References mValues.
Referenced by setLowEdges().
00054 { 00055 if (fAdc >= 32) return false; 00056 mValues [fAdc] = fValue; 00057 return true; 00058 }
bool CastorQIEShape::setLowEdges | ( | const float | fValue[32] | ) |
Definition at line 60 of file CastorQIEShape.cc.
References ecalMGPA::adc(), expand(), HLT_VtxMuL3::result, and setLowEdge().
00060 { 00061 bool result = true; 00062 for (int adc = 0; adc < 32; adc++) result = result && setLowEdge (fValue [adc], adc); 00063 expand (); 00064 return result; 00065 }
float CastorQIEShape::mValues[129] [private] |
Definition at line 28 of file CastorQIEShape.h.
Referenced by CastorQIEShape(), center(), expand(), highEdge(), lowEdge(), and setLowEdge().