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:
31 CaloCluster() = default;
32
36 virtual ~CaloCluster();
37
41 friend std::ostream& operator<<(std::ostream& o, const CaloCluster& d);
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) { n_hits_ = nHits; }
66
72 void setIDs(std::vector<unsigned int>& hitIDs) { hit_ids_ = hitIDs; }
73
74 void setHitValsX(std::vector<float>& x_) { hit_x_ = x_; }
75 void setHitValsY(std::vector<float>& x_) { hit_y_ = x_; }
76 void setHitValsZ(std::vector<float>& x_) { hit_z_ = x_; }
77 void setHitValsE(std::vector<float>& x_) { hit_e_ = x_; }
78
85 void setCentroidXYZ(double centroid_x, double centroid_y, double centroid_z) {
86 centroid_x_ = centroid_x;
87 centroid_y_ = centroid_y;
88 centroid_z_ = centroid_z;
89 }
90
91 // Sets the layer of the cluster centroid
92 void setLayer(int layer) { layer_ = layer; }
93 void setRMSXYZ(double rms_x, double rms_y, double rms_z) {
94 rms_x_ = rms_x;
95 rms_y_ = rms_y;
96 rms_z_ = rms_z;
97 }
98 void setDXDZ(double dxdz) { dxdz_ = dxdz; }
99
100 void setDYDZ(double dydz) { dydz_ = dydz; }
101
102 void setEDXDZ(double err_dxdz) { err_dxdz_ = err_dxdz; }
103
104 void setEDYDZ(double err_dydz) { err_dydz_ = err_dydz; }
105
107
108 // energy of cluster
109 double getEnergy() const { return energy_; }
110
111 // number of hits - equivalent to number of strips
112 int getNHits() const { return n_hits_; }
113
114 // position (weighted by energy)
116 double getCentroidX() const { return centroid_x_; }
118 double getCentroidY() const { return centroid_y_; }
120 double getCentroidZ() const { return centroid_z_; }
122 int getLayer() const { return layer_; }
124 double getRMSX() const { return rms_x_; }
126 double getRMSY() const { return rms_y_; }
128 double getRMSZ() const { return rms_z_; }
130 double getDXDZ() const { return dxdz_; }
132 double getDYDZ() const { return dydz_; }
134 double getEDXDZ() const { return err_dxdz_; }
136 double getEDYDZ() const { return err_dydz_; }
137
138 // get hit rawIDs (unused)
139 const std::vector<unsigned int>& getHitIDs() const { return hit_ids_; }
140
141 // ability to store limited hit info
142 const std::vector<float>& getHitX() const { return hit_x_; }
143 const std::vector<float>& getHitY() const { return hit_y_; }
144 const std::vector<float>& getHitZ() const { return hit_z_; }
145 const std::vector<float>& getHitE() const { return hit_e_; }
146
147 bool operator<(const CaloCluster& rhs) const {
148 return this->getEnergy() < rhs.getEnergy();
149 }
150
151 protected:
152 std::vector<unsigned int> hit_ids_;
153 double energy_{0};
154 int n_hits_{0};
155 double centroid_x_{0};
156 double centroid_y_{0};
157 double centroid_z_{0};
158 int layer_{-1};
159 double rms_x_{0};
160 double rms_y_{0};
161 double rms_z_{0};
162 double dxdz_{0};
163 double dydz_{0};
164 double err_dxdz_{0};
165 double err_dydz_{0};
166 std::vector<float> hit_x_;
167 std::vector<float> hit_y_;
168 std::vector<float> hit_z_;
169 std::vector<float> hit_e_;
170
171 private:
172 ClassDef(CaloCluster, 3);
173};
174} // namespace ldmx
175
176#endif
Class that represents a reconstructed hit in a calorimeter cell within the detector.
Stores cluster information from the ECal.
Definition CaloCluster.h:26
double getRMSX() const
rms in x
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.
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:85
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: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
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.