ATLAS Offline Software
Loading...
Searching...
No Matches
TrackFindingBaseAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7// ActsTrk
14#include "Acts/Surfaces/PerigeeSurface.hpp"
15
17
18#include <boost/math/distributions/chi_squared.hpp>
19#include <cmath>
20#include <numbers>
21
22namespace ActsTrk {
24
27
28 TrackFindingBaseAlg::TrackFindingBaseAlg(const std::string &name, ISvcLocator *pSvcLocator) : AthReentrantAlgorithm(name, pSvcLocator) {}
29
31
33 ATH_MSG_DEBUG("Properties Summary:");
45 ATH_MSG_DEBUG(" " << m_phiMin);
46 ATH_MSG_DEBUG(" " << m_phiMax);
47 ATH_MSG_DEBUG(" " << m_etaMin);
48 ATH_MSG_DEBUG(" " << m_etaMax);
51 ATH_MSG_DEBUG(" " << m_ptMin);
52 ATH_MSG_DEBUG(" " << m_ptMax);
53 ATH_MSG_DEBUG(" " << m_d0Min);
54 ATH_MSG_DEBUG(" " << m_d0Max);
55 ATH_MSG_DEBUG(" " << m_z0Min);
56 ATH_MSG_DEBUG(" " << m_z0Max);
75
76 m_logger = makeActsAthenaLogger(this, "Acts");
77
78 // Read and Write handles
79 ATH_CHECK(m_trackContainerKey.initialize());
81
82 ATH_CHECK(m_monTool.retrieve(EnableTool{not m_monTool.empty()}));
84 ATH_CHECK(m_ctxProvider.initialize());
85 ATH_CHECK(m_trackStatePrinter.retrieve(EnableTool{not m_trackStatePrinter.empty()}));
86 ATH_CHECK(m_pixelCalibTool.retrieve(EnableTool{not m_pixelCalibTool.empty()}));
87 ATH_CHECK(m_stripCalibTool.retrieve(EnableTool{not m_stripCalibTool.empty()}));
88 ATH_CHECK(m_hgtdCalibTool.retrieve(EnableTool{not m_hgtdCalibTool.empty()}));
89
90 auto magneticField = std::make_unique<ATLASMagneticFieldWrapper>();
91 auto trackingGeometry = m_trackingGeometrySvc->trackingGeometry();
92
93 if(trackingGeometry->geometryVersion() == Acts::TrackingGeometry::GeometryVersion::Gen3) {
94 m_endOfWorldVolumeIds.value().clear();
95 switch (m_envelopeConstraint.value()) {
96 using enum ActsTrk::SystemEnvelope;
97 case Acts::toUnderlying(ITkExit):
98 case Acts::toUnderlying(CaloExit): {
99 const Acts::TrackingVolume* volume = m_trackingGeometrySvc
100 ->getEnvelope(static_cast<SystemEnvelope>(m_envelopeConstraint.value()));
101 ATH_CHECK(volume != nullptr);
102 m_endOfWorldVolumeIds.value().push_back(volume->motherVolume()->geometryId().volume());
103 break;
104 } default: {
105 ATH_MSG_ERROR("Invalid configuration "<<m_envelopeConstraint);
106 return StatusCode::FAILURE;
107 }
108 }
109 }
110
111 detail::Stepper stepper(std::move(magneticField));
112 detail::Navigator::Config config{std::move(trackingGeometry)};
113 config.resolvePassive = false;
114 config.resolveMaterial = true;
115 config.resolveSensitive = true;
116 detail::Navigator navigator(std::move(config), logger().cloneWithSuffix("Navigator"));
117 detail::Propagator propagator(std::move(stepper), std::move(navigator), logger().cloneWithSuffix("Prop"));
118
119 // Using the CKF propagator as extrapolator
120 detail::Extrapolator extrapolator = propagator;
121
122 // m_etaBins (from flags.Tracking.ActiveConfig.etaBins) includes a dummy first and last bin, which we ignore
123 std::vector<double> absEtaEdges;
124 if (m_etaBins.size() <= 2)
125 {
126 absEtaEdges.reserve(2ul);
127 absEtaEdges.push_back(0.0);
128 absEtaEdges.push_back(std::numeric_limits<double>::infinity());
129 }
130 else
131 {
132 absEtaEdges.reserve(m_etaBins.size());
133 absEtaEdges.push_back(m_absEtaMin);
134 absEtaEdges.insert(absEtaEdges.end(), m_etaBins.begin() + 1, m_etaBins.end() - 1);
135 absEtaEdges.push_back(m_absEtaMax);
136 }
137
138 auto setCut = [](auto &cfgVal, const auto &cuts, size_t ind) -> void
139 {
140 if (cuts.empty())
141 return;
142 cfgVal = (ind < cuts.size()) ? cuts[ind] : cuts[cuts.size() - 1];
143 };
144
145 Acts::TrackSelector::EtaBinnedConfig trackSelectorCfg{std::move(absEtaEdges)};
146 if (m_etaBins.size() <= 2)
147 {
148 assert(trackSelectorCfg.cutSets.size() == 1);
149 trackSelectorCfg.cutSets[0].absEtaMin = m_absEtaMin;
150 trackSelectorCfg.cutSets[0].absEtaMax = m_absEtaMax;
151 }
152 size_t cutIndex = 0;
153 for (auto &cfg : trackSelectorCfg.cutSets)
154 {
155 setCut(cfg.phiMin, m_phiMin, cutIndex);
156 setCut(cfg.phiMax, m_phiMax, cutIndex);
157 setCut(cfg.etaMin, m_etaMin, cutIndex);
158 setCut(cfg.etaMax, m_etaMax, cutIndex);
159 setCut(cfg.ptMin, m_ptMin, cutIndex);
160 setCut(cfg.ptMax, m_ptMax, cutIndex);
161 setCut(cfg.loc0Min, m_d0Min, cutIndex);
162 setCut(cfg.loc0Max, m_d0Max, cutIndex);
163 setCut(cfg.loc1Min, m_z0Min, cutIndex);
164 setCut(cfg.loc1Max, m_z0Max, cutIndex);
165 setCut(cfg.minMeasurements, m_minMeasurements, cutIndex);
166 setCut(cfg.maxHoles, m_maxHoles, cutIndex);
167 setCut(cfg.maxOutliers, m_maxOutliers, cutIndex);
168 setCut(cfg.maxHolesAndOutliers, m_maxHolesAndOutliers, cutIndex);
169 setCut(cfg.maxSharedHits, m_maxSharedHits, cutIndex);
170 setCut(cfg.maxChi2, m_maxChi2, cutIndex);
171 ++cutIndex;
172 }
173
174 ATH_MSG_DEBUG(trackSelectorCfg);
175
176 // initializer measurement selector and connect it to the delegates of the track finder optins
177 ATH_CHECK(initializeMeasurementSelector());
178
179 detail::CKF_config ckfConfig{
180 std::move(extrapolator),
181 detail::CKF{std::move(propagator), logger().cloneWithSuffix("CKF")},
182 {},
183 Acts::TrackSelector{trackSelectorCfg}};
184
185 m_trackFinder = std::make_unique<CKF_pimpl>(std::move(ckfConfig));
186
188
189 initStatTables();
190
191 return StatusCode::SUCCESS;
192 }
193
194 StatusCode TrackFindingBaseAlg::execute(const EventContext &) const {
195 ATH_MSG_FATAL("execute() method from the base class was called! Implement proper execute() method in the derived class!");
196
197 return StatusCode::FAILURE;
198 }
199
202
203 return StatusCode::SUCCESS;
204 }
205
206 std::unique_ptr<ActsTrk::IMeasurementSelector> TrackFindingBaseAlg::setMeasurementSelector(
207 const EventContext &ctx,
208 const detail::TrackFindingMeasurements &measurements,
209 TrackFinderOptions &options) const {
210
211 std::unique_ptr<ActsTrk::IMeasurementSelector> measurementSelector = ActsTrk::detail::getMeasurementSelector(
212 ctx,
213 m_pixelCalibTool.isEnabled() ? &(*m_pixelCalibTool) : nullptr,
214 m_stripCalibTool.isEnabled() ? &(*m_stripCalibTool) : nullptr,
215 m_hgtdCalibTool.isEnabled() ? &(*m_hgtdCalibTool) : nullptr,
216 measurements.measurementRanges(),
218 m_measurementSelectorConfig.m_chi2CutOffOutlier,
220 m_edgeHoleBorderWidth.value());
221
222 measurementSelector->connect(&options.extensions.createTrackStates);
223
224 return measurementSelector;
225 }
226
228 const EventContext &ctx,
229 const DetectorContextHolder &detContext,
230 const detail::TrackFindingMeasurements &measurements,
231 const Acts::PerigeeSurface* pSurface) const {
232 Acts::PropagatorPlainOptions plainOptions{detContext.geometry, detContext.magField};
233 plainOptions.maxSteps = m_maxPropagationStep;
234 plainOptions.direction = Acts::Direction::Forward();
235 plainOptions.endOfWorldVolumeIds = m_endOfWorldVolumeIds;
236
237 // Set the CombinatorialKalmanFilter options
238 TrackFinderOptions options(detContext.geometry, detContext.magField, detContext.calib,
239 trackFinder().ckfExtensions, plainOptions);
240 options.recordMaterialStates = m_recordMaterialStates;
241
242 std::unique_ptr<ActsTrk::IMeasurementSelector> measurementSelector = setMeasurementSelector(ctx, measurements, options);
243
244 Acts::PropagatorPlainOptions plainSecondOptions{detContext.geometry, detContext.magField};
245 plainSecondOptions.maxSteps = m_maxPropagationStep;
246 plainSecondOptions.direction = plainOptions.direction.invert();
247 plainSecondOptions.endOfWorldVolumeIds = m_endOfWorldVolumeIds;
248
249 TrackFinderOptions secondOptions(detContext.geometry, detContext.magField, detContext.calib,
250 options.extensions, plainSecondOptions);
251 secondOptions.targetSurface = pSurface;
252 secondOptions.skipPrePropagationUpdate = true;
253 secondOptions.recordMaterialStates = m_recordMaterialStates;
254
255 return {std::move(options), std::move(secondOptions), std::move(measurementSelector)};
256 };
257
258 const Acts::TrackSelector::Config& TrackFindingBaseAlg::getCuts (double eta) const {
259 const auto &trackSelectorCfg = trackFinder().trackSelector.config();
260 // return the last bin for |eta|>=4 or nan
261 return (!(std::abs(eta) < trackSelectorCfg.absEtaEdges.back())) ? trackSelectorCfg.cutSets.back()
262 : (std::abs(eta) < trackSelectorCfg.absEtaEdges.front()) ? trackSelectorCfg.cutSets.front()
263 : trackSelectorCfg.getCuts(eta);
264 };
265
266 std::vector<typename detail::RecoTrackContainer::TrackProxy>
268 const TrkProxy &trackProxy,
269 detail::RecoTrackContainer &tracksContainerTemp,
270 const TrackFinderOptions &options) const {
271 if (not m_doTwoWay) return {};
272
273 // Create initial parameters for the propagation
274 Acts::BoundTrackParameters secondInitialParameters = trackProxy.createParametersFromState(detail::RecoConstTrackStateContainerProxy{firstMeasurement});
275 if (!secondInitialParameters.referenceSurface().insideBounds(secondInitialParameters.localPosition())) { // #3751
276 return {};
277 }
278
279 // First, inflate the covariance matrix if configured
281 ATH_MSG_DEBUG("Inflating covariance matrix for second track finding with factor = " << m_twoWayinflateCovarianceFactor.value());
282 ATH_MSG_VERBOSE("Original parameters before inflation: \n" << secondInitialParameters);
283
284 auto inflatedCovariance = secondInitialParameters.covariance().value();
285 inflatedCovariance *= m_twoWayinflateCovarianceFactor;
286
287 const auto& origSurface = secondInitialParameters.referenceSurface();
288 auto surfacePtr = const_cast<Acts::Surface&>(origSurface).shared_from_this();
289
290 Acts::BoundTrackParameters newParams(
291 std::static_pointer_cast<const Acts::Surface>(std::move(surfacePtr)),
292 secondInitialParameters.parameters(),
293 std::make_optional(inflatedCovariance),
294 secondInitialParameters.particleHypothesis());
295 secondInitialParameters = std::move(newParams);
296
297 ATH_MSG_VERBOSE("Inflated covariance matrix : \n" << secondInitialParameters.covariance().value());
298 }
299
300 auto rootBranch = tracksContainerTemp.makeTrack();
301 rootBranch.copyFromWithoutStates(trackProxy); // #3534
302
303 // perform track finding
304 auto secondResult =
305 trackFinder().ckf.findTracks(secondInitialParameters, options, tracksContainerTemp, rootBranch);
306 if (not secondResult.ok()) {
307 return {};
308 }
309 return secondResult.value();
310 }
311
312 xAOD::UncalibMeasType TrackFindingBaseAlg::measurementType (const detail::RecoTrackContainer::TrackStateProxy &trackState) {
313 if (trackState.hasReferenceSurface()) {
314 if (const auto *actsDetElem = dynamic_cast<const ISurfacePlacement*>(trackState.referenceSurface().surfacePlacement())) {
315 switch (actsDetElem->detectorType()) {
322 default:
323 break;
324 }
325 }
326 }
328 }
329
331 const detail::RecoTrackContainer::TrackProxy &track,
332 const detail::RecoTrackContainer::TrackStateProxy &trackState,
333 const Acts::TrackSelector::EtaBinnedConfig &trackSelectorCfg,
334 const Acts::GeometryContext &tgContext,
335 const detail::MeasurementIndex &measurementIndex,
336 const std::size_t typeIndex,
337 EventStats::value_type &event_stat_category_i) const {
338 if (m_addCounts) {
339 updateCounts(track, trackState.typeFlags(),
340 measurementType(trackState));
341 if (m_checkCounts) {
342 checkCounts(track);
343 }
344 }
345
346 if (m_trackStatePrinter.isSet()) {
347 m_trackStatePrinter->printTrackState(tgContext, trackState,
348 measurementIndex, true);
349 }
350
351 if (!m_doBranchStopper) {
352 return BranchStopperResult::Continue;
353 }
354
355 const auto &parameters = trackState.hasFiltered() ? trackState.filtered()
356 : trackState.predicted();
357 double eta = -std::log(std::tan(0.5 * parameters[Acts::eBoundTheta]));
358 const auto &cutSet = getCuts(eta);
359
360 if (typeIndex < m_ptMinMeasurements.size() &&
361 !(track.nMeasurements() < m_ptMinMeasurements[typeIndex])) {
362 double pT = std::sin(parameters[Acts::eBoundTheta]) /
363 parameters[Acts::eBoundQOverP];
364 if (std::abs(pT) < cutSet.ptMin * m_branchStopperPtMinFactor) {
365 ++event_stat_category_i[kNStoppedTracksMinPt];
366 ATH_MSG_DEBUG("CkfBranchStopper: drop branch with q*pT="
367 << pT << " after " << track.nMeasurements()
368 << " measurements");
369 return BranchStopperResult::StopAndDrop;
370 }
371 }
372
373 if (typeIndex < m_absEtaMaxMeasurements.size() &&
374 !(track.nMeasurements() < m_absEtaMaxMeasurements[typeIndex]) &&
375 !(std::abs(eta) < trackSelectorCfg.absEtaEdges.back() +
377 ++event_stat_category_i[kNStoppedTracksMaxEta];
378 ATH_MSG_DEBUG("CkfBranchStopper: drop branch with eta="
379 << eta << " after " << track.nMeasurements()
380 << " measurements");
381 return BranchStopperResult::StopAndDrop;
382 }
383
384
385 // In the pixel endcap regions relax the requirement for minMeasurements before cutting the branch off
386 auto minMeasurementsBranchStop = std::abs(eta) > m_branchStopperAbsEtaMeasCut ? cutSet.minMeasurements - m_branchStopperMeasCutReduce : cutSet.minMeasurements;
387 bool enoughMeasurements = (track.nMeasurements() >= minMeasurementsBranchStop);
388 bool tooManyHoles = (track.nHoles() > cutSet.maxHoles);
389 bool tooManyOutliers = (track.nOutliers() > cutSet.maxOutliers);
390 bool tooManyHolesAndOutliers = (track.nHoles() + track.nOutliers() > cutSet.maxHolesAndOutliers);
391
392 if (m_addCounts) {
393 auto [enoughMeasurementsPS, tooManyHolesPS, tooManyOutliersPS] =
394 selectCounts(track, eta);
395 enoughMeasurements = enoughMeasurements && enoughMeasurementsPS;
396 tooManyHoles = tooManyHoles || tooManyHolesPS;
397 tooManyOutliers = tooManyOutliers || tooManyOutliersPS;
398 }
399
400 if (!(tooManyHoles || tooManyOutliers || tooManyHolesAndOutliers)) {
401 return BranchStopperResult::Continue;
402 }
403
404 if (!enoughMeasurements) {
405 ++event_stat_category_i[kNStoppedTracksMaxHoles];
406 }
407
408 if (m_addCounts) {
409 ATH_MSG_DEBUG("CkfBranchStopper: stop and "
410 << (enoughMeasurements ? "keep" : "drop")
411 << " branch with nHoles=" << track.nHoles() << " ("
412 << s_branchState.nPixelHoles(track) << " pixel+"
413 << s_branchState.nStripHoles(track) << " strip+"
414 << s_branchState.nHgtdHoles(track)
415 << " hgtd), nOutliers=" << track.nOutliers() << " ("
416 << s_branchState.nPixelOutliers(track) << "+"
417 << s_branchState.nStripOutliers(track) << "+"
418 << s_branchState.nHgtdOutliers(track)
419 << "), nMeasurements=" << track.nMeasurements() << " ("
420 << s_branchState.nPixelHits(track) << "+"
421 << s_branchState.nStripHits(track) << "+"
422 << s_branchState.nHgtdHits(track) << ")");
423 } else {
424 ATH_MSG_DEBUG("CkfBranchStopper: stop and "
425 << (enoughMeasurements ? "keep" : "drop")
426 << " branch with nHoles=" << track.nHoles()
427 << ", nOutliers=" << track.nOutliers()
428 << ", nMeasurements=" << track.nMeasurements());
429 }
430
431 return enoughMeasurements ? BranchStopperResult::StopAndKeep
432 : BranchStopperResult::StopAndDrop;
433 }
434
435
437 {
438 if (addCounts) {
439 tracksContainer.addColumn<unsigned int>("nPixelHits");
440 tracksContainer.addColumn<unsigned int>("nStripHits");
441 tracksContainer.addColumn<unsigned int>("nHgtdHits");
442 tracksContainer.addColumn<unsigned int>("nPixelHoles");
443 tracksContainer.addColumn<unsigned int>("nStripHoles");
444 tracksContainer.addColumn<unsigned int>("nHgtdHoles");
445 tracksContainer.addColumn<unsigned int>("nPixelOutliers");
446 tracksContainer.addColumn<unsigned int>("nStripOutliers");
447 tracksContainer.addColumn<unsigned int>("nHgtdOutliers");
448 }
450 }
451
452 void TrackFindingBaseAlg::initCounts(const detail::RecoTrackContainer::TrackProxy &track)
453 {
454 s_branchState.nPixelHits(track) = 0;
455 s_branchState.nStripHits(track) = 0;
456 s_branchState.nHgtdHits(track) = 0;
457 s_branchState.nPixelHoles(track) = 0;
458 s_branchState.nStripHoles(track) = 0;
459 s_branchState.nHgtdHoles(track) = 0;
460 s_branchState.nPixelOutliers(track) = 0;
461 s_branchState.nStripOutliers(track) = 0;
462 s_branchState.nHgtdOutliers(track) = 0;
463 }
464
466 const detail::RecoTrackContainer::TrackProxy &track,
467 Acts::ConstTrackStateTypeMap typeFlags, xAOD::UncalibMeasType detType) {
469 if (typeFlags.isHole()) {
470 s_branchState.nPixelHoles(track)++;
471 } else if (typeFlags.isOutlier()) {
472 s_branchState.nPixelOutliers(track)++;
473 } else if (typeFlags.isMeasurement()) {
474 s_branchState.nPixelHits(track)++;
475 }
476 } else if (detType == xAOD::UncalibMeasType::StripClusterType) {
477 if (typeFlags.isHole()) {
478 s_branchState.nStripHoles(track)++;
479 } else if (typeFlags.isOutlier()) {
480 s_branchState.nStripOutliers(track)++;
481 } else if (typeFlags.isMeasurement()) {
482 s_branchState.nStripHits(track)++;
483 }
484 } else if (detType == xAOD::UncalibMeasType::HGTDClusterType) {
485 if (typeFlags.isHole()) {
486 s_branchState.nHgtdHoles(track)++;
487 } else if (typeFlags.isOutlier()) {
488 s_branchState.nHgtdOutliers(track)++;
489 } else if (typeFlags.isMeasurement()) {
490 s_branchState.nHgtdHits(track)++;
491 }
492 }
493 }
494
495 void TrackFindingBaseAlg::checkCounts(const detail::RecoTrackContainer::TrackProxy &track) const {
496 // This check will fail if there are other types (HGTD, MS?) of hits, holes, or outliers.
497 // The check can be removed when it is no longer appropriate.
498 if (track.nMeasurements() != s_branchState.nPixelHits(track) + s_branchState.nStripHits(track) + s_branchState.nHgtdHits(track))
499 ATH_MSG_WARNING("mismatched hit count: total (" << track.nMeasurements()
500 << ") != pixel (" << s_branchState.nPixelHits(track)
501 << ") + strip (" << s_branchState.nStripHits(track)
502 << ") + hgtd (" << s_branchState.nHgtdHits(track)
503 << ")");
504 if (track.nHoles() != s_branchState.nPixelHoles(track) + s_branchState.nStripHoles(track) + s_branchState.nHgtdHoles(track))
505 ATH_MSG_WARNING("mismatched hole count: total (" << track.nHoles()
506 << ") < pixel (" << s_branchState.nPixelHoles(track)
507 << ") + strip (" << s_branchState.nStripHoles(track)
508 << ") + hgtd (" << s_branchState.nHgtdHoles(track)
509 << ")");
510 if (track.nOutliers() != s_branchState.nPixelOutliers(track) + s_branchState.nStripOutliers(track) + s_branchState.nHgtdOutliers(track))
511 ATH_MSG_WARNING("mismatched outlier count: total (" << track.nOutliers()
512 << ") != pixel (" << s_branchState.nPixelOutliers(track)
513 << ") + strip (" << s_branchState.nStripOutliers(track)
514 << ") + hgtd (" << s_branchState.nHgtdOutliers(track)
515 << ")");
516 };
517
518 std::array<bool, 3> TrackFindingBaseAlg::selectCounts(const detail::RecoTrackContainer::TrackProxy &track, double eta) const {
519 bool enoughMeasurements = true, tooManyHoles = false, tooManyOutliers = false;
520 const auto &trackSelectorCfg = trackFinder().trackSelector.config();
521 std::size_t etaBin = (std::abs(eta) < trackSelectorCfg.absEtaEdges.front()) ? 0
522 : (std::abs(eta) >= trackSelectorCfg.absEtaEdges.back()) ? trackSelectorCfg.absEtaEdges.size() - 1
523 : trackSelectorCfg.binIndex(eta);
524 auto cutMin = [etaBin](std::size_t val, const std::vector<std::size_t> &cutSet) {
525 return !cutSet.empty() && (val < (etaBin < cutSet.size() ? cutSet[etaBin] : cutSet.back()));
526 };
527 auto cutMax = [etaBin](std::size_t val, const std::vector<std::size_t> &cutSet) {
528 return !cutSet.empty() && (val > (etaBin < cutSet.size() ? cutSet[etaBin] : cutSet.back()));
529 };
530
531 enoughMeasurements = enoughMeasurements && !cutMin(s_branchState.nPixelHits(track), m_minPixelHits);
532 enoughMeasurements = enoughMeasurements && !cutMin(s_branchState.nStripHits(track), m_minStripHits);
533 enoughMeasurements = enoughMeasurements && !cutMin(s_branchState.nHgtdHits(track), m_minHgtdHits);
534 tooManyHoles = tooManyHoles || cutMax(s_branchState.nPixelHoles(track), m_maxPixelHoles);
535 tooManyHoles = tooManyHoles || cutMax(s_branchState.nStripHoles(track), m_maxStripHoles);
536 tooManyHoles = tooManyHoles || cutMax(s_branchState.nHgtdHoles(track), m_maxHgtdHoles);
537 tooManyOutliers = tooManyOutliers || cutMax(s_branchState.nPixelOutliers(track), m_maxPixelOutliers);
538 tooManyOutliers = tooManyOutliers || cutMax(s_branchState.nStripOutliers(track), m_maxStripOutliers);
539 tooManyOutliers = tooManyOutliers || cutMax(s_branchState.nHgtdOutliers(track), m_maxHgtdOutliers);
540
541 return {enoughMeasurements, tooManyHoles, tooManyOutliers};
542 }
543
545 // the cuts for each eta bin are (measurement, outlier) pairs for each measurement dimension
546 auto &chi2CutOffOutlier = m_measurementSelectorConfig.m_chi2CutOffOutlier;
547 const std::vector<double> &cutOff = m_chi2CutOffSigma.value();
548 const std::vector<double> &outlierCutOff = m_chi2OutlierCutOffSigma.value();
549 chi2CutOffOutlier.reserve( cutOff.size() );
550 if (!outlierCutOff.empty()) {
551 if (cutOff.size() != outlierCutOff.size()) {
552 ATH_MSG_ERROR("Outlier chi2 cut off provided but number of elements does not agree with"
553 " chi2 cut off for measurements which however is required: "
554 << cutOff.size() << " != " << outlierCutOff.size());
555 return StatusCode::FAILURE;
556 }
557 }
558 // A cut at n sigma of a 1D Gaussian (two-sided) has the p-value erfc(n/sqrt(2)). The chi2 cut for
559 // a measurement of dimension DIM is the chi2 value with this p-value for DIM degrees of freedom.
560 // For DIM=1 this is n^2.
561 auto chi2Cut = [](double cut, std::size_t dim) -> float {
562 const double pValue = std::erfc(cut / std::numbers::sqrt2);
563 return static_cast<float>(boost::math::quantile(
564 boost::math::complement(boost::math::chi_squared_distribution<double>(dim), pValue)));
565 };
566 for (std::size_t idx = 0; idx < cutOff.size(); ++idx) {
567 std::array<std::pair<float, float>, 4> cuts{};
568 for (std::size_t dim = 1; dim < cuts.size(); ++dim) {
569 cuts[dim] = std::make_pair(chi2Cut(cutOff[idx], dim),
570 idx < outlierCutOff.size()
571 ? chi2Cut(outlierCutOff[idx], dim)
572 : std::numeric_limits<float>::max());
573 }
574 cuts[0] = cuts[1];
575 chi2CutOffOutlier.push_back(cuts);
576 ATH_MSG_DEBUG("Measurement selector eta bin " << idx << ": chi2 cuts for "
577 << cutOff[idx] << " / "
578 << (idx < outlierCutOff.size() ? outlierCutOff[idx] : std::numeric_limits<double>::infinity())
579 << " sigma: 1D " << cuts[1].first << " / " << cuts[1].second
580 << ", 2D " << cuts[2].first << " / " << cuts[2].second
581 << ", 3D " << cuts[3].first << " / " << cuts[3].second);
582 }
583 if (m_etaBins.size() > 2) {
584 std::vector<float> &etaBinsf = m_measurementSelectorConfig.m_etaBins;
585 etaBinsf.assign(m_etaBins.begin() + 1, m_etaBins.end() - 1);
586 }
587
588 return /*m_measurementSelector ?*/ StatusCode::SUCCESS /*: StatusCode::FAILURE*/;
589 }
590
591 // === Statistics printout =================================================
592
594 if (!m_statEtaBins.empty())
595 {
597 float last_eta = m_statEtaBins[0];
598 for (float eta : m_statEtaBins)
599 {
600 if (eta < last_eta)
601 {
602 ATH_MSG_FATAL("Eta bins for statistics counter not in ascending order.");
603 }
604 last_eta = eta;
605 }
606 }
607 m_stat.resize(nSeedCollections() * seedCollectionStride());
608 }
609
610 // copy statistics
611 void TrackFindingBaseAlg::copyStats(const EventStats &event_stat) const {
612 std::lock_guard<std::mutex> lock(m_mutex);
613 std::size_t category_i = 0;
614 for (const std::array<unsigned int, kNStat> &src_stat : event_stat)
615 {
616 std::array<std::size_t, kNStat> &dest_stat = m_stat[category_i++];
617 for (std::size_t i = 0; i < src_stat.size(); ++i)
618 {
619 assert(i < dest_stat.size());
620 dest_stat[i] += src_stat[i];
621 }
622 }
623 }
624
625 // print statistics
627 if (msgLvl(MSG::INFO))
628 {
629 std::vector<std::string> stat_labels =
631 {
632 std::make_pair(kNTotalSeeds, "Input seeds"),
633 std::make_pair(kNoTrackParam, "No track parameters"),
634 std::make_pair(kNUsedSeeds, "Used seeds"),
635 std::make_pair(kNoTrack, "Cannot find track"),
636 std::make_pair(kNDuplicateSeeds, "Duplicate seeds"),
637 std::make_pair(kNNoEstimatedParams, "Initial param estimation failed"),
638 std::make_pair(kNRejectedRefinedSeeds, "Rejected refined parameters"),
639 std::make_pair(kNSeedRefitFailure, "Seed refit Kalman fit failure"),
640 std::make_pair(kNOutputTracks, "CKF tracks"),
641 std::make_pair(kNSelectedTracks, "selected tracks"),
642 std::make_pair(kNResolvedTracks, "resolved tracks"),
643 std::make_pair(kNStoppedTracksMaxHoles, "Stopped tracks reaching max holes"),
644 std::make_pair(kMultipleBranches, "Seeds with more than one branch"),
645 std::make_pair(kNoSecond, "Tracks failing second CKF"),
646 std::make_pair(kNStoppedTracksMinPt, "Stopped tracks below pT cut"),
647 std::make_pair(kNStoppedTracksMaxEta, "Stopped tracks above max eta"),
648 std::make_pair(kNTotalSharedHits, "Total shared hits"),
649 std::make_pair(kNForcedSeedMeasurements, "Total forced measurements")
650 });
651 assert(stat_labels.size() == kNStat);
652 std::vector<std::string> categories;
653 categories.reserve(m_seedLabels.size() + 1);
654 categories.insert(categories.end(), m_seedLabels.begin(), m_seedLabels.end());
655 categories.push_back("ALL");
656
657 std::vector<std::string> eta_labels;
658 eta_labels.reserve(m_statEtaBins.size() + 2);
659 for (std::size_t eta_bin_i = 0; eta_bin_i < m_statEtaBins.size() + 2; ++eta_bin_i)
660 {
661 eta_labels.push_back(TableUtils::makeEtaBinLabel(m_statEtaBins, eta_bin_i, m_useAbsEtaForStat));
662 }
663
664 // vector used as 3D array stat[ eta_bin ][ stat_i ][ seed_type]
665 // stat_i = [0, kNStat)
666 // eta_bin = [0, m_statEtaBins.size()+2 ); eta_bin == m_statEtaBinsSize()+1 means sum of all etaBins
667 // seed_type = [0, nSeedCollections()+1) seed_type == nSeedCollections() means sum of all seed collections
668 std::vector<std::size_t> stat =
670 m_statEtaBins.size() + 1,
671 m_stat);
672
673 // the extra columns and rows for the projections are addeded internally:
674 std::size_t stat_stride =
676 m_statEtaBins.size() + 1,
677 kNStat);
678 std::size_t eta_stride =
680 m_statEtaBins.size() + 1,
681 kNStat);
682 std::stringstream table_out;
683
684 if (m_dumpAllStatEtaBins.value())
685 {
686 // dump for each counter a table with one row per eta bin
687 std::size_t max_label_width = TableUtils::maxLabelWidth(stat_labels) + TableUtils::maxLabelWidth(eta_labels);
688 for (std::size_t stat_i = 0; stat_i < kNStat; ++stat_i)
689 {
690 std::size_t dest_idx_offset = stat_i * stat_stride;
691 table_out << makeTable(stat, dest_idx_offset, eta_stride,
692 eta_labels,
693 categories)
694 .columnWidth(10)
695 // only dump the footer for the last eta bin i.e. total
696 .dumpHeader(stat_i == 0)
697 .dumpFooter(stat_i + 1 == kNStat)
698 .separateLastRow(true) // separate the sum of all eta bins
699 .minLabelWidth(max_label_width)
700 .labelPrefix(stat_labels.at(stat_i));
701 }
702 }
703 else
704 {
705 // dump one table with one row per counter showing the total eta range
706 for (std::size_t eta_bin_i = (m_dumpAllStatEtaBins.value() ? 0 : m_statEtaBins.size() + 1);
707 eta_bin_i < m_statEtaBins.size() + 2;
708 ++eta_bin_i)
709 {
710 std::size_t dest_idx_offset = eta_bin_i * eta_stride;
711 table_out << makeTable(stat, dest_idx_offset, stat_stride,
712 stat_labels,
713 categories,
714 eta_labels.at(eta_bin_i))
715 .columnWidth(10)
716 // only dump the footer for the last eta bin i.e. total
717 .dumpFooter(!m_dumpAllStatEtaBins.value() || eta_bin_i == m_statEtaBins.size() + 1);
718 }
719 }
720 ATH_MSG_INFO("statistics:\n"
721 << table_out.str());
722 table_out.str("");
723
724 // define retios first element numerator, second element denominator
725 // each element contains a vector of counter and a multiplier e.g. +- 1
726 // ratios are computed as (sum_i stat[stat_i] * multiplier_i ) / (sum_j stat[stat_j] * multiplier_j )
727 auto [ratio_labels, ratio_def] =
729 std::vector<TableUtils::SummandDefinition>{
733 // no track counted as used but want to include it as failed
735 }, // failed seeds i.e. seeds which are not duplicates but did not produce a track
736 std::vector<TableUtils::SummandDefinition>{TableUtils::defineSummand(kNTotalSeeds, 1)}),
738 TableUtils::defineSimpleRatio("Rejected refined params / seeds", kNRejectedRefinedSeeds, kNTotalSeeds),
740 TableUtils::defineSimpleRatio("selected tracks / used seeds", kNSelectedTracks, kNUsedSeeds),
742 TableUtils::defineSimpleRatio("resolved tracks / used seeds", kNResolvedTracks, kNUsedSeeds),
743 TableUtils::defineSimpleRatio("branched tracks / used seeds", kMultipleBranches, kNUsedSeeds),
744 TableUtils::defineSimpleRatio("no 2nd CKF / CKF tracks", kNoSecond, kNOutputTracks),
746 TableUtils::defineSimpleRatio("forced measurements / used seeds", kNForcedSeedMeasurements, kNUsedSeeds)});
747
748 std::vector<float> ratio = TableUtils::computeRatios(ratio_def,
749 nSeedCollections() + 1,
750 m_statEtaBins.size() + 2,
751 stat);
752
753 // the extra columns and rows for the projections are _not_ added internally
754 std::size_t ratio_stride = TableUtils::ratioStride(nSeedCollections() + 1,
755 m_statEtaBins.size() + 2,
756 ratio_def);
757 std::size_t ratio_eta_stride = TableUtils::subCategoryStride(nSeedCollections() + 1,
758 m_statEtaBins.size() + 2,
759 ratio_def);
760
761 std::size_t max_label_width = TableUtils::maxLabelWidth(ratio_labels) + TableUtils::maxLabelWidth(eta_labels);
762 if (m_dumpAllStatEtaBins.value())
763 {
764 // show for each ratio a table with one row per eta bin
765 for (std::size_t ratio_i = 0; ratio_i < ratio_labels.size(); ++ratio_i)
766 {
767 table_out << makeTable(ratio,
768 ratio_i * ratio_stride,
769 ratio_eta_stride,
770 eta_labels,
771 categories)
772 .columnWidth(10)
773 // only dump the footer for the last eta bin i.e. total
774 .dumpHeader(ratio_i == 0)
775 .dumpFooter(ratio_i + 1 == ratio_labels.size())
776 .separateLastRow(true) // separate the sum of las
777 .minLabelWidth(max_label_width)
778 .labelPrefix(ratio_labels.at(ratio_i));
779 }
780 }
781 else
782 {
783 // dump one table with one row per ratio showing the total eta range
784 table_out << makeTable(ratio,
785 (m_statEtaBins.size() + 1) * ratio_eta_stride + 0 * ratio_stride,
786 ratio_stride,
787 ratio_labels,
788 categories)
789 .columnWidth(10)
790 // only dump the footer for the last eta bin i.e. total
791 .minLabelWidth(max_label_width)
792 .dumpFooter(false);
793
794 // also dump a table for final tracks over used seeds (ratio_i==6 or 4) showing one row per eta bin
795 eta_labels.erase(eta_labels.end() - 1); // drop last line of table which shows again all eta bins summed.
796 std::size_t ratio_i = m_showResolvedStats ? 6 : 4;
797 table_out << makeTable(ratio,
798 ratio_i * ratio_stride,
799 ratio_eta_stride,
800 eta_labels,
801 categories)
802 .columnWidth(10)
803 .dumpHeader(false)
804 // only dump the footer for the last eta bin i.e. total
805 .dumpFooter(!m_dumpAllStatEtaBins.value() || ratio_i + 1 == ratio_labels.size())
806 .separateLastRow(false)
807 .minLabelWidth(max_label_width)
808 .labelPrefix(ratio_labels.at(ratio_i));
809 }
810
811 ATH_MSG_INFO("Ratios:\n"
812 << table_out.str());
813 }
814 }
815
816 std::size_t TrackFindingBaseAlg::getStatCategory(std::size_t seed_collection, float eta) const {
817 std::vector<float>::const_iterator bin_iter = std::upper_bound(m_statEtaBins.begin(),
818 m_statEtaBins.end(),
819 m_useAbsEtaForStat ? std::abs(eta) : eta);
820 std::size_t category_i = seed_collection * seedCollectionStride() + static_cast<std::size_t>(bin_iter - m_statEtaBins.begin());
821 assert(category_i < m_stat.size());
822 return category_i;
823 }
824
825 std::size_t TrackFindingBaseAlg::computeStatSum(std::size_t seed_collection, EStat counter_i, const EventStats &stat) const {
826 std::size_t out = 0u;
827 for (std::size_t category_i = seed_collection * seedCollectionStride();
828 category_i < (seed_collection + 1) * seedCollectionStride();
829 ++category_i)
830 {
831 assert(category_i < stat.size());
832 out += stat[category_i][counter_i];
833 }
834 return out;
835 }
836
837 bool TrackFindingBaseAlg::selectCountsFinal(const detail::RecoTrackContainer::TrackProxy &track) const {
838 if (not m_addCounts) return true;
839 double eta = -std::log(std::tan(0.5 * track.theta()));
840 auto [enoughMeasurementsPS, tooManyHolesPS, tooManyOutliersPS] = selectCounts(track, eta);
841 return enoughMeasurementsPS && !tooManyHolesPS && !tooManyOutliersPS;
842 }
843
844} // namespace ActsTrk
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
TableUtils::StatTable< T > makeTable(const std::array< T, N > &counter, const std::array< std::string, N > &label)
Definition TableUtils.h:544
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
Definition Logger.cxx:64
Extension of the interface of the Acts::SurfacePlacementBase for ATLAS.
Gaudi::Property< std::vector< std::size_t > > m_maxStripHoles
Gaudi::Property< double > m_branchStopperAbsEtaMeasCut
Gaudi::Property< std::vector< float > > m_statEtaBins
Gaudi::Property< double > m_branchStopperPtMinFactor
Gaudi::Property< std::vector< std::size_t > > m_maxOutliers
Gaudi::Property< std::vector< std::size_t > > m_maxHgtdHoles
std::unique_ptr< const Acts::Logger > m_logger
logging instance
Gaudi::Property< std::vector< double > > m_etaBins
Gaudi::Property< bool > m_doTwoWay
Gaudi::Property< bool > m_dumpAllStatEtaBins
Gaudi::Property< std::vector< size_t > > m_numMeasurementsCutOff
Gaudi::Property< std::vector< std::size_t > > m_maxSharedHits
Gaudi::Property< unsigned int > m_maxPropagationStep
static xAOD::UncalibMeasType measurementType(const detail::RecoTrackContainer::TrackStateProxy &trackState)
ToolHandle< ActsTrk::TrackStatePrinterTool > m_trackStatePrinter
Gaudi::Property< double > m_edgeHoleBorderWidth
Gaudi::Property< std::vector< double > > m_etaMax
Gaudi::Property< std::vector< double > > m_ptMin
Gaudi::Property< std::vector< std::size_t > > m_minPixelHits
Gaudi::Property< std::vector< std::size_t > > m_maxStripOutliers
SG::WriteHandleKey< ActsTrk::TrackContainer > m_trackContainerKey
Gaudi::Property< std::vector< double > > m_chi2CutOffSigma
Gaudi::Property< std::vector< double > > m_ptMax
Gaudi::Property< double > m_seedRefitPtMinFactor
detail::RecoTrackContainer::TrackProxy TrkProxy
Gaudi::Property< std::vector< std::size_t > > m_maxPixelHoles
static constexpr BranchState s_branchState
void copyStats(const EventStats &event_stat) const
Gaudi::Property< std::vector< double > > m_phiMin
Gaudi::Property< double > m_branchStopperMeasCutReduce
ToolHandle< ActsTrk::IPixelOnTrackCalibratorTool< detail::RecoTrackStateContainer > > m_pixelCalibTool
Gaudi::Property< std::vector< std::uint32_t > > m_endOfWorldVolumeIds
Gaudi::Property< std::vector< std::size_t > > m_minStripHits
ActsTrk::MutableTrackContainerHandlesHelper m_tracksBackendHandlesHelper
std::size_t getStatCategory(std::size_t seed_collection, float eta) const
std::size_t seedCollectionStride() const
Gaudi::Property< double > m_branchStopperAbsEtaMaxExtra
ToolHandle< GenericMonitoringTool > m_monTool
std::vector< typename detail::RecoTrackContainer::TrackProxy > doTwoWayTrackFinding(const detail::RecoTrackStateContainerProxy &firstMeasurement, const TrkProxy &trackProxy, detail::RecoTrackContainer &tracksContainerTemp, const TrackFinderOptions &options) const
Perform two-way track finding.
Gaudi::Property< std::vector< std::size_t > > m_absEtaMaxMeasurements
TrackFindingBaseAlg(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< std::vector< double > > m_etaMin
Gaudi::Property< bool > m_recordMaterialStates
Gaudi::Property< std::vector< double > > m_d0Min
virtual StatusCode execute(const EventContext &ctx) const override
Gaudi::Property< std::vector< std::size_t > > m_maxHgtdOutliers
Gaudi::Property< std::vector< double > > m_z0Max
Gaudi::Property< double > m_absEtaMax
std::size_t computeStatSum(std::size_t seed_collection, EStat counter_i, const EventStats &stat) const
virtual StatusCode initialize() override
Gaudi::Property< std::vector< double > > m_z0Min
void checkCounts(const detail::RecoTrackContainer::TrackProxy &track) const
Gaudi::Property< bool > m_doBranchStopper
static void addCountsAndProperties(detail::RecoTrackContainer &tracksContainer, bool add_counts)
Gaudi::Property< std::vector< std::size_t > > m_minMeasurements
Gaudi::Property< std::vector< double > > m_maxChi2
Gaudi::Property< double > m_absEtaMin
BranchStopperResult stopBranch(const detail::RecoTrackContainer::TrackProxy &track, const detail::RecoTrackContainer::TrackStateProxy &trackState, const Acts::TrackSelector::EtaBinnedConfig &trackSelectorCfg, const Acts::GeometryContext &tgContext, const detail::MeasurementIndex &measurementIndex, const std::size_t typeIndex, EventStats::value_type &event_stat_category_i) const
Branch stopper.
static void initCounts(const detail::RecoTrackContainer::TrackProxy &track)
Gaudi::Property< std::vector< std::size_t > > m_maxPixelOutliers
const Acts::TrackSelector::Config & getCuts(double eta) const
Retrieves track selector configuration for given eta value.
Gaudi::Property< bool > m_checkCounts
Gaudi::Property< std::vector< std::size_t > > m_maxHoles
ToolHandle< ActsTrk::IStripOnTrackCalibratorTool< detail::RecoTrackStateContainer > > m_stripCalibTool
std::array< bool, 3 > selectCounts(const detail::RecoTrackContainer::TrackProxy &track, double eta) const
Gaudi::Property< std::vector< std::size_t > > m_maxHolesAndOutliers
std::unique_ptr< CKF_pimpl > m_trackFinder
Gaudi::Property< std::vector< double > > m_chi2OutlierCutOffSigma
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
TrackFindingDefaultOptions getDefaultOptions(const EventContext &ctx, const DetectorContextHolder &detContext, const detail::TrackFindingMeasurements &measurements, const Acts::PerigeeSurface *pSurface) const
Get CKF options for first and second pass + pointer to MeasurementSelector.
Acts::CombinatorialKalmanFilterOptions< detail::RecoTrackContainer > TrackFinderOptions
virtual StatusCode finalize() override
ContextUtility m_ctxProvider
Utility to fetch the geometry, magnetic field and calibration context in the event.
std::vector< std::array< unsigned int, kNStat > > EventStats
ToolHandle< ActsTrk::IHGTDOnTrackCalibratorTool< detail::RecoTrackStateContainer > > m_hgtdCalibTool
Gaudi::Property< double > m_twoWayinflateCovarianceFactor
static void updateCounts(const detail::RecoTrackContainer::TrackProxy &track, Acts::ConstTrackStateTypeMap typeFlags, xAOD::UncalibMeasType detType)
Gaudi::Property< bool > m_addCounts
Gaudi::Property< std::vector< std::size_t > > m_minHgtdHits
struct ActsTrk::TrackFindingBaseAlg::MeasurementSelectorConfig m_measurementSelectorConfig
Gaudi::Property< std::vector< double > > m_phiMax
Gaudi::Property< std::vector< std::size_t > > m_ptMinMeasurements
Gaudi::Property< std::vector< double > > m_d0Max
Gaudi::Property< bool > m_inflateCovarianceTwoWay
Acts::CombinatorialKalmanFilterBranchStopperResult BranchStopperResult
std::unique_ptr< ActsTrk::IMeasurementSelector > setMeasurementSelector(const EventContext &ctx, const detail::TrackFindingMeasurements &measurements, TrackFinderOptions &options) const
Setup and attach measurement selector to KF options.
Gaudi::Property< std::uint32_t > m_envelopeConstraint
Stop the propagation as soon as the envelope is left (Gen3 only).
bool selectCountsFinal(const detail::RecoTrackContainer::TrackProxy &track) const
Gaudi::Property< std::vector< std::string > > m_seedLabels
const MeasurementRangeList & measurementRanges() const
bool msgLvl(const MSG::Level lvl) const
An algorithm that can be simultaneously executed in multiple threads.
static Root::TMsgLogger logger("iLumiCalc")
Acts::Result< void > gainMatrixUpdate(const Acts::GeometryContext &gctx, typename trajectory_t::TrackStateProxy trackState, const Acts::Logger &logger)
Acts::SympyStepper Stepper
Adapted from Acts Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithmFunction....
RecoTrackStateContainer::TrackStateProxy RecoTrackStateContainerProxy
std::unique_ptr< ActsTrk::IMeasurementSelector > getMeasurementSelector(const EventContext &ctx, const ActsTrk::IPixelOnTrackCalibratorTool< detail::RecoTrackStateContainer > *pixelOnTrackCalibratorTool, const ActsTrk::IStripOnTrackCalibratorTool< detail::RecoTrackStateContainer > *stripOnTrackCalibratorTool, const ActsTrk::IHGTDOnTrackCalibratorTool< detail::RecoTrackStateContainer > *hgtdOnTrackCalibratorTool, const ActsTrk::detail::MeasurementRangeList &measurementRanges, const std::vector< float > &etaBinsf, const std::vector< std::array< std::pair< float, float >, 4 > > &chi2CutOffOutlier, const std::vector< size_t > &numMeasurementsCutOff, double edge_hole_border_width)
Acts::TrackContainer< Acts::VectorTrackContainer, Acts::VectorMultiTrajectory > RecoTrackContainer
RecoTrackStateContainer::ConstTrackStateProxy RecoConstTrackStateContainerProxy
Acts::CombinatorialKalmanFilter< Propagator, RecoTrackContainer > CKF
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
std::string prefixFromTrackContainerName(const std::string &tracks)
Parse TrackContainer name to get the prefix for backends The name has to contain XYZTracks,...
@ Pixel
Inner detector legacy.
SystemEnvelope
Define an enumeration to retrieve the envelope tracking volume from.
std::tuple< std::vector< std::string >, std::vector< RatioDefinition > > splitRatioDefinitionsAndLabels(std::initializer_list< std::tuple< std::string, RatioDefinition > > a_ratio_list)
Definition TableUtils.h:469
SummandDefinition defineSummand(T counter_idx, int multiplier)
Definition TableUtils.h:423
std::size_t maxLabelWidth(const T_Collection &col)
Definition TableUtils.h:311
RatioDefinition defineSimpleRatio(T numerator, T denominator)
Definition TableUtils.h:405
std::vector< std::string > makeLabelVector(T_index n_entries, std::initializer_list< std::pair< T_index, T_string > > a_list)
Definition TableUtils.h:296
constexpr std::size_t subCategoryStride(const std::size_t categories, const std::size_t sub_categories, const std::size_t n_counter)
Definition TableUtils.h:325
constexpr std::size_t counterStride(const std::size_t categories, const std::size_t sub_categories, const std::size_t n_counter)
Definition TableUtils.h:330
std::string makeEtaBinLabel(const std::vector< float > &eta_bins, std::size_t eta_bin_i, bool abs_eta=false)
Definition TableUtils.h:535
std::tuple< std::string, RatioDefinition > makeRatioDefinition(std::string &&name, std::vector< SummandDefinition > &&numerator, std::vector< SummandDefinition > &&denominator)
Definition TableUtils.h:459
std::vector< float > computeRatios(const std::vector< RatioDefinition > &ratio_def, const std::size_t categories, const std::size_t sub_categories, const std::vector< std::size_t > &counter)
constexpr std::size_t ratioStride(const std::size_t categories, const std::size_t sub_categories, const std::vector< RatioDefinition > &ratio_def)
Definition TableUtils.h:494
std::vector< T_Output > createCounterArrayWithProjections(const std::size_t categories, const std::size_t sub_categories, const std::vector< std::array< T_Input, N > > &input_counts)
Definition TableUtils.h:343
UncalibMeasType
Define the type of the uncalibrated measurement.
static void addFitterTypeProperty(track_container_t &tracksContainer)
add fitter column to the track container