29 uint32_t rawChi2 = 0x7F & (
flags()>>4);
30 return (
float)rawChi2 / (float)((1<<7)-1) * 64.;
35 std::cerr <<
"Please retrieve the chi2 value instead of its probability.\n";
36 std::cerr <<
"Use the method EcalRecHit::chi2() for that purpose.\n";
37 std::cerr <<
"The chi2 is still in a commissioning phase and further\n";
38 std::cerr <<
"actions will be taken in the future. Thanks.\n";
40 uint32_t rawChi2Prob = 0x7F & (
flags()>>4);
41 return (
float)rawChi2Prob / (float)((1<<7)-1);
46 std::cerr <<
"Please retrieve the chi2 value instead of its probability.\n";
47 std::cerr <<
"Use the method EcalRecHit::outOfTimeChi2() for that purpose.\n";
48 std::cerr <<
"The chi2 is still in a commissioning phase and further\n";
49 std::cerr <<
"actions will be taken in the future. Thanks.\n";
60 uint32_t rawChi2Prob = 0x7F & (
flags()>>24);
61 return (
float)rawChi2Prob / (float)((1<<7)-1) * 64.;
66 uint32_t rawEnergy = (0x1FFF &
flags()>>11);
67 uint16_t exponent = rawEnergy>>10;
68 uint16_t significand = ~(0xE<<9) & rawEnergy;
69 return (
float) significand*
pow(10,exponent-5);
80 std::cerr <<
"Please store the chi2 value instead of its probability.\n";
81 std::cerr <<
"Use the method EcalRecHit::setChi2() for that purpose.\n";
82 std::cerr <<
"The chi2 is still in a commissioning phase and further\n";
83 std::cerr <<
"actions will be taken in the future. Thanks.\n";
100 if ( chi2 > 64 ) chi2 = 64;
102 uint32_t rawChi2 = lround( chi2 / 64. * ((1<<7)-1) );
109 if ( energy > 0.001 ) {
110 uint16_t exponent = lround(floor(log10(energy)))+3;
111 uint16_t significand = lround(energy/
pow(10,exponent-5));
113 uint32_t rawEnergy = exponent<<10 | significand;
115 setFlags( ( ~(0x1FFF<<11) &
flags()) | ((rawEnergy & 0x1FFF)<<11) );
122 std::cerr <<
"Please store the chi2 value instead of its probability.\n";
123 std::cerr <<
"Use the method EcalRecHit::setOutOfTimeChi2() for that purpose.\n";
124 std::cerr <<
"The chi2 is still in a commissioning phase and further\n";
125 std::cerr <<
"actions will be taken in the future. Thanks.\n";
143 if ( chi2 > 64 ) chi2 = 64;
145 uint32_t rawChi2 = lround( chi2 / 64. * ((1<<7)-1) );
147 setFlags( (~(0x7F<<24) &
flags()) | ((rawChi2 & 0x7F)<<24) );
160 uint32_t timeErrorBits = 0xFF &
aux();
162 if( (0xFF & timeErrorBits) == 0x00 )
165 if( (0xFF & timeErrorBits) == 0xFF )
169 uint8_t exponent = timeErrorBits>>5;
170 uint8_t significand = timeErrorBits & ~(0x7<<5);
171 return pow(2.,exponent)*significand*LSB/1000.;
202 return s <<
"EcalRecHit undefined subdetector" ;
bool isTimeErrorValid() const
const DetId & detid() const
std::vector< Variable::Flags > flags
std::ostream & operator<<(std::ostream &out, const ALILine &li)
float outOfTimeChi2Prob() const
void setTimeError(uint8_t timeErrBits)
void setRecoFlag(uint32_t flag)
uint32_t recoFlag() const
float outOfTimeEnergy() const
float outOfTimeChi2() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void setFlags(uint32_t flags)
void setChi2Prob(float chi2Prob)
void setOutOfTimeChi2(float chi2)
void setOutOfTimeEnergy(float energy)
void setAux(uint32_t value)
Detector det() const
get the detector field from this detid
Power< A, B >::type pow(const A &a, const B &b)
void setOutOfTimeChi2Prob(float chi2Prob)