LDMX Software
tracking::sim::LdmxMeasurementCalibrator Class Reference

Public Member Functions

 LdmxMeasurementCalibrator ()=default
 Construct an invalid calibrator. Required to allow copying.
 
 LdmxMeasurementCalibrator (const std::vector< ldmx::Measurement > &measurements)
 
template<typename traj_t >
void calibrate (const Acts::GeometryContext &, const Acts::CalibrationContext &, const Acts::SourceLink &genericSourceLink, typename traj_t::TrackStateProxy trackState) const
 Find the measurement corresponding to the source link.
 
template<typename traj_t >
void calibrate1d (const Acts::GeometryContext &, const Acts::CalibrationContext &, const Acts::SourceLink &genericSourceLink, typename traj_t::TrackStateProxy trackState) const
 Find the measurement corresponding to the source link.
 
void test (const Acts::GeometryContext &, const acts_examples::IndexSourceLink &sourceLink) const
 

Private Attributes

const std::vector< ldmx::Measurement > * m_measurements_ = nullptr
 

Detailed Description

Definition at line 42 of file MeasurementCalibrator.h.

Constructor & Destructor Documentation

◆ LdmxMeasurementCalibrator()

tracking::sim::LdmxMeasurementCalibrator::LdmxMeasurementCalibrator ( const std::vector< ldmx::Measurement > & measurements)
inline

Definition at line 48 of file MeasurementCalibrator.h.

49 {
50 m_measurements_ = &measurements;
51 }

Member Function Documentation

◆ calibrate()

template<typename traj_t >
void tracking::sim::LdmxMeasurementCalibrator::calibrate ( const Acts::GeometryContext & ,
const Acts::CalibrationContext & ,
const Acts::SourceLink & genericSourceLink,
typename traj_t::TrackStateProxy trackState ) const
inline

Find the measurement corresponding to the source link.

Uses a 2D measurement, cov-matrix and projection

Template Parameters
parameters_tTrack parameters type
Parameters
gctxThe geometry context (unused)
trackStateThe track state to calibrate

Definition at line 60 of file MeasurementCalibrator.h.

63 {
65 genericSourceLink.get<acts_examples::IndexSourceLink>()};
66 assert(m_measurements_ and
67 "Undefined measurement container in LdmxMeasurementCalibrator");
68 assert((source_link.index() < m_measurements_->size()) and
69 "Source link index is outside the container bounds in "
70 "LdmxMeasurementCalibrator");
71
72 auto meas = m_measurements_->at(source_link.index());
73 Acts::Vector2 local_pos{meas.getLocalPosition()[0],
74 meas.getLocalPosition()[1]};
75 trackState.allocateCalibrated(2);
76 auto ts_cal{trackState.template calibrated<2>()};
77 auto ts_cal_cov{trackState.template calibratedCovariance<2>()};
78 ts_cal.setZero();
79 ts_cal.template head<2>() = local_pos;
80 Acts::SquareMatrix2 local_cov;
81 local_cov.setZero();
82 local_cov(0, 0) = meas.getLocalCovariance()[0];
83 local_cov(1, 1) = meas.getLocalCovariance()[1];
84 ts_cal_cov.setZero();
85 // make tsCalCov 2x2 block the local_cov we just set
86 ts_cal_cov.block(0, 0, 2, 2) = local_cov;
87
88 trackState.setProjectorSubspaceIndices(
89 std::array<Acts::BoundIndices, 2>{Acts::eBoundLoc0, Acts::eBoundLoc1});
90 trackState.setUncalibratedSourceLink(Acts::SourceLink{genericSourceLink});
91 }

Referenced by ecal::EcalTrackFinderProcessor::produce(), and tracking::reco::CKFProcessor::produce().

◆ calibrate1d()

template<typename traj_t >
void tracking::sim::LdmxMeasurementCalibrator::calibrate1d ( const Acts::GeometryContext & ,
const Acts::CalibrationContext & ,
const Acts::SourceLink & genericSourceLink,
typename traj_t::TrackStateProxy trackState ) const
inline

Find the measurement corresponding to the source link.

Uses a 1D measurement, cov-matrix and projection

Template Parameters
parameters_tTrack parameters type
Parameters
gctxThe geometry context (unused)
trackStateThe track state to calibrate

Definition at line 100 of file MeasurementCalibrator.h.

103 {
105 genericSourceLink.get<acts_examples::IndexSourceLink>()};
106
107 assert(m_measurements_ and
108 "Undefined measurement container in LdmxMeasurementCalibrator");
109 assert((source_link.index() < m_measurements_->size()) and
110 "Source link index is outside the container bounds in "
111 "LdmxMeasurementCalibrator");
112
113 auto meas = m_measurements_->at(source_link.index());
114
115 trackState.allocateCalibrated(1);
116 auto ts_cal{trackState.template calibrated<1>()};
117 auto ts_cal_cov{trackState.template calibratedCovariance<1>()};
118
119 ts_cal.setZero();
120 ts_cal(0) = (meas.getLocalPosition())[0];
121 ts_cal_cov.setZero();
122 ts_cal_cov(0, 0) = (meas.getLocalCovariance())[0];
123
124 trackState.setProjectorSubspaceIndices(
125 std::array<Acts::BoundIndices, 1>{Acts::eBoundLoc0});
126 trackState.setUncalibratedSourceLink(Acts::SourceLink{genericSourceLink});
127 }

Referenced by tracking::reco::CKFProcessor::produce(), and tracking::reco::GSFProcessor::produce().

◆ test()

void tracking::sim::LdmxMeasurementCalibrator::test ( const Acts::GeometryContext & ,
const acts_examples::IndexSourceLink & sourceLink ) const
inline

Definition at line 132 of file MeasurementCalibrator.h.

133 {
134 auto meas = m_measurements_->at(sourceLink.index());
135
136 Acts::Vector3 global_pos{meas.getGlobalPosition()[0],
137 meas.getGlobalPosition()[1],
138 meas.getGlobalPosition()[2]};
139 std::cout << "Measurement global_position::\n" << global_pos << std::endl;
140
141 Acts::Vector2 local_pos{meas.getLocalPosition()[0],
142 meas.getLocalPosition()[1]};
143 std::cout << "Measurement local_position::\n" << local_pos << std::endl;
144 }

Member Data Documentation

◆ m_measurements_

const std::vector<ldmx::Measurement>* tracking::sim::LdmxMeasurementCalibrator::m_measurements_ = nullptr
private

Definition at line 148 of file MeasurementCalibrator.h.


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