LDMX Software
BeamElectronTruth.h
Go to the documentation of this file.
1
9#ifndef RECON_EVENT_BEAMELECTRONTRUTH_H_
10#define RECON_EVENT_BEAMELECTRONTRUTH_H_
11
12// ROOT
13
14// STL
15#include <Rtypes.h> // For ClassDef
16
17#include <iostream>
18
19namespace ldmx {
20
26 public:
30 BeamElectronTruth() = default;
31
35 virtual ~BeamElectronTruth() {};
36
40 friend std::ostream& operator<<(std::ostream& o, const BeamElectronTruth& d);
41
45 void clear();
46
51 void setX(double x) { x_ = x; }
52
57 void setY(double y) { y_ = y; }
58
63 void setZ(double z) { z_ = z; }
64
72 void setXYZ(double x, double y, double z) {
73 x_ = x;
74 y_ = y;
75 z_ = z;
76 }
77
82 double getX() { return x_; }
83
88 double getY() { return y_; }
89
94 double getZ() { return z_; }
95
96 // binned coordinates, according to some detector granularity. here, assume TS
97
102 void setBinnedX(double x) { binned_x_ = x; }
103
108 void setBinnedY(double y) { binned_y_ = y; }
109
115 void setBinnedXY(double x, double y) {
116 binned_x_ = x;
117 binned_y_ = y;
118 }
119
124 double getBinnedX() { return binned_x_; }
125
130 double getBinnedY() { return binned_y_; }
131
132 // repeat for bar numbers instead of a spatial (bar center) coordinate
133
138 void setBarX(double x) { bar_x_ = x; }
139
144 void setBarY(double y) { bar_y_ = y; }
145
151 void setBarXY(double x, double y) {
152 bar_x_ = x;
153 bar_y_ = y;
154 }
155
160 double getBarX() { return bar_x_; }
161
166 double getBarY() { return bar_y_; }
167
168 // TODO could add separate setters for each momentum component
169
176 void setThreeMomentum(double px, double py, double pz);
177
182 double getPx() { return px_; }
183
188 double getPy() { return py_; }
189
194 double getPz() { return pz_; }
195
200 bool operator<(BeamElectronTruth& rhs) { return this->getZ() < rhs.getZ(); }
201
202 private:
203 /* Algorithm variable results from simhit associations. */
204
206 double x_{-999};
207
209 double y_{-999};
210
213 double z_{-9999};
214
216 double binned_x_{-999};
217
219 double binned_y_{-999};
220
222 double bar_x_{-1};
223
225 double bar_y_{-1};
226
228 double px_{-999};
230 double py_{-999};
232 double pz_{-999};
233
234 ClassDef(BeamElectronTruth, 2);
235}; // class BeamElectronTruth
236} // namespace ldmx
237
238#endif
Represents the truth information on beam electrons at the target.
double binned_x_
x-coordinate (with TS resolution)
double bar_y_
TS horizontal bar number overlapping with y-coordinate.
double getX()
Get x coordinate of the beam electron.
virtual ~BeamElectronTruth()
Class destructor.
void setBarX(double x)
Set x bar number of the found beam electron.
double pz_
momentum z-component
void setBinnedY(double y)
SetBinned y coordinate of the found beam electron.
double getBarX()
Get x bar number of the found beam electron.
double getBarY()
Get y_ bar number of the found beam electron.
void setY(double y)
Set y_ coordinate of the found beam electron.
double getBinnedY()
GetBinned y_ coordinate of the beam electron.
void clear()
Clear the data in the object.
double px_
momentum x-component
void setBinnedXY(double x, double y)
Set all three binned spatial coordinates at once.
bool operator<(BeamElectronTruth &rhs)
some sorting operator is mandatory sort on hit Z coordinate
double getBinnedX()
Get binned x coordinate of the beam electron.
double getPy()
Get py component of the beam electron momentum.
double getPx()
Get px component of the beam electron momentum.
double py_
momentum y-component
BeamElectronTruth()=default
Class constructor.
void setThreeMomentum(double px, double py, double pz)
Set the entire three-momentum at once.
void setXYZ(double x, double y, double z)
Set all three spatial coordinates at once.
double binned_y_
y-coordinate (with TS resolution)
double z_
z-coordinate ("truth" resolution, in practice, set to taget z-coord = 0
void setBarXY(double x, double y)
Set both bar number coordinates at once.
double getZ()
Get z_ coordinate of the beam electron.
void setZ(double z)
Set z coordinate of the found beam electron.
double getPz()
Get pz component of the beam electron momentum.
double x_
x-coordinate ("truth" resolution, but within merging tolerance)
double y_
y-coordinate ("truth" resolution, but within merging tolerance)
void setX(double x)
Set x coordinate of the found beam electron.
double getY()
Get y_ coordinate of the beam electron.
void setBarY(double y)
Set y_ bar number of the found beam electron.
friend std::ostream & operator<<(std::ostream &o, const BeamElectronTruth &d)
Print a description of this object.
void setBinnedX(double x)
SetBinned x coordinate of the found beam electron.
double bar_x_
TS vertical bar number overlapping with x-coordinate.