1 #ifndef DATAFORMATS_ECALRECHIT_H
2 #define DATAFORMATS_ECALRECHIT_H 1
97 return (value >> offset) & ((1 <<
width) - 1);
101 const uint32_t mask = ((1 <<
width) - 1) <<
offset;
103 value |= (x & ((1U <<
width) - 1)) << offset;
115 return (
float)rawChi2 / (float)((1<<7)-1) * 64.;
120 if (chi2 > 64) chi2 = 64;
123 uint32_t rawChi2 = lround(chi2 / 64. * ((1<<7)-1));
130 uint16_t exponent = rawEnergy >> 10;
131 uint16_t significand = ~(0xE<<9) & rawEnergy;
132 return (
float) significand*
pow(10,exponent-5);
138 uint32_t rawEnergy = 0;
139 if (energy > 0.001) {
140 uint16_t exponent = lround(floor(log10(energy))) + 3;
141 uint16_t significand = lround(energy/
pow(10, exponent - 5));
143 rawEnergy = exponent << 10 | significand;
152 if( (0xFF & timeErrorBits) == 0x00 )
155 if( (0xFF & timeErrorBits) == 0xFF )
159 uint8_t exponent = timeErrorBits>>5;
160 uint8_t significand = timeErrorBits & ~(0x7<<5);
161 return pow(2.,exponent)*significand*LSB/1000.;
180 for (std::vector<int>::const_iterator flagPtr = flagsvec.begin();
181 flagPtr!= flagsvec.end(); ++flagPtr) {
bool isTimeErrorValid() const
bool checkFlags(const std::vector< int > &flagsvec) const
check if one of the flags in a set is true
static uint32_t setMasked(uint32_t value, uint32_t x, uint32_t offset, uint32_t width)
const DetId & detid() const
void setFlag(int flag)
set the flags (from Flags or ESFlags)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
void setTimeError(uint8_t timeErrBits)
float outOfTimeEnergy() const
bool checkFlag(int flag) const
check if the flag is true
float outOfTimeChi2() const
unsigned int offset(bool)
static uint32_t getMasked(uint32_t value, uint32_t offset, uint32_t width)
DetId id() const
get the id
void setEnergy(float energy)
void setOutOfTimeChi2(short chi2)
Flags recoFlag() const
DEPRECATED provided for temporary backward compatibility.
EcalRecHit(const DetId &id, float energy, float time, uint32_t extra=0, uint32_t flagBits=0)
bool checkFlagMask(uint32_t mask) const
apply a bitmask to our flags. Experts only
void setOutOfTimeEnergy(float energy)
uint32_t flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Power< A, B >::type pow(const A &a, const B &b)