Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RefittingCalibrator.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RefittingCalibrator.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 
10 
15 
16 namespace ActsExamples {
17 
19  const Acts::CalibrationContext& /*cctx*/,
20  const Acts::SourceLink& sourceLink,
21  Proxy trackState) const {
22  const auto sl = sourceLink.get<RefittingSourceLink>();
23 
24  // Reset the original uncalibrated sourcelink on this track state
25  trackState.setUncalibratedSourceLink(sl.state.getUncalibratedSourceLink());
26 
27  // Here we construct a measurement by extracting the information available
28  // in the state
29  Acts::visit_measurement(sl.state.calibratedSize(), [&](auto N) {
30  using namespace Acts;
31  constexpr int Size = decltype(N)::value;
32 
33  trackState.allocateCalibrated(Size);
34  trackState.template calibrated<Size>() =
35  sl.state.template calibrated<Size>();
36  trackState.template calibratedCovariance<Size>() =
37  sl.state.template calibratedCovariance<Size>();
38  });
39 
40  trackState.setProjectorBitset(sl.state.projectorBitset());
41 }
42 
43 } // namespace ActsExamples