17 inline unsigned index (
unsigned fRange,
unsigned fCapId) {
return fCapId * 4 + fRange;}
21 unsigned range = fShape.
range (fAdc);
27 for (
unsigned range = 0; range < 4; range++) {
28 float qieCharge = fCharge *
slope (fCapId, range) +
offset (fCapId, range);
29 unsigned nbin = fShape.
nbins();
30 unsigned minBin = nbin * range;
31 unsigned maxBin = minBin + nbin - 1;
32 float qieChargeMax = fShape.
highEdge (maxBin);
33 if (qieCharge <= qieChargeMax) {
34 for (
unsigned bin = minBin;
bin <= maxBin;
bin++) {
41 else if (range == 3) {
42 return ( 4 * nbin - 1);
57 if (fCapId < 4
U && fRange < 4
U) {
61 std::cerr <<
"HcalQIECoder::setOffset-> Wrong parameters capid/range: " << fCapId <<
'/' << fRange << std::endl;
66 if (fCapId < 4
U && fRange < 4
U) {
70 std::cerr <<
"HcalQIECoder::setSlope-> Wrong parameters capid/range: " << fCapId <<
'/' << fRange << std::endl;
float slope(unsigned fCapId, unsigned fRange) const
void setOffset(unsigned fCapId, unsigned fRange, float fValue)
float offset(unsigned fCapId, unsigned fRange) const
float center(unsigned fAdc) const
bin
set the eta bin as selection string.
unsigned adc(const HcalQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
unsigned range(unsigned fAdc) const
void setSlope(unsigned fCapId, unsigned fRange, float fValue)
float highEdge(unsigned fAdc) const
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.