ATLAS Offline Software
TrackSummary.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 /***************************************************************************
5  Summary.cxx - description
6  -------------------
7  begin : Tue Feb 17 2004
8  email : edward.moyse@cern.ch
9  ***************************************************************************/
10 
12 #include "GaudiKernel/MsgStream.h"
13 
15 
18  , m_information(numberOfTrackSummaryTypes, SummaryTypeNotSet)
19  , m_idHitPattern(0)
20  , m_muonTrackSummary(nullptr)
21 {
22 }
23 
24 Trk::TrackSummary::TrackSummary(const std::vector<int>& information,
25  std::bitset<numberOfDetectorTypes>& hitPattern)
27  , m_information(information)
28  , m_idHitPattern(hitPattern.to_ulong())
29  , m_muonTrackSummary(nullptr)
30 {
31 }
32 
35  , m_information(rhs.m_information)
36  , m_idHitPattern(rhs.m_idHitPattern)
37 {
38  if (rhs.m_muonTrackSummary) {
40  std::make_unique<MuonTrackSummary>(*rhs.m_muonTrackSummary);
41  } else {
42  m_muonTrackSummary = nullptr;
43  }
44 }
45 
48 {
49  if (&rhs != this) {
50  m_information = rhs.m_information;
51  m_idHitPattern = rhs.m_idHitPattern;
52  m_muonTrackSummary.reset(rhs.m_muonTrackSummary
54  : nullptr);
55  }
56  return *this;
57 }
58 
60 
63 {
64  if (this != &ts) {
65  for (int i = 0; i < numberOfTrackSummaryTypes; ++i) {
66  // if added number is <0, leave as is (this also catches the case where
67  // both are <0)
68  if (ts.m_information[i] < 0) {
69  continue;
70  }
71 
72  if (m_information[i] < 0) {
73  m_information[i]++;
74  }
75  m_information[i] += ts.m_information[i];
76  }
77  if (!m_muonTrackSummary) {
78  m_muonTrackSummary.reset(ts.m_muonTrackSummary
79  ? new MuonTrackSummary(*ts.m_muonTrackSummary)
80  : nullptr);
81  }
82  }
83  return *this;
84 }
85 
86 namespace Trk {
87 namespace {
88 
89 template<class T_out>
90 inline T_out&
91 dumpTrackSummary(T_out& out, const TrackSummary& trackSum)
92 {
93  out << "Persistant track summary information:"
94  << "\n";
95  out << " * Number of contrib. Pixel Layer: "
96  << trackSum.get(numberOfContribPixelLayers) << "\n";
97  out << " * Number of Innermost Pixel layer hits : "
98  << trackSum.get(numberOfInnermostPixelLayerHits) << "\n";
99  out << " * Number of Next-To-Innermost Pixel layer hits : "
100  << trackSum.get(numberOfNextToInnermostPixelLayerHits) << "\n";
101  out << " * Number of pixel hits : "
102  << trackSum.get(numberOfPixelHits) << "\n";
103  out << " * Number of spoilt pixel hits : "
104  << trackSum.get(numberOfPixelSpoiltHits) << "\n";
105  out << " * Number of pixel holes : "
106  << trackSum.get(numberOfPixelHoles) << "\n";
107  out << " * Number of GangedPixels : "
108  << trackSum.get(numberOfGangedPixels) << "\n";
109  out << " * Number of GangedFlaggedFakes : "
110  << trackSum.get(numberOfGangedFlaggedFakes) << "\n";
111  out << " * Number of dead pixel sensors : "
112  << trackSum.get(numberOfPixelDeadSensors) << "\n";
113  out << " * Number of SCT hits : " << trackSum.get(numberOfSCTHits)
114  << "\n";
115  out << " * Number of SCT holes : " << trackSum.get(numberOfSCTHoles)
116  << "\n";
117  out << " * Number of SCT double Holes : "
118  << trackSum.get(numberOfSCTDoubleHoles) << "\n";
119  out << " * Number of dead SCT sensors : "
120  << trackSum.get(numberOfSCTDeadSensors) << "\n";
121  out << " * Number of spoilt SCT hits : "
122  << trackSum.get(numberOfSCTSpoiltHits) << "\n";
123  out << " * Number of TRT hits : " << trackSum.get(numberOfTRTHits)
124  << "\n";
125  out << " * Number of TRT xenon hits : "
126  << trackSum.get(numberOfTRTXenonHits) << "\n";
127  out << " * Number of TRT outliers : "
128  << trackSum.get(numberOfTRTOutliers) << "\n";
129  out << " * Number of TRT TR hits : "
130  << trackSum.get(numberOfTRTHighThresholdHits) << "\n";
131  out << " * Number of TRT TR hits total : "
132  << trackSum.get(numberOfTRTHighThresholdHitsTotal) << "\n";
133  out << " * Number of TRT TR outliers : "
134  << trackSum.get(numberOfTRTHighThresholdOutliers) << "\n";
135  out << " * Number of TRT holes : " << trackSum.get(numberOfTRTHoles)
136  << "\n";
137  out << " * Number of TRT tube hits : "
138  << trackSum.get(numberOfTRTTubeHits) << "\n";
139  out << " * Number of dead TRT straws : "
140  << trackSum.get(numberOfTRTDeadStraws) << "\n";
141  out << " * Number of MDT hits : " << trackSum.get(numberOfMdtHits)
142  << "\n";
143  out << " * Number of MDT holes : " << trackSum.get(numberOfMdtHoles)
144  << "\n";
145 
146  // New Small Wheel
147  out << " * Number of STGC hits : phi "
148  << trackSum.get(numberOfStgcPhiHits) << " eta "
149  << trackSum.get(numberOfStgcEtaHits) << "\n";
150  out << " * Number of STGC holes : phi "
151  << trackSum.get(numberOfStgcPhiHoles) << " eta "
152  << trackSum.get(numberOfStgcEtaHoles) << "\n";
153  out << " * Number of MM hits : " << trackSum.get(numberOfMmHits)
154  << "\n";
155  out << " * Number of MM holes : " << trackSum.get(numberOfMmHoles)
156  << "\n";
157 
158  out << " * Number of TGC hits : phi "
159  << trackSum.get(numberOfTgcPhiHits) << " eta "
160  << trackSum.get(numberOfTgcEtaHits) << "\n";
161  out << " * Number of TGC holes : phi "
162  << trackSum.get(numberOfTgcPhiHoles) << " eta "
163  << trackSum.get(numberOfTgcEtaHoles) << "\n";
164  out << " * Number of RPC hits : phi "
165  << trackSum.get(numberOfRpcPhiHits) << " eta "
166  << trackSum.get(numberOfRpcEtaHits) << "\n";
167  out << " * Number of RPC holes : phi "
168  << trackSum.get(numberOfRpcPhiHoles) << " eta "
169  << trackSum.get(numberOfRpcEtaHoles) << "\n";
170  out << " * Number of CSC hits : phi "
171  << trackSum.get(numberOfCscPhiHits) << " eta "
172  << trackSum.get(numberOfCscEtaHits) << "\n";
173  out << " * Number of unspoilt CSC etahits:"
174  << trackSum.get(numberOfCscUnspoiltEtaHits) << "\n";
175  out << " * Number of CSC holes : phi "
176  << trackSum.get(numberOfCscPhiHoles) << " eta "
177  << trackSum.get(numberOfCscEtaHoles) << "\n";
178  out << " * Number of Outliers : "
179  << trackSum.get(numberOfOutliersOnTrack) << "\n";
180  out << "Transient track summary information:"
181  << "\n";
182  out << " * scatter of chi2 on Surface : "
183  << float(trackSum.get(standardDeviationOfChi2OS)) / 100. << "\n";
184  // this is a bit nasty, but I don't have access to internal data members
185  out << " Hit pattern (see DetectorType enum for meaning) : ";
186  for (int i = 0; i < Trk::numberOfDetectorTypes; ++i) {
187  if (trackSum.isHit(static_cast<Trk::DetectorType>(i))) {
188  out << "1";
189  } else {
190  out << "0";
191  }
192  }
193  out << "\n";
194  if (nullptr != trackSum.muonTrackSummary()) {
195  out << *(trackSum.muonTrackSummary());
196  }
197  return out;
198 }
199 }
200 }
201 
202 std::ostream&
203 Trk::operator<<(std::ostream& out, const TrackSummary& trackSum)
204 {
205  return dumpTrackSummary(out, trackSum);
206 }
207 
208 MsgStream&
209 Trk::operator<<(MsgStream& out, const TrackSummary& trackSum)
210 {
211  return dumpTrackSummary(out, trackSum);
212 }
Trk::numberOfPixelHits
@ numberOfPixelHits
number of pixel layers on track with absence of hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:57
Trk::numberOfContribPixelLayers
@ numberOfContribPixelLayers
number of contributing layers of the pixel detector
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:49
Trk::numberOfRpcPhiHoles
@ numberOfRpcPhiHoles
number of RPC Phi measurements missing from the track
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:118
Trk::numberOfTRTHighThresholdHits
@ numberOfTRTHighThresholdHits
total number of TRT hits which pass the high threshold
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:87
Trk::numberOfMdtHoles
@ numberOfMdtHoles
number of MDT measurements missing from the track
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:120
Trk::numberOfTRTHighThresholdOutliers
@ numberOfTRTHighThresholdOutliers
number of dead TRT straws crossed
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:93
Trk::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 1st pixel layer
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:53
Trk::numberOfCscEtaHits
@ numberOfCscEtaHits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:108
Trk::TrackSummary::m_idHitPattern
unsigned long m_idHitPattern
contains the 'hit pattern'
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:367
Trk::numberOfCscUnspoiltEtaHits
@ numberOfCscUnspoiltEtaHits
number of unspoilt CSC eta measurements (all CSC phi measurements are by definition spoilt).
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:142
Trk::numberOfPixelSpoiltHits
@ numberOfPixelSpoiltHits
number of DBM Hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:67
Trk::numberOfSCTDeadSensors
@ numberOfSCTDeadSensors
number of TRT hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:76
Trk::numberOfCscEtaHoles
@ numberOfCscEtaHoles
number of CSC Eta measurements missing from the track
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:112
Trk::numberOfTrackSummaryTypes
@ numberOfTrackSummaryTypes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:189
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Trk::numberOfNextToInnermostPixelLayerHits
@ numberOfNextToInnermostPixelLayerHits
these are the pixel hits, including the b-layer
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:55
Trk::numberOfOutliersOnTrack
@ numberOfOutliersOnTrack
100 times the standard deviation of the chi2 from the surfaces
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:148
Trk::numberOfTgcPhiHits
@ numberOfTgcPhiHits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:105
Trk::numberOfStgcEtaHoles
@ numberOfStgcEtaHoles
number of TGC Eta measurements missing from the track
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:134
Trk::standardDeviationOfChi2OS
@ standardDeviationOfChi2OS
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:150
Trk::numberOfCscPhiHoles
@ numberOfCscPhiHoles
number of CSC Phi measurements missing from the track
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:114
Trk::numberOfMmHoles
@ numberOfMmHoles
number of TGC Eta measurements missing from the track
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:138
Trk::numberOfSCTHoles
@ numberOfSCTHoles
number of Holes in both sides of a SCT module
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:73
Trk::numberOfTRTHoles
@ numberOfTRTHoles
number of TRT hits which pass the high threshold (only xenon counted) total number of TRT hits which ...
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:83
Trk::ObjectCounter
Helper to enable counting number of instantiations in debug builds.
Definition: TrkObjectCounter.h:18
Trk::numberOfMmHits
@ numberOfMmHits
number of TGC Eta measurements missing from the track
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:132
Trk::numberOfTRTDeadStraws
@ numberOfTRTDeadStraws
number of TRT tube hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:95
Trk::TrackSummary::~TrackSummary
~TrackSummary()
Trk::numberOfTRTTubeHits
@ numberOfTRTTubeHits
number of TRT hits on track in straws with xenon
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:97
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::numberOfTRTOutliers
@ numberOfTRTOutliers
number of TRT holes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:81
Trk::numberOfSCTHits
@ numberOfSCTHits
number of SCT holes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:71
Trk::TrackSummary::isHit
bool isHit(const DetectorType &type) const
returns true if the detector type 'type' is hit.
Trk::numberOfPixelDeadSensors
@ numberOfPixelDeadSensors
number of pixel hits with broad errors (width/sqrt(12))
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:65
Trk::MuonTrackSummary
Detailed track summary for the muon system Give access to hit counts per chamber.
Definition: MuonTrackSummary.h:26
TrackSummary.h
xAOD::numberOfTrackSummaryTypes
@ numberOfTrackSummaryTypes
Definition: TrackingPrimitives.h:319
Trk::numberOfStgcEtaHits
@ numberOfStgcEtaHits
number of TGC Eta measurements missing from the track
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:128
Trk::numberOfTgcEtaHits
@ numberOfTgcEtaHits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:106
Trk::numberOfPixelHoles
@ numberOfPixelHoles
number of pixels which have a ganged ambiguity.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:59
Trk::numberOfTgcPhiHoles
@ numberOfTgcPhiHoles
number of TGC Phi measurements missing from the track
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:124
Trk::TrackSummary::operator+=
TrackSummary & operator+=(const TrackSummary &ts)
adds the values of the passed TrackSummary to this TrackSummary.
Definition: TrackSummary.cxx:62
Trk::numberOfGangedPixels
@ numberOfGangedPixels
number of Ganged Pixels flagged as fakes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:61
Trk::TrackSummary::SummaryTypeNotSet
static const int SummaryTypeNotSet
Value set in the cxx file to -1.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:297
Trk::numberOfTRTHits
@ numberOfTRTHits
number of TRT outliers
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:79
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::numberOfRpcPhiHits
@ numberOfRpcPhiHits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:109
Trk::TrackSummary
A summary of the information contained by a track.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:287
Trk::numberOfTgcEtaHoles
@ numberOfTgcEtaHoles
number of TGC Eta measurements missing from the track
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:122
Trk::numberOfSCTSpoiltHits
@ numberOfSCTSpoiltHits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:78
Trk::TrackSummary::operator=
TrackSummary & operator=(const TrackSummary &)
assignment operator
Definition: TrackSummary.cxx:47
Trk::TrackSummary::m_information
std::vector< int > m_information
vector containing the persistent summary information.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:364
Trk::numberOfStgcPhiHoles
@ numberOfStgcPhiHoles
number of TGC Phi measurements missing from the track
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:136
Trk::DetectorType
DetectorType
enumerates the various detector types currently accessible from the isHit() method.
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:231
Trk::numberOfStgcPhiHits
@ numberOfStgcPhiHits
number of TGC Phi measurements missing from the track
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:130
Trk::operator<<
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
Definition: AlignModule.cxx:204
Trk::numberOfDetectorTypes
@ numberOfDetectorTypes
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:263
Trk::TrackSummary::TrackSummary
TrackSummary()
needed by POOL
Definition: TrackSummary.cxx:16
Trk::TrackSummary::m_muonTrackSummary
std::unique_ptr< MuonTrackSummary > m_muonTrackSummary
pointer to the MuonTrackSummary
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:370
Trk::numberOfGangedFlaggedFakes
@ numberOfGangedFlaggedFakes
number of dead pixel sensors crossed
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:63
Trk::numberOfRpcEtaHits
@ numberOfRpcEtaHits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:110
Trk::TrackSummary::get
int get(const SummaryType &type) const
returns the summary information for the passed SummaryType.
Trk::numberOfTRTHighThresholdHitsTotal
@ numberOfTRTHighThresholdHitsTotal
number of TRT hits used for dE/dx computation
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:89
Trk::TrackSummary::muonTrackSummary
const MuonTrackSummary * muonTrackSummary() const
returns a pointer to the MuonTrackSummary if available
python.CaloScaleNoiseConfig.ts
ts
Definition: CaloScaleNoiseConfig.py:86
Trk::numberOfSCTDoubleHoles
@ numberOfSCTDoubleHoles
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:75
Trk::numberOfTRTXenonHits
@ numberOfTRTXenonHits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:99
Trk::numberOfCscPhiHits
@ numberOfCscPhiHits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:107
readCCLHist.float
float
Definition: readCCLHist.py:83
Trk::numberOfRpcEtaHoles
@ numberOfRpcEtaHoles
number of RPC Eta measurements missing from the track
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:116
Trk::numberOfMdtHits
@ numberOfMdtHits
number of mdt hits
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:103