12 CaloRecHit(id,energy,time,flags), flagBits_(flagBits) {
16 uint32_t rawChi2 = 0x7F & (
flags()>>4);
17 return (
float)rawChi2 / (float)((1<<7)-1) * 64.;
21 uint32_t rawChi2Prob = 0x7F & (
flags()>>24);
22 return (
float)rawChi2Prob / (float)((1<<7)-1) * 64.;
26 uint32_t rawEnergy = (0x1FFF &
flags()>>11);
28 uint16_t significand = ~(0xE<<9) & rawEnergy;
29 return (
float) significand*
pow(10,exponent-5);
34 if ( chi2 > 64 ) chi2 = 64;
36 uint32_t rawChi2 = lround( chi2 / 64. * ((1<<7)-1) );
42 if ( energy > 0.001 ) {
43 uint16_t
exponent = lround(floor(log10(energy)))+3;
44 uint16_t significand = lround(energy/
pow(10,exponent-5));
46 uint32_t rawEnergy = exponent<<10 | significand;
48 setFlags( ( ~(0x1FFF<<11) &
flags()) | ((rawEnergy & 0x1FFF)<<11) );
54 if ( chi2 > 64 ) chi2 = 64;
56 uint32_t rawChi2 = lround( chi2 / 64. * ((1<<7)-1) );
67 uint32_t timeErrorBits = 0xFF &
aux();
69 if( (0xFF & timeErrorBits) == 0x00 )
72 if( (0xFF & timeErrorBits) == 0xFF )
77 uint8_t significand = timeErrorBits & ~(0x7<<5);
78 return pow(2.,exponent)*significand*LSB/1000.;
100 for (std::vector<int>::const_iterator flagPtr = flagsvec.begin();
101 flagPtr!= flagsvec.end(); ++flagPtr) {
116 return s <<
"HGCRecHit undefined subdetector" ;
const DetId & detid() const
bool checkFlags(const std::vector< int > &flagsvec) const
check if one of the flags in a set is true
std::vector< Variable::Flags > flags
bool isTimeErrorValid() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
float outOfTimeEnergy() const
bool checkFlag(int flag) const
check if the flag is true
void setOutOfTimeEnergy(float energy)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void setFlags(uint32_t flags)
void setOutOfTimeChi2(float chi2)
void setAux(uint32_t value)
float outOfTimeChi2() const
Detector det() const
get the detector field from this detid
void setTimeError(uint8_t timeErrBits)
Power< A, B >::type pow(const A &a, const B &b)