LDMX Software
CaloCluster.h
Go to the documentation of this file.
1
6#ifndef EVENT_CALOCLUSTER_H_
7#define EVENT_CALOCLUSTER_H_
8
9// ROOT
10#include "TObject.h" //For ClassDef
11#include "TString.h"
12
13// STL
14#include <iostream>
15#include <set>
16
17// ldmx-sw
19
20namespace ldmx {
21
27 public:
32
36 virtual ~CaloCluster();
37
41 void Print() const;
42
46 void Clear();
47
53 void addHits(const std::vector<const ldmx::CalorimeterHit*> hitsVec);
54
59 void setEnergy(double energy) { energy_ = energy; }
60
65 void setNHits(int nHits) { nHits_ = nHits; }
66
72 void setIDs(std::vector<unsigned int>& hitIDs) { hitIDs_ = hitIDs; }
73
74 void setHitValsX(std::vector<float>& x) { hitX_ = x; }
75 void setHitValsY(std::vector<float>& x) { hitY_ = x; }
76 void setHitValsZ(std::vector<float>& x) { hitZ_ = x; }
77 void setHitValsE(std::vector<float>& x) { hitE_ = x; }
78
85 void setCentroidXYZ(double x, double y, double z) {
86 centroidX_ = x;
87 centroidY_ = y;
88 centroidZ_ = z;
89 }
90 void setRMSXYZ(double x, double y, double z) {
91 rmsX_ = x;
92 rmsY_ = y;
93 rmsZ_ = z;
94 }
95 void setDXDZ(double x) { DXDZ_ = x; }
96
97 void setDYDZ(double x) { DYDZ_ = x; }
98
99 void setEDXDZ(double x) { errDXDZ_ = x; }
100
101 void setEDYDZ(double x) { errDYDZ_ = x; }
102
104
105 // energy of cluster
106 double getEnergy() const { return energy_; }
107
108 // number of hits - equivalent to number of strips
109 int getNHits() const { return nHits_; }
110
111 // position (weighted by energy)
112 double getCentroidX() const { return centroidX_; }
113 double getCentroidY() const { return centroidY_; }
114 double getCentroidZ() const { return centroidZ_; }
115 double getRMSX() const { return rmsX_; }
116 double getRMSY() const { return rmsY_; }
117 double getRMSZ() const { return rmsZ_; }
118
119 double getDXDZ() const { return DXDZ_; }
120
121 double getDYDZ() const { return DYDZ_; }
122
123 double getEDXDZ() const { return errDXDZ_; }
124
125 double getEDYDZ() const { return errDYDZ_; }
126
127 // get hit rawIDs (unused)
128 const std::vector<unsigned int>& getHitIDs() const { return hitIDs_; }
129
130 // ability to store limited hit info
131 const std::vector<float>& getHitX() const { return hitX_; }
132 const std::vector<float>& getHitY() const { return hitY_; }
133 const std::vector<float>& getHitZ() const { return hitZ_; }
134 const std::vector<float>& getHitE() const { return hitE_; }
135
136 bool operator<(const CaloCluster& rhs) const {
137 return this->getEnergy() < rhs.getEnergy();
138 }
139
140 protected:
141 std::vector<unsigned int> hitIDs_;
142 double energy_{0};
143 int nHits_{0};
144 double centroidX_{0};
145 double centroidY_{0};
146 double centroidZ_{0};
147 double rmsX_{0};
148 double rmsY_{0};
149 double rmsZ_{0};
150 double DXDZ_{0};
151 double DYDZ_{0};
152 double errDXDZ_{0};
153 double errDYDZ_{0};
154 std::vector<float> hitX_;
155 std::vector<float> hitY_;
156 std::vector<float> hitZ_;
157 std::vector<float> hitE_;
158
159 private:
160 ClassDef(CaloCluster, 1);
161};
162} // namespace ldmx
163
164#endif
Class that represents a reconstructed hit in a calorimeter cell within the detector.
Stores cluster information from the ECal.
Definition CaloCluster.h:26
void Print() const
Print a description of this object.
void setNHits(int nHits)
Sets total number of hits in the cluster.
Definition CaloCluster.h:65
void addHits(const std::vector< const ldmx::CalorimeterHit * > hitsVec)
Take in the hits that make up the cluster.
void Clear()
Reset the CaloCluster object.
virtual ~CaloCluster()
Class destructor.
void setEnergy(double energy)
Sets total energy for the cluster.
Definition CaloCluster.h:59
void setIDs(std::vector< unsigned int > &hitIDs)
Sets a sorted vector for the IDs of the hits that make up the cluster.
Definition CaloCluster.h:72
void setCentroidXYZ(double x, double y, double z)
Sets the three coordinates of the cluster centroid.
Definition CaloCluster.h:85
CaloCluster()
Class constructor.