File indexing completed on 2024-04-06 12:04:21
0001 #ifndef DATAFORMATS_HGCRECHIT_H
0002 #define DATAFORMATS_HGCRECHIT_H 1
0003
0004 #include "DataFormats/CaloRecHit/interface/CaloRecHit.h"
0005 #include <vector>
0006
0007
0008
0009
0010
0011
0012
0013
0014 class HGCRecHit : public CaloRecHit {
0015 public:
0016 typedef DetId key_type;
0017
0018
0019 enum Flags {
0020 kGood = 0,
0021 kPoorReco,
0022 kOutOfTime,
0023 kFaultyHardware,
0024 kNoisy,
0025 kPoorCalib,
0026 kSaturated,
0027 kDead,
0028 kKilled,
0029 kWeird,
0030 kDiWeird,
0031
0032 kUnknown
0033 };
0034
0035
0036 enum HGCfheFlags { kHGCfheGood, kHGCfheDead, kHGCfheHot, kHGCfhePassBX, kHGCfheSaturated };
0037
0038
0039 enum HGCbheFlags { kHGCbheGood, kHGCbheDead, kHGCbheHot, kHGCbhePassBX, kHGCbheSaturated };
0040
0041
0042 enum HFNoseFlags {
0043 kHFNoseGood,
0044 kHFNosePoorReco,
0045 kHFNoseOutOfTime,
0046 kHFNoseFaultyHardware,
0047 kHFNoseNoisy,
0048 kHFNosePoorCalib,
0049 kHFNoseSaturated,
0050 kHFNoseDead,
0051 kHFNoseKilled,
0052 kHFNoseWeird,
0053 kHFNoseDiWeird,
0054 kHFNoseUnknown
0055 };
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068 HGCRecHit();
0069
0070 HGCRecHit(const DetId& id,
0071 float energy,
0072 float time,
0073 uint32_t flags = 0,
0074 uint32_t flagBits = 0,
0075 uint8_t son = 0,
0076 float timeError = 0.f);
0077
0078
0079 DetId id() const { return DetId(detid()); }
0080
0081 bool isTimeValid() const;
0082 bool isTimeErrorValid() const;
0083
0084 float chi2() const;
0085 float outOfTimeChi2() const;
0086 float signalOverSigmaNoise() const;
0087
0088
0089
0090 float outOfTimeEnergy() const;
0091 float timeError() const;
0092
0093 void setChi2(float chi2);
0094 void setOutOfTimeChi2(float chi2);
0095 void setOutOfTimeEnergy(float energy);
0096 void setSignalOverSigmaNoise(float sOverNoise);
0097
0098 void setTimeError(float timeErr);
0099
0100
0101 void setFlag(int flag) { flagBits_ |= (0x1 << flag); }
0102 void unsetFlag(int flag) { flagBits_ &= ~(0x1 << flag); }
0103
0104
0105 bool checkFlag(int flag) const { return flagBits_ & (0x1 << flag); }
0106
0107
0108 bool checkFlags(const std::vector<int>& flagsvec) const;
0109
0110
0111 uint32_t flagBits() const { return flagBits_; }
0112
0113 private:
0114
0115 uint32_t flagBits_;
0116 uint8_t signalOverSigmaNoise_;
0117 float timeError_;
0118 };
0119
0120 std::ostream& operator<<(std::ostream& s, const HGCRecHit& hit);
0121
0122 #endif