LDMX Software
Public Member Functions | Private Attributes | List of all members
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 calibrate_1d (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 ActsExamples::IndexSourceLink &sourceLink) const
 

Private Attributes

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

Detailed Description

Definition at line 40 of file MeasurementCalibrator.h.

Constructor & Destructor Documentation

◆ LdmxMeasurementCalibrator()

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

Definition at line 46 of file MeasurementCalibrator.h.

47 {
48 m_measurements = &measurements;
49 }

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 58 of file MeasurementCalibrator.h.

61 {
63 genericSourceLink.get<ActsExamples::IndexSourceLink>()};
64 assert(m_measurements and
65 "Undefined measurement container in LdmxMeasurementCalibrator");
66 assert((sourceLink.index() < m_measurements->size()) and
67 "Source link index is outside the container bounds in "
68 "LdmxMeasurementCalibrator");
69
70 auto meas = m_measurements->at(sourceLink.index());
71 Acts::Vector2 local_pos{meas.getLocalPosition()[0],
72 meas.getLocalPosition()[1]};
73 auto tsCal{trackState.template calibrated<2>()};
74 auto tsCalCov{trackState.template calibratedCovariance<2>()};
75 tsCal.setZero();
76 tsCal.template head<2>() = local_pos;
77 Acts::SquareMatrix2 local_cov;
78 local_cov.setZero();
79 local_cov(0, 0) = meas.getLocalCovariance()[0];
80 local_cov(1, 1) = meas.getLocalCovariance()[1];
81 tsCalCov.setZero();
82 // make tsCalCov 2x2 block the local_cov we just set
83 tsCalCov.block(0, 0, 2, 2) = local_cov;
84
85 Acts::ActsMatrix<2, 6> projector;
86 projector.setZero();
87 projector(0, 0) = 1.;
88 projector(1, 1) = 1.;
89
90 trackState.setProjector(projector);
91 }

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

◆ calibrate_1d()

template<typename traj_t >
void tracking::sim::LdmxMeasurementCalibrator::calibrate_1d ( 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<ActsExamples::IndexSourceLink>()};
106
107 assert(m_measurements and
108 "Undefined measurement container in LdmxMeasurementCalibrator");
109 assert((sourceLink.index() < m_measurements->size()) and
110 "Source link index is outside the container bounds in "
111 "LdmxMeasurementCalibrator");
112
113 auto meas = m_measurements->at(sourceLink.index());
114
115 trackState.allocateCalibrated(1);
116 auto tsCal{trackState.template calibrated<1>()};
117 auto tsCalCov{trackState.template calibratedCovariance<1>()};
118
119 tsCal.setZero();
120 tsCal(0) = (meas.getLocalPosition())[0];
121 tsCalCov.setZero();
122 tsCalCov(0, 0) = (meas.getLocalCovariance())[0];
123
124 Acts::ActsMatrix<2, 6> projector;
125 projector.setZero();
126 projector(0, 0) = 1.;
127 projector(1, 1) = 1.;
128 trackState.setProjector(projector.row(0));
129 trackState.setUncalibratedSourceLink(genericSourceLink);
130 }

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

◆ test()

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

Definition at line 135 of file MeasurementCalibrator.h.

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

Member Data Documentation

◆ m_measurements

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

Definition at line 151 of file MeasurementCalibrator.h.


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