Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-08 09:22:31

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 "Acts/TrackFitting/detail/GsfUtils.hpp"
0010 
0011 #include "Acts/EventData/MeasurementHelpers.hpp"
0012 #include "Acts/EventData/SubspaceHelpers.hpp"
0013 #include "Acts/EventData/Types.hpp"
0014 
0015 #include <cstddef>
0016 #include <cstdint>
0017 #include <span>
0018 
0019 namespace Acts::detail {
0020 
0021 using TrackStateTraits = TrackStateTraits<kMeasurementSizeMax, true>;
0022 
0023 double calculateDeterminant(const double* fullCalibratedCovariance,
0024                             TrackStateTraits::Covariance predictedCovariance,
0025                             BoundSubspaceIndices projector,
0026                             unsigned int calibratedSize) {
0027   return visit_measurement(calibratedSize, [&](auto N) {
0028     constexpr std::size_t kMeasurementSize = decltype(N)::value;
0029     std::span<const std::uint8_t, kMeasurementSize> validSubspaceIndices(
0030         projector.begin(), projector.begin() + kMeasurementSize);
0031     FixedBoundSubspaceHelper<kMeasurementSize> subspaceHelper(
0032         validSubspaceIndices);
0033 
0034     typename Acts::TrackStateTraits<
0035         kMeasurementSize, true>::CalibratedCovariance calibratedCovariance{
0036         fullCalibratedCovariance};
0037 
0038     const auto H = subspaceHelper.projector();
0039 
0040     return (H * predictedCovariance * H.transpose() + calibratedCovariance)
0041         .determinant();
0042   });
0043 }
0044 }  // namespace Acts::detail