LDMX Software
ldmx::Measurement Class Reference

Public Member Functions

 Measurement ()=default
 Default constructor.
 
 Measurement (const ldmx::SimTrackerHit &hit, const float &cov_uu=0.05, const float &cov_vv=1.0)
 Constructor that uses a SimTrackerHit to populate the global position, deposited energy, ID and measurement time.
 
virtual ~Measurement ()=default
 Default destructor.
 
void setGlobalPosition (const float &meas_x, const float &meas_y, const float &meas_z)
 Set the global position i.e.
 
std::array< float, 3 > getGlobalPosition () const
 
void setLocalPosition (const float &meas_u, const float &meas_v)
 Set the local position i.e.
 
std::array< float, 2 > getLocalPosition () const
 
void setLocalCovariance (const float &cov_uu, const float &cov_vv)
 Set cov(U,U) and cov(V, V).
 
std::array< float, 2 > getLocalCovariance () const
 
void setTime (const float &meas_t)
 Set the measurement time in ns.
 
float getTime () const
 
void setLayerID (const int &layer_id)
 Set the layer ID of the sensor where this measurement took place.
 
int getLayerID () const
 
int getLayer () const
 
void addTrackId (int trk_id)
 Add a trackId to the internal vector.
 
std::vector< unsigned int > getTrackIds () const
 
float getEdep () const
 

Private Member Functions

 ClassDef (Measurement, 2)
 

Private Attributes

float meas_x_ {0.}
 The global position in x (mm).
 
float meas_y_ {0.}
 The global position in x (mm).
 
float meas_z_ {0.}
 The global position in x (mm).
 
float meas_t_ {0.}
 Measurement time (ns).
 
float meas_u_ {0.}
 Local position in u (mm).
 
float meas_v_ {0.}
 Local position in v (mm).
 
int layer_id_ {0}
 The ID of the sensor where the measurement took place.
 
int layer_ {0}
 The layer number internal to the tracker.
 
float edep_ {0.}
 The energy deposited in the sensor where the measurement took place.
 
float cov_uu_ {0.}
 cov(U, U)
 
float cov_vv_ {0.}
 cov(V, V)
 
int id_ {0}
 The ID of the hit.
 
std::vector< unsigned int > track_ids_ {}
 TrackIDs the vector of TrackIDs that form the measurement.
 

Friends

std::ostream & operator<< (std::ostream &output, const Measurement &measurement)
 Overload the stream insertion operator to output a string representation of this Measurement.
 

Detailed Description

Definition at line 12 of file Measurement.h.

Constructor & Destructor Documentation

◆ Measurement()

ldmx::Measurement::Measurement ( const ldmx::SimTrackerHit & hit,
const float & cov_uu = 0.05,
const float & cov_vv = 1.0 )

Constructor that uses a SimTrackerHit to populate the global position, deposited energy, ID and measurement time.

The cov(U, U) and cov(V, V) are optional.

Parameters
hitThe SimTrackerHit used to set the initial Measurement values.
cov_uucov(U, U)
cov_vvcov(V, V)

Definition at line 6 of file Measurement.cxx.

7 {
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}
float cov_vv_
cov(V, V)
float meas_y_
The global position in x (mm).
void addTrackId(int trk_id)
Add a trackId to the internal vector.
float edep_
The energy deposited in the sensor where the measurement took place.
float meas_z_
The global position in x (mm).
float meas_t_
Measurement time (ns).
float meas_x_
The global position in x (mm).
float cov_uu_
cov(U, U)
int id_
The ID of the hit.
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.

References addTrackId(), cov_uu_, cov_vv_, edep_, ldmx::SimTrackerHit::getEdep(), ldmx::SimTrackerHit::getID(), ldmx::SimTrackerHit::getPosition(), ldmx::SimTrackerHit::getTime(), ldmx::SimTrackerHit::getTrackID(), id_, meas_t_, meas_x_, meas_y_, and meas_z_.

Member Function Documentation

◆ addTrackId()

void ldmx::Measurement::addTrackId ( int trk_id)
inline

Add a trackId to the internal vector.

Definition at line 114 of file Measurement.h.

114{ track_ids_.push_back(trk_id); };
std::vector< unsigned int > track_ids_
TrackIDs the vector of TrackIDs that form the measurement.

References track_ids_.

Referenced by Measurement().

◆ getEdep()

float ldmx::Measurement::getEdep ( ) const
inline
Returns
The energy deposited in the sensor where the measurement took place.

Definition at line 120 of file Measurement.h.

120{ return edep_; };

References edep_.

◆ getGlobalPosition()

std::array< float, 3 > ldmx::Measurement::getGlobalPosition ( ) const
inlinenodiscard
Returns
The global position of the measurement as an array.

Definition at line 48 of file Measurement.h.

48 {
49 return std::array<float, 3>{meas_x_, meas_y_, meas_z_};
50 };

References meas_x_, meas_y_, and meas_z_.

Referenced by tracking::reco::DigitizationProcessor::digitizeHits().

◆ getLayer()

int ldmx::Measurement::getLayer ( ) const
inline
Returns
The layer number internal to the tracker.

Definition at line 111 of file Measurement.h.

111{ return layer_; }
int layer_
The layer number internal to the tracker.

References layer_.

◆ getLayerID()

int ldmx::Measurement::getLayerID ( ) const
inlinenodiscard
Returns
The layer ID of the sensor associated with this measurement.

Definition at line 108 of file Measurement.h.

108{ return layer_id_; };
int layer_id_
The ID of the sensor where the measurement took place.

References layer_id_.

◆ getLocalCovariance()

std::array< float, 2 > ldmx::Measurement::getLocalCovariance ( ) const
inlinenodiscard
Returns
The covariance of the local coordinates as an array { cov(U, U), cov(V, V) }.

Definition at line 82 of file Measurement.h.

82 {
83 return std::array<float, 2>{cov_uu_, cov_vv_};
84 };

References cov_uu_, and cov_vv_.

◆ getLocalPosition()

std::array< float, 2 > ldmx::Measurement::getLocalPosition ( ) const
inlinenodiscard
Returns
The local position of the measurement as an array.

Definition at line 65 of file Measurement.h.

65 {
66 return std::array<float, 2>{meas_u_, meas_v_};
67 };
float meas_v_
Local position in v (mm).
float meas_u_
Local position in u (mm).

References meas_u_, and meas_v_.

◆ getTime()

float ldmx::Measurement::getTime ( ) const
inlinenodiscard
Returns
The hit time in ns.

Definition at line 94 of file Measurement.h.

94{ return meas_t_; };

References meas_t_.

◆ getTrackIds()

std::vector< unsigned int > ldmx::Measurement::getTrackIds ( ) const
inline
Returns
the sim particle IDs that compose the measurement

Definition at line 116 of file Measurement.h.

116{ return track_ids_; };

References track_ids_.

◆ setGlobalPosition()

void ldmx::Measurement::setGlobalPosition ( const float & meas_x,
const float & meas_y,
const float & meas_z )
inline

Set the global position i.e.

position of the measurement in the detector frame.

Parameters
xPosition in x in mm.
yPosition in y in mm.
zPosition in z in mm.

Definition at line 40 of file Measurement.h.

41 {
42 meas_x_ = meas_x;
43 meas_y_ = meas_y;
44 meas_z_ = meas_z;
45 };

References meas_x_, meas_y_, and meas_z_.

Referenced by tracking::reco::DigitizationProcessor::digitizeHits(), and tracking::reco::SeedFinderProcessor::produce().

◆ setLayerID()

void ldmx::Measurement::setLayerID ( const int & layer_id)
inline

Set the layer ID of the sensor where this measurement took place.

Parameters
layer_idThe layer ID of the sensor associated with this measurement.

Definition at line 102 of file Measurement.h.

102 {
103 layer_id_ = layer_id;
104 layer_ = ((layer_id_ / 100) % 10 - 1) * 2 + layer_id % 2;
105 };

References layer_, and layer_id_.

Referenced by tracking::reco::DigitizationProcessor::digitizeHits().

◆ setLocalCovariance()

void ldmx::Measurement::setLocalCovariance ( const float & cov_uu,
const float & cov_vv )
inline

Set cov(U,U) and cov(V, V).

Parameters
cov_uucov(U, U).
cov_vvcov(V, V).

Definition at line 75 of file Measurement.h.

75 {
76 cov_uu_ = cov_uu;
77 cov_vv_ = cov_vv;
78 }

References cov_uu_, and cov_vv_.

Referenced by tracking::reco::DigitizationProcessor::digitizeHits(), and tracking::reco::SeedFinderProcessor::produce().

◆ setLocalPosition()

void ldmx::Measurement::setLocalPosition ( const float & meas_u,
const float & meas_v )
inline

Set the local position i.e.

position of the measurement in the reference frame of the surface where the hit was created.

Parameters
uPosition in U in mm.
vPosition in V in mm.

Definition at line 59 of file Measurement.h.

59 {
60 meas_u_ = meas_u;
61 meas_v_ = meas_v;
62 };

References meas_u_, and meas_v_.

Referenced by tracking::reco::DigitizationProcessor::digitizeHits(), and tracking::reco::SeedFinderProcessor::produce().

◆ setTime()

void ldmx::Measurement::setTime ( const float & meas_t)
inline

Set the measurement time in ns.

Parameters
meas_tThe time in ns.

Definition at line 91 of file Measurement.h.

91{ meas_t_ = meas_t; };

References meas_t_.

Referenced by tracking::reco::SeedFinderProcessor::produce().

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & output,
const Measurement & measurement )
friend

Overload the stream insertion operator to output a string representation of this Measurement.

Parameters
[in]outputThe output stream where the string representation will be inserted.
[in]measurementThe Measurement object to print.
Returns
[out] An ostream object with the string representation of Measurement.

Definition at line 30 of file Measurement.cxx.

30 {
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}

Member Data Documentation

◆ cov_uu_

float ldmx::Measurement::cov_uu_ {0.}
private

cov(U, U)

Definition at line 157 of file Measurement.h.

157{0.};

Referenced by getLocalCovariance(), Measurement(), and setLocalCovariance().

◆ cov_vv_

float ldmx::Measurement::cov_vv_ {0.}
private

cov(V, V)

Definition at line 159 of file Measurement.h.

159{0.};

Referenced by getLocalCovariance(), Measurement(), and setLocalCovariance().

◆ edep_

float ldmx::Measurement::edep_ {0.}
private

The energy deposited in the sensor where the measurement took place.

Definition at line 155 of file Measurement.h.

155{0.};

Referenced by getEdep(), and Measurement().

◆ id_

int ldmx::Measurement::id_ {0}
private

The ID of the hit.

Definition at line 161 of file Measurement.h.

161{0};

Referenced by Measurement().

◆ layer_

int ldmx::Measurement::layer_ {0}
private

The layer number internal to the tracker.

Definition at line 153 of file Measurement.h.

153{0};

Referenced by getLayer(), and setLayerID().

◆ layer_id_

int ldmx::Measurement::layer_id_ {0}
private

The ID of the sensor where the measurement took place.

Definition at line 151 of file Measurement.h.

151{0};

Referenced by getLayerID(), and setLayerID().

◆ meas_t_

float ldmx::Measurement::meas_t_ {0.}
private

Measurement time (ns).

Definition at line 145 of file Measurement.h.

145{0.};

Referenced by getTime(), Measurement(), and setTime().

◆ meas_u_

float ldmx::Measurement::meas_u_ {0.}
private

Local position in u (mm).

Definition at line 147 of file Measurement.h.

147{0.};

Referenced by getLocalPosition(), and setLocalPosition().

◆ meas_v_

float ldmx::Measurement::meas_v_ {0.}
private

Local position in v (mm).

Definition at line 149 of file Measurement.h.

149{0.};

Referenced by getLocalPosition(), and setLocalPosition().

◆ meas_x_

float ldmx::Measurement::meas_x_ {0.}
private

The global position in x (mm).

Definition at line 139 of file Measurement.h.

139{0.};

Referenced by getGlobalPosition(), Measurement(), and setGlobalPosition().

◆ meas_y_

float ldmx::Measurement::meas_y_ {0.}
private

The global position in x (mm).

Definition at line 141 of file Measurement.h.

141{0.};

Referenced by getGlobalPosition(), Measurement(), and setGlobalPosition().

◆ meas_z_

float ldmx::Measurement::meas_z_ {0.}
private

The global position in x (mm).

Definition at line 143 of file Measurement.h.

143{0.};

Referenced by getGlobalPosition(), Measurement(), and setGlobalPosition().

◆ track_ids_

std::vector<unsigned int> ldmx::Measurement::track_ids_ {}
private

TrackIDs the vector of TrackIDs that form the measurement.

Definition at line 163 of file Measurement.h.

163{};

Referenced by addTrackId(), and getTrackIds().


The documentation for this class was generated from the following files: