LDMX Software
Measurement.cxx
1#include "Tracking/Event/Measurement.h"
2
3ClassImp(ldmx::Measurement);
4
5namespace ldmx {
6Measurement::Measurement(const ldmx::SimTrackerHit& hit, const float& sigma_u,
7 const float& sigma_v) {
8 // Set the global positions
9 meas_x_ = hit.getPosition()[2];
10 meas_y_ = hit.getPosition()[0];
11 meas_z_ = hit.getPosition()[1];
12
13 // Set the energy deposited
14 edep_ = hit.getEdep();
15
16 // Set the measurement time
17 meas_t_ = hit.getTime();
18
19 // Set the measurement ID
20 id_ = hit.getID();
21
22 // Set the local covariances
23 cov_uu_ = sigma_u * sigma_u;
24 cov_vv_ = sigma_v * sigma_v;
25
26 // Store the trackID
28}
29
30std::ostream& operator<<(std::ostream& output, const Measurement& measurement) {
31 return output << "[ Measurement ]:\n\tGlobal position (mm): [ "
32 << measurement.meas_x_ << ", " << measurement.meas_y_ << ", "
33 << measurement.meas_z_ << " ]\n\tLocal position (mm): [ "
34 << measurement.meas_u_ << ", " << measurement.meas_v_
35 << "]\n\tcov(U,U) " << measurement.cov_uu_ << " cov(V,V) "
36 << measurement.cov_vv_ << "\n\tTime: " << measurement.meas_t_
37 << " ns \n\tLayer ID: " << measurement.layer_id_
38 << "\n\tLayer: " << measurement.layer_
39 << "\n\tEnergy Deposition: " << measurement.edep_ << " MeV";
40
41 return output;
42}
43} // namespace ldmx
float cov_vv_
cov(V, V)
float meas_y_
The global position in x (mm).
Measurement()=default
Default constructor.
int layer_
The layer number internal to the tracker.
void addTrackId(int trk_id)
Add a trackId to the internal vector.
float meas_v_
Local position in v (mm).
float edep_
The energy deposited in the sensor where the measurement took place.
float meas_z_
The global position in x (mm).
float meas_u_
Local position in u (mm).
float meas_t_
Measurement time (ns).
float meas_x_
The global position in x (mm).
float cov_uu_
cov(U, U)
int layer_id_
The ID of the sensor where the measurement took place.
int id_
The ID of the hit.
Represents a simulated tracker hit in the simulation.
float getEdep() const
Get the energy deposited on the hit [MeV].
std::vector< float > getPosition() const
Get the XYZ position of the hit [mm].
int getID() const
Get the detector ID of the hit.
float getTime() const
Get the global time of the hit [ns].
int getTrackID() const
Get the Sim particle track ID of the hit.