ATLAS Offline Software
Loading...
Searching...
No Matches
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
23
24Trk::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
37{
38 if (rhs.m_muonTrackSummary) {
39 m_muonTrackSummary =
40 std::make_unique<MuonTrackSummary>(*rhs.m_muonTrackSummary);
41 } else {
42 m_muonTrackSummary = nullptr;
43 }
44}
45
48{
49 if (&rhs != this) {
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
86namespace Trk {
87namespace {
88
89template<class T_out>
90inline T_out&
91dumpTrackSummary(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
202std::ostream&
203Trk::operator<<(std::ostream& out, const TrackSummary& trackSum)
204{
205 return dumpTrackSummary(out, trackSum);
206}
207
208MsgStream&
209Trk::operator<<(MsgStream& out, const TrackSummary& trackSum)
210{
211 return dumpTrackSummary(out, trackSum);
212}
Detailed track summary for the muon system Give access to hit counts per chamber.
A summary of the information contained by a track.
TrackSummary & operator=(const TrackSummary &)
assignment operator
static const int SummaryTypeNotSet
Value set in the cxx file to -1.
bool isHit(const DetectorType &type) const
returns true if the detector type 'type' is hit.
std::unique_ptr< MuonTrackSummary > m_muonTrackSummary
pointer to the MuonTrackSummary
const MuonTrackSummary * muonTrackSummary() const
returns a pointer to the MuonTrackSummary if available
std::vector< int > m_information
vector containing the persistent summary information.
TrackSummary & operator+=(const TrackSummary &ts)
adds the values of the passed TrackSummary to this TrackSummary.
TrackSummary()
needed by POOL
int get(const SummaryType &type) const
returns the summary information for the passed SummaryType.
int ts
Definition globals.cxx:24
Ensure that the ATLAS eigen extensions are properly loaded.
MsgStream & operator<<(MsgStream &sl, const AlignModule &alignModule)
overload of << operator for MsgStream for debug output
DetectorType
enumerates the various detector types currently accessible from the isHit() method.
@ 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
@ 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
@ numberOfMdtHoles
number of MDT measurements missing from the track
@ numberOfMmHits
number of TGC Eta measurements missing from the track
@ numberOfStgcEtaHits
number of TGC Eta measurements missing from the track
@ 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
@ numberOfInnermostPixelLayerHits
these are the hits in the 1st pixel layer
@ numberOfTRTHighThresholdHits
total number of TRT hits which pass the high threshold
@ numberOfSCTHoles
number of Holes in both sides of a SCT module
@ numberOfGangedFlaggedFakes
number of dead pixel sensors crossed
@ 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
@ 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