CMS 3D CMS Logo

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

#include <HGCRecHit.h>

Inheritance diagram for HGCRecHit:
CaloRecHit

Public Types

enum  Flags {
  kGood = 0, kPoorReco, kOutOfTime, kFaultyHardware,
  kNoisy, kPoorCalib, kSaturated, kDead,
  kKilled, kWeird, kDiWeird, kUnknown
}
 
enum  HFNoseFlags {
  kHFNoseGood, kHFNosePoorReco, kHFNoseOutOfTime, kHFNoseFaultyHardware,
  kHFNoseNoisy, kHFNosePoorCalib, kHFNoseSaturated, kHFNoseDead,
  kHFNoseKilled, kHFNoseWeird, kHFNoseDiWeird, kHFNoseUnknown
}
 
enum  HGCbheFlags {
  kHGCbheGood, kHGCbheDead, kHGCbheHot, kHGCbhePassBX,
  kHGCbheSaturated
}
 
enum  HGCfheFlags {
  kHGCfheGood, kHGCfheDead, kHGCfheHot, kHGCfhePassBX,
  kHGCfheSaturated
}
 
typedef DetId key_type
 

Public Member Functions

bool checkFlag (int flag) const
 check if the flag is true More...
 
bool checkFlags (const std::vector< int > &flagsvec) const
 check if one of the flags in a set is true More...
 
float chi2 () const
 
uint32_t flagBits () const
 
 HGCRecHit ()
 
 HGCRecHit (const DetId &id, float energy, float time, uint32_t flags=0, uint32_t flagBits=0, uint8_t son=0, float timeError=0.f)
 
DetId id () const
 get the id More...
 
bool isTimeErrorValid () const
 
bool isTimeValid () const
 
float outOfTimeChi2 () const
 
float outOfTimeEnergy () const
 
void setChi2 (float chi2)
 
void setFlag (int flag)
 set the flags (from Flags or ESFlags) More...
 
void setOutOfTimeChi2 (float chi2)
 
void setOutOfTimeEnergy (float energy)
 
void setSignalOverSigmaNoise (float sOverNoise)
 
void setTimeError (float timeErr)
 
float signalOverSigmaNoise () const
 
float timeError () const
 
void unsetFlag (int flag)
 
- Public Member Functions inherited from CaloRecHit
constexpr uint32_t aux () const
 
constexpr CaloRecHit ()
 
constexpr CaloRecHit (const DetId &id, float energy, float time, uint32_t flags=0, uint32_t aux=0)
 
constexpr const DetIddetid () const
 
constexpr float energy () const
 
constexpr uint32_t flagField (int base, int width=1) const
 
constexpr uint32_t flags () const
 
constexpr void setAux (uint32_t value)
 
constexpr void setEnergy (float energy)
 
constexpr void setFlagField (uint32_t value, int base, int width=1)
 
constexpr void setFlags (uint32_t flags)
 
constexpr void setTime (float time)
 
constexpr float time () const
 

Private Attributes

uint32_t flagBits_
 store rechit condition (see Flags enum) in a bit-wise way More...
 
uint8_t signalOverSigmaNoise_
 
float timeError_
 

Detailed Description

based on EcalRecHit

Author
Valeri Andreev

Definition at line 14 of file HGCRecHit.h.

Member Typedef Documentation

◆ key_type

Definition at line 16 of file HGCRecHit.h.

Member Enumeration Documentation

◆ Flags

Enumerator
kGood 
kPoorReco 
kOutOfTime 
kFaultyHardware 
kNoisy 
kPoorCalib 
kSaturated 
kDead 
kKilled 
kWeird 
kDiWeird 
kUnknown 

Definition at line 19 of file HGCRecHit.h.

19  {
20  kGood = 0, // channel ok, the energy and time measurement are reliable
21  kPoorReco, // the energy is available from the UncalibRecHit, but approximate (bad shape, large chi2)
22  kOutOfTime, // the energy is available from the UncalibRecHit (sync reco), but the event is out of time
23  kFaultyHardware, // The energy is available from the UncalibRecHit, channel is faulty at some hardware level (e.g. noisy)
24  kNoisy, // the channel is very noisy
25  kPoorCalib, // the energy is available from the UncalibRecHit, but the calibration of the channel is poor
26  kSaturated, // saturated channel (recovery not tried)
27  kDead, // channel is dead and any recovery fails
28  kKilled, // MC only flag: the channel is killed in the real detector
29  kWeird, // the signal is believed to originate from an anomalous deposit (spike)
30  kDiWeird, // the signal is anomalous, and neighbors another anomalous signal
31  //
32  kUnknown // to ease the interface with functions returning flags.
33  };

◆ HFNoseFlags

Enumerator
kHFNoseGood 
kHFNosePoorReco 
kHFNoseOutOfTime 
kHFNoseFaultyHardware 
kHFNoseNoisy 
kHFNosePoorCalib 
kHFNoseSaturated 
kHFNoseDead 
kHFNoseKilled 
kHFNoseWeird 
kHFNoseDiWeird 
kHFNoseUnknown 

Definition at line 42 of file HGCRecHit.h.

◆ HGCbheFlags

Enumerator
kHGCbheGood 
kHGCbheDead 
kHGCbheHot 
kHGCbhePassBX 
kHGCbheSaturated 

Definition at line 39 of file HGCRecHit.h.

◆ HGCfheFlags

Enumerator
kHGCfheGood 
kHGCfheDead 
kHGCfheHot 
kHGCfhePassBX 
kHGCfheSaturated 

Definition at line 36 of file HGCRecHit.h.

Constructor & Destructor Documentation

◆ HGCRecHit() [1/2]

HGCRecHit::HGCRecHit ( )

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 10 of file HGCRecHit.cc.

10 : CaloRecHit(), flagBits_(0) {}

◆ HGCRecHit() [2/2]

HGCRecHit::HGCRecHit ( const DetId id,
float  energy,
float  time,
uint32_t  flags = 0,
uint32_t  flagBits = 0,
uint8_t  son = 0,
float  timeError = 0.f 
)

Definition at line 12 of file HGCRecHit.cc.

Member Function Documentation

◆ checkFlag()

bool HGCRecHit::checkFlag ( int  flag) const
inline

check if the flag is true

Definition at line 105 of file HGCRecHit.h.

105 { return flagBits_ & (0x1 << flag); }

References RemoveAddSevLevel::flag, and flagBits_.

Referenced by checkFlags().

◆ checkFlags()

bool HGCRecHit::checkFlags ( const std::vector< int > &  flagsvec) const

check if one of the flags in a set is true

Definition at line 98 of file HGCRecHit.cc.

98  {
99  for (std::vector<int>::const_iterator flagPtr = flagsvec.begin(); flagPtr != flagsvec.end();
100  ++flagPtr) { // check if one of the flags is up
101  if (checkFlag(*flagPtr))
102  return true;
103  }
104  return false;
105 }

References checkFlag().

◆ chi2()

float HGCRecHit::chi2 ( void  ) const

Definition at line 16 of file HGCRecHit.cc.

16  {
17  uint32_t rawChi2 = 0x7F & (flags() >> 4);
18  return (float)rawChi2 / (float)((1 << 7) - 1) * 64.f;
19 }

References f, CaloRecHit::flags(), and dqmMemoryStats::float.

Referenced by setChi2(), and setOutOfTimeChi2().

◆ flagBits()

uint32_t HGCRecHit::flagBits ( ) const
inline

Definition at line 111 of file HGCRecHit.h.

111 { return flagBits_; }

References flagBits_.

Referenced by HeterogeneousHGCalRecHitsValidator::analyze().

◆ id()

DetId HGCRecHit::id ( ) const
inline

get the id

Definition at line 79 of file HGCRecHit.h.

79 { return DetId(detid()); }

References CaloRecHit::detid().

Referenced by FWHGCRecHitProxyBuilder::build().

◆ isTimeErrorValid()

bool HGCRecHit::isTimeErrorValid ( ) const

Definition at line 88 of file HGCRecHit.cc.

88  {
89  if (!isTimeValid())
90  return false;
91  if (timeError() >= 10000)
92  return false;
93 
94  return true;
95 }

References isTimeValid(), and timeError().

◆ isTimeValid()

bool HGCRecHit::isTimeValid ( ) const

Definition at line 81 of file HGCRecHit.cc.

81  {
82  if (timeError() <= 0)
83  return false;
84  else
85  return true;
86 }

References timeError().

Referenced by isTimeErrorValid().

◆ outOfTimeChi2()

float HGCRecHit::outOfTimeChi2 ( ) const

Definition at line 21 of file HGCRecHit.cc.

21  {
22  uint32_t rawChi2Prob = 0x7F & (flags() >> 24);
23  return (float)rawChi2Prob / (float)((1 << 7) - 1) * 64.f;
24 }

References f, CaloRecHit::flags(), and dqmMemoryStats::float.

◆ outOfTimeEnergy()

float HGCRecHit::outOfTimeEnergy ( ) const

Definition at line 26 of file HGCRecHit.cc.

26  {
27  uint32_t rawEnergy = (0x1FFF & flags() >> 11);
28  uint16_t exponent = rawEnergy >> 10;
29  uint16_t significand = ~(0xE << 9) & rawEnergy;
30  return (float)significand * pow(10, exponent - 5);
31 }

References HLT_FULL_cff::exponent, CaloRecHit::flags(), and funct::pow().

◆ setChi2()

void HGCRecHit::setChi2 ( float  chi2)

Definition at line 33 of file HGCRecHit.cc.

33  {
34  // bound the max value of the chi2
35  if (chi2 > 64)
36  chi2 = 64;
37  // use 7 bits
38  uint32_t rawChi2 = lround(chi2 / 64.f * ((1 << 7) - 1));
39  // shift by 4 bits (recoFlag)
40  setFlags((~(0x7F << 4) & flags()) | ((rawChi2 & 0x7F) << 4));
41 }

References chi2(), f, CaloRecHit::flags(), and CaloRecHit::setFlags().

◆ setFlag()

void HGCRecHit::setFlag ( int  flag)
inline

set the flags (from Flags or ESFlags)

Definition at line 101 of file HGCRecHit.h.

101 { flagBits_ |= (0x1 << flag); }

References RemoveAddSevLevel::flag, and flagBits_.

Referenced by HGCalRecHitSimpleAlgo::makeRecHit().

◆ setOutOfTimeChi2()

void HGCRecHit::setOutOfTimeChi2 ( float  chi2)

Definition at line 54 of file HGCRecHit.cc.

54  {
55  // bound the max value of chi2
56  if (chi2 > 64)
57  chi2 = 64;
58  // use 7 bits
59  uint32_t rawChi2 = lround(chi2 / 64.f * ((1 << 7) - 1));
60  // shift by 24 bits (recoFlag + chi2 + outOfTimeEnergy)
61  setFlags((~(0x7F << 24) & flags()) | ((rawChi2 & 0x7F) << 24));
62 }

References chi2(), f, CaloRecHit::flags(), and CaloRecHit::setFlags().

◆ setOutOfTimeEnergy()

void HGCRecHit::setOutOfTimeEnergy ( float  energy)

Definition at line 43 of file HGCRecHit.cc.

43  {
44  if (energy > 0.001f) {
45  uint16_t exponent = lround(floor(log10(energy))) + 3;
46  uint16_t significand = lround(energy / pow(10, exponent - 5));
47  // use 13 bits (3 exponent, 10 significand)
48  uint32_t rawEnergy = exponent << 10 | significand;
49  // shift by 11 bits (recoFlag + chi2)
50  setFlags((~(0x1FFF << 11) & flags()) | ((rawEnergy & 0x1FFF) << 11));
51  }
52 }

References CaloRecHit::energy(), HLT_FULL_cff::exponent, f, CaloRecHit::flags(), funct::pow(), and CaloRecHit::setFlags().

◆ setSignalOverSigmaNoise()

void HGCRecHit::setSignalOverSigmaNoise ( float  sOverNoise)

Definition at line 64 of file HGCRecHit.cc.

64  {
65  // bound the max value of sOverNoise
66  if (sOverNoise > 32.f)
67  sOverNoise = 32.f;
68  //use 8 bits
69  signalOverSigmaNoise_ = lround(sOverNoise / 32.f * ((1 << 8) - 1));
70 }

References f, and signalOverSigmaNoise_.

◆ setTimeError()

void HGCRecHit::setTimeError ( float  timeErr)

Definition at line 74 of file HGCRecHit.cc.

74  {
75  //expected resolution on single cell for that given S/N
76  timeError_ = timeErr;
77 }

References timeError_.

◆ signalOverSigmaNoise()

float HGCRecHit::signalOverSigmaNoise ( ) const

Definition at line 72 of file HGCRecHit.cc.

72 { return (float)signalOverSigmaNoise_ * 0.125f; }

References signalOverSigmaNoise_.

Referenced by HeterogeneousHGCalRecHitsValidator::analyze(), and PFRecHitQTestHGCalThresholdSNR::test().

◆ timeError()

float HGCRecHit::timeError ( ) const

◆ unsetFlag()

void HGCRecHit::unsetFlag ( int  flag)
inline

Definition at line 102 of file HGCRecHit.h.

102 { flagBits_ &= ~(0x1 << flag); }

References RemoveAddSevLevel::flag, and flagBits_.

Member Data Documentation

◆ flagBits_

uint32_t HGCRecHit::flagBits_
private

store rechit condition (see Flags enum) in a bit-wise way

Definition at line 115 of file HGCRecHit.h.

Referenced by checkFlag(), flagBits(), setFlag(), and unsetFlag().

◆ signalOverSigmaNoise_

uint8_t HGCRecHit::signalOverSigmaNoise_
private

Definition at line 116 of file HGCRecHit.h.

Referenced by setSignalOverSigmaNoise(), and signalOverSigmaNoise().

◆ timeError_

float HGCRecHit::timeError_
private

Definition at line 117 of file HGCRecHit.h.

Referenced by setTimeError(), and timeError().

HGCRecHit::signalOverSigmaNoise_
uint8_t signalOverSigmaNoise_
Definition: HGCRecHit.h:116
HGCRecHit::kHGCbheGood
Definition: HGCRecHit.h:39
HGCRecHit::isTimeValid
bool isTimeValid() const
Definition: HGCRecHit.cc:81
HGCRecHit::kHFNoseWeird
Definition: HGCRecHit.h:52
HGCRecHit::kHFNoseFaultyHardware
Definition: HGCRecHit.h:46
HGCRecHit::kHGCbheHot
Definition: HGCRecHit.h:39
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
HGCRecHit::kHFNosePoorReco
Definition: HGCRecHit.h:44
CaloRecHit::energy
constexpr float energy() const
Definition: CaloRecHit.h:29
HGCRecHit::checkFlag
bool checkFlag(int flag) const
check if the flag is true
Definition: HGCRecHit.h:105
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
HGCRecHit::kHFNoseOutOfTime
Definition: HGCRecHit.h:45
HGCRecHit::kHFNoseKilled
Definition: HGCRecHit.h:51
HGCRecHit::kHGCbhePassBX
Definition: HGCRecHit.h:39
HGCRecHit::kHFNoseSaturated
Definition: HGCRecHit.h:49
HGCRecHit::kHFNoseGood
Definition: HGCRecHit.h:43
CaloRecHit::detid
constexpr const DetId & detid() const
Definition: CaloRecHit.h:33
HGCRecHit::kHGCfheGood
Definition: HGCRecHit.h:36
HGCRecHit::timeError
float timeError() const
Definition: HGCRecHit.cc:79
HGCRecHit::kNoisy
Definition: HGCRecHit.h:24
DetId
Definition: DetId.h:17
HGCRecHit::flagBits_
uint32_t flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Definition: HGCRecHit.h:115
HGCRecHit::kFaultyHardware
Definition: HGCRecHit.h:23
HGCRecHit::kKilled
Definition: HGCRecHit.h:28
HGCRecHit::kHFNoseNoisy
Definition: HGCRecHit.h:47
HGCRecHit::kPoorCalib
Definition: HGCRecHit.h:25
HLT_FULL_cff.exponent
exponent
Definition: HLT_FULL_cff.py:52824
HGCRecHit::kHFNosePoorCalib
Definition: HGCRecHit.h:48
CaloRecHit::CaloRecHit
constexpr CaloRecHit()
Definition: CaloRecHit.h:25
HGCRecHit::kHGCfheSaturated
Definition: HGCRecHit.h:36
CaloRecHit::time
constexpr float time() const
Definition: CaloRecHit.h:31
HGCRecHit::kDiWeird
Definition: HGCRecHit.h:30
HGCRecHit::kGood
Definition: HGCRecHit.h:20
HGCRecHit::kUnknown
Definition: HGCRecHit.h:32
HGCRecHit::kOutOfTime
Definition: HGCRecHit.h:22
CaloRecHit::setFlags
constexpr void setFlags(uint32_t flags)
Definition: CaloRecHit.h:35
HGCRecHit::kHGCfhePassBX
Definition: HGCRecHit.h:36
HGCRecHit::kHFNoseDiWeird
Definition: HGCRecHit.h:53
HGCRecHit::kHGCfheDead
Definition: HGCRecHit.h:36
HGCRecHit::kHFNoseUnknown
Definition: HGCRecHit.h:54
HGCRecHit::kDead
Definition: HGCRecHit.h:27
HGCRecHit::kWeird
Definition: HGCRecHit.h:29
HGCRecHit::timeError_
float timeError_
Definition: HGCRecHit.h:117
HGCRecHit::kPoorReco
Definition: HGCRecHit.h:21
HGCRecHit::kHFNoseDead
Definition: HGCRecHit.h:50
HGCRecHit::kHGCfheHot
Definition: HGCRecHit.h:36
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
HGCRecHit::flagBits
uint32_t flagBits() const
Definition: HGCRecHit.h:111
HGCRecHit::chi2
float chi2() const
Definition: HGCRecHit.cc:16
CaloRecHit::flags
constexpr uint32_t flags() const
Definition: CaloRecHit.h:34
HGCRecHit::kSaturated
Definition: HGCRecHit.h:26
HGCRecHit::kHGCbheSaturated
Definition: HGCRecHit.h:39
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117
HGCRecHit::kHGCbheDead
Definition: HGCRecHit.h:39