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...
class  TgcL0SectorLogicWordEncoder
 Encode the TGC-owned fields of the Run-4 Sector Logic format. More...
struct  TgcL0SectorLogicWords
 MuCTPI candidate words produced from one TGC candidate. More...
struct  TgcL0Segment
 Event-local projection segment optionally exposed for validation. More...
class  TgcL0TruthValidationAlg
 Calculates event-local TGC 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  TgcL0ValidationFinalCandidateBlock
 Final post-selection TGC candidates and their truth matching. More...
struct  TgcL0ValidationSectorLogicBlock
 TGC Sector Logic words and their placeholder metadata. 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  TgcL0ValidationStation : std::uint8_t { M1 = 0U , M2 = 1U , M3 = 2U , Invalid = 255U }
 Station used as the reconstructed candidate position reference. 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};

◆ TgcL0ValidationStation

enum class L0Muon::TgcL0ValidationStation : std::uint8_t
strong

Station used as the reconstructed candidate position reference.

Enumerator
M1 
M2 
M3 
Invalid 

Definition at line 27 of file TgcL0ValidationEvent.h.

◆ 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 35 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 const std::size_t nFinalCandidates =
30 event.finalCandidates.subdetectorId.size();
31 const std::size_t nSectorLogic = event.sectorLogic.candWord.size();
32
33 const auto invalid = [](std::string message) {
34 return TgcL0ValidationCheckResult{false, std::move(message)};
35 };
36 const auto checkTruthSize = [&](const std::size_t size,
37 const char* field) {
38 return size == nTruth
40 : invalid(std::string{"Truth block size mismatch for "} +
41 field);
42 };
43 const auto checkSegmentSize = [&](const std::size_t size,
44 const char* field) {
45 return size == nSegments
47 : invalid(std::string{"Segment block size mismatch for "} +
48 field);
49 };
50 const auto checkCandidateSize = [&](const std::size_t size,
51 const char* field) {
52 return size == nCandidates
54 : invalid(std::string{"Candidate block size mismatch for "} +
55 field);
56 };
57 const auto checkFinalCandidateSize = [&](const std::size_t size,
58 const char* field) {
59 return size == nFinalCandidates
61 : invalid(
62 std::string{"Final-candidate block size mismatch for "} +
63 field);
64 };
65 //coverity[AUTO_CAUSES_COPY:FALSE]
66 const auto checkSectorLogicSize = [&](const std::size_t size,
67 const char* field) {
68 return size == nSectorLogic
70 : invalid(std::string{"Sector Logic block size mismatch for "} +
71 field);
72 };
73
74#define TGC_CHECK_TRUTH_SIZE(FIELD) \
75 do { \
76 const auto result = checkTruthSize( \
77 event.truth.FIELD.size(), #FIELD); \
78 if (!result.valid) return result; \
79 } while (false)
80
81 TGC_CHECK_TRUTH_SIZE(barcode);
86 TGC_CHECK_TRUTH_SIZE(extrapolatedStationMask);
93 TGC_CHECK_TRUTH_SIZE(matched);
94 TGC_CHECK_TRUTH_SIZE(matchedCandidateIndex);
95 TGC_CHECK_TRUTH_SIZE(matchMeanDeltaR);
96 TGC_CHECK_TRUTH_SIZE(unmatchedReason);
97 TGC_CHECK_TRUTH_SIZE(finalCandidateMatched);
98 TGC_CHECK_TRUTH_SIZE(matchedFinalCandidateIndex);
99 TGC_CHECK_TRUTH_SIZE(finalCandidateMatchDeltaR);
100 TGC_CHECK_TRUTH_SIZE(finalCandidateUnmatchedReason);
101 TGC_CHECK_TRUTH_SIZE(wireSegmentMatched);
102 TGC_CHECK_TRUTH_SIZE(stripSegmentMatched);
103 TGC_CHECK_TRUTH_SIZE(matchedWireSegmentIndex);
104 TGC_CHECK_TRUTH_SIZE(matchedStripSegmentIndex);
105 TGC_CHECK_TRUTH_SIZE(wireSegmentMatchResidual);
106 TGC_CHECK_TRUTH_SIZE(stripSegmentMatchResidual);
107#undef TGC_CHECK_TRUTH_SIZE
108
109#define TGC_CHECK_SEGMENT_SIZE(FIELD) \
110 do { \
111 const auto result = checkSegmentSize( \
112 event.segments.FIELD.size(), #FIELD); \
113 if (!result.valid) return result; \
114 } while (false)
115
116 TGC_CHECK_SEGMENT_SIZE(triggerSector);
118 TGC_CHECK_SEGMENT_SIZE(projection);
119 TGC_CHECK_SEGMENT_SIZE(stationMask);
120 TGC_CHECK_SEGMENT_SIZE(summedQuality);
121 TGC_CHECK_SEGMENT_SIZE(nStations);
124 TGC_CHECK_SEGMENT_SIZE(residual);
125 TGC_CHECK_SEGMENT_SIZE(outputResidual);
126 TGC_CHECK_SEGMENT_SIZE(consistency);
127 TGC_CHECK_SEGMENT_SIZE(pivotChannel);
128 TGC_CHECK_SEGMENT_SIZE(truthIndex);
129 TGC_CHECK_SEGMENT_SIZE(truthMatchResidual);
130#undef TGC_CHECK_SEGMENT_SIZE
131
132#define TGC_CHECK_CANDIDATE_SIZE(FIELD) \
133 do { \
134 const auto result = checkCandidateSize( \
135 event.candidates.FIELD.size(), #FIELD); \
136 if (!result.valid) return result; \
137 } while (false)
138
139 TGC_CHECK_CANDIDATE_SIZE(triggerSector);
140 TGC_CHECK_CANDIDATE_SIZE(readoutSector);
142 TGC_CHECK_CANDIDATE_SIZE(stationMask);
143 TGC_CHECK_CANDIDATE_SIZE(wireStationMask);
144 TGC_CHECK_CANDIDATE_SIZE(stripStationMask);
147 TGC_CHECK_CANDIDATE_SIZE(deltaTheta);
150 TGC_CHECK_CANDIDATE_SIZE(threshold);
152 TGC_CHECK_CANDIDATE_SIZE(goodMagneticField);
153 TGC_CHECK_CANDIDATE_SIZE(truthIndex);
154#undef TGC_CHECK_CANDIDATE_SIZE
155
156#define TGC_CHECK_FINAL_CANDIDATE_SIZE(FIELD) \
157 do { \
158 const auto result = checkFinalCandidateSize( \
159 event.finalCandidates.FIELD.size(), #FIELD); \
160 if (!result.valid) return result; \
161 } while (false)
162
163 TGC_CHECK_FINAL_CANDIDATE_SIZE(sourceCandidateIndex);
164 TGC_CHECK_FINAL_CANDIDATE_SIZE(referenceStation);
165 TGC_CHECK_FINAL_CANDIDATE_SIZE(triggerSector);
176 TGC_CHECK_FINAL_CANDIDATE_SIZE(innerCoincidence);
177 TGC_CHECK_FINAL_CANDIDATE_SIZE(goodMagneticField);
179 TGC_CHECK_FINAL_CANDIDATE_SIZE(truthMatchDeltaR);
180#undef TGC_CHECK_FINAL_CANDIDATE_SIZE
181
182#define TGC_CHECK_SECTOR_LOGIC_SIZE(FIELD) \
183 do { \
184 const auto result = checkSectorLogicSize( \
185 event.sectorLogic.FIELD.size(), #FIELD); \
186 if (!result.valid) return result; \
187 } while (false)
188
189 TGC_CHECK_SECTOR_LOGIC_SIZE(inputCandidateIndex);
190 TGC_CHECK_SECTOR_LOGIC_SIZE(candExtraWord);
193 TGC_CHECK_SECTOR_LOGIC_SIZE(bcidOffset);
195#undef TGC_CHECK_SECTOR_LOGIC_SIZE
196
197 const auto wireProjection =
198 static_cast<std::uint8_t>(TgcL0ValidationProjection::Wire);
199 const auto stripProjection =
200 static_cast<std::uint8_t>(TgcL0ValidationProjection::Strip);
201 const auto invalidStation =
202 static_cast<std::uint8_t>(TgcL0ValidationStation::Invalid);
203
204 for (std::size_t segment = 0U; segment < nSegments; ++segment) {
205 const std::uint8_t projection = event.segments.projection[segment];
206 if (projection != wireProjection && projection != stripProjection) {
207 return invalid("Segment projection is not wire or strip");
208 }
209 if (event.segments.nStations[segment] == 0U ||
210 event.segments.nStations[segment] > 3U) {
211 return invalid("Segment station count is out of range");
212 }
213 const int truth = event.segments.truthIndex[segment];
214 if (truth >= 0 && static_cast<std::size_t>(truth) >= nTruth) {
215 return invalid("Segment truth index is out of range");
216 }
217 const float residual = event.segments.truthMatchResidual[segment];
218 if (truth >= 0 &&
219 (!std::isfinite(residual) ||
220 residual == TgcL0ValidationInvalidValue)) {
221 return invalid("Matched segment has an invalid truth residual");
222 }
223 if (truth < 0 && residual != TgcL0ValidationInvalidValue) {
224 return invalid("Unmatched segment has a truth residual");
225 }
226 }
227
228 for (std::size_t candidate = 0U; candidate < nCandidates; ++candidate) {
229 if (event.candidates.goodMagneticField[candidate] > 1U) {
230 return invalid("Candidate GoodMag flag is not binary");
231 }
232 const int truth = event.candidates.truthIndex[candidate];
233 if (truth >= 0 && static_cast<std::size_t>(truth) >= nTruth) {
234 return invalid("Candidate truth index is out of range");
235 }
236 }
237
238 std::vector<bool> sourceCandidateLinked(nCandidates, false);
239 for (std::size_t candidate = 0U; candidate < nFinalCandidates;
240 ++candidate) {
241 if (event.finalCandidates.tcId[candidate] > 6U) {
242 return invalid("Final-candidate TCID is out of range");
243 }
244 if (event.finalCandidates.innerCoincidence[candidate] > 1U ||
245 event.finalCandidates.goodMagneticField[candidate] > 1U) {
246 return invalid("Final-candidate flag is not binary");
247 }
248 if (std::abs(event.finalCandidates.charge[candidate]) != 1) {
249 return invalid("Final-candidate charge is invalid");
250 }
251 const int source = event.finalCandidates.sourceCandidateIndex[candidate];
252 const std::uint8_t station =
253 event.finalCandidates.referenceStation[candidate];
254 const int truth = event.finalCandidates.truthIndex[candidate];
255 const float residual = event.finalCandidates.truthMatchDeltaR[candidate];
256 if (event.finalCandidates.tcId[candidate] == 0U) {
257 if (source >= 0 || station != invalidStation || truth >= 0 ||
258 residual != TgcL0ValidationInvalidValue) {
259 return invalid("Empty final candidate has validation links");
260 }
261 continue;
262 }
263 if (static_cast<std::size_t>(source) >= nCandidates) {
264 return invalid("Final-candidate source index is out of range");
265 }
266 const std::size_t sourceIndex = static_cast<std::size_t>(source);
267 if (station > static_cast<std::uint8_t>(TgcL0ValidationStation::M3)) {
268 return invalid("Final-candidate reference station is invalid");
269 }
270 if (sourceCandidateLinked[sourceIndex]) {
271 return invalid(
272 "Source candidate is linked to more than one final candidate");
273 }
274 sourceCandidateLinked[sourceIndex] = true;
275 if (truth >= 0 && static_cast<std::size_t>(truth) >= nTruth) {
276 return invalid("Final-candidate truth index is out of range");
277 }
278 if (truth >= 0 &&
279 (!std::isfinite(residual) ||
280 residual == TgcL0ValidationInvalidValue)) {
281 return invalid("Matched final candidate has an invalid truth residual");
282 }
283 if (truth < 0 && residual != TgcL0ValidationInvalidValue) {
284 return invalid("Unmatched final candidate has a truth residual");
285 }
286 }
287
288 for (std::size_t candidate = 0U; candidate < nSectorLogic; ++candidate) {
289 const std::size_t inputIndex =
290 event.sectorLogic.inputCandidateIndex[candidate];
291 if (inputIndex >= nFinalCandidates) {
292 return invalid("Sector Logic input-candidate index is out of range");
293 }
294 if (event.finalCandidates.tcId[inputIndex] == 0U) {
295 return invalid("Sector Logic input index points to an empty candidate");
296 }
297 if (candidate != 0U &&
298 event.sectorLogic.inputCandidateIndex[candidate] <=
299 event.sectorLogic.inputCandidateIndex[candidate - 1U]) {
300 return invalid("Sector Logic input-candidate indices are not ordered");
301 }
302 if (event.sectorLogic.boardId[candidate] != 0U ||
303 event.sectorLogic.fiberId[candidate] != 0U ||
304 event.sectorLogic.bcidOffset[candidate] != 0 ||
305 event.sectorLogic.veto[candidate] != 0U) {
306 return invalid("Sector Logic placeholder metadata is not zero");
307 }
308 }
309
310 std::vector<int> candidateOwner(nCandidates, -1);
311 std::vector<int> finalCandidateOwner(nFinalCandidates, -1);
312 for (std::size_t truth = 0U; truth < nTruth; ++truth) {
313 if (event.truth.matched[truth] > 1U) {
314 return invalid("Truth matched flag is not binary");
315 }
316 const bool matched = event.truth.matched[truth] != 0U;
317 const int candidate = event.truth.matchedCandidateIndex[truth];
318 if (candidate >= 0 && static_cast<std::size_t>(candidate) >= nCandidates) {
319 return invalid("Truth matched-candidate index is out of range");
320 }
321 if (matched && candidate < 0) {
322 return invalid("Matched truth has no candidate index");
323 }
324 if (!matched && candidate >= 0) {
325 return invalid("Unmatched truth has a candidate index");
326 }
327 if (matched &&
328 event.truth.unmatchedReason[truth] !=
330 return invalid("Matched truth has an unmatched-reason code");
331 }
332 if (!matched &&
333 event.truth.unmatchedReason[truth] ==
335 return invalid("Unmatched truth has no unmatched-reason code");
336 }
337 if (!matched &&
338 event.truth.unmatchedReason[truth] >
339 static_cast<std::uint8_t>(
341 return invalid("Truth unmatched-reason code is out of range");
342 }
343 if (matched &&
344 (!std::isfinite(event.truth.matchMeanDeltaR[truth]) ||
345 event.truth.matchMeanDeltaR[truth] == TgcL0ValidationInvalidValue)) {
346 return invalid("Matched truth has an invalid candidate residual");
347 }
348 if (!matched &&
349 event.truth.matchMeanDeltaR[truth] != TgcL0ValidationInvalidValue) {
350 return invalid("Unmatched truth has a candidate residual");
351 }
352 if (candidate >= 0) {
353 const auto candidateIndex = static_cast<std::size_t>(candidate);
354 if (candidateOwner[candidateIndex] >= 0) {
355 return invalid("Candidate is matched to more than one truth muon");
356 }
357 candidateOwner[candidateIndex] = static_cast<int>(truth);
358 if (event.candidates.truthIndex[candidateIndex] !=
359 static_cast<int>(truth)) {
360 return invalid("Truth-candidate matching indices are not reciprocal");
361 }
362 }
363
364 if (event.truth.finalCandidateMatched[truth] > 1U) {
365 return invalid("Truth final-candidate-matched flag is not binary");
366 }
367 const bool finalMatched =
368 event.truth.finalCandidateMatched[truth] != 0U;
369 const int finalCandidate =
370 event.truth.matchedFinalCandidateIndex[truth];
371 if (finalCandidate >= 0 &&
372 static_cast<std::size_t>(finalCandidate) >= nFinalCandidates) {
373 return invalid("Truth matched-final-candidate index is out of range");
374 }
375 if (finalMatched && finalCandidate < 0) {
376 return invalid("Final-candidate-matched truth has no candidate index");
377 }
378 if (!finalMatched && finalCandidate >= 0) {
379 return invalid("Final-candidate-unmatched truth has a candidate index");
380 }
381 if (finalMatched &&
382 event.truth.finalCandidateUnmatchedReason[truth] !=
384 return invalid("Final-candidate-matched truth has an unmatched-reason code");
385 }
386 if (!finalMatched &&
387 event.truth.finalCandidateUnmatchedReason[truth] ==
389 return invalid("Final-candidate-unmatched truth has no unmatched-reason code");
390 }
391 if (!finalMatched &&
392 event.truth.finalCandidateUnmatchedReason[truth] >
393 static_cast<std::uint8_t>(
395 return invalid("Truth final-candidate unmatched-reason code is out of range");
396 }
397 if (finalMatched &&
398 (!std::isfinite(event.truth.finalCandidateMatchDeltaR[truth]) ||
399 event.truth.finalCandidateMatchDeltaR[truth] ==
401 return invalid("Final-candidate-matched truth has an invalid residual");
402 }
403 if (!finalMatched &&
404 event.truth.finalCandidateMatchDeltaR[truth] !=
406 return invalid("Final-candidate-unmatched truth has a residual");
407 }
408 if (finalCandidate >= 0) {
409 const auto finalCandidateIndex =
410 static_cast<std::size_t>(finalCandidate);
411 if (finalCandidateOwner[finalCandidateIndex] >= 0) {
412 return invalid("Final candidate is matched to more than one truth muon");
413 }
414 finalCandidateOwner[finalCandidateIndex] = static_cast<int>(truth);
415 if (event.finalCandidates.truthIndex[finalCandidateIndex] !=
416 static_cast<int>(truth)) {
417 return invalid(
418 "Truth-final-candidate matching indices are not reciprocal");
419 }
420 }
421
422 if (event.truth.wireSegmentMatched[truth] > 1U ||
423 event.truth.stripSegmentMatched[truth] > 1U) {
424 return invalid("Truth segment-matched flag is not binary");
425 }
426 const bool wireMatched = event.truth.wireSegmentMatched[truth] != 0U;
427 const bool stripMatched = event.truth.stripSegmentMatched[truth] != 0U;
428 const int wireSegment = event.truth.matchedWireSegmentIndex[truth];
429 const int stripSegment = event.truth.matchedStripSegmentIndex[truth];
430 if (wireSegment >= 0 &&
431 static_cast<std::size_t>(wireSegment) >= nSegments) {
432 return invalid("Truth matched-wire-segment index is out of range");
433 }
434 if (stripSegment >= 0 &&
435 static_cast<std::size_t>(stripSegment) >= nSegments) {
436 return invalid("Truth matched-strip-segment index is out of range");
437 }
438 if (wireMatched && wireSegment < 0) {
439 return invalid("Wire-segment-matched truth has no segment index");
440 }
441 if (stripMatched && stripSegment < 0) {
442 return invalid("Strip-segment-matched truth has no segment index");
443 }
444 if (!wireMatched && wireSegment >= 0) {
445 return invalid("Wire-segment-unmatched truth has a segment index");
446 }
447 if (!stripMatched && stripSegment >= 0) {
448 return invalid("Strip-segment-unmatched truth has a segment index");
449 }
450 if (wireMatched &&
451 (!std::isfinite(event.truth.wireSegmentMatchResidual[truth]) ||
452 event.truth.wireSegmentMatchResidual[truth] ==
454 return invalid("Wire-segment-matched truth has an invalid residual");
455 }
456 if (!wireMatched &&
457 event.truth.wireSegmentMatchResidual[truth] !=
459 return invalid("Wire-segment-unmatched truth has a residual");
460 }
461 if (stripMatched &&
462 (!std::isfinite(event.truth.stripSegmentMatchResidual[truth]) ||
463 event.truth.stripSegmentMatchResidual[truth] ==
465 return invalid("Strip-segment-matched truth has an invalid residual");
466 }
467 if (!stripMatched &&
468 event.truth.stripSegmentMatchResidual[truth] !=
470 return invalid("Strip-segment-unmatched truth has a residual");
471 }
472 if (wireSegment >= 0 &&
473 event.segments.projection[wireSegment] != wireProjection) {
474 return invalid("Truth wire-segment index points to a strip segment");
475 }
476 if (stripSegment >= 0 &&
477 event.segments.projection[stripSegment] != stripProjection) {
478 return invalid("Truth strip-segment index points to a wire segment");
479 }
480 if ((wireSegment >= 0 &&
481 event.segments.truthIndex[wireSegment] != static_cast<int>(truth)) ||
482 (stripSegment >= 0 &&
483 event.segments.truthIndex[stripSegment] != static_cast<int>(truth))) {
484 return invalid("Truth-segment matching indices are not reciprocal");
485 }
486 }
487
488 for (std::size_t candidate = 0U; candidate < nCandidates; ++candidate) {
489 const int truth = event.candidates.truthIndex[candidate];
490 if (truth < 0) continue;
491 if (event.truth.matched[truth] == 0U ||
492 event.truth.matchedCandidateIndex[truth] !=
493 static_cast<int>(candidate)) {
494 return invalid("Truth-candidate matching indices are not reciprocal");
495 }
496 }
497
498 for (std::size_t candidate = 0U; candidate < nFinalCandidates;
499 ++candidate) {
500 const int truth = event.finalCandidates.truthIndex[candidate];
501 if (truth < 0) continue;
502 if (event.truth.finalCandidateMatched[truth] == 0U ||
503 event.truth.matchedFinalCandidateIndex[truth] !=
504 static_cast<int>(candidate)) {
505 return invalid(
506 "Truth-final-candidate matching indices are not reciprocal");
507 }
508 }
509
510 for (std::size_t segment = 0U; segment < nSegments; ++segment) {
511 const int truth = event.segments.truthIndex[segment];
512 if (truth < 0) continue;
513 const bool isWire = event.segments.projection[segment] == wireProjection;
514 const int reverseIndex =
515 isWire ? event.truth.matchedWireSegmentIndex[truth]
516 : event.truth.matchedStripSegmentIndex[truth];
517 if (reverseIndex != static_cast<int>(segment)) {
518 return invalid("Truth-segment matching indices are not reciprocal");
519 }
520 }
521
522 return {};
523}
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_FINAL_CANDIDATE_SIZE(FIELD)
#define TGC_CHECK_TRUTH_SIZE(FIELD)
#define TGC_CHECK_CANDIDATE_SIZE(FIELD)
#define TGC_CHECK_SECTOR_LOGIC_SIZE(FIELD)
std::vector< std::string > veto
these patterns are anded
Definition listroot.cxx:191
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.