LDMX Software
Measurement.cxx
1#include "Tracking/Event/Measurement.h"
2
3ClassImp(ldmx::Measurement)
4
5 namespace ldmx {
6 Measurement::Measurement(const ldmx::SimTrackerHit& hit, const float& sigma_u,
7 const float& sigma_v) {
8 // Set the global positions
9 x_ = hit.getPosition()[2];
10 y_ = hit.getPosition()[0];
11 z_ = hit.getPosition()[1];
12
13 // Set the energy deposited
14 edep_ = hit.getEdep();
15
16 // Set the measurement time
17 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
30 std::ostream& operator<<(std::ostream& output,
31 const Measurement& measurement) {
32 output << "[ Measurement ]:\n\tGlobal position (mm): [ " << measurement.x_
33 << ", " << measurement.y_ << ", " << measurement.z_
34 << " ]\n\tLocal position (mm): [ " << measurement.u_ << ", "
35 << measurement.v_ << "]\n\tcov(U,U) " << measurement.cov_uu_
36 << " cov(V,V) " << measurement.cov_vv_
37 << "\n\tTime: " << measurement.t_
38 << " ns \n\tLayer ID: " << measurement.layerid_
39 << "\n\tLayer: " << measurement.layer_
40 << "\n\tEnergy Deposition: " << measurement.edep_ << " MeV"
41 << std::endl;
42
43 return output;
44 }
45}
float cov_vv_
cov(V, V)
Measurement()=default
Default constructor.
float edep_
The energy deposited in the sensor where the measurement took place.
float z_
The global position in x (mm).
float t_
Measurement time (ns).
float x_
The global position in x (mm).
float cov_uu_
cov(U, U)
void addTrackId(int trkId)
Add a trackId to the internal vector.
float y_
The global position in x (mm).
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.