File indexing completed on 2024-04-06 12:04:19
0001 #ifndef DATAFORMATS_HCALRECHIT_HBHERECHIT_H
0002 #define DATAFORMATS_HCALRECHIT_HBHERECHIT_H 1
0003
0004 #include <vector>
0005
0006 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0007 #include "DataFormats/CaloRecHit/interface/CaloRecHit.h"
0008
0009
0010
0011
0012
0013 class HBHERecHit : public CaloRecHit {
0014 public:
0015 typedef HcalDetId key_type;
0016
0017 constexpr HBHERecHit()
0018 : CaloRecHit(),
0019 timeFalling_(0),
0020 chiSquared_(-1),
0021 rawEnergy_(-1.0e21),
0022 auxEnergy_(-1.0e21),
0023 auxHBHE_(0),
0024 auxPhase1_(0),
0025 auxTDC_(0) {}
0026
0027 constexpr HBHERecHit(const HcalDetId& id, float energy, float timeRising, float timeFalling = 0)
0028 : CaloRecHit(id, energy, timeRising),
0029 timeFalling_(timeFalling),
0030 chiSquared_(-1),
0031 rawEnergy_(-1.0e21),
0032 auxEnergy_(-1.0e21),
0033 auxHBHE_(0),
0034 auxPhase1_(0),
0035 auxTDC_(0) {}
0036
0037
0038 constexpr inline float timeFalling() const { return timeFalling_; }
0039 constexpr inline void setTimeFalling(float timeFalling) { timeFalling_ = timeFalling; }
0040
0041 constexpr inline HcalDetId id() const { return HcalDetId(detid()); }
0042
0043 constexpr inline void setChiSquared(const float chi2) { chiSquared_ = chi2; }
0044 constexpr inline float chi2() const { return chiSquared_; }
0045
0046 constexpr inline void setRawEnergy(const float en) { rawEnergy_ = en; }
0047 constexpr inline float eraw() const { return rawEnergy_; }
0048
0049 constexpr inline void setAuxEnergy(const float en) { auxEnergy_ = en; }
0050 constexpr inline float eaux() const { return auxEnergy_; }
0051
0052 constexpr inline void setAuxHBHE(const uint32_t aux) { auxHBHE_ = aux; }
0053 constexpr inline uint32_t auxHBHE() const { return auxHBHE_; }
0054
0055 constexpr inline void setAuxPhase1(const uint32_t aux) { auxPhase1_ = aux; }
0056 constexpr inline uint32_t auxPhase1() const { return auxPhase1_; }
0057
0058 constexpr inline void setAuxTDC(const uint32_t aux) { auxTDC_ = aux; }
0059 constexpr inline uint32_t auxTDC() const { return auxTDC_; }
0060
0061
0062 bool isMerged() const;
0063
0064
0065
0066
0067 void getMergedIds(std::vector<HcalDetId>* ids) const;
0068
0069
0070 HcalDetId idFront() const;
0071
0072 private:
0073 float timeFalling_;
0074 float chiSquared_;
0075 float rawEnergy_;
0076 float auxEnergy_;
0077 uint32_t auxHBHE_;
0078 uint32_t auxPhase1_;
0079 uint32_t auxTDC_;
0080 };
0081
0082 std::ostream& operator<<(std::ostream& s, const HBHERecHit& hit);
0083
0084 #endif