6 #include "Acts/Surfaces/BoundaryTolerance.hpp"
17 const typename ActsTrk::TrackContainer::ConstTrackProxy &
track,
21 &measurement_to_summary_type,
24 std::vector<ActsTrk::TrackStateBackend::ConstTrackStateProxy::IndexType > ¶m_state_idx_out,
28 chi2_stat_out.
reset();
31 param_state_idx_out.clear();
33 const auto lastMeasurementIndex =
track.tipIndex();
34 tracksContainer.trackStateContainer().visitBackwards(
37 &measurement_to_summary_type,
41 &special_hit_counts_out
42 ](
const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy &state) ->
void
45 auto flag = state.typeFlags();
46 if (
flag.test(Acts::TrackStateFlag::HoleFlag)) {
47 xAOD::UncalibMeasType det_type = xAOD::UncalibMeasType::Other;
48 if (state.hasReferenceSurface()) {
49 if (state.referenceSurface().associatedDetectorElement()) {
50 const ActsDetectorElement *
51 actsDetEl = dynamic_cast<const ActsDetectorElement *>(state.referenceSurface().associatedDetectorElement());
53 const InDetDD::SiDetectorElement *
54 detEl = dynamic_cast<const InDetDD::SiDetectorElement *>(actsDetEl->upstreamDetectorElement());
56 if (detEl->isPixel()) {
57 det_type = xAOD::UncalibMeasType::PixelClusterType;
59 else if (detEl->isSCT()) {
60 det_type = xAOD::UncalibMeasType::StripClusterType;
67 Acts::BoundaryTolerance
tolerance = Acts::BoundaryTolerance::AbsoluteBound(
70 || state.referenceSurface().bounds().type() != Acts::SurfaceBounds::eAnnulus)
71 ? 0.0 : std::numeric_limits<double>::infinity(),
74 || state.referenceSurface().bounds().type() == Acts::SurfaceBounds::eAnnulus)
75 ? 0.0 : std::numeric_limits<double>::infinity()
77 Acts::Vector2 localPos(state.predicted()[Acts::eBoundLoc0],state.predicted()[Acts::eBoundLoc1]);
78 if (state.referenceSurface().insideBounds(localPos,
tolerance)) {
83 ++special_hit_counts_out.at(to_underlying(det_type)).at(HitCategory::Hole);
87 else if (
flag.test(Acts::TrackStateFlag::MeasurementFlag)) {
89 param_state_idx_out.push_back(state.index());
93 if (state.hasUncalibratedSourceLink()) {
94 auto sl = state.getUncalibratedSourceLink().template get<ActsTrk::ATLASUncalibSourceLink>();
95 assert( sl != nullptr );
96 const xAOD::UncalibratedMeasurement &uncalibMeas = getUncalibratedMeasurement(sl);
97 if (measurement_to_summary_type.at(to_underlying(uncalibMeas.type())) < xAOD::numberOfTrackSummaryTypes ) {
98 if (static_cast<unsigned int>(to_underlying(uncalibMeas.type())) < siDetEleColl.size()) {
99 hit_info_out.addHit(siDetEleColl[to_underlying(uncalibMeas.type())],
100 uncalibMeas.identifierHash(),
101 (flag.test(Acts::TrackStateFlag::OutlierFlag)
102 ? HitSummaryData::Outlier
103 : HitSummaryData::Hit));
106 if (state.calibratedSize()>0 && !
flag.test(Acts::TrackStateFlag::OutlierFlag)) {
109 double chi2add = std::min(state.chi2(),1e5f) / state.calibratedSize();
110 chi2_stat_out.add(chi2add );