Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-22 09:20:46

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #include "ActsExamples/TrackFitting/RefittingCalibrator.hpp"
0010 
0011 #include "Acts/EventData/MeasurementHelpers.hpp"
0012 #include "Acts/EventData/SourceLink.hpp"
0013 #include "Acts/Utilities/CalibrationContext.hpp"
0014 
0015 namespace ActsExamples {
0016 
0017 void RefittingCalibrator::calibrate(const Acts::GeometryContext& /*gctx*/,
0018                                     const Acts::CalibrationContext& /*cctx*/,
0019                                     const Acts::SourceLink& sourceLink,
0020                                     Proxy trackState) const {
0021   const auto sl = sourceLink.get<RefittingSourceLink>();
0022 
0023   // Reset the original uncalibrated source link on this track state
0024   trackState.setUncalibratedSourceLink(sl.state.getUncalibratedSourceLink());
0025 
0026   // Here we construct a measurement by extracting the information available
0027   // in the state
0028   Acts::visit_measurement(sl.state.calibratedSize(), [&](auto N) {
0029     using namespace Acts;
0030     constexpr int Size = decltype(N)::value;
0031 
0032     trackState.allocateCalibrated(
0033         sl.state.template calibrated<Size>().eval(),
0034         sl.state.template calibratedCovariance<Size>().eval());
0035   });
0036 
0037   trackState.setProjectorSubspaceIndices(sl.state.projectorSubspaceIndices());
0038 }
0039 
0040 }  // namespace ActsExamples