16 &measurement_to_summary_type,
19 std::vector<ActsTrk::TrackStateBackend::ConstTrackStateProxy::IndexType > ¶m_state_idx_out,
20 std::array<std::array<uint8_t, Acts::toUnderlying(
HitCategory::N)>,
24 chi2_stat_out.
reset();
26 struct TimeInfoHelper {
double sum{};
double sumInv2{};
double chi2{};
unsigned int n=0u;};
27 TimeInfoHelper time_info_helper;
30 param_state_idx_out.clear();
32 const auto lastMeasurementIndex = track.tipIndex();
33 track.container().trackStateContainer().visitBackwards(
35 [&measurement_to_summary_type,
39 &special_hit_counts_out,
41 ](
const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy &state) ->
void
44 auto flag = state.typeFlags();
45 if (!state.hasReferenceSurface()) {
49 const auto* placement =
dynamic_cast<const ISurfacePlacement*
>(state.referenceSurface().surfacePlacement());
50 if (placement !=
nullptr) {
51 det_type =
toMeasType(placement->detectorType());
54 if (flag.hasNoExpectedHit()) {
61 const Amg::Vector2D localPos{state.parameters()[Acts::eBoundLoc0],
62 state.parameters()[Acts::eBoundLoc1]};
63 if (state.referenceSurface().insideBounds(localPos)) {
65 ++special_hit_counts_out.at(Acts::toUnderlying(det_type)).at(Acts::toUnderlying(
HitCategory::Hole));
71 if (!flag.hasMeasurement() || !state.hasUncalibratedSourceLink()) {
74 param_state_idx_out.push_back(state.index());
78 assert( uncalibMeas !=
nullptr );
79 assert( det_type == uncalibMeas->type());
81 if (measurement_to_summary_type.at(Acts::toUnderlying(uncalibMeas->type())) <
86 if (flag.isSharedHit()) {
89 if (flag.isSplitHit()) {
94 hit_info_out.
addHit(det_type, siDet, hit_selection);
98 if (!flag.isOutlier() && state.hasCalibrated()) {
100 assert( state.calibratedSize()==3);
101 auto pos = state.calibrated<3>();
102 auto cov = state.calibratedCovariance<3>();
103 time_info_helper.sum += pos[2];
104 time_info_helper.sumInv2 += 1./cov(2,2);
105 time_info_helper.chi2 += state.chi2();
106 ++time_info_helper.n;
110 if (state.calibratedSize()>0 && !flag.isOutlier()) {
113 double chi2add = std::min(state.chi2(),1e5f) / state.calibratedSize();
114 chi2_stat_out.
add(chi2add );
120 if (time_info_helper.n>1) {
123 time_info.
chi2 = time_info_helper.chi2;
128 time_info.
chi2 = time_info_helper.chi2;
void gatherTrackSummaryData(const typename ActsTrk::TrackContainer::ConstTrackProxy &track, const std::array< unsigned short, Acts::toUnderlying(xAOD::UncalibMeasType::nTypes)> &measurement_to_summary_type, SumOfValues &chi2_stat_out, HitSummaryData &hit_info_out, std::vector< ActsTrk::TrackStateBackend::ConstTrackStateProxy::IndexType > ¶m_state_idx_out, std::array< std::array< uint8_t, Acts::toUnderlying(HitCategory::N)>, Acts::toUnderlying(xAOD::UncalibMeasType::nTypes)> &special_hit_counts_out, TimeInfo &time_info)
Helper to gather track summary information from the track states of the specified track.