Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MeasurementCalibration.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MeasurementCalibration.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2023 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
13 
14 #include <cassert>
15 #include <variant>
16 
17 namespace Acts {
18 class VectorMultiTrajectory;
19 } // namespace Acts
20 
22  const MeasurementContainer& measurements,
23  const ClusterContainer* /*clusters*/, const Acts::GeometryContext& /*gctx*/,
24  const Acts::CalibrationContext& /*cctx*/,
25  const Acts::SourceLink& sourceLink,
27  trackState.setUncalibratedSourceLink(sourceLink);
28  const IndexSourceLink& idxSourceLink = sourceLink.get<IndexSourceLink>();
29 
30  assert((idxSourceLink.index() < measurements.size()) and
31  "Source link index is outside the container bounds");
32 
33  std::visit(
34  [&trackState](const auto& meas) {
35  trackState.allocateCalibrated(meas.size());
36  trackState.setCalibrated(meas);
37  },
38  (measurements)[idxSourceLink.index()]);
39 }
40 
42  const MeasurementCalibrator& calibrator,
43  const MeasurementContainer& measurements, const ClusterContainer* clusters)
44  : m_calibrator{calibrator},
45  m_measurements{measurements},
46  m_clusters{clusters} {}
47 
50  const Acts::SourceLink& sourceLink,
52  return m_calibrator.calibrate(m_measurements, m_clusters, gctx, cctx,
53  sourceLink, trackState);
54 }