CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
EcalUncalibratedRecHit Class Reference

#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
 
float amplitudeError () const
 
bool checkFlag (Flags flag) const
 
float chi2 () const
 
 EcalUncalibratedRecHit ()
 
 EcalUncalibratedRecHit (const DetId &id, 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 outOfTimeAmplitude (int bx) const
 
float pedestal () const
 
void setAmplitude (float amplitude)
 
void setAmplitudeError (float amplitudeerror)
 
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 setOutOfTimeAmplitude (int bx, float amplitude)
 
void setPedestal (float pedestal)
 

Private Attributes

float amplitude_
 
float amplitudeError_
 
uint32_t aux_
 
float chi2_
 
uint32_t flags_
 
DetId id_
 
float jitter_
 
float OOTamplitudes_ [EcalDataFrame::MAXSAMPLES]
 
float OOTchi2_
 
float pedestal_
 

Detailed Description

Definition at line 8 of file EcalUncalibratedRecHit.h.

Member Typedef Documentation

◆ key_type

Definition at line 10 of file EcalUncalibratedRecHit.h.

Member Enumeration Documentation

◆ Flags

Enumerator
kGood 
kPoorReco 
kSaturated 
kOutOfTime 
kLeadingEdgeRecovered 
kHasSwitchToGain6 
kHasSwitchToGain1 

Definition at line 12 of file EcalUncalibratedRecHit.h.

12  {
13  kGood = -1, // channel is good (mutually exclusive with other states) setFlagBit(kGood) reset flags_ to zero
14  kPoorReco, // channel has been badly reconstructed (e.g. bad shape, bad chi2 etc.)
15  kSaturated, // saturated channel
16  kOutOfTime, // channel out of time
17  kLeadingEdgeRecovered, // saturated channel: energy estimated from the leading edge before saturation
18  kHasSwitchToGain6, // at least one data frame is in G6
19  kHasSwitchToGain1 // at least one data frame is in G1
20 
21  };

Constructor & Destructor Documentation

◆ EcalUncalibratedRecHit() [1/2]

EcalUncalibratedRecHit::EcalUncalibratedRecHit ( )

Definition at line 5 of file EcalUncalibratedRecHit.cc.

6  : amplitude_(0.), amplitudeError_(0.), pedestal_(0.), jitter_(0.), chi2_(10000.), flags_(0), aux_(0) {
7  const unsigned int nsample = EcalDataFrame::MAXSAMPLES;
8  for (unsigned int ibx = 0; ibx < nsample; ++ibx)
9  OOTamplitudes_[ibx] = 0.;
10 }

References EcalDataFrame::MAXSAMPLES, and OOTamplitudes_.

◆ EcalUncalibratedRecHit() [2/2]

EcalUncalibratedRecHit::EcalUncalibratedRecHit ( const DetId id,
float  ampl,
float  ped,
float  jit,
float  chi2,
uint32_t  flags = 0,
uint32_t  aux = 0 
)

Definition at line 12 of file EcalUncalibratedRecHit.cc.

14  : amplitude_(ampl),
15  amplitudeError_(0.),
16  pedestal_(ped),
17  jitter_(jit),
18  chi2_(chi2),
19  flags_(flags),
20  aux_(aux),
21  id_(id) {
22  const unsigned int nsample = EcalDataFrame::MAXSAMPLES;
23  for (unsigned int ibx = 0; ibx < nsample; ++ibx)
24  OOTamplitudes_[ibx] = 0.;
25 }

References EcalDataFrame::MAXSAMPLES, and OOTamplitudes_.

Member Function Documentation

◆ amplitude()

float EcalUncalibratedRecHit::amplitude ( ) const
inline

◆ amplitudeError()

float EcalUncalibratedRecHit::amplitudeError ( ) const
inline

Definition at line 29 of file EcalUncalibratedRecHit.h.

29 { return amplitudeError_; }

References amplitudeError_.

Referenced by EcalRecHitSimpleAlgo::makeRecHit().

◆ checkFlag()

bool EcalUncalibratedRecHit::checkFlag ( EcalUncalibratedRecHit::Flags  flag) const

Definition at line 109 of file EcalUncalibratedRecHit.cc.

109  {
110  if (flag == kGood) {
111  if (!flags_)
112  return true;
113  else
114  return false;
115  } // if all flags are unset, then hit is good
116  return flags_ & (0x1 << flag);
117 }

References RemoveAddSevLevel::flag, flags_, and kGood.

Referenced by isSaturated(), and EcalRecHitSimpleAlgo::makeRecHit().

◆ chi2()

float EcalUncalibratedRecHit::chi2 ( void  ) const
inline

Definition at line 32 of file EcalUncalibratedRecHit.h.

32 { return chi2_; }

References chi2_.

Referenced by EcalRecHitSimpleAlgo::makeRecHit(), and setChi2().

◆ flags()

uint32_t EcalUncalibratedRecHit::flags ( ) const
inline

Definition at line 35 of file EcalUncalibratedRecHit.h.

35 { return flags_; }

References flags_.

Referenced by EcalRecHitWorkerRecover::run(), and setFlags().

◆ id()

DetId EcalUncalibratedRecHit::id ( ) const
inline

◆ isJitterErrorValid()

bool EcalUncalibratedRecHit::isJitterErrorValid ( ) const

Definition at line 85 of file EcalUncalibratedRecHit.cc.

85  {
86  if (!isJitterValid())
87  return false;
88  if (jitterError() >= 10000)
89  return false;
90 
91  return true;
92 }

References isJitterValid(), and jitterError().

◆ isJitterValid()

bool EcalUncalibratedRecHit::isJitterValid ( ) const

Definition at line 78 of file EcalUncalibratedRecHit.cc.

78  {
79  if (jitterError() <= 0)
80  return false;
81  else
82  return true;
83 }

References jitterError().

Referenced by isJitterErrorValid().

◆ isSaturated()

bool EcalUncalibratedRecHit::isSaturated ( ) const

Definition at line 27 of file EcalUncalibratedRecHit.cc.

References checkFlag(), and kSaturated.

Referenced by EcalRecHitSimpleAlgo::makeRecHit().

◆ jitter()

float EcalUncalibratedRecHit::jitter ( ) const
inline

Definition at line 31 of file EcalUncalibratedRecHit.h.

31 { return jitter_; }

References jitter_.

Referenced by EcalRecHitSimpleAlgo::makeRecHit(), EcalUncalibRecHitWorkerGlobal::run(), and setJitter().

◆ jitterError()

float EcalUncalibratedRecHit::jitterError ( ) const

Definition at line 29 of file EcalUncalibratedRecHit.cc.

29  {
30  // stored in ps, but return BXs to match with jitter units
31  uint32_t jitterErrorBits = 0xFF & aux_;
32  // all bits off --> time reco bailed out (return negative value)
33  if ((0xFF & jitterErrorBits) == 0x00)
34  return -1;
35  // all bits on --> time error over 5 ns (return large value)
36  if ((0xFF & jitterErrorBits) == 0xFF)
37  return 10000;
38 
39  float LSB = 1.26008;
40  uint8_t exponent = jitterErrorBits >> 5;
41  uint8_t significand = jitterErrorBits & ~(0x7 << 5);
42  return (float)(std::pow(2, exponent) * significand * LSB) / (25. * 1000);
43 }

References aux_, HLT_FULL_cff::exponent, jitterErrorBits(), and funct::pow().

Referenced by isJitterErrorValid(), and isJitterValid().

◆ jitterErrorBits()

uint8_t EcalUncalibratedRecHit::jitterErrorBits ( ) const

Definition at line 94 of file EcalUncalibratedRecHit.cc.

94  {
95  uint8_t jitterErrorBits = 0xFF & aux_;
96  return jitterErrorBits;
97 }

References aux_.

Referenced by jitterError(), EcalRecHitSimpleAlgo::makeRecHit(), and setJitterError().

◆ outOfTimeAmplitude()

float EcalUncalibratedRecHit::outOfTimeAmplitude ( int  bx) const
inline

Definition at line 33 of file EcalUncalibratedRecHit.h.

33 { return OOTamplitudes_[bx]; }

References l1GtPatternGenerator_cfi::bx, and OOTamplitudes_.

◆ pedestal()

float EcalUncalibratedRecHit::pedestal ( ) const
inline

Definition at line 30 of file EcalUncalibratedRecHit.h.

30 { return pedestal_; }

References pedestal_.

Referenced by setPedestal().

◆ setAmplitude()

void EcalUncalibratedRecHit::setAmplitude ( float  amplitude)
inline

Definition at line 40 of file EcalUncalibratedRecHit.h.

40 { amplitude_ = amplitude; }

References amplitude(), and amplitude_.

Referenced by EcalUncalibRecHitWorkerRatio::run().

◆ setAmplitudeError()

void EcalUncalibratedRecHit::setAmplitudeError ( float  amplitudeerror)
inline

Definition at line 41 of file EcalUncalibratedRecHit.h.

41 { amplitudeError_ = amplitudeerror; }

References amplitudeError_.

Referenced by EcalUncalibRecHitMultiFitAlgo::makeRecHit().

◆ setAux()

void EcalUncalibratedRecHit::setAux ( uint32_t  aux)
inline

Definition at line 50 of file EcalUncalibratedRecHit.h.

50 { aux_ = aux; }

References printConversionInfo::aux, and aux_.

◆ setChi2()

void EcalUncalibratedRecHit::setChi2 ( float  chi2)
inline

Definition at line 44 of file EcalUncalibratedRecHit.h.

44 { chi2_ = chi2; }

References chi2(), and chi2_.

Referenced by EcalUncalibRecHitWorkerGlobal::run().

◆ setFlagBit()

void EcalUncalibratedRecHit::setFlagBit ( EcalUncalibratedRecHit::Flags  flag)

Definition at line 99 of file EcalUncalibratedRecHit.cc.

99  {
100  if (flag == kGood) {
101  //then set all bits to zero;
102  flags_ = 0;
103  return;
104  }
105  // else set the flagbit
106  flags_ |= 0x1 << flag;
107 }

References RemoveAddSevLevel::flag, flags_, and kGood.

Referenced by EcalUncalibRecHitWorkerWeights::run(), and EcalUncalibRecHitWorkerGlobal::run().

◆ setFlags()

void EcalUncalibratedRecHit::setFlags ( uint32_t  flags)
inline

Definition at line 48 of file EcalUncalibratedRecHit.h.

48 { flags_ = flags; }

References flags(), and flags_.

◆ setId()

void EcalUncalibratedRecHit::setId ( DetId  id)
inline

Definition at line 49 of file EcalUncalibratedRecHit.h.

49 { id_ = id; }

References id(), and id_.

◆ setJitter()

void EcalUncalibratedRecHit::setJitter ( float  jitter)
inline

Definition at line 43 of file EcalUncalibratedRecHit.h.

43 { jitter_ = jitter; }

References jitter(), and jitter_.

Referenced by EcalUncalibRecHitWorkerRatio::run(), and EcalUncalibRecHitWorkerGlobal::run().

◆ setJitterError()

void EcalUncalibratedRecHit::setJitterError ( float  jitterErr)

Definition at line 45 of file EcalUncalibratedRecHit.cc.

45  {
46  // use 8 bits (3 exp, 5 mant) and store in ps
47  // has range of 5 ps - 5000 ps
48  // expect input in BX units
49  // all bits off --> time reco bailed out
50  if (jitterErr <= 0) {
51  aux_ = (~0xFF & aux_);
52  return;
53  }
54  // all bits on --> time error over 5 ns
55  if (25 * jitterErr >= 5) {
56  aux_ = (0xFF | aux_);
57  return;
58  }
59 
60  float LSB = 1.26008;
61  float quantityInLSB = (1000 * 25 * jitterErr) / LSB;
62  int log2OfQuantity = (int)(log2(quantityInLSB));
63  int exponentTmp = log2OfQuantity - 4;
64  uint8_t exponent = 0;
65  if (exponentTmp > 0)
66  exponent = exponentTmp;
67  uint8_t significand = (int)(std::lround(quantityInLSB / std::pow(2, exponent)));
68  uint32_t jitterErrorBits = exponent << 5 | significand;
69 
70  if ((0xFF & jitterErrorBits) == 0xFF)
71  jitterErrorBits = 0xFE;
72  if ((0xFF & jitterErrorBits) == 0x00)
73  jitterErrorBits = 0x01;
74 
75  aux_ = (~0xFF & aux_) | (jitterErrorBits & 0xFF);
76 }

References aux_, HLT_FULL_cff::exponent, createfilelist::int, jitterErrorBits(), and funct::pow().

Referenced by EcalUncalibRecHitWorkerRatio::run(), and EcalUncalibRecHitWorkerGlobal::run().

◆ setOutOfTimeAmplitude()

void EcalUncalibratedRecHit::setOutOfTimeAmplitude ( int  bx,
float  amplitude 
)
inline

◆ setPedestal()

void EcalUncalibratedRecHit::setPedestal ( float  pedestal)
inline

Definition at line 42 of file EcalUncalibratedRecHit.h.

42 { pedestal_ = pedestal; }

References pedestal(), and pedestal_.

Member Data Documentation

◆ amplitude_

float EcalUncalibratedRecHit::amplitude_
private

Definition at line 59 of file EcalUncalibratedRecHit.h.

Referenced by amplitude(), and setAmplitude().

◆ amplitudeError_

float EcalUncalibratedRecHit::amplitudeError_
private

Definition at line 60 of file EcalUncalibratedRecHit.h.

Referenced by amplitudeError(), and setAmplitudeError().

◆ aux_

uint32_t EcalUncalibratedRecHit::aux_
private

Definition at line 68 of file EcalUncalibratedRecHit.h.

Referenced by jitterError(), jitterErrorBits(), setAux(), and setJitterError().

◆ chi2_

float EcalUncalibratedRecHit::chi2_
private

Definition at line 63 of file EcalUncalibratedRecHit.h.

Referenced by chi2(), and setChi2().

◆ flags_

uint32_t EcalUncalibratedRecHit::flags_
private

Definition at line 67 of file EcalUncalibratedRecHit.h.

Referenced by checkFlag(), flags(), setFlagBit(), and setFlags().

◆ id_

DetId EcalUncalibratedRecHit::id_
private

Definition at line 69 of file EcalUncalibratedRecHit.h.

Referenced by id(), and setId().

◆ jitter_

float EcalUncalibratedRecHit::jitter_
private

Definition at line 62 of file EcalUncalibratedRecHit.h.

Referenced by jitter(), and setJitter().

◆ OOTamplitudes_

float EcalUncalibratedRecHit::OOTamplitudes_[EcalDataFrame::MAXSAMPLES]
private

◆ OOTchi2_

float EcalUncalibratedRecHit::OOTchi2_
private

Definition at line 66 of file EcalUncalibratedRecHit.h.

◆ pedestal_

float EcalUncalibratedRecHit::pedestal_
private

Definition at line 61 of file EcalUncalibratedRecHit.h.

Referenced by pedestal(), and setPedestal().

EcalDataFrame::MAXSAMPLES
static constexpr int MAXSAMPLES
Definition: EcalDataFrame.h:48
EcalUncalibratedRecHit::kHasSwitchToGain6
Definition: EcalUncalibratedRecHit.h:18
EcalUncalibratedRecHit::amplitude
float amplitude() const
Definition: EcalUncalibratedRecHit.h:28
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
EcalUncalibratedRecHit::jitterError
float jitterError() const
Definition: EcalUncalibratedRecHit.cc:29
EcalUncalibratedRecHit::jitterErrorBits
uint8_t jitterErrorBits() const
Definition: EcalUncalibratedRecHit.cc:94
EcalUncalibratedRecHit::id_
DetId id_
Definition: EcalUncalibratedRecHit.h:69
EcalUncalibratedRecHit::kGood
Definition: EcalUncalibratedRecHit.h:13
EcalUncalibratedRecHit::amplitude_
float amplitude_
Definition: EcalUncalibratedRecHit.h:59
EcalUncalibratedRecHit::amplitudeError_
float amplitudeError_
Definition: EcalUncalibratedRecHit.h:60
EcalUncalibratedRecHit::pedestal_
float pedestal_
Definition: EcalUncalibratedRecHit.h:61
EcalUncalibratedRecHit::kPoorReco
Definition: EcalUncalibratedRecHit.h:14
EcalUncalibratedRecHit::isJitterValid
bool isJitterValid() const
Definition: EcalUncalibratedRecHit.cc:78
EcalUncalibratedRecHit::kLeadingEdgeRecovered
Definition: EcalUncalibratedRecHit.h:17
EcalUncalibratedRecHit::kOutOfTime
Definition: EcalUncalibratedRecHit.h:16
HLT_FULL_cff.exponent
exponent
Definition: HLT_FULL_cff.py:52824
EcalUncalibratedRecHit::chi2_
float chi2_
Definition: EcalUncalibratedRecHit.h:63
EcalUncalibratedRecHit::aux_
uint32_t aux_
Definition: EcalUncalibratedRecHit.h:68
EcalUncalibratedRecHit::id
DetId id() const
Definition: EcalUncalibratedRecHit.h:38
EcalUncalibratedRecHit::pedestal
float pedestal() const
Definition: EcalUncalibratedRecHit.h:30
EcalUncalibratedRecHit::checkFlag
bool checkFlag(Flags flag) const
Definition: EcalUncalibratedRecHit.cc:109
printConversionInfo.aux
aux
Definition: printConversionInfo.py:19
createfilelist.int
int
Definition: createfilelist.py:10
EcalUncalibratedRecHit::flags_
uint32_t flags_
Definition: EcalUncalibratedRecHit.h:67
EcalUncalibratedRecHit::chi2
float chi2() const
Definition: EcalUncalibratedRecHit.h:32
EcalUncalibratedRecHit::jitter_
float jitter_
Definition: EcalUncalibratedRecHit.h:62
EcalUncalibratedRecHit::kSaturated
Definition: EcalUncalibratedRecHit.h:15
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
EcalUncalibratedRecHit::jitter
float jitter() const
Definition: EcalUncalibratedRecHit.h:31
EcalUncalibratedRecHit::kHasSwitchToGain1
Definition: EcalUncalibratedRecHit.h:19
EcalUncalibratedRecHit::flags
uint32_t flags() const
Definition: EcalUncalibratedRecHit.h:35
EcalUncalibratedRecHit::OOTamplitudes_
float OOTamplitudes_[EcalDataFrame::MAXSAMPLES]
Definition: EcalUncalibratedRecHit.h:65
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117