Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:41

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/Definitions/Algebra.hpp"
0012 #include "Acts/EventData/MeasurementHelpers.hpp"
0013 #include "Acts/EventData/SourceLink.hpp"
0014 #include "Acts/Utilities/CalibrationContext.hpp"
0015 
0016 namespace ActsExamples {
0017 
0018 void RefittingCalibrator::calibrate(const Acts::GeometryContext& /*gctx*/,
0019                                     const Acts::CalibrationContext& /*cctx*/,
0020                                     const Acts::SourceLink& sourceLink,
0021                                     Proxy trackState) const {
0022   const auto sl = sourceLink.get<RefittingSourceLink>();
0023 
0024   // Reset the original uncalibrated source link on this track state
0025   trackState.setUncalibratedSourceLink(sl.state.getUncalibratedSourceLink());
0026 
0027   // Here we construct a measurement by extracting the information available
0028   // in the state
0029   Acts::visit_measurement(sl.state.calibratedSize(), [&](auto N) {
0030     using namespace Acts;
0031     constexpr int Size = decltype(N)::value;
0032 
0033     trackState.allocateCalibrated(
0034         sl.state.template calibrated<Size>().eval(),
0035         sl.state.template calibratedCovariance<Size>().eval());
0036   });
0037 
0038   trackState.setProjectorSubspaceIndices(sl.state.projectorSubspaceIndices());
0039 }
0040 
0041 }  // namespace ActsExamples