ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCalibTrackSummary.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <sstream>
8
11
12namespace MuonCalib {
13
14 std::string MuonCalibTrackSummary::dump() const {
15 MuonFixedIdPrinter printer{};
16
17 std::ostringstream sout;
18 if (hasId()) {
19 sout << " Pixel: " << npixel << " SCT " << nsct << " TRT barrel " << ntrtBarrel << " TRT endcap " << ntrtEndcap;
20 if (hasMuon()) sout << std::endl;
21 }
22
23 if (hasMuon()) {
24 sout << " Layers: eta " << precisionStationLayers.size() << " good " << goodPrecisionStationLayers.size() << " phi "
25 << phiStationLayers.size() << " eta confirmed " << phiEtaStationLayers.size() << std::endl
26 << " Hits: eta " << nmdtHits + ncscEtaHits << " phi " << nrpcPhiHits + ntgcPhiHits + ncscPhiHits << " eta trig "
27 << nrpcEtaHits + ntgcEtaHits << " holes " << nholes << " outliers " << noutliers << " pseudo " << npseudo
28 << " scatters " << nscatters << std::endl;
29 }
30
31 sout.setf(std::ios::left);
32 std::vector<ChamberHitSummary>::const_iterator chit = chamberHitSummary.begin();
33 std::vector<ChamberHitSummary>::const_iterator chit_end = chamberHitSummary.end();
34 std::vector<ChamberHitSummary>::const_iterator chit_last = chit_end - 1;
35 for (; chit != chit_end; ++chit) {
36 const MuonFixedId& chId = chit->chId;
37 bool isMdt = chit->isMdt();
38
39 sout << " " << std::setw(35) << printer.chamberIdentifier(chId);
40
41 const ChamberHitSummary::Projection& first = chit->etaProjection();
42 const ChamberHitSummary::Projection& second = chit->phiProjection();
43
44 std::string firstString = isMdt ? "ml1 " : "eta ";
45 std::string secondString = isMdt ? "ml2 " : "phi ";
46
47 sout << " Hits: " << firstString << std::setw(3) << first.nhits << " " << secondString << std::setw(3) << second.nhits;
48
49 if (first.nholes || second.nholes) {
50 sout << " Holes: ";
51 if (first.nholes != 0) sout << firstString << std::setw(3) << first.nholes;
52 if (second.nholes != 0) {
53 if (first.nholes != 0) sout << " ";
54 sout << secondString << std::setw(3) << second.nholes;
55 }
56 }
57 if (first.noutliers || second.noutliers) {
58 sout << " Outliers: ";
59 if (first.noutliers != 0) sout << firstString << std::setw(3) << first.noutliers << " ";
60 if (second.noutliers != 0) {
61 if (first.noutliers != 0) sout << " ";
62 sout << secondString << std::setw(3) << second.noutliers;
63 }
64 }
65
66 if (first.ndeltas || second.ndeltas) {
67 sout << " Deltas: ";
68 if (first.ndeltas != 0) sout << firstString << std::setw(3) << first.ndeltas << " ";
69 if (second.ndeltas != 0) {
70 if (first.ndeltas != 0) sout << " ";
71 sout << secondString << std::setw(3) << second.ndeltas;
72 }
73 }
74
75 if (chit != chit_last) sout << std::endl;
76 }
77
78 return sout.str();
79 }
80
81 unsigned int MuonCalibTrackSummary::nmdtHitsPerMl(int ml) const {
82 unsigned int nhits = 0;
83 std::vector<ChamberHitSummary>::const_iterator chit = chamberHitSummary.begin();
84 std::vector<ChamberHitSummary>::const_iterator chit_end = chamberHitSummary.end();
85 for (; chit != chit_end; ++chit) {
86 if (chit->chId.is_mdt()) {
87 if (ml == 1)
88 nhits += chit->nMdtHitsMl1();
89 else
90 nhits += chit->nMdtHitsMl2();
91 }
92 }
93 return nhits;
94 }
95
96 unsigned int MuonCalibTrackSummary::nmdtCh() const {
97 unsigned int nCh = 0;
98 std::vector<ChamberHitSummary>::const_iterator chit = chamberHitSummary.begin();
99 std::vector<ChamberHitSummary>::const_iterator chit_end = chamberHitSummary.end();
100 for (; chit != chit_end; ++chit) {
101 if (chit->chId.is_mdt()) ++nCh;
102 }
103 return nCh;
104 }
105
106 unsigned int MuonCalibTrackSummary::nrpcCh(bool phi) const {
107 unsigned int nCh = 0;
108 std::vector<ChamberHitSummary>::const_iterator chit = chamberHitSummary.begin();
109 std::vector<ChamberHitSummary>::const_iterator chit_end = chamberHitSummary.end();
110 for (; chit != chit_end; ++chit) {
111 if (chit->chId.is_rpc()) {
112 if (phi && chit->nphiHits() > 0)
113 ++nCh;
114 else if (!phi && chit->netaHits() > 0)
115 ++nCh;
116 }
117 }
118 return nCh;
119 }
120
121 unsigned int MuonCalibTrackSummary::ntgcCh(bool phi) const {
122 unsigned int nCh = 0;
123 std::vector<ChamberHitSummary>::const_iterator chit = chamberHitSummary.begin();
124 std::vector<ChamberHitSummary>::const_iterator chit_end = chamberHitSummary.end();
125 for (; chit != chit_end; ++chit) {
126 if (chit->chId.is_tgc()) {
127 if (phi && chit->nphiHits() > 0)
128 ++nCh;
129 else if (!phi && chit->netaHits() > 0)
130 ++nCh;
131 }
132 }
133 return nCh;
134 }
135
136 unsigned int MuonCalibTrackSummary::ncscCh(bool phi) const {
137 unsigned int nCh = 0;
138 std::vector<ChamberHitSummary>::const_iterator chit = chamberHitSummary.begin();
139 std::vector<ChamberHitSummary>::const_iterator chit_end = chamberHitSummary.end();
140 for (; chit != chit_end; ++chit) {
141 if (chit->chId.is_csc()) {
142 if (phi && chit->nphiHits() > 0)
143 ++nCh;
144 else if (!phi && chit->netaHits() > 0)
145 ++nCh;
146 }
147 }
148 return nCh;
149 }
150
152 unsigned int nCh = 0;
153 std::vector<ChamberHitSummary>::const_iterator chit = chamberHitSummary.begin();
154 std::vector<ChamberHitSummary>::const_iterator chit_end = chamberHitSummary.end();
155 for (; chit != chit_end; ++chit) {
156 if (chit->chId.is_rpc()) {
157 if (chit->nphiHits() > 0 && chit->netaHits() > 0) ++nCh;
158 }
159 }
160 return nCh;
161 }
162
164 unsigned int nCh = 0;
165 std::vector<ChamberHitSummary>::const_iterator chit = chamberHitSummary.begin();
166 std::vector<ChamberHitSummary>::const_iterator chit_end = chamberHitSummary.end();
167 for (; chit != chit_end; ++chit) {
168 if (chit->chId.is_tgc()) {
169 if (chit->nphiHits() > 0 && chit->netaHits() > 0) ++nCh;
170 }
171 }
172 return nCh;
173 }
174
176 unsigned int nCh = 0;
177 std::vector<ChamberHitSummary>::const_iterator chit = chamberHitSummary.begin();
178 std::vector<ChamberHitSummary>::const_iterator chit_end = chamberHitSummary.end();
179 for (; chit != chit_end; ++chit) {
180 if (chit->chId.is_csc()) {
181 if (chit->nphiHits() > 0 && chit->netaHits() > 0) ++nCh;
182 }
183 }
184 return nCh;
185 }
186
187} // namespace MuonCalib
Scalar phi() const
phi method
unsigned int nmdtCh() const
access to number of chambers per technology on the track
unsigned int nmdtHitsPerMl(int ml) const
access to number of MDT hits per ml (ml=1,2)
std::set< MuonFixedIdManipulator::PhiStationIndex > phiStationLayers
set of phi layers on the track
unsigned int ncscCh(bool phi) const
std::set< MuonFixedIdManipulator::StationIndex > precisionStationLayers
set of precision layers on the track
std::set< MuonFixedIdManipulator::StationIndex > goodPrecisionStationLayers
set of precision layers with (MDT: two multi layers, CSC: at least 2 eta and phi hits) on the track
std::string dump() const
dump counts to string
std::vector< ChamberHitSummary > chamberHitSummary
unsigned int ntgcCh(bool phi) const
std::set< MuonFixedIdManipulator::PhiStationIndex > phiEtaStationLayers
set of phi layers which also have eta hits on the track
unsigned int nrpcCh(bool phi) const
std::string chamberIdentifier(const MuonFixedId &id) const
prints chamber Identifier for the give id.
Implements fixed identifiers not dependent upon Athena Identifier for internal use in the calibration...
Definition MuonFixedId.h:50
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.