LDMX Software
TrigScintCluster.h
1
2#ifndef TRIGSCINT_EVENT_TRIGSCINTCLUSTER_H_
3#define TRIGSCINT_EVENT_TRIGSCINTCLUSTER_H_
4
5// STL
6#include <iostream>
7
8// ldmx-sw
9#include "TrigScint/Event/TrigScintHit.h"
10
11namespace ldmx {
12
19 public:
23 TrigScintCluster() = default;
24
28 virtual ~TrigScintCluster();
29
33 friend std::ostream& operator<<(std::ostream& o, const TrigScintCluster& d);
34
38 void clear(Option_t* option = ""); // override;
39
47 void addHit(uint idx, const ldmx::TrigScintHit* hit);
48
52 void setSeed(int idx) { seed_ = idx; }
53
58 void setEnergy(double energy) { energy_ = energy; }
59
64 void setPE(float PE) { pe_ = PE; }
65
70 void setNHits(int nHits) { n_hits_ = nHits; }
71
76 void setIDs(std::vector<unsigned int>& hitIDs) { hit_ids_ = hitIDs; }
77
84 void setCentroidXYZ(double x, double y, double z) {
85 centroid_x_ = x;
86 centroid_y_ = y;
87 centroid_z_ = z;
88 }
89
93 void setCentroid(double centroid) { centroid_ = centroid; }
94
96 void setTime(float t) { time_ = t; }
97
99 float getTime() const { return time_; }
100
102 void setBeamEfrac(float e) { beam_efrac_ = e; }
103
105 float getBeamEfrac() const { return beam_efrac_; }
106
108 int getSeed() const { return seed_; }
109
111 double getEnergy() const { return energy_; }
112
114 double getPE() const { return pe_; }
115
117 int getNHits() const { return n_hits_; }
118
120 double getCentroidX() const { return centroid_x_; }
121
123 double getCentroidY() const { return centroid_y_; }
124
126 double getCentroidZ() const { return centroid_z_; }
127
129 const std::vector<unsigned int>& getHitIDs() const { return hit_ids_; }
130
132 double getCentroid() const { return centroid_; }
133
134 bool operator<(const TrigScintCluster& rhs) const {
135 return this->getEnergy() < rhs.getEnergy();
136 }
137
138 private:
139 // hits forming the cluster
140 std::vector<unsigned int> hit_ids_;
141
142 // total cluster energy depostion
143 double energy_{0};
144
145 // number of hits forming the cluster
146 int n_hits_{0};
147
148 // total cluster photoelectron count
149 float pe_{0};
150
151 // index of cluster seeding hit
152 int seed_{-1};
153
154 // hit centroid in units of channel nb: energy weighted average of the IDs of
155 // the hits forming the cluster
156 double centroid_{-1};
157
158 // hit centroid in x [mm] (not implemented)
159 double centroid_x_{0};
160
161 // hit centroid in y [mm] (not implemented)
162 double centroid_y_{0};
163
164 // hit centroid in z [mm] (not implemented)
165 double centroid_z_{0};
166
167 // fraction of cluster energy deposited in a sim hit associated with beam
168 // electrons
169 float beam_efrac_{0.};
170
171 // cluster time: energy weighted average of the times of the hits forming the
172 // cluster
173 float time_{0.};
174
179};
180} // namespace ldmx
181
182#endif // TRIGSCINT_EVENT_TRIGSCINTCLUSTER_H_
Stores cluster information from the trigger scintillator pads.
int getNHits() const
Get the number of hits constituting the cluster.
int getSeed() const
Get cluster seed channel nb.
double getPE() const
Get cluster total photoelectron count.
ClassDef(TrigScintCluster, 3)
The ROOT class definition.
void setIDs(std::vector< unsigned int > &hitIDs)
The channel numbers of hits forming the cluster.
virtual ~TrigScintCluster()
Class destructor.
void setNHits(int nHits)
The number of hits forming the cluster.
TrigScintCluster()=default
Class constructor.
void setCentroidXYZ(double x, double y, double z)
The cluster centroid in x,y,z.
void setEnergy(double energy)
Set the cluster energy.
void setCentroid(double centroid)
double getCentroidZ() const
Get cluster centroid in z [mm] (not implmented)
float getTime() const
Get time of hit.
const std::vector< unsigned int > & getHitIDs() const
Get vector of channel IDs of hits forming the cluster.
double getEnergy() const
Get cluster total energy deposition.
friend std::ostream & operator<<(std::ostream &o, const TrigScintCluster &d)
Print a description of this object.
double getCentroidX() const
Get cluster centroid in x [mm] (not implmented)
void clear(Option_t *option="")
Reset the TrigScintCluster object.
void setPE(float PE)
Set the cluster photoelectron count (PE)
void setBeamEfrac(float e)
Set beam energy fraction of hit.
void setTime(float t)
Set time of hit.
double getCentroidY() const
Get cluster centroid in y [mm] (not implmented)
float getBeamEfrac() const
Get beam energy fraction of hit.
double getCentroid() const
Get the cluster centroid in units of channel nb.
void addHit(uint idx, const ldmx::TrigScintHit *hit)
Take in the hits that make up the cluster.