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;
13 case "pathLength"_hash:
14 case "typeFlags"_hash:
15 case "predicted"_hash:
19 case "projector"_hash:
20 case "uncalibratedSourceLink"_hash:
21 case "calibrated"_hash:
22 case "calibratedCov"_hash:
24 case "referenceSurface"_hash:
27 for (auto& d : m_decorations) {
37 void ActsTrk::MutableMultiTrajectory::addColumn_impl(std::string_view name) {
38 // It is actually not clear if we would allow decorating RO MTJ, maybe we do
39 if constexpr (ActsTrk::detail::accepted_decoration_types<T>::value) {
40 m_decorations.emplace_back( ActsTrk::detail::decoration<T>(
42 ActsTrk::detail::constDecorationGetter<T>,
43 ActsTrk::detail::decorationCopier<T>,
44 ActsTrk::detail::decorationSetter<T>
47 INSPECTCALL("added dynamic decoration " << name << " n decorations now " << m_decorations.size());
49 // it would be useful to force presence of decoration already here
51 throw std::runtime_error("Can't add decoration of this type to MutableMultiTrajectory");
55 template <typename val_t, typename cov_t>
56 void ActsTrk::MutableMultiTrajectory::allocateCalibrated_impl(IndexType istate,
57 const Eigen::DenseBase<val_t>& val,
58 const Eigen::DenseBase<cov_t>& cov)
60 requires(Eigen::PlainObjectBase<val_t>::RowsAtCompileTime > 0 &&
61 Eigen::PlainObjectBase<val_t>::RowsAtCompileTime <= Acts::eBoundSize &&
62 Eigen::PlainObjectBase<val_t>::RowsAtCompileTime ==
63 Eigen::PlainObjectBase<cov_t>::RowsAtCompileTime &&
64 Eigen::PlainObjectBase<cov_t>::RowsAtCompileTime ==
65 Eigen::PlainObjectBase<cov_t>::ColsAtCompileTime)
67 constexpr std::size_t measdim = val_t::RowsAtCompileTime;
69 if(m_trackStatesAux->measDim.at(istate) != kInvalid
70 && m_trackStatesAux->measDim.at(istate) != measdim) {
71 throw std::invalid_argument{
72 "Measurement dimension does not match the allocated dimension"};
75 m_trackStatesAux->measDim.at(istate) = measdim;
76 auto idx = m_trackStatesAux->calibrated.at(istate);
77 m_trackMeasurementsAux->meas.at(idx).resize(measdim);
78 m_trackMeasurementsAux->covMatrix.at(idx).resize(measdim*measdim);
80 double* measPtr = m_trackMeasurementsAux->meas[idx].data();
81 Eigen::Map<Acts::ActsVector<measdim>> valMap(measPtr);
84 double* covPtr = m_trackMeasurementsAux->covMatrix[idx].data();
85 Eigen::Map<Acts::ActsSquareMatrix<measdim>> covMap(covPtr);