6 #include "Acts/Surfaces/BoundaryTolerance.hpp"
16 const typename ActsTrk::TrackContainer::ConstTrackProxy &
track,
20 &measurement_to_summary_type,
23 std::vector<ActsTrk::TrackStateBackend::ConstTrackStateProxy::IndexType > ¶m_state_idx_out,
27 chi2_stat_out.
reset();
30 param_state_idx_out.clear();
32 const auto lastMeasurementIndex =
track.tipIndex();
33 tracksContainer.trackStateContainer().visitBackwards(
36 &measurement_to_summary_type,
40 &special_hit_counts_out
41 ](
const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy &state) ->
void
44 auto flag = state.typeFlags();
45 if (
flag.test(Acts::TrackStateFlag::HoleFlag)) {
46 xAOD::UncalibMeasType det_type = xAOD::UncalibMeasType::Other;
47 if (state.hasReferenceSurface()) {
48 if (state.referenceSurface().associatedDetectorElement()) {
49 const ActsDetectorElement *
50 actsDetEl = dynamic_cast<const ActsDetectorElement *>(state.referenceSurface().associatedDetectorElement());
52 const InDetDD::SiDetectorElement *
53 detEl = dynamic_cast<const InDetDD::SiDetectorElement *>(actsDetEl->upstreamDetectorElement());
55 if (detEl->isPixel()) {
56 det_type = xAOD::UncalibMeasType::PixelClusterType;
58 else if (detEl->isSCT()) {
59 det_type = xAOD::UncalibMeasType::StripClusterType;
66 Acts::Vector2 localPos(state.predicted()[Acts::eBoundLoc0],state.predicted()[Acts::eBoundLoc1]);
67 if (state.referenceSurface().insideBounds(localPos)) {
72 ++special_hit_counts_out.at(to_underlying(det_type)).at(HitCategory::Hole);
76 else if (
flag.test(Acts::TrackStateFlag::MeasurementFlag)) {
78 param_state_idx_out.push_back(state.index());
82 if (state.hasUncalibratedSourceLink()) {
83 auto sl = state.getUncalibratedSourceLink().template get<ActsTrk::ATLASUncalibSourceLink>();
84 assert( sl != nullptr );
85 const xAOD::UncalibratedMeasurement &uncalibMeas = getUncalibratedMeasurement(sl);
86 if (measurement_to_summary_type.at(to_underlying(uncalibMeas.type())) < xAOD::numberOfTrackSummaryTypes ) {
87 if (static_cast<unsigned int>(to_underlying(uncalibMeas.type())) < siDetEleColl.size()) {
88 HitSummaryData::EHitSelection hit_selection = (flag.test(Acts::TrackStateFlag::OutlierFlag)
89 ? HitSummaryData::Outlier
90 : HitSummaryData::Hit);
91 if (flag.test(Acts::TrackStateFlag::SharedHitFlag)) {
92 hit_selection = HitSummaryData::EHitSelection(hit_selection | HitSummaryData::SharedHit);
94 hit_info_out.addHit(siDetEleColl[to_underlying(uncalibMeas.type())],
95 uncalibMeas.identifierHash(),
99 if (state.calibratedSize()>0 && !
flag.test(Acts::TrackStateFlag::OutlierFlag)) {
102 double chi2add = std::min(state.chi2(),1e5f) / state.calibratedSize();
103 chi2_stat_out.add(chi2add );