#include <EcalRecHit.h>
Public Types | |
enum | ESFlags { kESGood, kESDead, kESHot, kESPassBX, kESTwoGoodRatios, kESBadRatioFor12, kESBadRatioFor23Upper, kESBadRatioFor23Lower, kESTS1Largest, kESTS3Largest, kESTS3Negative, kESSaturated, kESTS2Saturated, kESTS3Saturated, kESTS13Sigmas, kESTS15Sigmas } |
enum | Flags { kGood = 0, kPoorReco, kOutOfTime, kFaultyHardware, kNoisy, kPoorCalib, kSaturated, kLeadingEdgeRecovered, kNeighboursRecovered, kTowerRecovered, kDead, kKilled, kTPSaturated, kL1SpikeFlag, kWeird, kDiWeird, kHasSwitchToGain6, kHasSwitchToGain1, kUnknown } |
typedef DetId | key_type |
Public Member Functions | |
bool | checkFlag (int flag) const |
check if the flag is true | |
bool | checkFlagMask (uint32_t mask) const |
apply a bitmask to our flags. Experts only | |
float | chi2 () const |
EcalRecHit (const DetId &id, float energy, float time, uint32_t flags=0, uint32_t flagBits=0) | |
EcalRecHit () | |
DetId | id () const |
get the id | |
bool | isRecovered () const |
bool | isTimeErrorValid () const |
bool | isTimeValid () const |
float | outOfTimeChi2 () const |
float | outOfTimeEnergy () const |
Flags | recoFlag () const |
DEPRECATED provided for temporary backward compatibility. | |
void | setChi2 (float chi2) |
void | setFlag (int flag) |
set the flags (from Flags or ESFlags) | |
void | setOutOfTimeChi2 (float chi2) |
void | setOutOfTimeEnergy (float energy) |
void | setTimeError (uint8_t timeErrBits) |
float | timeError () const |
void | unsetFlag (int flag) |
Private Attributes | |
uint32_t | flagBits_ |
store rechit condition (see Flags enum) in a bit-wise way |
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 41 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 kDead, // channel is dead and any recovery fails kKilled, // MC only flag: the channel is killed in the real detector kTPSaturated, // the channel is in a region with saturated TP kL1SpikeFlag, // the channel is in a region with TP with sFGVB = 0 kWeird, // the signal is believed to originate from an anomalous deposit (spike) kDiWeird, // the signal is anomalous, and neighbors another anomalous signal kHasSwitchToGain6, // at least one data frame is in G6 kHasSwitchToGain1, // at least one data frame is in G1 // kUnknown // to ease 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 9 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 12 of file EcalRecHit.cc.
: CaloRecHit(id,energy,time,flags), flagBits_(flagBits) { }
bool EcalRecHit::checkFlag | ( | int | flag | ) | const [inline] |
check if the flag is true
Definition at line 102 of file EcalRecHit.h.
References flagBits_.
Referenced by PFRecHitProducerPS::createRecHits(), isRecovered(), recoFlag(), and EcalSeverityLevelAlgo::severityLevel().
bool EcalRecHit::checkFlagMask | ( | uint32_t | mask | ) | const [inline] |
apply a bitmask to our flags. Experts only
Definition at line 105 of file EcalRecHit.h.
References flagBits_.
Referenced by EcalSeverityLevelAlgo::severityLevel().
{ return flagBits_&mask; }
float EcalRecHit::chi2 | ( | void | ) | const |
Definition at line 26 of file EcalRecHit.cc.
References CaloRecHit::flags().
Referenced by BetaCalculatorECAL::addInfoToCandidate().
{ uint32_t rawChi2 = 0x7F & (flags()>>4); return (float)rawChi2 / (float)((1<<7)-1) * 64.; }
DetId EcalRecHit::id | ( | void | ) | const [inline] |
get the id
Definition at line 76 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(), ZeeCalibration::getHottestDetId(), EcalMIPRecHitFilter::hltFilter(), EcalRecHitWorkerRecover::insertRecHit(), Multi5x5ClusterAlgo::mainSearch(), CosmicClusterAlgo::makeCluster(), EcalDisplaysByEvent::makeHistos(), PhysicsTowerOrganizer::PhysicsTowerOrganizer(), Multi5x5ClusterAlgo::ProtoBasicCluster::removeHit(), EcalDisplaysByEvent::selectHits(), and EcalMipGraphs::selectHits().
bool EcalRecHit::isRecovered | ( | ) | const |
Definition at line 18 of file EcalRecHit.cc.
References checkFlag(), kLeadingEdgeRecovered, kNeighboursRecovered, and kTowerRecovered.
{ return ( checkFlag(kLeadingEdgeRecovered) || checkFlag(kNeighboursRecovered) || checkFlag(kTowerRecovered) ); }
bool EcalRecHit::isTimeErrorValid | ( | ) | const |
Definition at line 121 of file EcalRecHit.cc.
References isTimeValid(), and timeError().
Referenced by BetaCalculatorECAL::addInfoToCandidate().
{ if(!isTimeValid()) return false; if(timeError() >= 10000) return false; return true; }
bool EcalRecHit::isTimeValid | ( | ) | const |
Definition at line 112 of file EcalRecHit.cc.
References timeError().
Referenced by BetaCalculatorECAL::addInfoToCandidate(), and isTimeErrorValid().
{ if(timeError() <= 0) return false; else return true; }
float EcalRecHit::outOfTimeChi2 | ( | ) | const |
Definition at line 34 of file EcalRecHit.cc.
References CaloRecHit::flags().
Referenced by BetaCalculatorECAL::addInfoToCandidate().
{ uint32_t rawChi2Prob = 0x7F & (flags()>>24); return (float)rawChi2Prob / (float)((1<<7)-1) * 64.; }
float EcalRecHit::outOfTimeEnergy | ( | ) | const |
Definition at line 40 of file EcalRecHit.cc.
References CaloRecHit::flags(), and funct::pow().
Referenced by BetaCalculatorECAL::addInfoToCandidate().
EcalRecHit::Flags EcalRecHit::recoFlag | ( | ) | const |
DEPRECATED provided for temporary backward compatibility.
Definition at line 133 of file EcalRecHit.cc.
References checkFlag(), i, kGood, and kUnknown.
Referenced by BetaCalculatorECAL::addInfoToCandidate(), HLTEcalResonanceFilter::checkStatusOfEcalRecHit(), and EgammaHLTNxNClusterProducer::checkStatusOfEcalRecHit().
void EcalRecHit::setChi2 | ( | float | chi2 | ) |
Definition at line 52 of file EcalRecHit.cc.
References CaloRecHit::flags(), and CaloRecHit::setFlags().
Referenced by EcalRecHitSimpleAlgo::makeRecHit().
void EcalRecHit::setFlag | ( | int | flag | ) | [inline] |
set the flags (from Flags or ESFlags)
Definition at line 98 of file EcalRecHit.h.
References flagBits_.
Referenced by ESRecHitAnalyticAlgo::reconstruct(), ESRecHitFitAlgo::reconstruct(), EcalRecHitWorkerRecover::run(), and EcalRecHitWorkerSimple::run().
void EcalRecHit::setOutOfTimeChi2 | ( | float | chi2 | ) |
Definition at line 77 of file EcalRecHit.cc.
References CaloRecHit::flags(), and CaloRecHit::setFlags().
void EcalRecHit::setOutOfTimeEnergy | ( | float | energy | ) |
Definition at line 62 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::setTimeError | ( | uint8_t | timeErrBits | ) |
Definition at line 88 of file EcalRecHit.cc.
References CaloRecHit::aux(), and CaloRecHit::setAux().
float EcalRecHit::timeError | ( | ) | const |
Definition at line 95 of file EcalRecHit.cc.
References CaloRecHit::aux(), and funct::pow().
Referenced by BetaCalculatorECAL::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.; }
void EcalRecHit::unsetFlag | ( | int | flag | ) | [inline] |
uint32_t EcalRecHit::flagBits_ [private] |
store rechit condition (see Flags enum) in a bit-wise way
Definition at line 113 of file EcalRecHit.h.
Referenced by checkFlag(), checkFlagMask(), setFlag(), and unsetFlag().