CMS 3D CMS Logo

HBHERecHit.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_HCALRECHIT_HBHERECHIT_H
2 #define DATAFORMATS_HCALRECHIT_HBHERECHIT_H 1
3 
4 #include <vector>
5 
8 
13 class HBHERecHit : public CaloRecHit {
14 public:
16 
18  : CaloRecHit(),
19  timeFalling_(0),
20  chiSquared_(-1),
21  rawEnergy_(-1.0e21),
22  auxEnergy_(-1.0e21),
23  auxHBHE_(0),
24  auxPhase1_(0)
25  {}
26  //HBHERecHit(const HcalDetId& id, float energy, float time);
27  constexpr HBHERecHit(const HcalDetId& id, float energy,
28  float timeRising, float timeFalling=0)
29  : CaloRecHit(id,energy,timeRising),
31  chiSquared_(-1),
32  rawEnergy_(-1.0e21),
33  auxEnergy_(-1.0e21),
34  auxHBHE_(0),
35  auxPhase1_(0)
36  {}
37 
39  constexpr inline float timeFalling() const { return timeFalling_; }
42  constexpr inline HcalDetId id() const { return HcalDetId(detid()); }
43 
44  constexpr inline void setChiSquared(const float chi2) {chiSquared_ = chi2;}
45  constexpr inline float chi2() const {return chiSquared_;}
46 
47  constexpr inline void setRawEnergy(const float en) {rawEnergy_ = en;}
48  constexpr inline float eraw() const {return rawEnergy_;}
49 
50  constexpr inline void setAuxEnergy(const float en) {auxEnergy_ = en;}
51  constexpr inline float eaux() const {return auxEnergy_;}
52 
53  constexpr inline void setAuxHBHE(const uint32_t aux) { auxHBHE_ = aux;}
54  constexpr inline uint32_t auxHBHE() const {return auxHBHE_;}
55 
56  constexpr inline void setAuxPhase1(const uint32_t aux) { auxPhase1_ = aux;}
57  constexpr inline uint32_t auxPhase1() const {return auxPhase1_;}
58 
59  // The following method returns "true" for "Plan 1" merged rechits
60  bool isMerged() const;
61 
62  // The following method fills the vector with the ids of the
63  // rechits that have been merged to construct the "Plan 1" rechit.
64  // For normal (i.e., not merged) rechits the vector will be cleared.
65  void getMergedIds(std::vector<HcalDetId>* ids) const;
66 
67  // Returns the DetId of the front Id if it is a merged RecHit in "Plan 1"
68  HcalDetId idFront() const;
69 private:
70  float timeFalling_;
71  float chiSquared_;
72  float rawEnergy_;
73  float auxEnergy_;
74  uint32_t auxHBHE_;
75  uint32_t auxPhase1_;
76 };
77 
78 std::ostream& operator<<(std::ostream& s, const HBHERecHit& hit);
79 
80 
81 #endif
constexpr float energy() const
Definition: CaloRecHit.h:31
float chi2() const
Definition: HBHERecHit.h:45
constexpr const DetId & detid() const
Definition: CaloRecHit.h:35
float auxEnergy_
Definition: HBHERecHit.h:73
HcalDetId id() const
get the id
Definition: HBHERecHit.h:42
uint32_t auxPhase1() const
Definition: HBHERecHit.h:57
float chiSquared_
Definition: HBHERecHit.h:71
uint32_t auxPhase1_
Definition: HBHERecHit.h:75
HcalDetId idFront() const
Definition: HBHERecHit.cc:5
void setTimeFalling(float timeFalling)
Definition: HBHERecHit.h:40
HcalDetId key_type
Definition: HBHERecHit.h:15
bool isMerged() const
Definition: HBHERecHit.cc:14
float timeFalling_
Definition: HBHERecHit.h:70
void setAuxHBHE(const uint32_t aux)
Definition: HBHERecHit.h:53
float timeFalling() const
get the hit falling time
Definition: HBHERecHit.h:39
uint32_t auxHBHE_
Definition: HBHERecHit.h:74
HBHERecHit(const HcalDetId &id, float energy, float timeRising, float timeFalling=0)
Definition: HBHERecHit.h:27
void getMergedIds(std::vector< HcalDetId > *ids) const
Definition: HBHERecHit.cc:32
uint32_t auxHBHE() const
Definition: HBHERecHit.h:54
void setAuxEnergy(const float en)
Definition: HBHERecHit.h:50
void setChiSquared(const float chi2)
Definition: HBHERecHit.h:44
constexpr uint32_t aux() const
Definition: CaloRecHit.h:52
float eraw() const
Definition: HBHERecHit.h:48
void setRawEnergy(const float en)
Definition: HBHERecHit.h:47
void setAuxPhase1(const uint32_t aux)
Definition: HBHERecHit.h:56
float eaux() const
Definition: HBHERecHit.h:51
#define constexpr
float rawEnergy_
Definition: HBHERecHit.h:72
std::ostream & operator<<(std::ostream &s, const HBHERecHit &hit)
Definition: HBHERecHit.cc:18