1 #ifndef DATAFORMATS_ECALRECHIT_H
2 #define DATAFORMATS_ECALRECHIT_H 1
100 const uint32_t mask = ((1 <<
width) - 1) <<
offset;
107 static constexpr
float p10[] = {1.e-2
f, 1.e-1
f, 1.f, 1.e1f, 1.e2f, 1.e3f, 1.e4f, 1.e5f, 1.e6f};
108 int b =
e < p10[4] ? 0 : 5;
122 return (
float)rawChi2 / (
float)((1 << 7) - 1) * 64.;
131 uint32_t rawChi2 = lround(
chi2 / 64. * ((1 << 7) - 1));
137 uint16_t
exponent = rawEnergy >> 10;
138 uint16_t significand = ~(0xE << 9) & rawEnergy;
145 uint32_t rawEnergy = 0;
148 static constexpr
float ip10[] = {1.e5f, 1.e4f, 1.e3f, 1.e2f, 1.e1f, 1.e0f, 1.e-1
f, 1.e-2
f, 1.e-3
f, 1.e-4};
151 rawEnergy =
exponent << 10 | significand;
168 if ((0xFF & timeErrorBits) == 0x00)
171 if ((0xFF & timeErrorBits) == 0xFF)
175 uint8_t
exponent = timeErrorBits >> 5;
176 uint8_t significand = timeErrorBits & ~(0x7 << 5);
177 return pow(2.,
exponent) * significand * LSB / 1000.;
191 for (std::vector<int>::const_iterator flagPtr = flagsvec.begin(); flagPtr != flagsvec.end();