14 unsigned index(
unsigned fRange,
unsigned fCapId) {
return fCapId * 4 + fRange; }
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++) {
35 }
else if (
range == 3) {
47 if (fCapId < 4
U && fRange < 4
U) {
50 std::cerr <<
"CastorQIECoder::setOffset-> Wrong parameters capid/range: " << fCapId <<
'/' << fRange << std::endl;
55 if (fCapId < 4
U && fRange < 4
U) {
58 std::cerr <<
"CastorQIECoder::setSlope-> Wrong parameters capid/range: " << fCapId <<
'/' << fRange << std::endl;
void setSlope(unsigned fCapId, unsigned fRange, float fValue)
unsigned range(unsigned fAdc) const
float highEdge(unsigned fAdc) const
float charge(const CastorQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
void setOffset(unsigned fCapId, unsigned fRange, float fValue)
float center(unsigned fAdc) const
float offset(unsigned fCapId, unsigned fRange) const
unsigned adc(const CastorQIEShape &fShape, float fCharge, unsigned fCapId) const
fC + capid [0..3] -> ADC conversion
float slope(unsigned fCapId, unsigned fRange) const