CMS 3D CMS Logo

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

#include <HGCUncalibratedRecHit.h>

Public Types

enum  Flags { kGood = -1, kPoorReco, kSaturated, kOutOfTime }
 
typedef DetId key_type
 

Public Member Functions

float amplitude () const
 
bool checkFlag (Flags flag) const
 
float chi2 () const
 
uint32_t flags () const
 
 HGCUncalibratedRecHit ()
 
 HGCUncalibratedRecHit (const DetId &detId, float ampl, float ped, float jit, float chi2, uint32_t flags=0, uint32_t aux=0)
 
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 ~HGCUncalibratedRecHit ()
 

Private Attributes

float amplitude_
 
uint32_t aux_
 
float chi2_
 
uint32_t flags_
 
DetId id_
 
float jitter_
 
float OOTamplitude_
 
float OOTchi2_
 
float pedestal_
 

Detailed Description

Definition at line 7 of file HGCUncalibratedRecHit.h.

Member Typedef Documentation

◆ key_type

Definition at line 9 of file HGCUncalibratedRecHit.h.

Member Enumeration Documentation

◆ Flags

Enumerator
kGood 
kPoorReco 
kSaturated 
kOutOfTime 

Definition at line 11 of file HGCUncalibratedRecHit.h.

11  {
12  kGood = -1, // channel is good (mutually exclusive with other states) setFlagBit(kGood) reset flags_ to zero
13  kPoorReco, // channel has been badly reconstructed (e.g. bad shape, bad chi2 etc.)
14  kSaturated, // saturated channel
15  kOutOfTime // channel out of time
16  };

Constructor & Destructor Documentation

◆ HGCUncalibratedRecHit() [1/2]

HGCUncalibratedRecHit::HGCUncalibratedRecHit ( )

Definition at line 4 of file HGCUncalibratedRecHit.cc.

5  : amplitude_(0.),
6  pedestal_(0.),
7  jitter_(0.),
8  chi2_(10000.),
9  OOTamplitude_(0.),
10  OOTchi2_(10000.),
11  flags_(0),
12  aux_(0) {}

◆ HGCUncalibratedRecHit() [2/2]

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

Definition at line 14 of file HGCUncalibratedRecHit.cc.

16  : amplitude_(ampl),
17  pedestal_(ped),
18  jitter_(jit),
19  chi2_(chi2),
20  OOTamplitude_(0.),
21  OOTchi2_(10000.),
22  flags_(flags),
23  aux_(aux),
24  id_(id) {}

◆ ~HGCUncalibratedRecHit()

HGCUncalibratedRecHit::~HGCUncalibratedRecHit ( )
virtual

Definition at line 26 of file HGCUncalibratedRecHit.cc.

26 {}

Member Function Documentation

◆ amplitude()

float HGCUncalibratedRecHit::amplitude ( ) const
inline

Definition at line 23 of file HGCUncalibratedRecHit.h.

23 { return amplitude_; }

References amplitude_.

Referenced by HGCalRecHitSimpleAlgo::makeRecHit(), and setAmplitude().

◆ checkFlag()

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

Definition at line 110 of file HGCUncalibratedRecHit.cc.

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

References RemoveAddSevLevel::flag, flags_, and kGood.

Referenced by isSaturated().

◆ chi2()

float HGCUncalibratedRecHit::chi2 ( void  ) const
inline

Definition at line 26 of file HGCUncalibratedRecHit.h.

26 { return chi2_; }

References chi2_.

Referenced by setChi2(), and setOutOfTimeChi2().

◆ flags()

uint32_t HGCUncalibratedRecHit::flags ( ) const
inline

Definition at line 30 of file HGCUncalibratedRecHit.h.

30 { return flags_; }

References flags_.

Referenced by setFlags().

◆ id()

DetId HGCUncalibratedRecHit::id ( ) const
inline

Definition at line 33 of file HGCUncalibratedRecHit.h.

33 { return id_; }

References id_.

Referenced by HGCalRecHitSimpleAlgo::makeRecHit(), HGCalRecHitWorkerSimple::run(), and setId().

◆ isJitterErrorValid()

bool HGCUncalibratedRecHit::isJitterErrorValid ( ) const

Definition at line 86 of file HGCUncalibratedRecHit.cc.

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

References isJitterValid(), and jitterError().

◆ isJitterValid()

bool HGCUncalibratedRecHit::isJitterValid ( ) const

Definition at line 79 of file HGCUncalibratedRecHit.cc.

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

References jitterError().

Referenced by isJitterErrorValid().

◆ isSaturated()

bool HGCUncalibratedRecHit::isSaturated ( ) const

Definition at line 28 of file HGCUncalibratedRecHit.cc.

References checkFlag(), and kSaturated.

◆ jitter()

float HGCUncalibratedRecHit::jitter ( ) const
inline

Definition at line 25 of file HGCUncalibratedRecHit.h.

25 { return jitter_; }

References jitter_.

Referenced by HGCalRecHitSimpleAlgo::makeRecHit(), and setJitter().

◆ jitterError()

float HGCUncalibratedRecHit::jitterError ( ) const

Definition at line 30 of file HGCUncalibratedRecHit.cc.

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

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

Referenced by isJitterErrorValid(), and isJitterValid().

◆ jitterErrorBits()

uint8_t HGCUncalibratedRecHit::jitterErrorBits ( ) const

Definition at line 95 of file HGCUncalibratedRecHit.cc.

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

References aux_.

Referenced by jitterError(), and setJitterError().

◆ outOfTimeChi2()

float HGCUncalibratedRecHit::outOfTimeChi2 ( ) const
inline

Definition at line 28 of file HGCUncalibratedRecHit.h.

28 { return OOTchi2_; }

References OOTchi2_.

◆ outOfTimeEnergy()

float HGCUncalibratedRecHit::outOfTimeEnergy ( ) const
inline

Definition at line 27 of file HGCUncalibratedRecHit.h.

27 { return OOTamplitude_; }

References OOTamplitude_.

◆ pedestal()

float HGCUncalibratedRecHit::pedestal ( ) const
inline

Definition at line 24 of file HGCUncalibratedRecHit.h.

24 { return pedestal_; }

References pedestal_.

Referenced by setPedestal().

◆ setAmplitude()

void HGCUncalibratedRecHit::setAmplitude ( float  amplitude)
inline

Definition at line 35 of file HGCUncalibratedRecHit.h.

35 { amplitude_ = amplitude; }

References amplitude(), and amplitude_.

◆ setAux()

void HGCUncalibratedRecHit::setAux ( uint32_t  aux)
inline

Definition at line 45 of file HGCUncalibratedRecHit.h.

45 { aux_ = aux; }

References printConversionInfo::aux, and aux_.

◆ setChi2()

void HGCUncalibratedRecHit::setChi2 ( float  chi2)
inline

Definition at line 38 of file HGCUncalibratedRecHit.h.

38 { chi2_ = chi2; }

References chi2(), and chi2_.

◆ setFlagBit()

void HGCUncalibratedRecHit::setFlagBit ( HGCUncalibratedRecHit::Flags  flag)

Definition at line 100 of file HGCUncalibratedRecHit.cc.

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

References RemoveAddSevLevel::flag, flags_, and kGood.

◆ setFlags()

void HGCUncalibratedRecHit::setFlags ( uint32_t  flags)
inline

Definition at line 43 of file HGCUncalibratedRecHit.h.

43 { flags_ = flags; }

References flags(), and flags_.

◆ setId()

void HGCUncalibratedRecHit::setId ( DetId  id)
inline

Definition at line 44 of file HGCUncalibratedRecHit.h.

44 { id_ = id; }

References id(), and id_.

◆ setJitter()

void HGCUncalibratedRecHit::setJitter ( float  jitter)
inline

Definition at line 37 of file HGCUncalibratedRecHit.h.

37 { jitter_ = jitter; }

References jitter(), and jitter_.

◆ setJitterError()

void HGCUncalibratedRecHit::setJitterError ( float  jitterErr)

Definition at line 46 of file HGCUncalibratedRecHit.cc.

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

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

◆ setOutOfTimeChi2()

void HGCUncalibratedRecHit::setOutOfTimeChi2 ( float  chi2)
inline

Definition at line 40 of file HGCUncalibratedRecHit.h.

40 { OOTchi2_ = chi2; }

References chi2(), and OOTchi2_.

◆ setOutOfTimeEnergy()

void HGCUncalibratedRecHit::setOutOfTimeEnergy ( float  energy)
inline

Definition at line 39 of file HGCUncalibratedRecHit.h.

39 { OOTamplitude_ = energy; }

References HCALHighEnergyHPDFilter_cfi::energy, and OOTamplitude_.

◆ setPedestal()

void HGCUncalibratedRecHit::setPedestal ( float  pedestal)
inline

Definition at line 36 of file HGCUncalibratedRecHit.h.

36 { pedestal_ = pedestal; }

References pedestal(), and pedestal_.

Member Data Documentation

◆ amplitude_

float HGCUncalibratedRecHit::amplitude_
private

Definition at line 54 of file HGCUncalibratedRecHit.h.

Referenced by amplitude(), and setAmplitude().

◆ aux_

uint32_t HGCUncalibratedRecHit::aux_
private

Definition at line 61 of file HGCUncalibratedRecHit.h.

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

◆ chi2_

float HGCUncalibratedRecHit::chi2_
private

Definition at line 57 of file HGCUncalibratedRecHit.h.

Referenced by chi2(), and setChi2().

◆ flags_

uint32_t HGCUncalibratedRecHit::flags_
private

Definition at line 60 of file HGCUncalibratedRecHit.h.

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

◆ id_

DetId HGCUncalibratedRecHit::id_
private

Definition at line 62 of file HGCUncalibratedRecHit.h.

Referenced by id(), and setId().

◆ jitter_

float HGCUncalibratedRecHit::jitter_
private

Definition at line 56 of file HGCUncalibratedRecHit.h.

Referenced by jitter(), and setJitter().

◆ OOTamplitude_

float HGCUncalibratedRecHit::OOTamplitude_
private

Definition at line 58 of file HGCUncalibratedRecHit.h.

Referenced by outOfTimeEnergy(), and setOutOfTimeEnergy().

◆ OOTchi2_

float HGCUncalibratedRecHit::OOTchi2_
private

Definition at line 59 of file HGCUncalibratedRecHit.h.

Referenced by outOfTimeChi2(), and setOutOfTimeChi2().

◆ pedestal_

float HGCUncalibratedRecHit::pedestal_
private

Definition at line 55 of file HGCUncalibratedRecHit.h.

Referenced by pedestal(), and setPedestal().

HGCUncalibratedRecHit::pedestal
float pedestal() const
Definition: HGCUncalibratedRecHit.h:24
HGCUncalibratedRecHit::flags_
uint32_t flags_
Definition: HGCUncalibratedRecHit.h:60
HGCUncalibratedRecHit::kSaturated
Definition: HGCUncalibratedRecHit.h:14
HGCUncalibratedRecHit::chi2
float chi2() const
Definition: HGCUncalibratedRecHit.h:26
HGCUncalibratedRecHit::kGood
Definition: HGCUncalibratedRecHit.h:12
HGCUncalibratedRecHit::flags
uint32_t flags() const
Definition: HGCUncalibratedRecHit.h:30
HGCUncalibratedRecHit::isJitterValid
bool isJitterValid() const
Definition: HGCUncalibratedRecHit.cc:79
HGCUncalibratedRecHit::amplitude_
float amplitude_
Definition: HGCUncalibratedRecHit.h:54
HGCUncalibratedRecHit::checkFlag
bool checkFlag(Flags flag) const
Definition: HGCUncalibratedRecHit.cc:110
HGCUncalibratedRecHit::OOTamplitude_
float OOTamplitude_
Definition: HGCUncalibratedRecHit.h:58
HGCUncalibratedRecHit::id_
DetId id_
Definition: HGCUncalibratedRecHit.h:62
HLT_FULL_cff.exponent
exponent
Definition: HLT_FULL_cff.py:52788
HGCUncalibratedRecHit::id
DetId id() const
Definition: HGCUncalibratedRecHit.h:33
HGCUncalibratedRecHit::jitter
float jitter() const
Definition: HGCUncalibratedRecHit.h:25
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
HGCUncalibratedRecHit::OOTchi2_
float OOTchi2_
Definition: HGCUncalibratedRecHit.h:59
HGCUncalibratedRecHit::chi2_
float chi2_
Definition: HGCUncalibratedRecHit.h:57
HGCUncalibratedRecHit::jitterErrorBits
uint8_t jitterErrorBits() const
Definition: HGCUncalibratedRecHit.cc:95
printConversionInfo.aux
aux
Definition: printConversionInfo.py:19
createfilelist.int
int
Definition: createfilelist.py:10
HGCUncalibratedRecHit::pedestal_
float pedestal_
Definition: HGCUncalibratedRecHit.h:55
HGCUncalibratedRecHit::kPoorReco
Definition: HGCUncalibratedRecHit.h:13
HGCUncalibratedRecHit::amplitude
float amplitude() const
Definition: HGCUncalibratedRecHit.h:23
HGCUncalibratedRecHit::aux_
uint32_t aux_
Definition: HGCUncalibratedRecHit.h:61
HGCUncalibratedRecHit::jitter_
float jitter_
Definition: HGCUncalibratedRecHit.h:56
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
HGCUncalibratedRecHit::kOutOfTime
Definition: HGCUncalibratedRecHit.h:15
HGCUncalibratedRecHit::jitterError
float jitterError() const
Definition: HGCUncalibratedRecHit.cc:30
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116