#include <EcalUncalibratedRecHit.h>
Public Types | |
enum | Flags { kGood = -1, kPoorReco, kSaturated, kOutOfTime, kLeadingEdgeRecovered, kHasSwitchToGain6, kHasSwitchToGain1 } |
typedef DetId | key_type |
Public Member Functions | |
float | amplitude () const |
bool | checkFlag (Flags flag) const |
float | chi2 () const |
EcalUncalibratedRecHit () | |
EcalUncalibratedRecHit (const DetId &detId, float ampl, float ped, float jit, float chi2, uint32_t flags=0, uint32_t aux=0) | |
uint32_t | flags () const |
DetId | id () const |
bool | isJitterErrorValid () const |
bool | isJitterValid () const |
bool | isSaturated () const |
float | jitter () const |
float | jitterError () const |
uint8_t | jitterErrorBits () const |
float | outOfTimeChi2 () const |
float | outOfTimeEnergy () const |
float | pedestal () const |
void | setAmplitude (float amplitude) |
void | setAux (uint32_t aux) |
void | setChi2 (float chi2) |
void | setFlagBit (Flags flag) |
void | setFlags (uint32_t flags) |
void | setId (DetId id) |
void | setJitter (float jitter) |
void | setJitterError (float jitterErr) |
void | setOutOfTimeChi2 (float chi2) |
void | setOutOfTimeEnergy (float energy) |
void | setPedestal (float pedestal) |
virtual | ~EcalUncalibratedRecHit () |
Private Attributes | |
float | amplitude_ |
uint32_t | aux_ |
float | chi2_ |
uint32_t | flags_ |
DetId | id_ |
float | jitter_ |
float | OOTamplitude_ |
float | OOTchi2_ |
float | pedestal_ |
Definition at line 7 of file EcalUncalibratedRecHit.h.
Definition at line 11 of file EcalUncalibratedRecHit.h.
kGood | |
kPoorReco | |
kSaturated | |
kOutOfTime | |
kLeadingEdgeRecovered | |
kHasSwitchToGain6 | |
kHasSwitchToGain1 |
Definition at line 13 of file EcalUncalibratedRecHit.h.
{ kGood=-1, // channel is good (mutually exclusive with other states) setFlagBit(kGood) reset flags_ to zero kPoorReco, // channel has been badly reconstructed (e.g. bad shape, bad chi2 etc.) kSaturated, // saturated channel kOutOfTime, // channel out of time kLeadingEdgeRecovered, // saturated channel: energy estimated from the leading edge before saturation kHasSwitchToGain6, // at least one data frame is in G6 kHasSwitchToGain1 // at least one data frame is in G1 };
EcalUncalibratedRecHit::EcalUncalibratedRecHit | ( | ) |
Definition at line 5 of file EcalUncalibratedRecHit.cc.
: amplitude_(0.), pedestal_(0.), jitter_(0.), chi2_(10000.), OOTamplitude_(0.), OOTchi2_(10000.), flags_(0), aux_(0) { }
EcalUncalibratedRecHit::EcalUncalibratedRecHit | ( | const DetId & | detId, |
float | ampl, | ||
float | ped, | ||
float | jit, | ||
float | chi2, | ||
uint32_t | flags = 0 , |
||
uint32_t | aux = 0 |
||
) |
Definition at line 8 of file EcalUncalibratedRecHit.cc.
EcalUncalibratedRecHit::~EcalUncalibratedRecHit | ( | ) | [virtual] |
Definition at line 12 of file EcalUncalibratedRecHit.cc.
{ }
float EcalUncalibratedRecHit::amplitude | ( | ) | const [inline] |
Definition at line 29 of file EcalUncalibratedRecHit.h.
References amplitude_.
Referenced by EcalURecHitHists::analyze(), EcalPulseShapeGrapher::analyze(), EcalSimpleUncalibRecHitFilter::hltFilter(), CosmicClusterAlgo::makeCluster(), CosmicClusterAlgo::makeClusters(), EcalRecHitSimpleAlgo::makeRecHit(), EcalTBWeightUncalibRecHitProducer::produce(), EcalUncalibRecHitWorkerAnalFit::run(), and setAmplitude().
{ return amplitude_; }
bool EcalUncalibratedRecHit::checkFlag | ( | EcalUncalibratedRecHit::Flags | flag | ) | const |
Definition at line 110 of file EcalUncalibratedRecHit.cc.
Referenced by isSaturated(), and EcalRecHitSimpleAlgo::makeRecHit().
float EcalUncalibratedRecHit::chi2 | ( | void | ) | const [inline] |
Definition at line 32 of file EcalUncalibratedRecHit.h.
References chi2_.
Referenced by EcalRecHitSimpleAlgo::makeRecHit(), setChi2(), and setOutOfTimeChi2().
{ return chi2_; }
uint32_t EcalUncalibratedRecHit::flags | ( | ) | const [inline] |
Definition at line 36 of file EcalUncalibratedRecHit.h.
References flags_.
Referenced by EcalRecHitWorkerRecover::run(), and setFlags().
{ return flags_; }
DetId EcalUncalibratedRecHit::id | ( | void | ) | const [inline] |
Definition at line 39 of file EcalUncalibratedRecHit.h.
References id_.
Referenced by EcalURecHitHists::analyze(), EcalPulseShapeGrapher::analyze(), EcalSimpleUncalibRecHitFilter::hltFilter(), CosmicClusterAlgo::makeCluster(), EcalRecHitSimpleAlgo::makeRecHit(), EcalRecHitWorkerRecover::run(), EcalRecHitWorkerSimple::run(), and setId().
{ return id_; }
bool EcalUncalibratedRecHit::isJitterErrorValid | ( | ) | const |
Definition at line 81 of file EcalUncalibratedRecHit.cc.
References isJitterValid(), and jitterError().
{ if(!isJitterValid()) return false; if(jitterError() >= 10000) return false; return true; }
bool EcalUncalibratedRecHit::isJitterValid | ( | ) | const |
Definition at line 73 of file EcalUncalibratedRecHit.cc.
References jitterError().
Referenced by isJitterErrorValid().
{ if(jitterError() <= 0) return false; else return true; }
bool EcalUncalibratedRecHit::isSaturated | ( | ) | const |
Definition at line 15 of file EcalUncalibratedRecHit.cc.
References checkFlag(), and kSaturated.
Referenced by EcalRecHitSimpleAlgo::makeRecHit().
{ return EcalUncalibratedRecHit::checkFlag(kSaturated); }
float EcalUncalibratedRecHit::jitter | ( | ) | const [inline] |
Definition at line 31 of file EcalUncalibratedRecHit.h.
References jitter_.
Referenced by EcalURecHitHists::analyze(), EcalRecHitSimpleAlgo::makeRecHit(), and setJitter().
{ return jitter_; }
float EcalUncalibratedRecHit::jitterError | ( | ) | const |
Definition at line 20 of file EcalUncalibratedRecHit.cc.
References aux_, jitterErrorBits(), and funct::pow().
Referenced by isJitterErrorValid(), and isJitterValid().
{ // stored in ps, but return BXs to match with jitter units uint32_t jitterErrorBits = 0xFF & aux_; // all bits off --> time reco bailed out (return negative value) if( (0xFF & jitterErrorBits) == 0x00) return -1; // all bits on --> time error over 5 ns (return large value) if( (0xFF & jitterErrorBits) == 0xFF) return 10000; float LSB = 1.26008; uint8_t exponent = jitterErrorBits>>5; uint8_t significand = jitterErrorBits & ~(0x7<<5); return (float)(pow(2.,exponent)*significand*LSB)/(25.*1000); }
uint8_t EcalUncalibratedRecHit::jitterErrorBits | ( | ) | const |
Definition at line 91 of file EcalUncalibratedRecHit.cc.
References aux_.
Referenced by jitterError(), EcalRecHitSimpleAlgo::makeRecHit(), and setJitterError().
{ uint8_t jitterErrorBits = 0xFF & aux_; return jitterErrorBits; }
float EcalUncalibratedRecHit::outOfTimeChi2 | ( | ) | const [inline] |
Definition at line 34 of file EcalUncalibratedRecHit.h.
References OOTchi2_.
Referenced by EcalRecHitSimpleAlgo::makeRecHit().
{ return OOTchi2_; }
float EcalUncalibratedRecHit::outOfTimeEnergy | ( | ) | const [inline] |
Definition at line 33 of file EcalUncalibratedRecHit.h.
References OOTamplitude_.
Referenced by EcalRecHitSimpleAlgo::makeRecHit().
{ return OOTamplitude_; }
float EcalUncalibratedRecHit::pedestal | ( | ) | const [inline] |
Definition at line 30 of file EcalUncalibratedRecHit.h.
References pedestal_.
Referenced by setPedestal().
{ return pedestal_; }
void EcalUncalibratedRecHit::setAmplitude | ( | float | amplitude | ) | [inline] |
Definition at line 41 of file EcalUncalibratedRecHit.h.
References amplitude(), and amplitude_.
Referenced by EcalUncalibRecHitWorkerRatio::run().
{ amplitude_ = amplitude; }
void EcalUncalibratedRecHit::setAux | ( | uint32_t | aux | ) | [inline] |
Definition at line 51 of file EcalUncalibratedRecHit.h.
References printConversionInfo::aux, and aux_.
void EcalUncalibratedRecHit::setChi2 | ( | float | chi2 | ) | [inline] |
void EcalUncalibratedRecHit::setFlagBit | ( | EcalUncalibratedRecHit::Flags | flag | ) |
Definition at line 98 of file EcalUncalibratedRecHit.cc.
Referenced by EcalUncalibRecHitWorkerGlobal::run().
void EcalUncalibratedRecHit::setFlags | ( | uint32_t | flags | ) | [inline] |
void EcalUncalibratedRecHit::setId | ( | DetId | id | ) | [inline] |
void EcalUncalibratedRecHit::setJitter | ( | float | jitter | ) | [inline] |
Definition at line 43 of file EcalUncalibratedRecHit.h.
References jitter(), and jitter_.
Referenced by EcalUncalibRecHitWorkerRatio::run().
void EcalUncalibratedRecHit::setJitterError | ( | float | jitterErr | ) |
Definition at line 37 of file EcalUncalibratedRecHit.cc.
References aux_, jitterErrorBits(), and funct::pow().
Referenced by EcalUncalibRecHitWorkerRatio::run().
{ // use 8 bits (3 exp, 5 mant) and store in ps // has range of 5 ps - 5000 ps // expect input in BX units // all bits off --> time reco bailed out if(jitterErr < 0) { aux_ = (~0xFF & aux_); return; } // all bits on --> time error over 5 ns if(25*jitterErr >= 5) { aux_ = (0xFF | aux_); return; } float LSB = 1.26008; float quantityInLSB = (1000*25*jitterErr)/LSB; int log2OfQuantity = (int) (log2( quantityInLSB )); int exponentTmp = log2OfQuantity - 4; uint8_t exponent=0; if (exponentTmp>0) exponent = exponentTmp; uint8_t significand = (int) ( lround( quantityInLSB / pow(2.,exponent) ) ); uint32_t jitterErrorBits = exponent<<5 | significand; if( (0xFF & jitterErrorBits) == 0xFF) jitterErrorBits = 0xFE; if( (0xFF & jitterErrorBits) == 0x00) jitterErrorBits = 0x01; aux_ = (~0xFF & aux_) | (jitterErrorBits & 0xFF); }
void EcalUncalibratedRecHit::setOutOfTimeChi2 | ( | float | chi2 | ) | [inline] |
void EcalUncalibratedRecHit::setOutOfTimeEnergy | ( | float | energy | ) | [inline] |
Definition at line 45 of file EcalUncalibratedRecHit.h.
References relval_parameters_module::energy, and OOTamplitude_.
{ OOTamplitude_ = energy; }
void EcalUncalibratedRecHit::setPedestal | ( | float | pedestal | ) | [inline] |
Definition at line 42 of file EcalUncalibratedRecHit.h.
References pedestal(), and pedestal_.
float EcalUncalibratedRecHit::amplitude_ [private] |
Definition at line 60 of file EcalUncalibratedRecHit.h.
Referenced by amplitude(), and setAmplitude().
uint32_t EcalUncalibratedRecHit::aux_ [private] |
Definition at line 67 of file EcalUncalibratedRecHit.h.
Referenced by jitterError(), jitterErrorBits(), setAux(), and setJitterError().
float EcalUncalibratedRecHit::chi2_ [private] |
Definition at line 63 of file EcalUncalibratedRecHit.h.
uint32_t EcalUncalibratedRecHit::flags_ [private] |
Definition at line 66 of file EcalUncalibratedRecHit.h.
Referenced by checkFlag(), flags(), setFlagBit(), and setFlags().
DetId EcalUncalibratedRecHit::id_ [private] |
Definition at line 68 of file EcalUncalibratedRecHit.h.
float EcalUncalibratedRecHit::jitter_ [private] |
Definition at line 62 of file EcalUncalibratedRecHit.h.
Referenced by jitter(), and setJitter().
float EcalUncalibratedRecHit::OOTamplitude_ [private] |
Definition at line 64 of file EcalUncalibratedRecHit.h.
Referenced by outOfTimeEnergy(), and setOutOfTimeEnergy().
float EcalUncalibratedRecHit::OOTchi2_ [private] |
Definition at line 65 of file EcalUncalibratedRecHit.h.
Referenced by outOfTimeChi2(), and setOutOfTimeChi2().
float EcalUncalibratedRecHit::pedestal_ [private] |
Definition at line 61 of file EcalUncalibratedRecHit.h.
Referenced by pedestal(), and setPedestal().