Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-12 07:51:26

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 #pragma once
0010 
0011 #include "Acts/EventData/TrackStateProxy.hpp"
0012 
0013 namespace Acts {
0014 
0015 template <typename D, std::size_t M, bool ReadOnly>
0016 inline TrackStateProxy<D, M, ReadOnly>::TrackStateProxy(
0017     detail_lt::ConstIf<MultiTrajectory<D>, ReadOnly>& trajectory,
0018     IndexType istate)
0019     : m_traj(&trajectory), m_istate(istate) {}
0020 
0021 template <typename D, std::size_t M, bool ReadOnly>
0022 TrackStatePropMask TrackStateProxy<D, M, ReadOnly>::getMask() const {
0023   using PM = TrackStatePropMask;
0024 
0025   PM mask = PM::None;
0026   if (hasPredicted()) {
0027     mask |= PM::Predicted;
0028   }
0029   if (hasFiltered()) {
0030     mask |= PM::Filtered;
0031   }
0032   if (hasSmoothed()) {
0033     mask |= PM::Smoothed;
0034   }
0035   if (hasJacobian()) {
0036     mask |= PM::Jacobian;
0037   }
0038   if (hasCalibrated()) {
0039     mask |= PM::Calibrated;
0040   }
0041   return mask;
0042 }
0043 
0044 template <typename D, std::size_t M, bool ReadOnly>
0045 inline auto TrackStateProxy<D, M, ReadOnly>::parameters() const
0046     -> ConstParameters {
0047   if (hasSmoothed()) {
0048     return smoothed();
0049   } else if (hasFiltered()) {
0050     return filtered();
0051   } else {
0052     return predicted();
0053   }
0054 }
0055 
0056 template <typename D, std::size_t M, bool ReadOnly>
0057 inline auto TrackStateProxy<D, M, ReadOnly>::covariance() const
0058     -> ConstCovariance {
0059   if (hasSmoothed()) {
0060     return smoothedCovariance();
0061   } else if (hasFiltered()) {
0062     return filteredCovariance();
0063   } else {
0064     return predictedCovariance();
0065   }
0066 }
0067 
0068 template <typename D, std::size_t M, bool ReadOnly>
0069 inline auto TrackStateProxy<D, M, ReadOnly>::getUncalibratedSourceLink() const
0070     -> SourceLink {
0071   assert(has<hashString("uncalibratedSourceLink")>());
0072   return m_traj->getUncalibratedSourceLink(m_istate);
0073 }
0074 
0075 }  // namespace Acts