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
 
void setEdep (float e)
 Set the energy deposited in the sensor [MeV].
 
void setTruthU (float u)
 Set the truth local U [mm]: the sim-hit global position projected onto the sensor surface, before any smearing or charge digitization.
 
float getTruthU () const
 
void setNStrips (int n)
 Set the number of strips that formed this cluster (-1 if not a cluster).
 
int getNStrips () const
 
void setClusterAmplitude (float amp)
 Set the total cluster amplitude [ADC counts].
 
float getClusterAmplitude () const
 

Private Member Functions

 ClassDef (Measurement, 3)
 

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.
 
float truth_u_ {std::numeric_limits<float>::quiet_NaN()}
 Truth local U [mm] projected from the SimTrackerHit before digitization.
 
int n_strips_ {-1}
 Number of strips in the cluster (-1 = not from strip clustering).
 
float cluster_amplitude_ {0}
 Total cluster amplitude [ADC counts] (0 = not from strip clustering).
 

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 13 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 115 of file Measurement.h.

115{ 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(), and tracking::reco::StripClusterProcessor::produce().

◆ getClusterAmplitude()

float ldmx::Measurement::getClusterAmplitude ( ) const
inline
Returns
Total cluster amplitude [ADC counts] (0 if not from strip clustering).

Definition at line 147 of file Measurement.h.

147{ return cluster_amplitude_; }
float cluster_amplitude_
Total cluster amplitude [ADC counts] (0 = not from strip clustering).

References cluster_amplitude_.

◆ getEdep()

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

Definition at line 121 of file Measurement.h.

121{ return edep_; };

References edep_.

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

◆ getGlobalPosition()

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

Definition at line 49 of file Measurement.h.

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

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 112 of file Measurement.h.

112{ 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 109 of file Measurement.h.

109{ 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 83 of file Measurement.h.

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

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 66 of file Measurement.h.

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

References meas_u_, and meas_v_.

◆ getNStrips()

int ldmx::Measurement::getNStrips ( ) const
inline
Returns
Number of strips in the cluster (-1 if not from strip clustering).

Definition at line 141 of file Measurement.h.

141{ return n_strips_; }
int n_strips_
Number of strips in the cluster (-1 = not from strip clustering).

References n_strips_.

◆ getTime()

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

Definition at line 95 of file Measurement.h.

95{ 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 117 of file Measurement.h.

117{ return track_ids_; };

References track_ids_.

◆ getTruthU()

float ldmx::Measurement::getTruthU ( ) const
inline
Returns
Truth local U [mm] (quiet_NaN if not set).

Definition at line 133 of file Measurement.h.

133{ return truth_u_; }
float truth_u_
Truth local U [mm] projected from the SimTrackerHit before digitization.

References truth_u_.

◆ setClusterAmplitude()

void ldmx::Measurement::setClusterAmplitude ( float amp)
inline

Set the total cluster amplitude [ADC counts].

Definition at line 144 of file Measurement.h.

144{ cluster_amplitude_ = amp; }

References cluster_amplitude_.

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

◆ setEdep()

void ldmx::Measurement::setEdep ( float e)
inline

Set the energy deposited in the sensor [MeV].

Definition at line 124 of file Measurement.h.

124{ edep_ = e; };

References edep_.

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

◆ 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 41 of file Measurement.h.

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

References meas_x_, meas_y_, and meas_z_.

Referenced by tracking::reco::DigitizationProcessor::digitizeHits(), tracking::reco::SeedFinderProcessor::produce(), and tracking::reco::StripClusterProcessor::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 103 of file Measurement.h.

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

References layer_, and layer_id_.

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

◆ 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 76 of file Measurement.h.

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

References cov_uu_, and cov_vv_.

Referenced by tracking::reco::DigitizationProcessor::digitizeHits(), tracking::reco::SeedFinderProcessor::produce(), and tracking::reco::StripClusterProcessor::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 60 of file Measurement.h.

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

References meas_u_, and meas_v_.

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

◆ setNStrips()

void ldmx::Measurement::setNStrips ( int n)
inline

Set the number of strips that formed this cluster (-1 if not a cluster).

Definition at line 139 of file Measurement.h.

139{ n_strips_ = n; }

References n_strips_.

Referenced by tracking::reco::StripClusterProcessor::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 92 of file Measurement.h.

92{ meas_t_ = meas_t; };

References meas_t_.

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

◆ setTruthU()

void ldmx::Measurement::setTruthU ( float u)
inline

Set the truth local U [mm]: the sim-hit global position projected onto the sensor surface, before any smearing or charge digitization.

Definition at line 131 of file Measurement.h.

131{ truth_u_ = u; }

References truth_u_.

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

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

◆ cluster_amplitude_

float ldmx::Measurement::cluster_amplitude_ {0}
private

Total cluster amplitude [ADC counts] (0 = not from strip clustering).

Definition at line 199 of file Measurement.h.

199{0};

Referenced by getClusterAmplitude(), and setClusterAmplitude().

◆ cov_uu_

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

cov(U, U)

Definition at line 184 of file Measurement.h.

184{0.};

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

◆ cov_vv_

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

cov(V, V)

Definition at line 186 of file Measurement.h.

186{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 182 of file Measurement.h.

182{0.};

Referenced by getEdep(), Measurement(), and setEdep().

◆ id_

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

The ID of the hit.

Definition at line 188 of file Measurement.h.

188{0};

Referenced by Measurement().

◆ layer_

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

The layer number internal to the tracker.

Definition at line 180 of file Measurement.h.

180{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 178 of file Measurement.h.

178{0};

Referenced by getLayerID(), and setLayerID().

◆ meas_t_

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

Measurement time (ns).

Definition at line 172 of file Measurement.h.

172{0.};

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

◆ meas_u_

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

Local position in u (mm).

Definition at line 174 of file Measurement.h.

174{0.};

Referenced by getLocalPosition(), and setLocalPosition().

◆ meas_v_

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

Local position in v (mm).

Definition at line 176 of file Measurement.h.

176{0.};

Referenced by getLocalPosition(), and setLocalPosition().

◆ meas_x_

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

The global position in x (mm).

Definition at line 166 of file Measurement.h.

166{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 168 of file Measurement.h.

168{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 170 of file Measurement.h.

170{0.};

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

◆ n_strips_

int ldmx::Measurement::n_strips_ {-1}
private

Number of strips in the cluster (-1 = not from strip clustering).

Definition at line 197 of file Measurement.h.

197{-1};

Referenced by getNStrips(), and setNStrips().

◆ track_ids_

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

TrackIDs the vector of TrackIDs that form the measurement.

Definition at line 190 of file Measurement.h.

190{};

Referenced by addTrackId(), and getTrackIds().

◆ truth_u_

float ldmx::Measurement::truth_u_ {std::numeric_limits<float>::quiet_NaN()}
private

Truth local U [mm] projected from the SimTrackerHit before digitization.

Initialised to quiet_NaN so the DQM can detect "not set".

Definition at line 194 of file Measurement.h.

194{std::numeric_limits<float>::quiet_NaN()};

Referenced by getTruthU(), and setTruthU().


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