2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 // has_impl implementation
8 constexpr std::optional<bool> has_impl(
9 const xAOD::TrackStateAuxContainer* trackStates, Acts::HashedString key,
10 ActsTrk::IndexType istate) {
11 using namespace Acts::HashedStringLiteral;
12 using Acts::MultiTrajectoryTraits::kInvalid;
13 INSPECTCALL(key << " " << istate);
17 return trackStates->previous[istate] < kInvalid;
19 INSPECTCALL(key << " " << istate << " chi2");
22 case "pathLength"_hash:{
23 INSPECTCALL(key << " " << istate << " pathLength");
26 case "typeFlags"_hash:{
27 INSPECTCALL(key << " " << istate << " type flags");
30 case "predicted"_hash:{
31 INSPECTCALL(key << " " << istate << " predicted");
32 return trackStates->predicted[istate] < kInvalid;
34 case "filtered"_hash:{
35 INSPECTCALL(key << " " << istate << " filtered");
36 return trackStates->filtered[istate] < kInvalid;
38 case "smoothed"_hash:{
39 INSPECTCALL(key << " " << istate << " smoothed");
40 return trackStates->smoothed[istate] < kInvalid;
42 case "jacobian"_hash:{
43 INSPECTCALL(key << " " << istate << " jacobian");
44 return trackStates->jacobian[istate] < kInvalid;
46 case "projector"_hash:{
47 INSPECTCALL(key << " " << istate << " projector");
48 return trackStates->calibrated[istate] < kInvalid;
50 case "calibrated"_hash:{
51 INSPECTCALL(key << " " << istate << " calibrated");
52 return trackStates->calibrated[istate] < kInvalid;
54 case "calibratedCov"_hash: {
55 INSPECTCALL(key << " " << istate << " calibratedCov");
56 return trackStates->calibrated[istate] < kInvalid;
58 case "measdim"_hash: {
59 INSPECTCALL(key << " " << istate << " measdim");
60 return trackStates->measDim[istate] < kInvalid;
62 case "referenceSurface"_hash: {
63 INSPECTCALL(key << " " << istate << " referenceSurfaceEnco");
67 // TODO restore once only the EL Source Links are in use
68 // return !trackStates[istate]->uncalibratedMeasurementLink().isDefault();
70 INSPECTCALL(key << " " << istate << " not a predefined component");
71 return std::optional<bool>();
73 } // namespace details
74 } // namespace ActsTrk
77 constexpr bool ActsTrk::MutableMultiTrajectory::hasColumn_impl(
78 Acts::HashedString key) const {
79 using namespace Acts::HashedStringLiteral;
85 case "pathLength"_hash:
86 case "typeFlags"_hash:
87 case "predicted"_hash:
91 case "projector"_hash:
92 case "uncalibratedSourceLink"_hash:
93 case "calibrated"_hash:
94 case "calibratedCov"_hash:
96 case "referenceSurface"_hash:
99 for (auto& d : m_decorations) {
108 template <typename T>
109 void ActsTrk::MutableMultiTrajectory::addColumn_impl(std::string_view name) {
110 // It is actually not clear if we would allow decorating RO MTJ, maybe we do
111 if constexpr (ActsTrk::detail::accepted_decoration_types<T>::value) {
112 m_decorations.emplace_back( ActsTrk::detail::decoration<T>(
114 ActsTrk::detail::constDecorationGetter<T>,
115 ActsTrk::detail::decorationCopier<T>,
116 ActsTrk::detail::decorationSetter<T>
119 // it would be useful to force presence of decoration already here
121 throw std::runtime_error("Can't add decoration of this type to MutableMultiTrajectory");
125 template <typename val_t, typename cov_t>
126 void ActsTrk::MutableMultiTrajectory::allocateCalibrated_impl(IndexType istate,
127 const Eigen::DenseBase<val_t>& val,
128 const Eigen::DenseBase<cov_t>& cov)
130 requires(Eigen::PlainObjectBase<val_t>::RowsAtCompileTime > 0 &&
131 Eigen::PlainObjectBase<val_t>::RowsAtCompileTime <= Acts::eBoundSize &&
132 Eigen::PlainObjectBase<val_t>::RowsAtCompileTime ==
133 Eigen::PlainObjectBase<cov_t>::RowsAtCompileTime &&
134 Eigen::PlainObjectBase<cov_t>::RowsAtCompileTime ==
135 Eigen::PlainObjectBase<cov_t>::ColsAtCompileTime)
137 constexpr std::size_t measdim = val_t::RowsAtCompileTime;
139 m_trackStatesAux->measDim[istate] = measdim;
140 auto idx = m_trackStatesAux->calibrated[istate];
141 m_trackMeasurementsAux->meas[idx].resize(measdim);
142 m_trackMeasurementsAux->covMatrix[idx].resize(measdim*measdim);
144 double* measPtr = m_trackMeasurementsAux->meas[idx].data();
145 Eigen::Map<Acts::ActsVector<measdim>> valMap(measPtr);
148 double* covPtr = m_trackMeasurementsAux->covMatrix[idx].data();
149 Eigen::Map<Acts::ActsSquareMatrix<measdim>> covMap(covPtr);