File indexing completed on 2025-01-18 09:11:48
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "ActsExamples/EventData/MeasurementCalibration.hpp"
0010
0011 #include "Acts/EventData/SourceLink.hpp"
0012 #include "ActsExamples/EventData/IndexSourceLink.hpp"
0013 #include "ActsExamples/EventData/Measurement.hpp"
0014
0015 #include <cassert>
0016
0017 namespace Acts {
0018 class VectorMultiTrajectory;
0019 }
0020
0021 void ActsExamples::PassThroughCalibrator::calibrate(
0022 const MeasurementContainer& measurements,
0023 const ClusterContainer* , const Acts::GeometryContext& ,
0024 const Acts::CalibrationContext& ,
0025 const Acts::SourceLink& sourceLink,
0026 Acts::VectorMultiTrajectory::TrackStateProxy& trackState) const {
0027 trackState.setUncalibratedSourceLink(Acts::SourceLink{sourceLink});
0028 const IndexSourceLink& idxSourceLink = sourceLink.get<IndexSourceLink>();
0029
0030 assert((idxSourceLink.index() < measurements.size()) &&
0031 "Source link index is outside the container bounds");
0032
0033 const ConstVariableBoundMeasurementProxy measurement =
0034 measurements.getMeasurement(idxSourceLink.index());
0035
0036 Acts::visit_measurement(measurement.size(), [&](auto N) -> void {
0037 constexpr std::size_t kMeasurementSize = decltype(N)::value;
0038 const ConstFixedBoundMeasurementProxy<kMeasurementSize> fixedMeasurement =
0039 static_cast<ConstFixedBoundMeasurementProxy<kMeasurementSize>>(
0040 measurement);
0041
0042 trackState.allocateCalibrated(fixedMeasurement.parameters().eval(),
0043 fixedMeasurement.covariance().eval());
0044 trackState.setProjectorSubspaceIndices(fixedMeasurement.subspaceIndices());
0045 });
0046 }
0047
0048 ActsExamples::MeasurementCalibratorAdapter::MeasurementCalibratorAdapter(
0049 const MeasurementCalibrator& calibrator,
0050 const MeasurementContainer& measurements, const ClusterContainer* clusters)
0051 : m_calibrator{calibrator},
0052 m_measurements{measurements},
0053 m_clusters{clusters} {}
0054
0055 void ActsExamples::MeasurementCalibratorAdapter::calibrate(
0056 const Acts::GeometryContext& gctx, const Acts::CalibrationContext& cctx,
0057 const Acts::SourceLink& sourceLink,
0058 Acts::VectorMultiTrajectory::TrackStateProxy trackState) const {
0059 return m_calibrator.calibrate(m_measurements, m_clusters, gctx, cctx,
0060 sourceLink, trackState);
0061 }