LDMX Software
PFCandidate.h
Go to the documentation of this file.
1
7#ifndef RECON_EVENT_PFCANDIDATE_H_
8#define RECON_EVENT_PFCANDIDATE_H_
9
10// ROOT
11#include "TObject.h" //For ClassDef
12
13namespace ldmx {
14
20 public:
21 PFCandidate() = default;
22 virtual ~PFCandidate() {}
23
24 friend std::ostream &operator<<(std::ostream &o, const PFCandidate &d);
25
26 bool operator<(const PFCandidate &rhs) const {
27 return this->getEnergy() < rhs.getEnergy();
28 }
29
30 /*
31 Setters
32 */
33 void setPID(int x_) { pid_ = x_; }
34 void setMass(float x_) { mass_ = x_; }
35 void setEnergy(float x_) { energy_ = x_; }
36
37 void setTargetPositionXYZ(float x_, float y_, float z_) {
38 pos_targ_x_ = x_;
39 pos_targ_y_ = y_;
40 pos_targ_z_ = z_;
41 }
42 void setEcalPositionXYZ(float x_, float y_, float z_) {
43 pos_ecal_x_ = x_;
44 pos_ecal_y_ = y_;
45 pos_ecal_z_ = z_;
46 }
47 void setHcalPositionXYZ(float x_, float y_, float z_) {
48 pos_hcal_x_ = x_;
49 pos_hcal_y_ = y_;
50 pos_hcal_z_ = z_;
51 }
52 void setTrackPxPyPz(float x_, float y_, float z_) {
53 track_px_ = x_;
54 track_py_ = y_;
55 track_pz_ = z_;
56 }
57 // associate component indices to the pf candidate
58 void setTrackIndex(int x) { track_idx_ = x; }
59 void setEcalIndex(int x) { ecal_idx_ = x; }
60 void setHcalIndex(int x) { hcal_idx_ = x; }
61
62 void setEcalEnergy(float x_) { ecal_energy_ = x_; }
63 void setEcalRawEnergy(float x_) { ecal_raw_energy_ = x_; }
64 void setEcalClusterXYZ(float x_, float y_, float z_) {
65 ecal_cluster_x_ = x_;
66 ecal_cluster_y_ = y_;
67 ecal_cluster_z_ = z_;
68 }
69 void setEcalClusterEXYZ(float x_, float y_, float z_) {
70 ecal_cluster_ex_ = x_;
71 ecal_cluster_ey_ = y_;
72 ecal_cluster_ez_ = z_;
73 }
74 void setEcalClusterDXDZ(float x_) { ecal_cluster_dxdz_ = x_; }
75 void setEcalClusterDYDZ(float x_) { ecal_cluster_dydz_ = x_; }
76 void setEcalClusterEDXDZ(float x_) { ecal_cluster_edxdz_ = x_; }
77 void setEcalClusterEDYDZ(float x_) { ecal_cluster_edydz_ = x_; }
78
79 void setHcalEnergy(float x_) { hcal_energy_ = x_; }
80 void setHcalRawEnergy(float x_) { hcal_raw_energy_ = x_; }
81 void setHcalClusterXYZ(float x_, float y_, float z_) {
82 hcal_cluster_x_ = x_;
83 hcal_cluster_y_ = y_;
84 hcal_cluster_z_ = z_;
85 }
86 void setHcalClusterEXYZ(float x_, float y_, float z_) {
87 hcal_cluster_ex_ = x_;
88 hcal_cluster_ey_ = y_;
89 hcal_cluster_ez_ = z_;
90 }
91 void setHcalClusterDXDZ(float x_) { hcal_cluster_dxdz_ = x_; }
92 void setHcalClusterDYDZ(float x_) { hcal_cluster_dydz_ = x_; }
93 void setHcalClusterEDXDZ(float x_) { hcal_cluster_edxdz_ = x_; }
94 void setHcalClusterEDYDZ(float x_) { hcal_cluster_edydz_ = x_; }
95
96 void setTruthEcalXYZ(double x_, double y_, double z_) {
97 truth_ecal_x_ = x_;
98 truth_ecal_y_ = y_;
99 truth_ecal_z_ = z_;
100 }
101 void setTruthPxPyPz(double x_, double y_, double z_) {
102 truth_px_ = x_;
103 truth_py_ = y_;
104 truth_pz_ = z_;
105 }
106 void setTruthMass(double x_) { truth_mass_ = x_; }
107 void setTruthEnergy(double x_) { truth_energy_ = x_; }
108 void setTruthPdgId(int x_) { truth_pdg_id_ = x_; }
109
110 /*
111 Getters
112 */
113 int getPID() const { return pid_; }
114 float getMass() const { return mass_; }
115 float getEnergy() const { return energy_; }
116
117 std::vector<float> getTargetPositionXYZ() const {
118 return {pos_targ_x_, pos_targ_y_, pos_targ_z_};
119 }
120 std::vector<float> getEcalPositionXYZ() const {
121 return {pos_ecal_x_, pos_ecal_y_, pos_ecal_z_};
122 }
123 std::vector<float> getHcalPositionXYZ() const {
124 return {pos_hcal_x_, pos_hcal_y_, pos_hcal_z_};
125 }
126 // associate component indices to the pf candidate
127 int getTrackIndex() const { return track_idx_; }
128 int getEcalIndex() const { return ecal_idx_; }
129 int getHcalIndex() const { return hcal_idx_; }
130
131 std::vector<float> getTrackPxPyPz() const {
132 return {track_px_, track_py_, track_pz_};
133 }
134
135 float getEcalEnergy() const { return ecal_energy_; }
136 float getEcalRawEnergy() const { return ecal_raw_energy_; }
137 std::vector<float> getEcalClusterXYZ() const {
138 return {ecal_cluster_x_, ecal_cluster_y_, ecal_cluster_z_};
139 }
140 std::vector<float> getEcalClusterEXYZ() const {
141 return {ecal_cluster_ex_, ecal_cluster_ey_, ecal_cluster_ez_};
142 }
143 float getEcalClusterDXDZ() const { return ecal_cluster_dxdz_; }
144 float getEcalClusterDYDZ() const { return ecal_cluster_dydz_; }
145 float getEcalClusterEDXDZ() const { return ecal_cluster_edxdz_; }
146 float getEcalClusterEDYDZ() const { return ecal_cluster_edydz_; }
147
148 float getHcalEnergy() const { return hcal_energy_; }
149 float getHcalRawEnergy() const { return hcal_raw_energy_; }
150 std::vector<float> getHcalClusterXYZ() const {
151 return {hcal_cluster_x_, hcal_cluster_y_, hcal_cluster_z_};
152 }
153 std::vector<float> getHcalClusterEXYZ() const {
154 return {hcal_cluster_ex_, hcal_cluster_ey_, hcal_cluster_ez_};
155 }
156 float getHcalClusterDXDZ() const { return hcal_cluster_dxdz_; }
157 float getHcalClusterDYDZ() const { return hcal_cluster_dydz_; }
158 float getHcalClusterEDXDZ() const { return hcal_cluster_edxdz_; }
159 float getHcalClusterEDYDZ() const { return hcal_cluster_edydz_; }
160
161 std::vector<double> const getTruthEcalXYZ() {
162 return {truth_ecal_x_, truth_ecal_y_, truth_ecal_z_};
163 }
164 std::vector<double> const getTruthPxPyPz() {
165 return {truth_px_, truth_py_, truth_pz_};
166 }
167 double getTruthMass() { return truth_mass_; }
168 double getTruthEnergy() { return truth_energy_; }
169 int getTruthPdgId() { return truth_pdg_id_; }
170
171 private:
172 /* Particle ID enum */
173 int pid_{0};
174 float mass_{0};
175 float energy_{0};
176
177 /* Position at the Target */
178 float pos_targ_x_{0};
179 float pos_targ_y_{0};
180 float pos_targ_z_{0};
181 /* Position at the ECal face */
182 float pos_ecal_x_{0};
183 float pos_ecal_y_{0};
184 float pos_ecal_z_{0};
185 /* Position at the HCal face */
186 float pos_hcal_x_{0};
187 float pos_hcal_y_{0};
188 float pos_hcal_z_{0};
189
190 /* track momenta */
191 float track_px_{0};
192 float track_py_{0};
193 float track_pz_{0};
194
195 /* Ecal energy, cluster info */
196 float ecal_energy_{0};
197 float ecal_raw_energy_{0};
198 float ecal_cluster_x_{0};
199 float ecal_cluster_y_{0};
200 float ecal_cluster_z_{0};
201 float ecal_cluster_ex_{0};
202 float ecal_cluster_ey_{0};
203 float ecal_cluster_ez_{0};
204 float ecal_cluster_dxdz_{0};
205 float ecal_cluster_dydz_{0};
206 float ecal_cluster_edxdz_{0};
207 float ecal_cluster_edydz_{0};
208
209 /* Hcal energy, cluster info */
210 float hcal_energy_{0};
211 float hcal_raw_energy_{0};
212 float hcal_cluster_x_{0};
213 float hcal_cluster_y_{0};
214 float hcal_cluster_z_{0};
215 float hcal_cluster_ex_{0};
216 float hcal_cluster_ey_{0};
217 float hcal_cluster_ez_{0};
218 float hcal_cluster_dxdz_{0};
219 float hcal_cluster_dydz_{0};
220 float hcal_cluster_edxdz_{0};
221 float hcal_cluster_edydz_{0};
222
223 /* Information for truth matched particles */
224 double truth_ecal_x_{0};
225 double truth_ecal_y_{0};
226 double truth_ecal_z_{0};
227 double truth_px_{0};
228 double truth_py_{0};
229 double truth_pz_{0};
230 double truth_mass_{0};
231 double truth_energy_{0};
232 int truth_pdg_id_{0};
233
234 /* Indices of the components making up the PFlow object */
235 int track_idx_{-1};
236 int ecal_idx_{-1};
237 int hcal_idx_{-1};
238
239 /* The ROOT class definition. */
240 ClassDef(PFCandidate, 2);
241};
242} // namespace ldmx
243
244#endif /* RECON_EVENT_PFCANDIDATE_H_ */
Represents a reconstructed particle.
Definition PFCandidate.h:19