ATLAS Offline Software
Loading...
Searching...
No Matches
MuonTrackSegmentMatchResult.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5/***************************************************************************
6 * Interface for matching tracks to muon segments
7 * ----------------------------------------------
8 * Author : Martin Woudstra
9 * Creation Date: 06 September 2010
10 ***************************************************************************/
11
12// std
13
14// other packages
15
16// this package
17
19
20namespace Muon {
21
26
28
30 localPosXDiff = 0.0;
31 localPosYDiff = 0.0;
32 localAngleXDiff = 0.0;
33 localAngleYDiff = 0.0;
34 posXMeasErr2 = 0.0;
35 posXPredErr2 = 0.0;
36 posXAlignErr2 = 0.0;
37 posXTotalErr2 = 0.0;
38 posYMeasErr2 = 0.0;
39 posYPredErr2 = 0.0;
40 posYAlignErr2 = 0.0;
41 posYTotalErr2 = 0.0;
42 angleXMeasErr2 = 0.0;
43 angleXPredErr2 = 0.0;
44 angleXAlignErr2 = 0.0;
45 angleXTotalErr2 = 0.0;
46 angleYMeasErr2 = 0.0;
47 angleYPredErr2 = 0.0;
48 angleYAlignErr2 = 0.0;
49 angleYTotalErr2 = 0.0;
50 matchChiSquared = 0.0;
53 predictionCovariance.setZero();
54 measuredCovariance.setZero();
55 totalCovariance.setZero();
56 diffVector.setZero();
57 track = nullptr;
58 segment = nullptr;
59 havePosX = false;
60 havePosY = false;
61 haveAngleX = false;
62 haveAngleY = false;
63 havePosXError = false;
64 havePosYError = false;
65 haveAngleXError = false;
66 haveAngleYError = false;
67 haveMatchChiSquared = false;
68 matchOK = true;
70 }
71
73 if (static_cast<int>(cut) < 0 || static_cast<int>(cut) >= static_cast<int>(NumberOfCutTypes)) { return "CutTypeOutOfRange"; }
74
75 switch (cut) {
76 case PosXCut: return "PosXCut";
77 case PosYCut: return "PosYCut";
78 case AngXCut: return "AngleXCut";
79 case AngYCut: return "AngleYCut";
80 case PosXPullCut: return "PosXPullCut";
81 case PosYPullCut: return "PosYPullCut";
82 case AngXPullCut: return "AngleXPullCut";
83 case AngYPullCut: return "AngleYPullCut";
84 case MatchChiSquaredCut: return "ChiSquaredMatchCut";
85 default: return "CutTypeNotInList";
86 }
87
88 return "";
89 }
90
92 if (static_cast<int>(r) < 0 || static_cast<int>(r) >= static_cast<int>(NumberOfReasons)) { return "ReasonOutOfRange"; }
93 switch (r) {
94 case Unknown: return "Unknown";
95 case NoCutsApplied: return "NoCutsApplied";
96 case PassedAllCuts: return "PassedAllCuts";
97 case PassedMatchChiSquaredCut: return "PassedMatchChiSquaredCut";
98 case PassedPosAngleCuts: return "PassedPosAngleCuts";
99 case FailedCuts: return "FailedCuts";
100 case SegmentMatching: return "SegmentMatching";
101 case NoSegmentPointer: return "NoSegmentPointer";
102 case StereoAngleWithoutPhi: return "StereoAngleWithoutPhi";
103 case NoClosestPars: return "NoClosestPars";
104 case FieldNotOk: return "FieldNotOk";
105 case NoClosestSegment: return "NoClosestSegment";
106 case SegmentMatch: return "SegmentMatch";
107 case NoMomentumWithMagField: return "NoMomentumWithMagField";
108 case ExtrapolFailed: return "ExtrapolationFailed";
109 case ExtrapolNoErrors: return "ExtrapolationNoErrors";
110 case NoMeasErrors: return "NoMeasErrors";
111 case AngleMeasErrFailed: return "AngleMeasErrFailed";
112 case AnglePredErrFailed: return "AnglePredErrFailed";
113 case LocalDirFailed: return "LocalDirFailed";
114
115 default: return "ReasonNotInList";
116 }
117 }
118
121 std::string failedStr;
122 for (int i = 0; i < (int)NumberOfCutTypes; ++i) {
123 CutType cut = static_cast<CutType>(i);
124 if (appliedCut(cut) && failedCut(cut)) {
125 if (!failedStr.empty()) failedStr += ",";
126 failedStr += TrackSegmentMatchResult::cutString(cut);
127 }
128 }
129 return failedStr;
130 }
131
134 std::string passedStr;
135 for (int i = 0; i < (int)NumberOfCutTypes; ++i) {
136 CutType cut = static_cast<CutType>(i);
137 if (appliedCut(cut) && passedCut(cut)) {
138 if (!passedStr.empty()) passedStr += ",";
139 passedStr += cutString(cut);
140 }
141 }
142 return passedStr;
143 }
144
146
148
150
152 posXCut = 0.0;
153 posYCut = 0.0;
154 posXPullCut = 0.0;
155 posYPullCut = 0.0;
156 angleXCut = 0.0;
157 angleYCut = 0.0;
158 angleXPullCut = 0.0;
159 angleYPullCut = 0.0;
160 matchChiSquaredCut = 0.0;
161 useTightCuts = false;
162 cutOnPosX = false;
163 cutOnPosY = false;
164 cutOnPosXPull = false;
165 cutOnPosYPull = false;
166 cutOnAngleX = false;
167 cutOnAngleY = false;
168 cutOnAngleXPull = false;
169 cutOnAngleYPull = false;
170 cutOnMatchChiSquared = false;
171 }
172
173} // namespace Muon
int r
Definition globals.cxx:22
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
void resetCuts()
Reset all cuts (applied & passed)
bool passedCut(CutType cut) const
Did it pass the cut?
bool failedCut(CutType cut) const
Did it fail the cut?
std::string failedCutsString() const
String with all cuts that were applied and failed.
bool appliedCut(CutType cut) const
Was the cut applied ?
static std::string cutString(CutType cut)
turn enum CutType into a string
std::string passedCutsString() const
String with all cuts that were applied and passed.