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
53 void setTrackPxPyPz(float x_, float y_, float z_) {
54 track_px_ = x_;
55 track_py_ = y_;
56 track_pz_ = z_;
57 }
58
59 void setEcalEnergy(float x_) { ecal_energy_ = x_; }
60 void setEcalRawEnergy(float x_) { ecal_raw_energy_ = x_; }
61 void setEcalClusterXYZ(float x_, float y_, float z_) {
62 ecal_cluster_x_ = x_;
63 ecal_cluster_y_ = y_;
64 ecal_cluster_z_ = z_;
65 }
66 void setEcalClusterEXYZ(float x_, float y_, float z_) {
67 ecal_cluster_ex_ = x_;
68 ecal_cluster_ey_ = y_;
69 ecal_cluster_ez_ = z_;
70 }
71 void setEcalClusterDXDZ(float x_) { ecal_cluster_dxdz_ = x_; }
72 void setEcalClusterDYDZ(float x_) { ecal_cluster_dydz_ = x_; }
73 void setEcalClusterEDXDZ(float x_) { ecal_cluster_edxdz_ = x_; }
74 void setEcalClusterEDYDZ(float x_) { ecal_cluster_edydz_ = x_; }
75
76 void setHcalEnergy(float x_) { hcal_energy_ = x_; }
77 void setHcalRawEnergy(float x_) { hcal_raw_energy_ = x_; }
78 void setHcalClusterXYZ(float x_, float y_, float z_) {
79 hcal_cluster_x_ = x_;
80 hcal_cluster_y_ = y_;
81 hcal_cluster_z_ = z_;
82 }
83 void setHcalClusterEXYZ(float x_, float y_, float z_) {
84 hcal_cluster_ex_ = x_;
85 hcal_cluster_ey_ = y_;
86 hcal_cluster_ez_ = z_;
87 }
88 void setHcalClusterDXDZ(float x_) { hcal_cluster_dxdz_ = x_; }
89 void setHcalClusterDYDZ(float x_) { hcal_cluster_dydz_ = x_; }
90 void setHcalClusterEDXDZ(float x_) { hcal_cluster_edxdz_ = x_; }
91 void setHcalClusterEDYDZ(float x_) { hcal_cluster_edydz_ = x_; }
92
93 void setTruthEcalXYZ(double x_, double y_, double z_) {
94 truth_ecal_x_ = x_;
95 truth_ecal_y_ = y_;
96 truth_ecal_z_ = z_;
97 }
98 void setTruthPxPyPz(double x_, double y_, double z_) {
99 truth_px_ = x_;
100 truth_py_ = y_;
101 truth_pz_ = z_;
102 }
103 void setTruthMass(double x_) { truth_mass_ = x_; }
104 void setTruthEnergy(double x_) { truth_energy_ = x_; }
105 void setTruthPdgId(int x_) { truth_pdg_id_ = x_; }
106
107 /*
108 Getters
109 */
110 int getPID() const { return pid_; }
111 float getMass() const { return mass_; }
112 float getEnergy() const { return energy_; }
113
114 std::vector<float> getTargetPositionXYZ() const {
115 return {pos_targ_x_, pos_targ_y_, pos_targ_z_};
116 }
117 std::vector<float> getEcalPositionXYZ() const {
118 return {pos_ecal_x_, pos_ecal_y_, pos_ecal_z_};
119 }
120 std::vector<float> getHcalPositionXYZ() const {
121 return {pos_hcal_x_, pos_hcal_y_, pos_hcal_z_};
122 }
123
124 std::vector<float> getTrackPxPyPz() const {
125 return {track_px_, track_py_, track_pz_};
126 }
127
128 float getEcalEnergy() const { return ecal_energy_; }
129 float getEcalRawEnergy() const { return ecal_raw_energy_; }
130 std::vector<float> getEcalClusterXYZ() const {
131 return {ecal_cluster_x_, ecal_cluster_y_, ecal_cluster_z_};
132 }
133 std::vector<float> getEcalClusterEXYZ() const {
134 return {ecal_cluster_ex_, ecal_cluster_ey_, ecal_cluster_ez_};
135 }
136 float getEcalClusterDXDZ() const { return ecal_cluster_dxdz_; }
137 float getEcalClusterDYDZ() const { return ecal_cluster_dydz_; }
138 float getEcalClusterEDXDZ() const { return ecal_cluster_edxdz_; }
139 float getEcalClusterEDYDZ() const { return ecal_cluster_edydz_; }
140
141 float getHcalEnergy() const { return hcal_energy_; }
142 float getHcalRawEnergy() const { return hcal_raw_energy_; }
143 std::vector<float> getHcalClusterXYZ() const {
144 return {hcal_cluster_x_, hcal_cluster_y_, hcal_cluster_z_};
145 }
146 std::vector<float> getHcalClusterEXYZ() const {
147 return {hcal_cluster_ex_, hcal_cluster_ey_, hcal_cluster_ez_};
148 }
149 float getHcalClusterDXDZ() const { return hcal_cluster_dxdz_; }
150 float getHcalClusterDYDZ() const { return hcal_cluster_dydz_; }
151 float getHcalClusterEDXDZ() const { return hcal_cluster_edxdz_; }
152 float getHcalClusterEDYDZ() const { return hcal_cluster_edydz_; }
153
154 std::vector<double> const getTruthEcalXYZ() {
155 return {truth_ecal_x_, truth_ecal_y_, truth_ecal_z_};
156 }
157 std::vector<double> const getTruthPxPyPz() {
158 return {truth_px_, truth_py_, truth_pz_};
159 }
160 double getTruthMass() { return truth_mass_; }
161 double getTruthEnergy() { return truth_energy_; }
162 int getTruthPdgId() { return truth_pdg_id_; }
163
164 private:
165 /* Particle ID enum */
166 int pid_{0};
167 float mass_{0};
168 float energy_{0};
169
170 /* Position at the Target */
171 float pos_targ_x_{0};
172 float pos_targ_y_{0};
173 float pos_targ_z_{0};
174 /* Position at the ECal face */
175 float pos_ecal_x_{0};
176 float pos_ecal_y_{0};
177 float pos_ecal_z_{0};
178 /* Position at the HCal face */
179 float pos_hcal_x_{0};
180 float pos_hcal_y_{0};
181 float pos_hcal_z_{0};
182
183 /* track momenta */
184 float track_px_{0};
185 float track_py_{0};
186 float track_pz_{0};
187
188 /* Ecal energy, cluster info */
189 float ecal_energy_{0};
190 float ecal_raw_energy_{0};
191 float ecal_cluster_x_{0};
192 float ecal_cluster_y_{0};
193 float ecal_cluster_z_{0};
194 float ecal_cluster_ex_{0};
195 float ecal_cluster_ey_{0};
196 float ecal_cluster_ez_{0};
197 float ecal_cluster_dxdz_{0};
198 float ecal_cluster_dydz_{0};
199 float ecal_cluster_edxdz_{0};
200 float ecal_cluster_edydz_{0};
201
202 /* Hcal energy, cluster info */
203 float hcal_energy_{0};
204 float hcal_raw_energy_{0};
205 float hcal_cluster_x_{0};
206 float hcal_cluster_y_{0};
207 float hcal_cluster_z_{0};
208 float hcal_cluster_ex_{0};
209 float hcal_cluster_ey_{0};
210 float hcal_cluster_ez_{0};
211 float hcal_cluster_dxdz_{0};
212 float hcal_cluster_dydz_{0};
213 float hcal_cluster_edxdz_{0};
214 float hcal_cluster_edydz_{0};
215
216 /* Information for truth matched particles */
217 double truth_ecal_x_{0};
218 double truth_ecal_y_{0};
219 double truth_ecal_z_{0};
220 double truth_px_{0};
221 double truth_py_{0};
222 double truth_pz_{0};
223 double truth_mass_{0};
224 double truth_energy_{0};
225 int truth_pdg_id_{0};
226
227 /* The ROOT class definition. */
228 ClassDef(PFCandidate, 2);
229};
230} // namespace ldmx
231
232#endif /* RECON_EVENT_PFCANDIDATE_H_ */
Represents a reconstructed particle.
Definition PFCandidate.h:19