CMS 3D CMS Logo

HGCRecHit.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_HGCRECHIT_H
2 #define DATAFORMATS_HGCRECHIT_H 1
3 
5 #include <vector>
6 
14 class HGCRecHit : public CaloRecHit {
15 public:
16  typedef DetId key_type;
17 
18  // HGCEE recHit flags
19  enum Flags {
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  };
34 
35  // HGCfhe recHit flags
37 
38  // HGCbhe recHit flags
40 
41  // HFnose rechit flags
42  enum HFNoseFlags {
55  };
56 
68  HGCRecHit();
69  // by default a recHit is greated with no flag
70  HGCRecHit(const DetId& id, float energy, float time, uint32_t flags = 0, uint32_t flagBits = 0);
72  // For the moment not returning a specific id for subdetector
73  DetId id() const { return DetId(detid()); }
75  bool isTimeValid() const;
76  bool isTimeErrorValid() const;
77 
78  float chi2() const;
79  float outOfTimeChi2() const;
80  float signalOverSigmaNoise() const;
81 
82  // set the energy for out of time events
83  // (only energy >= 0 will be stored)
84  float outOfTimeEnergy() const;
85  float timeError() const;
86 
87  void setChi2(float chi2);
88  void setOutOfTimeChi2(float chi2);
89  void setOutOfTimeEnergy(float energy);
90  void setSignalOverSigmaNoise(float sOverNoise);
91 
92  void setTimeError(float timeErr);
93 
95  void setFlag(int flag) { flagBits_ |= (0x1 << flag); }
96  void unsetFlag(int flag) { flagBits_ &= ~(0x1 << flag); }
97 
99  bool checkFlag(int flag) const { return flagBits_ & (0x1 << flag); }
100 
102  bool checkFlags(const std::vector<int>& flagsvec) const;
103 
104 private:
106  uint32_t flagBits_;
108  float timeError_;
109 };
110 
111 std::ostream& operator<<(std::ostream& s, const HGCRecHit& hit);
112 
113 #endif
HGCRecHit::setSignalOverSigmaNoise
void setSignalOverSigmaNoise(float sOverNoise)
Definition: HGCRecHit.cc:63
HGCRecHit::signalOverSigmaNoise_
uint8_t signalOverSigmaNoise_
Definition: HGCRecHit.h:107
HGCRecHit::kHGCbheGood
Definition: HGCRecHit.h:39
HGCRecHit::isTimeValid
bool isTimeValid() const
Definition: HGCRecHit.cc:80
HGCRecHit::kHFNoseWeird
Definition: HGCRecHit.h:52
HGCRecHit::kHFNoseFaultyHardware
Definition: HGCRecHit.h:46
HGCRecHit::kHGCbheHot
Definition: HGCRecHit.h:39
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:99
HGCRecHit::kHFNoseOutOfTime
Definition: HGCRecHit.h:45
HGCRecHit::unsetFlag
void unsetFlag(int flag)
Definition: HGCRecHit.h:96
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
Definition: CaloRecHit.h:23
CaloRecHit::detid
constexpr const DetId & detid() const
Definition: CaloRecHit.h:33
HGCRecHit::kHGCfheGood
Definition: HGCRecHit.h:36
HGCRecHit::HFNoseFlags
HFNoseFlags
Definition: HGCRecHit.h:42
CaloRecHit.h
HGCRecHit::timeError
float timeError() const
Definition: HGCRecHit.cc:78
HGCRecHit::id
DetId id() const
get the id
Definition: HGCRecHit.h:73
HGCRecHit::HGCbheFlags
HGCbheFlags
Definition: HGCRecHit.h:39
HGCRecHit::setFlag
void setFlag(int flag)
set the flags (from Flags or ESFlags)
Definition: HGCRecHit.h:95
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:106
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HGCRecHit::setOutOfTimeEnergy
void setOutOfTimeEnergy(float energy)
Definition: HGCRecHit.cc:42
HGCRecHit::kFaultyHardware
Definition: HGCRecHit.h:23
HGCRecHit::kKilled
Definition: HGCRecHit.h:28
HGCRecHit::Flags
Flags
Definition: HGCRecHit.h:19
HGCRecHit::kHFNoseNoisy
Definition: HGCRecHit.h:47
HGCRecHit::kPoorCalib
Definition: HGCRecHit.h:25
HGCRecHit::kHFNosePoorCalib
Definition: HGCRecHit.h:48
HGCRecHit::HGCfheFlags
HGCfheFlags
Definition: HGCRecHit.h:36
HGCRecHit::kHGCfheSaturated
Definition: HGCRecHit.h:36
CaloRecHit::time
constexpr float time() const
Definition: CaloRecHit.h:31
HGCRecHit
Definition: HGCRecHit.h:14
HGCRecHit::kDiWeird
Definition: HGCRecHit.h:30
HGCRecHit::kGood
Definition: HGCRecHit.h:20
HGCRecHit::setTimeError
void setTimeError(float timeErr)
Definition: HGCRecHit.cc:73
HGCRecHit::kUnknown
Definition: HGCRecHit.h:32
HGCRecHit::kOutOfTime
Definition: HGCRecHit.h:22
HGCRecHit::kHGCfhePassBX
Definition: HGCRecHit.h:36
HGCRecHit::checkFlags
bool checkFlags(const std::vector< int > &flagsvec) const
check if one of the flags in a set is true
Definition: HGCRecHit.cc:97
HGCRecHit::setOutOfTimeChi2
void setOutOfTimeChi2(float chi2)
Definition: HGCRecHit.cc:53
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::outOfTimeChi2
float outOfTimeChi2() const
Definition: HGCRecHit.cc:20
HGCRecHit::HGCRecHit
HGCRecHit()
Definition: HGCRecHit.cc:10
HGCRecHit::key_type
DetId key_type
Definition: HGCRecHit.h:16
HGCRecHit::kWeird
Definition: HGCRecHit.h:29
HGCRecHit::timeError_
float timeError_
Definition: HGCRecHit.h:108
HGCRecHit::isTimeErrorValid
bool isTimeErrorValid() const
Definition: HGCRecHit.cc:87
HGCRecHit::setChi2
void setChi2(float chi2)
Definition: HGCRecHit.cc:32
HGCRecHit::kPoorReco
Definition: HGCRecHit.h:21
HGCRecHit::kHFNoseDead
Definition: HGCRecHit.h:50
HGCRecHit::kHGCfheHot
Definition: HGCRecHit.h:36
HGCRecHit::outOfTimeEnergy
float outOfTimeEnergy() const
Definition: HGCRecHit.cc:25
HGCRecHit::signalOverSigmaNoise
float signalOverSigmaNoise() const
Definition: HGCRecHit.cc:71
HGCRecHit::chi2
float chi2() const
Definition: HGCRecHit.cc:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
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:116
HGCRecHit::kHGCbheDead
Definition: HGCRecHit.h:39
operator<<
std::ostream & operator<<(std::ostream &s, const HGCRecHit &hit)
Definition: HGCRecHit.cc:106