Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:09:41

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2021 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #include "Acts/TrackFitting/detail/GsfUtils.hpp"
0010 
0011 #include "Acts/EventData/MeasurementHelpers.hpp"
0012 
0013 #include <cstddef>
0014 
0015 namespace Acts::detail {
0016 
0017 using TrackStateTraits =
0018     TrackStateTraits<MultiTrajectoryTraits::MeasurementSizeMax, true>;
0019 
0020 ActsScalar calculateDeterminant(
0021     const double* fullCalibratedCovariance,
0022     TrackStateTraits::Covariance predictedCovariance,
0023     TrackStateTraits::Projector projector, unsigned int calibratedSize) {
0024   return visit_measurement(calibratedSize, [&](auto N) {
0025     constexpr std::size_t kMeasurementSize = decltype(N)::value;
0026 
0027     typename Acts::TrackStateTraits<
0028         kMeasurementSize, true>::MeasurementCovariance calibratedCovariance{
0029         fullCalibratedCovariance};
0030 
0031     const auto H =
0032         projector.template topLeftCorner<kMeasurementSize, eBoundSize>().eval();
0033 
0034     return (H * predictedCovariance * H.transpose() + calibratedCovariance)
0035         .determinant();
0036   });
0037 }
0038 }  // namespace Acts::detail