6 #include "Acts/Surfaces/BoundaryCheck.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::BoundaryCheck bcheck(
69 || state.referenceSurface().bounds().type() != Acts::SurfaceBounds::eAnnulus),
72 || state.referenceSurface().bounds().type() == Acts::SurfaceBounds::eAnnulus)
75 Acts::Vector2 localPos(state.predicted()[Acts::eBoundLoc0],state.predicted()[Acts::eBoundLoc1]);
76 if (state.referenceSurface().insideBounds(localPos,bcheck)) {
81 ++special_hit_counts_out.at(to_underlying(det_type)).at(HitCategory::Hole);
85 else if (
flag.test(Acts::TrackStateFlag::MeasurementFlag)) {
87 param_state_idx_out.push_back(state.index());
91 if (state.hasUncalibratedSourceLink()) {
92 auto sl = state.getUncalibratedSourceLink().template get<ActsTrk::ATLASUncalibSourceLink>();
93 assert( sl != nullptr );
94 const xAOD::UncalibratedMeasurement &uncalibMeas = getUncalibratedMeasurement(sl);
95 if (measurement_to_summary_type.at(to_underlying(uncalibMeas.type())) < xAOD::numberOfTrackSummaryTypes ) {
96 if (static_cast<unsigned int>(to_underlying(uncalibMeas.type())) < siDetEleColl.size()) {
97 hit_info_out.addHit(siDetEleColl[to_underlying(uncalibMeas.type())],
98 uncalibMeas.identifierHash(),
99 (flag.test(Acts::TrackStateFlag::OutlierFlag)
100 ? HitSummaryData::Outlier
101 : HitSummaryData::Hit));
104 if (state.calibratedSize()>0 && !
flag.test(Acts::TrackStateFlag::OutlierFlag)) {
107 double chi2add = std::min(state.chi2(),1e5f) / state.calibratedSize();
108 chi2_stat_out.add(chi2add );