ATLAS Offline Software
Loading...
Searching...
No Matches
L0Muon Namespace Reference

Namespaces

namespace  MuCTPIBits
namespace  NSWTPBits
namespace  TgcL0Floating

Classes

class  ICandData
class  ITgcL0CandidateBuilderTool
 Interface for building pre-Inner-Coincidence TGC candidates. More...
class  ITgcL0InnerCoincidenceTool
 Interface for applying Inner Coincidence to TGC candidates. More...
class  ITgcL0TrackSelectorTool
 Interface for selecting TGC candidates and filling TGCCandData. More...
class  L0MuonEndcapAlg
 Initial data-flow boundary for the Phase-II endcap trigger. More...
class  L0MuonSmearingAlg
class  L0MuonTrack
class  MDTSimulation
class  NSWSimulation
class  RPCCandData
class  RPCSimulation
class  TGCCandData
class  TgcL0BitwiseCandidateBuilderTool
class  TgcL0BitwiseInnerCoincidenceTool
class  TgcL0BitwiseTrackSelectorTool
struct  TgcL0Candidate
 Event-local candidate used by the TGC simulation tools. More...
class  TgcL0FloatingCandidateBuilderTool
class  TgcL0FloatingInnerCoincidenceTool
struct  TgcL0FloatingPtEvaluation
class  TgcL0FloatingPtLut
 Immutable Floating-pT runtime calibration loaded from ASCII. More...
class  TgcL0FloatingTrackSelectorTool
class  TgcL0GoodMagMap
 Immutable sparse GoodMag map loaded from ASCII. More...
class  TgcL0MdtCandidateSelector
 Select the TGC candidates sent to MDTTP. More...
class  TgcL0RootOutputAlg
 MuonTester backend for event-level TGC truth-validation data. More...
struct  TgcL0Segment
 Event-local projection segment optionally exposed for validation. More...
class  TgcL0TruthValidationAlg
 Calculates event-local TGC truth-validation quantities. More...
struct  TgcL0ValidationCandidateBlock
 Reconstruction quantities exposed to validation backends. More...
struct  TgcL0ValidationCheckResult
 Result of a structural validation-data consistency check. More...
struct  TgcL0ValidationEvent
 ROOT-independent validation data for one event. More...
struct  TgcL0ValidationEventInfo
 Event identifiers used by the validation chain. More...
struct  TgcL0ValidationSegmentBlock
 Projection-segment quantities published by reconstruction. More...
struct  TgcL0ValidationTruthBlock
 Truth and truth-to-reconstruction matching quantities. More...
class  TGCSimulation
class  TruthTrackSmearer

Typedefs

using RPCCandDataContainer = DataVector<RPCCandData>
using TGCCandDataContainer = DataVector<TGCCandData>
using TgcL0CandidateContainer = std::vector<TgcL0Candidate>
 Event-local candidate collection.
using TgcL0SegmentContainer = std::vector<TgcL0Segment>

Enumerations

enum class  TgcL0FloatingPtResponseMode : std::uint8_t { Invalid = 0 , Linear = 1 , FloatingMonotonicLut = 2 }
enum class  TgcL0FloatingThresholdCalibrationStatus : std::uint8_t {
  None = 0 , Direct = 1 , PhiMedianFallback = 2 , EtaNeighborFallback = 3 ,
  GlobalFallback = 4 , Provisional = 5
}
enum class  TgcL0SegmentProjection : std::uint8_t { Wire = 0U , Strip = 1U }
 Projection represented by a transient TGC segment. More...
enum class  TgcL0ValidationProjection : std::uint8_t { Wire = 0U , Strip = 1U }
 Projection encoding used in the validation segment block. More...
enum class  TgcL0ValidationUnmatchedReason : std::uint8_t { NotFullyExtrapolated = 0U , NoCandidateInWindow = 1U , CandidateCompetition = 2U }
 Reason why a selected truth muon has no matched candidate. More...

Functions

TgcL0ValidationCheckResult checkTgcL0ValidationEvent (const TgcL0ValidationEvent &event)
 Check vector sizes and reciprocal cross-block indices.

Variables

static constexpr float TgcL0ValidationInvalidValue = 999.F
 Common sentinel for unavailable floating-point validation data.
static constexpr std::uint8_t TgcL0ValidationNoUnmatchedReason = 255U
 Sentinel indicating that a matched truth object has no failure code.

Typedef Documentation

◆ RPCCandDataContainer

◆ TGCCandDataContainer

◆ TgcL0CandidateContainer

Event-local candidate collection.

Definition at line 103 of file TgcL0Candidate.h.

◆ TgcL0SegmentContainer

Definition at line 34 of file TgcL0Segment.h.

Enumeration Type Documentation

◆ TgcL0FloatingPtResponseMode

enum class L0Muon::TgcL0FloatingPtResponseMode : std::uint8_t
strong
Enumerator
Invalid 
Linear 
FloatingMonotonicLut 

Definition at line 15 of file TgcL0FloatingPtLut.h.

◆ TgcL0FloatingThresholdCalibrationStatus

enum class L0Muon::TgcL0FloatingThresholdCalibrationStatus : std::uint8_t
strong
Enumerator
None 
Direct 
PhiMedianFallback 
EtaNeighborFallback 
GlobalFallback 
Provisional 

Definition at line 21 of file TgcL0FloatingPtLut.h.

◆ TgcL0SegmentProjection

enum class L0Muon::TgcL0SegmentProjection : std::uint8_t
strong

Projection represented by a transient TGC segment.

Enumerator
Wire 
Strip 

Definition at line 15 of file TgcL0Segment.h.

◆ TgcL0ValidationProjection

enum class L0Muon::TgcL0ValidationProjection : std::uint8_t
strong

Projection encoding used in the validation segment block.

Enumerator
Wire 
Strip 

Definition at line 21 of file TgcL0ValidationEvent.h.

21 : std::uint8_t {
22 Wire = 0U,
23 Strip = 1U
24};

◆ TgcL0ValidationUnmatchedReason

enum class L0Muon::TgcL0ValidationUnmatchedReason : std::uint8_t
strong

Reason why a selected truth muon has no matched candidate.

Enumerator
NotFullyExtrapolated 
NoCandidateInWindow 
CandidateCompetition 

Definition at line 27 of file TgcL0ValidationEvent.h.

Function Documentation

◆ checkTgcL0ValidationEvent()

TgcL0ValidationCheckResult L0Muon::checkTgcL0ValidationEvent ( const TgcL0ValidationEvent & event)
inline

Check vector sizes and reciprocal cross-block indices.

Definition at line 24 of file TgcL0ValidationEventCheck.h.

25 {
26 const std::size_t nTruth = event.truth.pdgId.size();
27 const std::size_t nSegments = event.segments.subdetectorId.size();
28 const std::size_t nCandidates = event.candidates.subdetectorId.size();
29
30 const auto invalid = [](std::string message) {
31 return TgcL0ValidationCheckResult{false, std::move(message)};
32 };
33 const auto checkTruthSize = [&](const std::size_t size,
34 const char* field) {
35 return size == nTruth
37 : invalid(std::string{"Truth block size mismatch for "} +
38 field);
39 };
40 const auto checkSegmentSize = [&](const std::size_t size,
41 const char* field) {
42 return size == nSegments
44 : invalid(std::string{"Segment block size mismatch for "} +
45 field);
46 };
47 const auto checkCandidateSize = [&](const std::size_t size,
48 const char* field) {
49 return size == nCandidates
51 : invalid(std::string{"Candidate block size mismatch for "} +
52 field);
53 };
54
55#define TGC_CHECK_TRUTH_SIZE(FIELD) \
56 do { \
57 const auto result = checkTruthSize( \
58 event.truth.FIELD.size(), #FIELD); \
59 if (!result.valid) return result; \
60 } while (false)
61
62 TGC_CHECK_TRUTH_SIZE(barcode);
67 TGC_CHECK_TRUTH_SIZE(extrapolatedStationMask);
74 TGC_CHECK_TRUTH_SIZE(matched);
75 TGC_CHECK_TRUTH_SIZE(matchedCandidateIndex);
76 TGC_CHECK_TRUTH_SIZE(matchMeanDeltaR);
77 TGC_CHECK_TRUTH_SIZE(unmatchedReason);
78 TGC_CHECK_TRUTH_SIZE(wireSegmentMatched);
79 TGC_CHECK_TRUTH_SIZE(stripSegmentMatched);
80 TGC_CHECK_TRUTH_SIZE(matchedWireSegmentIndex);
81 TGC_CHECK_TRUTH_SIZE(matchedStripSegmentIndex);
82 TGC_CHECK_TRUTH_SIZE(wireSegmentMatchResidual);
83 TGC_CHECK_TRUTH_SIZE(stripSegmentMatchResidual);
84#undef TGC_CHECK_TRUTH_SIZE
85
86#define TGC_CHECK_SEGMENT_SIZE(FIELD) \
87 do { \
88 const auto result = checkSegmentSize( \
89 event.segments.FIELD.size(), #FIELD); \
90 if (!result.valid) return result; \
91 } while (false)
92
93 TGC_CHECK_SEGMENT_SIZE(triggerSector);
95 TGC_CHECK_SEGMENT_SIZE(projection);
96 TGC_CHECK_SEGMENT_SIZE(stationMask);
97 TGC_CHECK_SEGMENT_SIZE(summedQuality);
98 TGC_CHECK_SEGMENT_SIZE(nStations);
101 TGC_CHECK_SEGMENT_SIZE(residual);
102 TGC_CHECK_SEGMENT_SIZE(outputResidual);
103 TGC_CHECK_SEGMENT_SIZE(consistency);
104 TGC_CHECK_SEGMENT_SIZE(pivotChannel);
105 TGC_CHECK_SEGMENT_SIZE(truthIndex);
106 TGC_CHECK_SEGMENT_SIZE(truthMatchResidual);
107#undef TGC_CHECK_SEGMENT_SIZE
108
109#define TGC_CHECK_CANDIDATE_SIZE(FIELD) \
110 do { \
111 const auto result = checkCandidateSize( \
112 event.candidates.FIELD.size(), #FIELD); \
113 if (!result.valid) return result; \
114 } while (false)
115
116 TGC_CHECK_CANDIDATE_SIZE(triggerSector);
117 TGC_CHECK_CANDIDATE_SIZE(readoutSector);
119 TGC_CHECK_CANDIDATE_SIZE(stationMask);
120 TGC_CHECK_CANDIDATE_SIZE(wireStationMask);
121 TGC_CHECK_CANDIDATE_SIZE(stripStationMask);
124 TGC_CHECK_CANDIDATE_SIZE(deltaTheta);
127 TGC_CHECK_CANDIDATE_SIZE(threshold);
129 TGC_CHECK_CANDIDATE_SIZE(truthIndex);
130#undef TGC_CHECK_CANDIDATE_SIZE
131
132 const auto wireProjection =
133 static_cast<std::uint8_t>(TgcL0ValidationProjection::Wire);
134 const auto stripProjection =
135 static_cast<std::uint8_t>(TgcL0ValidationProjection::Strip);
136
137 for (std::size_t segment = 0U; segment < nSegments; ++segment) {
138 const std::uint8_t projection = event.segments.projection[segment];
139 if (projection != wireProjection && projection != stripProjection) {
140 return invalid("Segment projection is not wire or strip");
141 }
142 if (event.segments.nStations[segment] == 0U ||
143 event.segments.nStations[segment] > 3U) {
144 return invalid("Segment station count is out of range");
145 }
146 const int truth = event.segments.truthIndex[segment];
147 if (truth >= 0 && static_cast<std::size_t>(truth) >= nTruth) {
148 return invalid("Segment truth index is out of range");
149 }
150 const float residual = event.segments.truthMatchResidual[segment];
151 if (truth >= 0 &&
152 (!std::isfinite(residual) ||
153 residual == TgcL0ValidationInvalidValue)) {
154 return invalid("Matched segment has an invalid truth residual");
155 }
156 if (truth < 0 && residual != TgcL0ValidationInvalidValue) {
157 return invalid("Unmatched segment has a truth residual");
158 }
159 }
160
161 for (const int truth : event.candidates.truthIndex) {
162 if (truth >= 0 && static_cast<std::size_t>(truth) >= nTruth) {
163 return invalid("Candidate truth index is out of range");
164 }
165 }
166
167 std::vector<int> candidateOwner(nCandidates, -1);
168 for (std::size_t truth = 0U; truth < nTruth; ++truth) {
169 if (event.truth.matched[truth] > 1U) {
170 return invalid("Truth matched flag is not binary");
171 }
172 const bool matched = event.truth.matched[truth] != 0U;
173 const int candidate = event.truth.matchedCandidateIndex[truth];
174 if (candidate >= 0 && static_cast<std::size_t>(candidate) >= nCandidates) {
175 return invalid("Truth matched-candidate index is out of range");
176 }
177 if (matched && candidate < 0) {
178 return invalid("Matched truth has no candidate index");
179 }
180 if (!matched && candidate >= 0) {
181 return invalid("Unmatched truth has a candidate index");
182 }
183 if (matched &&
184 event.truth.unmatchedReason[truth] !=
186 return invalid("Matched truth has an unmatched-reason code");
187 }
188 if (!matched &&
189 event.truth.unmatchedReason[truth] ==
191 return invalid("Unmatched truth has no unmatched-reason code");
192 }
193 if (!matched &&
194 event.truth.unmatchedReason[truth] >
195 static_cast<std::uint8_t>(
197 return invalid("Truth unmatched-reason code is out of range");
198 }
199 if (matched &&
200 (!std::isfinite(event.truth.matchMeanDeltaR[truth]) ||
201 event.truth.matchMeanDeltaR[truth] == TgcL0ValidationInvalidValue)) {
202 return invalid("Matched truth has an invalid candidate residual");
203 }
204 if (!matched &&
205 event.truth.matchMeanDeltaR[truth] != TgcL0ValidationInvalidValue) {
206 return invalid("Unmatched truth has a candidate residual");
207 }
208 if (candidate >= 0) {
209 const auto candidateIndex = static_cast<std::size_t>(candidate);
210 if (candidateOwner[candidateIndex] >= 0) {
211 return invalid("Candidate is matched to more than one truth muon");
212 }
213 candidateOwner[candidateIndex] = static_cast<int>(truth);
214 if (event.candidates.truthIndex[candidateIndex] !=
215 static_cast<int>(truth)) {
216 return invalid("Truth-candidate matching indices are not reciprocal");
217 }
218 }
219
220 if (event.truth.wireSegmentMatched[truth] > 1U ||
221 event.truth.stripSegmentMatched[truth] > 1U) {
222 return invalid("Truth segment-matched flag is not binary");
223 }
224 const bool wireMatched = event.truth.wireSegmentMatched[truth] != 0U;
225 const bool stripMatched = event.truth.stripSegmentMatched[truth] != 0U;
226 const int wireSegment = event.truth.matchedWireSegmentIndex[truth];
227 const int stripSegment = event.truth.matchedStripSegmentIndex[truth];
228 if (wireSegment >= 0 &&
229 static_cast<std::size_t>(wireSegment) >= nSegments) {
230 return invalid("Truth matched-wire-segment index is out of range");
231 }
232 if (stripSegment >= 0 &&
233 static_cast<std::size_t>(stripSegment) >= nSegments) {
234 return invalid("Truth matched-strip-segment index is out of range");
235 }
236 if (wireMatched && wireSegment < 0) {
237 return invalid("Wire-segment-matched truth has no segment index");
238 }
239 if (stripMatched && stripSegment < 0) {
240 return invalid("Strip-segment-matched truth has no segment index");
241 }
242 if (!wireMatched && wireSegment >= 0) {
243 return invalid("Wire-segment-unmatched truth has a segment index");
244 }
245 if (!stripMatched && stripSegment >= 0) {
246 return invalid("Strip-segment-unmatched truth has a segment index");
247 }
248 if (wireMatched &&
249 (!std::isfinite(event.truth.wireSegmentMatchResidual[truth]) ||
250 event.truth.wireSegmentMatchResidual[truth] ==
252 return invalid("Wire-segment-matched truth has an invalid residual");
253 }
254 if (!wireMatched &&
255 event.truth.wireSegmentMatchResidual[truth] !=
257 return invalid("Wire-segment-unmatched truth has a residual");
258 }
259 if (stripMatched &&
260 (!std::isfinite(event.truth.stripSegmentMatchResidual[truth]) ||
261 event.truth.stripSegmentMatchResidual[truth] ==
263 return invalid("Strip-segment-matched truth has an invalid residual");
264 }
265 if (!stripMatched &&
266 event.truth.stripSegmentMatchResidual[truth] !=
268 return invalid("Strip-segment-unmatched truth has a residual");
269 }
270 if (wireSegment >= 0 &&
271 event.segments.projection[wireSegment] != wireProjection) {
272 return invalid("Truth wire-segment index points to a strip segment");
273 }
274 if (stripSegment >= 0 &&
275 event.segments.projection[stripSegment] != stripProjection) {
276 return invalid("Truth strip-segment index points to a wire segment");
277 }
278 if ((wireSegment >= 0 &&
279 event.segments.truthIndex[wireSegment] != static_cast<int>(truth)) ||
280 (stripSegment >= 0 &&
281 event.segments.truthIndex[stripSegment] != static_cast<int>(truth))) {
282 return invalid("Truth-segment matching indices are not reciprocal");
283 }
284 }
285
286 for (std::size_t candidate = 0U; candidate < nCandidates; ++candidate) {
287 const int truth = event.candidates.truthIndex[candidate];
288 if (truth < 0) continue;
289 if (event.truth.matched[truth] == 0U ||
290 event.truth.matchedCandidateIndex[truth] !=
291 static_cast<int>(candidate)) {
292 return invalid("Truth-candidate matching indices are not reciprocal");
293 }
294 }
295
296 for (std::size_t segment = 0U; segment < nSegments; ++segment) {
297 const int truth = event.segments.truthIndex[segment];
298 if (truth < 0) continue;
299 const bool isWire = event.segments.projection[segment] == wireProjection;
300 const int reverseIndex =
301 isWire ? event.truth.matchedWireSegmentIndex[truth]
302 : event.truth.matchedStripSegmentIndex[truth];
303 if (reverseIndex != static_cast<int>(segment)) {
304 return invalid("Truth-segment matching indices are not reciprocal");
305 }
306 }
307
308 return {};
309}
Scalar eta() const
pseudorapidity method
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
Scalar phi() const
phi method
double charge(const T &p)
Definition AtlasPID.h:1003
size_t size() const
Number of registered mappings.
unsigned bcTag(unsigned bcBitMap)
#define TGC_CHECK_SEGMENT_SIZE(FIELD)
#define TGC_CHECK_TRUTH_SIZE(FIELD)
#define TGC_CHECK_CANDIDATE_SIZE(FIELD)
static constexpr float TgcL0ValidationInvalidValue
Common sentinel for unavailable floating-point validation data.
static constexpr std::uint8_t TgcL0ValidationNoUnmatchedReason
Sentinel indicating that a matched truth object has no failure code.
Result of a structural validation-data consistency check.

Variable Documentation

◆ TgcL0ValidationInvalidValue

float L0Muon::TgcL0ValidationInvalidValue = 999.F
staticconstexpr

Common sentinel for unavailable floating-point validation data.

Definition at line 15 of file TgcL0ValidationEvent.h.

◆ TgcL0ValidationNoUnmatchedReason

std::uint8_t L0Muon::TgcL0ValidationNoUnmatchedReason = 255U
staticconstexpr

Sentinel indicating that a matched truth object has no failure code.

Definition at line 18 of file TgcL0ValidationEvent.h.