13#include "Identifier/Identifier.h"
23#include "GaudiKernel/EventContext.h"
26#include <initializer_list>
29template<
class Indexable,
class IntegerArray>
32 const IntegerArray& indices,
33 const typename Indexable::value_type& toValue)
35 for (
const auto idx : indices) {
40template<
class Indexable>
43 const std::initializer_list<size_t>& indices,
44 const typename Indexable::value_type& toValue)
46 for (
const auto idx : indices) {
58 declareInterface<ITrackSummaryTool>(
this);
68 ATH_MSG_WARNING(
"Could get neither InDetHelperTool nor MuonHelperTool.");
82 return StatusCode::SUCCESS;
97 const EventContext& ctx,
99 bool suppress_hole_search)
const
111std::unique_ptr<Trk::TrackSummary>
113 const Track& track)
const
124std::unique_ptr<Trk::TrackSummary>
126 const Track& track)
const
135std::unique_ptr<Trk::TrackSummary>
139 bool doHolesMuon)
const
141 std::unique_ptr<Trk::TrackSummary>
ts;
143 if (track.trackSummary() !=
nullptr) {
144 ts = std::make_unique<Trk::TrackSummary>(*(track.trackSummary()));
146 ts = std::make_unique<Trk::TrackSummary>();
164 bool doHolesMuon)
const
167 std::vector<int>& information =
ts.m_information;
168 information.resize(std::min(information.size(),
171 constexpr int toZero{ 0 };
175 constexpr size_t numberOfPixelCounters{ 8 };
176 constexpr std::array<size_t, numberOfPixelCounters> atPixelIndices{
186 setTheseElements(information, atPixelIndices, toZero);
191 constexpr size_t numberOfSctOrTrtCounters{ 9 };
192 constexpr std::array<size_t, numberOfSctOrTrtCounters> atSctOrTrtIndices{
203 setTheseElements(information, atSctOrTrtIndices, toZero);
208 constexpr size_t numberOfMuonRelatedCounters{ 15 };
209 constexpr std::array<size_t, numberOfMuonRelatedCounters> atMuonIndices{
220 constexpr size_t numberOfNswRelatedCounters{ 6 };
221 constexpr std::array<size_t, numberOfNswRelatedCounters> atNswIndices{
225 setTheseElements(information, atMuonIndices, toZero);
226 setTheseElements(information, atNswIndices, toZero);
230 std::bitset<numberOfDetectorTypes> hitPattern;
231 if (track.trackStateOnSurfaces()) {
235 track.trackStateOnSurfaces(),
242 << track.info().dumpInfo()
243 <<
"). This should never happen! ");
245 ts.m_idHitPattern = hitPattern.to_ulong();
256 if ((doHolesInDet || doHolesMuon) &&
277 const EventContext& ctx,
280 std::vector<int>& information,
281 std::bitset<numberOfDetectorTypes>& hitPattern,
283 bool doHolesMuon)
const
290 for (; it != itEnd; ++it) {
291 const auto& trackState = **it;
292 const auto isMeasurement =
295 if (isMeasurement or isOutlier) {
298 ATH_MSG_WARNING(
"measurementOnTrack == null for a TrackStateOnSurface "
299 "of type Measurement or Outlier");
305 ctx, track, measurement, *it, information, hitPattern);
310 if (
const auto& pFitQuality{ trackState.fitQualityOnSurface() };
311 pFitQuality and pFitQuality.numberDoF() > 0) {
313 if (
const auto& chiSq{ pFitQuality.chiSquared() };
318 const float chi2add = chiSq / pFitQuality.numberDoF();
320 chi2Sum2 += chi2add * chi2add;
326 trackState.trackParameters()) {
330 if (trackState.trackParameters()
331 ->associatedSurface()
332 .associatedDetectorElement() !=
nullptr) {
333 const Identifier&
id = trackState.trackParameters()
334 ->associatedSurface()
335 .associatedDetectorElementIdentifier();
336 if (!doHolesInDet &&
m_detID->is_pixel(
id))
338 if (!doHolesInDet &&
m_detID->is_sct(
id))
340 if (!doHolesMuon &&
m_detID->is_mdt(
id))
348 if (cntAddChi2 > 0) {
349 const auto inverseCount{ 1. / cntAddChi2 };
350 varChi2 = (chi2Sum2 - (chi2Sum * chi2Sum * inverseCount)) * inverseCount;
352 if (varChi2 > 0 && varChi2 < 1.e13)
363 const EventContext& ctx,
367 std::vector<int>& information,
368 std::bitset<numberOfDetectorTypes>& hitPattern)
const
378 if (tool ==
nullptr) {
382 ctx, track, rot, tsos, information, hitPattern);
395 if (tool ==
nullptr) {
399 ctx, track, compROT, tsos, information, hitPattern);
413 }
else if (
m_detID->is_muon(
id)) {
417 ATH_MSG_WARNING(
"getTool: Identifier is from Muon but have no Muon tool");
420 "getTool: Identifier is of unknown type! id: " <<
id.getString());
427 std::vector<int>& information,
429 bool doHolesMuon)
const
431 ATH_MSG_VERBOSE(
"Entering Trk::TrackSummaryTool::searchHolesStepWise");
433 if (track.trackStateOnSurfaces() ==
nullptr) {
434 constexpr int toMinusOne{ -1 };
452 setTheseElements(information, atIndices, toMinusOne);
456 constexpr int toZero{ 0 };
473 constexpr size_t numberOfRelatedMuonCounters{ 10 };
474 constexpr std::array<size_t, numberOfRelatedMuonCounters> atMuonIndices{
487 setTheseElements(information, atMuonIndices, toZero);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
This class is the pure abstract base class for all fittable tracking measurements.
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
Identifier identify() const
return the identifier -extends MeasurementBase
represents the track state (measurement, material, fit parameters and quality) at a surface.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
@ Hole
A hole on the track - this is defined in the following way.
A summary of the information contained by a track.
DataVector< const Trk::TrackStateOnSurface > TrackStates
@ numberOfTgcPhiHoles
number of TGC Phi measurements missing from the track
@ numberOfTRTHoles
number of TRT hits which pass the high threshold (only xenon counted) total number of TRT hits which ...
@ numberOfRpcEtaHoles
number of RPC Eta measurements missing from the track
@ numberOfContribPixelLayers
number of contributing layers of the pixel detector
@ standardDeviationOfChi2OS
@ numberOfSCTHits
number of SCT holes
@ numberOfGangedPixels
number of Ganged Pixels flagged as fakes
@ numberOfPixelHits
number of pixel layers on track with absence of hits
@ numberOfTRTHighThresholdOutliers
number of dead TRT straws crossed
@ numberOfTRTDeadStraws
number of TRT tube hits
@ numberOfMdtHoles
number of MDT measurements missing from the track
@ numberOfTrackSummaryTypes
@ numberOfMmHits
number of TGC Eta measurements missing from the track
@ numberOfStgcEtaHits
number of TGC Eta measurements missing from the track
@ numberOfTRTOutliers
number of TRT holes
@ numberOfStgcPhiHoles
number of TGC Phi measurements missing from the track
@ numberOfStgcEtaHoles
number of TGC Eta measurements missing from the track
@ numberOfNextToInnermostPixelLayerHits
these are the pixel hits, including the b-layer
@ numberOfMmHoles
number of TGC Eta measurements missing from the track
@ numberOfTRTHits
number of TRT outliers
@ numberOfInnermostPixelLayerHits
these are the hits in the 1st pixel layer
@ numberOfTRTHighThresholdHits
total number of TRT hits which pass the high threshold
@ numberOfMdtHits
number of mdt hits
@ numberOfDBMHits
number of hits in SCT
@ numberOfSCTHoles
number of Holes in both sides of a SCT module
@ numberOfGangedFlaggedFakes
number of dead pixel sensors crossed
@ numberOfSCTDeadSensors
number of TRT hits
@ numberOfStgcPhiHits
number of TGC Phi measurements missing from the track
@ numberOfPixelHoles
number of pixels which have a ganged ambiguity.
@ numberOfTRTTubeHits
number of TRT hits on track in straws with xenon
@ numberOfOutliersOnTrack
100 times the standard deviation of the chi2 from the surfaces
@ numberOfTgcEtaHoles
number of TGC Eta measurements missing from the track
@ numberOfPixelSpoiltHits
number of DBM Hits
@ numberOfTRTHighThresholdHitsTotal
number of TRT hits used for dE/dx computation
@ numberOfCscUnspoiltEtaHits
number of unspoilt CSC eta measurements (all CSC phi measurements are by definition spoilt).
@ numberOfPixelDeadSensors
number of pixel hits with broad errors (width/sqrt(12))
@ numberOfCscPhiHoles
number of CSC Phi measurements missing from the track
@ numberOfRpcPhiHoles
number of RPC Phi measurements missing from the track
@ numberOfCscEtaHoles
number of CSC Eta measurements missing from the track