#include <EcalRecHit.h>
Definition at line 12 of file EcalRecHit.h.
typedef DetId EcalRecHit::key_type |
Definition at line 14 of file EcalRecHit.h.
enum EcalRecHit::ESFlags |
Definition at line 40 of file EcalRecHit.h.
enum EcalRecHit::Flags |
Definition at line 17 of file EcalRecHit.h.
{ kGood=0, // channel ok, the energy and time measurement are reliable kPoorReco, // the energy is available from the UncalibRecHit, but approximate (bad shape, large chi2) kOutOfTime, // the energy is available from the UncalibRecHit (sync reco), but the event is out of time kFaultyHardware, // The energy is available from the UncalibRecHit, channel is faulty at some hardware level (e.g. noisy) kNoisy, // the channel is very noisy kPoorCalib, // the energy is available from the UncalibRecHit, but the calibration of the channel is poor kSaturated, // saturated channel (recovery not tried) kLeadingEdgeRecovered, // saturated channel: energy estimated from the leading edge before saturation kNeighboursRecovered, // saturated/isolated dead: energy estimated from neighbours kTowerRecovered, // channel in TT with no data link, info retrieved from Trigger Primitive kFake, // the signal in the channel is a fake (e.g. a so-called spike) kFakeNeighbours, // the signal in the channel is a fake and it is detected by looking at the neighbours kDead, // channel is dead and any recovery fails kKilled, // MC only flag: the channel is killed in the real detector kTPSaturated, // only for flagBits_: the channel is in a region with saturated TP kL1SpikeFlag, // only for flagBits_: the channel is in a region with TP with sFGVB = 0 // pro tempore, this will become obsolete when the online protection against spikes will be activated // kUnknown // to easy the interface with functions returning flags };
EcalRecHit::EcalRecHit | ( | ) |
bit structure of CaloRecHit::flags_ used in EcalRecHit:
| 32 | 31...25 | 24...12 | 11...5 | 4...1 | | | | | | | | | | +--> reco flags ( 4 bits) | | | +--> chi2 for in time events ( 7 bits) | | +--> energy for out-of-time events (13 bits) | +--> chi2 for out-of-time events ( 7 bits) +--> spare ( 1 bit )
Definition at line 11 of file EcalRecHit.cc.
: CaloRecHit(), flagBits_(0) { }
EcalRecHit::EcalRecHit | ( | const DetId & | id, |
float | energy, | ||
float | time, | ||
uint32_t | flags = 0 , |
||
uint32_t | flagBits = 0 |
||
) |
Definition at line 14 of file EcalRecHit.cc.
float EcalRecHit::chi2 | ( | void | ) | const |
Definition at line 27 of file EcalRecHit.cc.
References CaloRecHit::flags().
Referenced by BetaCalculatorTK::addInfoToCandidate().
{ uint32_t rawChi2 = 0x7F & (flags()>>4); return (float)rawChi2 / (float)((1<<7)-1) * 64.; }
float EcalRecHit::chi2Prob | ( | ) | const |
Definition at line 33 of file EcalRecHit.cc.
References ExpressReco_HICollisions_FallBack::cerr, and CaloRecHit::flags().
{ std::cerr << "Please retrieve the chi2 value instead of its probability.\n"; std::cerr << "Use the method EcalRecHit::chi2() for that purpose.\n"; std::cerr << "The chi2 is still in a commissioning phase and further\n"; std::cerr << "actions will be taken in the future. Thanks.\n"; assert(false); uint32_t rawChi2Prob = 0x7F & (flags()>>4); return (float)rawChi2Prob / (float)((1<<7)-1); }
uint32_t EcalRecHit::flagBits | ( | ) | const [inline] |
Definition at line 83 of file EcalRecHit.h.
References flagBits_.
Referenced by setFlagBits().
{ return flagBits_; }
DetId EcalRecHit::id | ( | void | ) | const [inline] |
get the id
Definition at line 74 of file EcalRecHit.h.
References CaloRecHit::detid().
Referenced by AlCaElectronsTest::analyze(), EcalSelectiveReadoutValidation::analyzeEB(), EcalSelectiveReadoutValidation::analyzeEE(), ClusterShapeAlgo::Calculate_2ndEnergy(), ClusterShapeAlgo::Calculate_TopEnergy(), HLTEcalResonanceFilter::checkStatusOfEcalRecHit(), EgammaHLTNxNClusterProducer::checkStatusOfEcalRecHit(), ClusterShapeAlgo::Create_Map(), EcalRecHitsFilter::filter(), EcalMIPRecHitFilter::filter(), ZeeCalibration::getHottestDetId(), EcalRecHitWorkerRecover::insertRecHit(), CosmicClusterAlgo::makeCluster(), EcalDisplaysByEvent::makeHistos(), PhysicsTowerOrganizer::PhysicsTowerOrganizer(), EcalDisplaysByEvent::selectHits(), EcalMipGraphs::selectHits(), and EcalSeverityLevelAlgo::severityLevel().
bool EcalRecHit::isRecovered | ( | ) | const |
Definition at line 20 of file EcalRecHit.cc.
References kLeadingEdgeRecovered, kNeighboursRecovered, kTowerRecovered, and recoFlag().
{ return ( recoFlag() == kLeadingEdgeRecovered || recoFlag() == kNeighboursRecovered || recoFlag() == kTowerRecovered ); }
bool EcalRecHit::isTimeErrorValid | ( | ) | const |
Definition at line 184 of file EcalRecHit.cc.
References isTimeValid(), and timeError().
Referenced by BetaCalculatorTK::addInfoToCandidate().
{ if(!isTimeValid()) return false; if(timeError() >= 10000) return false; return true; }
bool EcalRecHit::isTimeValid | ( | ) | const |
Definition at line 175 of file EcalRecHit.cc.
References timeError().
Referenced by BetaCalculatorTK::addInfoToCandidate(), and isTimeErrorValid().
{ if(timeError() <= 0) return false; else return true; }
float EcalRecHit::outOfTimeChi2 | ( | ) | const |
Definition at line 58 of file EcalRecHit.cc.
References CaloRecHit::flags().
Referenced by BetaCalculatorTK::addInfoToCandidate().
{ uint32_t rawChi2Prob = 0x7F & (flags()>>24); return (float)rawChi2Prob / (float)((1<<7)-1) * 64.; }
float EcalRecHit::outOfTimeChi2Prob | ( | ) | const |
Definition at line 44 of file EcalRecHit.cc.
References ExpressReco_HICollisions_FallBack::cerr.
{ std::cerr << "Please retrieve the chi2 value instead of its probability.\n"; std::cerr << "Use the method EcalRecHit::outOfTimeChi2() for that purpose.\n"; std::cerr << "The chi2 is still in a commissioning phase and further\n"; std::cerr << "actions will be taken in the future. Thanks.\n"; assert(false); /* uint32_t rawChi2Prob = 0x7F & (flags()>>24); return (float)rawChi2Prob / (float)((1<<7)-1); */ return -1; // will never get here }
float EcalRecHit::outOfTimeEnergy | ( | ) | const |
Definition at line 64 of file EcalRecHit.cc.
References CaloRecHit::flags(), and funct::pow().
Referenced by BetaCalculatorTK::addInfoToCandidate().
uint32_t EcalRecHit::recoFlag | ( | ) | const [inline] |
Definition at line 78 of file EcalRecHit.h.
References CaloRecHit::flags().
Referenced by BetaCalculatorTK::addInfoToCandidate(), HLTEcalResonanceFilter::checkStatusOfEcalRecHit(), EgammaHLTNxNClusterProducer::checkStatusOfEcalRecHit(), PFRecHitProducerPS::createRecHits(), isRecovered(), CosmicClusterAlgo::makeCluster(), EcalSeverityLevelAlgo::severityLevel(), and EcalSeverityLevelAlgo::spikeFromTiming().
{ return 0xF & flags(); }
void EcalRecHit::setChi2 | ( | float | chi2 | ) |
Definition at line 97 of file EcalRecHit.cc.
References CaloRecHit::flags(), and CaloRecHit::setFlags().
Referenced by EcalRecHitSimpleAlgo::makeRecHit().
void EcalRecHit::setChi2Prob | ( | float | chi2Prob | ) |
Definition at line 77 of file EcalRecHit.cc.
References ExpressReco_HICollisions_FallBack::cerr.
{ /* not used - store the raw chi2 instead */ std::cerr << "Please store the chi2 value instead of its probability.\n"; std::cerr << "Use the method EcalRecHit::setChi2() for that purpose.\n"; std::cerr << "The chi2 is still in a commissioning phase and further\n"; std::cerr << "actions will be taken in the future. Thanks.\n"; assert(false); /* if ( chi2Prob < 0 || chi2Prob > 1 ) { edm::LogWarning("EcalRecHit::setChi2Prob") << "chi2Prob outside limits [0, 1] : " << chi2Prob; } else { // use 7 bits uint32_t rawChi2Prob = lround( chi2Prob * ((1<<7)-1) ); // shift by 4 bits (recoFlag) setFlags( (~(0x7F<<4) & flags()) | ((rawChi2Prob & 0x7F)<<4) ); } */ }
void EcalRecHit::setFlagBits | ( | uint32_t | flagBits | ) | [inline] |
Definition at line 94 of file EcalRecHit.h.
References flagBits(), and flagBits_.
Referenced by EcalRecHitWorkerRecover::run().
void EcalRecHit::setOutOfTimeChi2 | ( | float | chi2 | ) |
Definition at line 140 of file EcalRecHit.cc.
References CaloRecHit::flags(), and CaloRecHit::setFlags().
void EcalRecHit::setOutOfTimeChi2Prob | ( | float | chi2Prob | ) |
Definition at line 119 of file EcalRecHit.cc.
References ExpressReco_HICollisions_FallBack::cerr.
{ /* not used - store the raw chi2 instead */ std::cerr << "Please store the chi2 value instead of its probability.\n"; std::cerr << "Use the method EcalRecHit::setOutOfTimeChi2() for that purpose.\n"; std::cerr << "The chi2 is still in a commissioning phase and further\n"; std::cerr << "actions will be taken in the future. Thanks.\n"; assert(false); /* if ( chi2Prob < 0 || chi2Prob > 1 ) { edm::LogWarning("EcalRecHit::setOutOfTimeChi2Prob") << "chi2Prob outside limits [0, 1] : " << chi2Prob; } else { // use 7 bits uint32_t rawChi2Prob = lround( chi2Prob * ((1<<7)-1) ); // shift by 24 bits (recoFlag + chi2 + outOfTimeEnergy) setFlags( (~(0x7F<<24) & flags()) | ((rawChi2Prob & 0x7F)<<24) ); } */ }
void EcalRecHit::setOutOfTimeEnergy | ( | float | energy | ) |
Definition at line 107 of file EcalRecHit.cc.
References CaloRecHit::flags(), funct::pow(), and CaloRecHit::setFlags().
Referenced by ESRecHitSimAlgo::reconstruct().
{ if ( energy > 0.001 ) { uint16_t exponent = lround(floor(log10(energy)))+3; uint16_t significand = lround(energy/pow(10,exponent-5)); // use 13 bits (3 exponent, 10 significand) uint32_t rawEnergy = exponent<<10 | significand; // shift by 11 bits (recoFlag + chi2) setFlags( ( ~(0x1FFF<<11) & flags()) | ((rawEnergy & 0x1FFF)<<11) ); } }
void EcalRecHit::setRecoFlag | ( | uint32_t | flag | ) |
Definition at line 72 of file EcalRecHit.cc.
References CaloRecHit::flags(), and CaloRecHit::setFlags().
Referenced by ESRecHitAnalyticAlgo::reconstruct(), and ESRecHitFitAlgo::reconstruct().
void EcalRecHit::setTimeError | ( | uint8_t | timeErrBits | ) |
Definition at line 151 of file EcalRecHit.cc.
References CaloRecHit::aux(), and CaloRecHit::setAux().
float EcalRecHit::timeError | ( | ) | const |
Definition at line 158 of file EcalRecHit.cc.
References CaloRecHit::aux(), and funct::pow().
Referenced by BetaCalculatorTK::addInfoToCandidate(), isTimeErrorValid(), and isTimeValid().
{ uint32_t timeErrorBits = 0xFF & aux(); // all bits off --> time reco bailed out (return negative value) if( (0xFF & timeErrorBits) == 0x00 ) return -1; // all bits on --> time error over 5 ns (return large value) if( (0xFF & timeErrorBits) == 0xFF ) return 10000; float LSB = 1.26008; uint8_t exponent = timeErrorBits>>5; uint8_t significand = timeErrorBits & ~(0x7<<5); return pow(2.,exponent)*significand*LSB/1000.; }
uint32_t EcalRecHit::flagBits_ [private] |
Definition at line 98 of file EcalRecHit.h.
Referenced by flagBits(), and setFlagBits().