18 #include <unordered_map>
22 namespace MultiTrajectoryHelpers {
44 std::unordered_map<GeometryIdentifier::Value, TrajectoryState>;
52 template <
typename traj_t>
55 multiTraj.visitBackwards(entryIndex, [&](
const auto&
state) {
57 const auto& geoID =
state.referenceSurface().geometryId();
58 const auto& volume = geoID.volume();
59 const auto&
layer = geoID.layer();
61 auto typeFlags =
state.typeFlags();
71 trajState.
NDF +=
state.calibratedSize();
95 template <
typename traj_t>
97 const traj_t& multiTraj,
size_t entryIndex,
98 const std::vector<GeometryIdentifier::Value>& volumeIds) {
100 multiTraj.visitBackwards(entryIndex, [&](
const auto&
state) {
102 const auto& geoID =
state.referenceSurface().geometryId();
103 const auto& volume = geoID.volume();
104 const auto&
layer = geoID.layer();
106 auto it = std::find(volumeIds.begin(), volumeIds.end(), volume);
107 if (
it == volumeIds.end()) {
111 auto& trajState = trajStateContainer[volume];
113 trajState.NDF +=
state.calibratedSize();
114 auto typeFlags =
state.typeFlags();
117 trajState.nSharedHits++;
119 trajState.nMeasurements++;
120 trajState.measurementChi2.push_back(
state.chi2());
121 trajState.measurementVolume.push_back(volume);
122 trajState.measurementLayer.push_back(
layer);
123 trajState.chi2Sum +=
state.chi2();
125 trajState.nOutliers++;
126 trajState.outlierChi2.push_back(
state.chi2());
127 trajState.outlierVolume.push_back(volume);
128 trajState.outlierLayer.push_back(
layer);
134 return trajStateContainer;
145 template <
typename track_state_proxy_t>
147 const track_state_proxy_t& trackStateProxy) {
149 trackStateProxy.referenceSurface(),
gctx, trackStateProxy.filtered());
160 template <
typename track_state_proxy_t>
162 const track_state_proxy_t& trackStateProxy) {
164 trackStateProxy.referenceSurface(),
gctx, trackStateProxy.smoothed());