2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
6 constexpr bool ActsTrk::MutableMultiTrajectory::hasColumn_impl(
7 Acts::HashedString key) const {
8 using namespace Acts::HashedStringLiteral;
14 case "pathLength"_hash:
15 case "typeFlags"_hash:
16 case "predicted"_hash:
20 case "projector"_hash:
21 case "uncalibratedSourceLink"_hash:
22 case "calibrated"_hash:
23 case "calibratedCov"_hash:
25 case "referenceSurface"_hash:
28 for (auto& d : m_decorations) {
38 void ActsTrk::MutableMultiTrajectory::addColumn_impl(std::string_view name) {
39 // It is actually not clear if we would allow decorating RO MTJ, maybe we do
40 if constexpr (ActsTrk::detail::accepted_decoration_types<T>::value) {
41 m_decorations.emplace_back( ActsTrk::detail::decoration<T>(
43 ActsTrk::detail::constDecorationGetter<T>,
44 ActsTrk::detail::decorationCopier<T>,
45 ActsTrk::detail::decorationSetter<T>
48 // it would be useful to force presence of decoration already here
50 throw std::runtime_error("Can't add decoration of this type to MutableMultiTrajectory");
54 template <typename val_t, typename cov_t>
55 void ActsTrk::MutableMultiTrajectory::allocateCalibrated_impl(IndexType istate,
56 const Eigen::DenseBase<val_t>& val,
57 const Eigen::DenseBase<cov_t>& cov)
59 requires(Eigen::PlainObjectBase<val_t>::RowsAtCompileTime > 0 &&
60 Eigen::PlainObjectBase<val_t>::RowsAtCompileTime <= Acts::eBoundSize &&
61 Eigen::PlainObjectBase<val_t>::RowsAtCompileTime ==
62 Eigen::PlainObjectBase<cov_t>::RowsAtCompileTime &&
63 Eigen::PlainObjectBase<cov_t>::RowsAtCompileTime ==
64 Eigen::PlainObjectBase<cov_t>::ColsAtCompileTime)
66 constexpr std::size_t measdim = val_t::RowsAtCompileTime;
68 if(m_trackStatesAux->measDim.at(istate) != kInvalid
69 && m_trackStatesAux->measDim.at(istate) != measdim) {
70 throw std::invalid_argument{
71 "Measurement dimension does not match the allocated dimension"};
74 m_trackStatesAux->measDim.at(istate) = measdim;
75 auto idx = m_trackStatesAux->calibrated.at(istate);
76 m_trackMeasurementsAux->meas.at(idx).resize(measdim);
77 m_trackMeasurementsAux->covMatrix.at(idx).resize(measdim*measdim);
79 double* measPtr = m_trackMeasurementsAux->meas[idx].data();
80 Eigen::Map<Acts::ActsVector<measdim>> valMap(measPtr);
83 double* covPtr = m_trackMeasurementsAux->covMatrix[idx].data();
84 Eigen::Map<Acts::ActsSquareMatrix<measdim>> covMap(covPtr);