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
11// STL
12#include <Rtypes.h> // For ClassDef
13
14#include <iostream>
15
16// ldmx-sw
18
19namespace ldmx {
20
26 public:
30 CaloCluster() = default;
31
35 virtual ~CaloCluster();
36
40 friend std::ostream& operator<<(std::ostream& o, const CaloCluster& d);
41
45 void clear();
46
52 void addHits(const std::vector<const ldmx::CalorimeterHit*> hitsVec);
53
58 void setEnergy(double energy) { energy_ = energy; }
59
64 void setNHits(int nHits) { n_hits_ = nHits; }
65
71 void setIDs(std::vector<unsigned int>& hitIDs) { hit_ids_ = hitIDs; }
72
73 void setHitValsX(std::vector<float>& x_) { hit_x_ = x_; }
74 void setHitValsY(std::vector<float>& x_) { hit_y_ = x_; }
75 void setHitValsZ(std::vector<float>& x_) { hit_z_ = x_; }
76 void setHitValsE(std::vector<float>& x_) { hit_e_ = x_; }
77
84 void setCentroidXYZ(double centroid_x, double centroid_y, double centroid_z) {
85 centroid_x_ = centroid_x;
86 centroid_y_ = centroid_y;
87 centroid_z_ = centroid_z;
88 }
89
90 // Sets the layer of the cluster centroid
91 void setLayer(int layer) { layer_ = layer; }
92 void setRMSXYZ(double rms_x, double rms_y, double rms_z) {
93 rms_x_ = rms_x;
94 rms_y_ = rms_y;
95 rms_z_ = rms_z;
96 }
97 void setDXDZ(double dxdz) { dxdz_ = dxdz; }
98
99 void setDYDZ(double dydz) { dydz_ = dydz; }
100
101 void setEDXDZ(double err_dxdz) { err_dxdz_ = err_dxdz; }
102
103 void setEDYDZ(double err_dydz) { err_dydz_ = err_dydz; }
104
106
107 // energy of cluster
108 double getEnergy() const { return energy_; }
109
110 // number of hits - equivalent to number of strips
111 int getNHits() const { return n_hits_; }
112
113 // position (weighted by energy)
115 double getCentroidX() const { return centroid_x_; }
117 double getCentroidY() const { return centroid_y_; }
119 double getCentroidZ() const { return centroid_z_; }
121 int getLayer() const { return layer_; }
123 double getRMSX() const { return rms_x_; }
125 double getRMSY() const { return rms_y_; }
127 double getRMSZ() const { return rms_z_; }
129 double getDXDZ() const { return dxdz_; }
131 double getDYDZ() const { return dydz_; }
133 double getEDXDZ() const { return err_dxdz_; }
135 double getEDYDZ() const { return err_dydz_; }
136
137 // get hit rawIDs
138 const std::vector<unsigned int>& getHitIDs() const { return hit_ids_; }
139
140 // ability to store limited hit info
141 const std::vector<float>& getHitX() const { return hit_x_; }
142 const std::vector<float>& getHitY() const { return hit_y_; }
143 const std::vector<float>& getHitZ() const { return hit_z_; }
144 const std::vector<float>& getHitE() const { return hit_e_; }
145
146 bool operator<(const CaloCluster& rhs) const {
147 return this->getEnergy() < rhs.getEnergy();
148 }
149
150 protected:
151 std::vector<unsigned int> hit_ids_;
152 double energy_{0};
153 int n_hits_{0};
154 double centroid_x_{0};
155 double centroid_y_{0};
156 double centroid_z_{0};
157 int layer_{-1};
158 double rms_x_{0};
159 double rms_y_{0};
160 double rms_z_{0};
161 double dxdz_{0};
162 double dydz_{0};
163 double err_dxdz_{0};
164 double err_dydz_{0};
165 std::vector<float> hit_x_;
166 std::vector<float> hit_y_;
167 std::vector<float> hit_z_;
168 std::vector<float> hit_e_;
169
170 private:
171 ClassDef(CaloCluster, 3);
172};
173} // namespace ldmx
174
175#endif
Class that represents a reconstructed hit in a calorimeter cell within the detector.
Stores cluster information from the ECal.
Definition CaloCluster.h:25
double getRMSX() const
rms in x
void setNHits(int nHits)
Sets total number of hits in the cluster.
Definition CaloCluster.h:64
void addHits(const std::vector< const ldmx::CalorimeterHit * > hitsVec)
Take in the hits that make up the cluster.
void clear()
Reset the CaloCluster object.
CaloCluster()=default
Class constructor.
double getDYDZ() const
Delta in y-z plane.
double getCentroidZ() const
centroid z-location
double getCentroidX() const
centroid x-location
void setCentroidXYZ(double centroid_x, double centroid_y, double centroid_z)
Sets the three coordinates of the cluster centroid.
Definition CaloCluster.h:84
int getLayer() const
layer of the cluster centroid
friend std::ostream & operator<<(std::ostream &o, const CaloCluster &d)
Print a description of this object.
double getRMSZ() const
rms in z
virtual ~CaloCluster()
Class destructor.
double getRMSY() const
rms in y
void setEnergy(double energy)
Sets total energy for the cluster.
Definition CaloCluster.h:58
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:71
double getCentroidY() const
centroid y-location
double getEDXDZ() const
Delta unc on unc in x-z plane.
double getDXDZ() const
Delta in x-z plane.
double getEDYDZ() const
Delta unc on unc in y-z plane.