ATLAS Offline Software
Loading...
Searching...
No Matches
TgcL0RootOutputAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef L0MUONS1TGCVALIDATION_TGCL0ROOTOUTPUTALG_H
5#define L0MUONS1TGCVALIDATION_TGCL0ROOTOUTPUTALG_H
6
11
12#include <cstdint>
13
14namespace L0Muon {
15
23 public:
25
26 virtual StatusCode initialize() override;
27 virtual StatusCode execute(const EventContext& ctx) override;
28 virtual StatusCode finalize() override;
29
30 private:
31 void copyToBranches(const TgcL0ValidationEvent& input);
32
34 this, "InputKey", "L0MuonTGCValidationEvent",
35 "Calculated event-local truth-validation data"};
36 Gaudi::Property<bool> m_failOnInvalidData{
37 this, "FailOnInvalidData", true,
38 "Fail instead of skipping structurally inconsistent validation data"};
39
40 MuonVal::MuonTesterTree m_tree{"truthValidation", "L0MUONTGCVALID"};
41
43 m_tree.newScalar<std::uint32_t>("runNumber")};
45 m_tree.newScalar<std::uint64_t>("eventNumber")};
47 m_tree.newScalar<std::uint32_t>("lumiBlock")};
49 m_tree.newScalar<std::uint32_t>("bcid")};
50
51#define TGCL0_VECTOR_BRANCH(TYPE, MEMBER, NAME) \
52 MuonVal::VectorBranch<TYPE>& MEMBER{m_tree.newVector<TYPE>(NAME)}
53
54 TGCL0_VECTOR_BRANCH(int, m_truthPdgId, "truthPdgId");
55 TGCL0_VECTOR_BRANCH(int, m_truthBarcode, "truthBarcode");
56 TGCL0_VECTOR_BRANCH(float, m_truthPt, "truthPt");
57 TGCL0_VECTOR_BRANCH(float, m_truthEta, "truthEta");
58 TGCL0_VECTOR_BRANCH(float, m_truthPhi, "truthPhi");
59 TGCL0_VECTOR_BRANCH(float, m_truthCharge, "truthCharge");
60 TGCL0_VECTOR_BRANCH(std::uint8_t, m_truthExtrapolatedStationMask,
61 "truthExtrapolatedStationMask");
62 TGCL0_VECTOR_BRANCH(float, m_truthM1Eta, "truthM1Eta");
63 TGCL0_VECTOR_BRANCH(float, m_truthM1Phi, "truthM1Phi");
64 TGCL0_VECTOR_BRANCH(float, m_truthM2Eta, "truthM2Eta");
65 TGCL0_VECTOR_BRANCH(float, m_truthM2Phi, "truthM2Phi");
66 TGCL0_VECTOR_BRANCH(float, m_truthM3Eta, "truthM3Eta");
67 TGCL0_VECTOR_BRANCH(float, m_truthM3Phi, "truthM3Phi");
68 TGCL0_VECTOR_BRANCH(std::uint8_t, m_truthMatched, "truthMatched");
69 TGCL0_VECTOR_BRANCH(int, m_truthMatchedCandidateIndex,
70 "truthMatchedCandidateIndex");
71 TGCL0_VECTOR_BRANCH(float, m_truthMatchMeanDeltaR,
72 "truthMatchMeanDeltaR");
73 TGCL0_VECTOR_BRANCH(std::uint8_t, m_truthUnmatchedReason,
74 "truthUnmatchedReason");
75 TGCL0_VECTOR_BRANCH(std::uint8_t, m_truthWireSegmentMatched,
76 "truthWireSegmentMatched");
77 TGCL0_VECTOR_BRANCH(std::uint8_t, m_truthStripSegmentMatched,
78 "truthStripSegmentMatched");
79 TGCL0_VECTOR_BRANCH(int, m_truthMatchedWireSegmentIndex,
80 "truthMatchedWireSegmentIndex");
81 TGCL0_VECTOR_BRANCH(int, m_truthMatchedStripSegmentIndex,
82 "truthMatchedStripSegmentIndex");
83 TGCL0_VECTOR_BRANCH(float, m_truthWireSegmentMatchResidual,
84 "truthWireSegmentMatchResidual");
85 TGCL0_VECTOR_BRANCH(float, m_truthStripSegmentMatchResidual,
86 "truthStripSegmentMatchResidual");
87
88 TGCL0_VECTOR_BRANCH(std::uint16_t, m_segmentSubdetectorId,
89 "segmentSubdetectorId");
90 TGCL0_VECTOR_BRANCH(std::uint16_t, m_segmentTriggerSector,
91 "segmentTriggerSector");
92 TGCL0_VECTOR_BRANCH(std::uint16_t, m_segmentBcTag, "segmentBcTag");
93 TGCL0_VECTOR_BRANCH(std::uint8_t, m_segmentProjection,
94 "segmentProjection");
95 TGCL0_VECTOR_BRANCH(std::uint8_t, m_segmentStationMask,
96 "segmentStationMask");
97 TGCL0_VECTOR_BRANCH(std::uint8_t, m_segmentSummedQuality,
98 "segmentSummedQuality");
99 TGCL0_VECTOR_BRANCH(std::uint8_t, m_segmentNStations,
100 "segmentNStations");
101 TGCL0_VECTOR_BRANCH(float, m_segmentEta, "segmentEta");
102 TGCL0_VECTOR_BRANCH(float, m_segmentPhi, "segmentPhi");
103 TGCL0_VECTOR_BRANCH(float, m_segmentResidual, "segmentResidual");
104 TGCL0_VECTOR_BRANCH(float, m_segmentOutputResidual,
105 "segmentOutputResidual");
106 TGCL0_VECTOR_BRANCH(float, m_segmentConsistency, "segmentConsistency");
107 TGCL0_VECTOR_BRANCH(std::uint16_t, m_segmentPivotChannel,
108 "segmentPivotChannel");
109 TGCL0_VECTOR_BRANCH(int, m_segmentTruthIndex, "segmentTruthIndex");
110 TGCL0_VECTOR_BRANCH(float, m_segmentTruthMatchResidual,
111 "segmentTruthMatchResidual");
112
113 TGCL0_VECTOR_BRANCH(std::uint16_t, m_candidateSubdetectorId,
114 "candidateSubdetectorId");
115 TGCL0_VECTOR_BRANCH(std::uint16_t, m_candidateTriggerSector,
116 "candidateTriggerSector");
117 TGCL0_VECTOR_BRANCH(std::uint16_t, m_candidateReadoutSector,
118 "candidateReadoutSector");
119 TGCL0_VECTOR_BRANCH(std::uint16_t, m_candidateBcTag, "candidateBcTag");
120 TGCL0_VECTOR_BRANCH(std::uint8_t, m_candidateStationMask,
121 "candidateStationMask");
122 TGCL0_VECTOR_BRANCH(std::uint8_t, m_candidateWireStationMask,
123 "candidateWireStationMask");
124 TGCL0_VECTOR_BRANCH(std::uint8_t, m_candidateStripStationMask,
125 "candidateStripStationMask");
126 TGCL0_VECTOR_BRANCH(float, m_candidateEta, "candidateEta");
127 TGCL0_VECTOR_BRANCH(float, m_candidatePhi, "candidatePhi");
128 TGCL0_VECTOR_BRANCH(float, m_candidateDeltaTheta, "candidateDeltaTheta");
129 TGCL0_VECTOR_BRANCH(float, m_candidateDeltaPhi, "candidateDeltaPhi");
130 TGCL0_VECTOR_BRANCH(int, m_candidateTruthIndex, "candidateTruthIndex");
131
132#undef TGCL0_VECTOR_BRANCH
133};
134
135} // namespace L0Muon
136
137#endif
Property holding a SG store/key/clid from which a ReadHandle is made.
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
MuonTester backend for event-level TGC truth-validation data.
TGCL0_VECTOR_BRANCH(std::uint16_t, m_candidateBcTag, "candidateBcTag")
TGCL0_VECTOR_BRANCH(float, m_segmentResidual, "segmentResidual")
TGCL0_VECTOR_BRANCH(int, m_truthMatchedStripSegmentIndex, "truthMatchedStripSegmentIndex")
TGCL0_VECTOR_BRANCH(float, m_truthMatchMeanDeltaR, "truthMatchMeanDeltaR")
TGCL0_VECTOR_BRANCH(std::uint8_t, m_candidateWireStationMask, "candidateWireStationMask")
MuonVal::ScalarBranch< std::uint32_t > & m_bcid
TGCL0_VECTOR_BRANCH(float, m_segmentTruthMatchResidual, "segmentTruthMatchResidual")
TGCL0_VECTOR_BRANCH(std::uint8_t, m_truthWireSegmentMatched, "truthWireSegmentMatched")
TGCL0_VECTOR_BRANCH(float, m_truthCharge, "truthCharge")
TGCL0_VECTOR_BRANCH(int, m_truthMatchedWireSegmentIndex, "truthMatchedWireSegmentIndex")
TGCL0_VECTOR_BRANCH(int, m_truthBarcode, "truthBarcode")
TGCL0_VECTOR_BRANCH(std::uint8_t, m_candidateStripStationMask, "candidateStripStationMask")
TGCL0_VECTOR_BRANCH(std::uint8_t, m_candidateStationMask, "candidateStationMask")
TGCL0_VECTOR_BRANCH(float, m_truthStripSegmentMatchResidual, "truthStripSegmentMatchResidual")
TGCL0_VECTOR_BRANCH(float, m_segmentOutputResidual, "segmentOutputResidual")
virtual StatusCode initialize() override
TGCL0_VECTOR_BRANCH(int, m_truthMatchedCandidateIndex, "truthMatchedCandidateIndex")
TGCL0_VECTOR_BRANCH(std::uint16_t, m_candidateTriggerSector, "candidateTriggerSector")
TGCL0_VECTOR_BRANCH(float, m_truthPhi, "truthPhi")
TGCL0_VECTOR_BRANCH(std::uint16_t, m_segmentTriggerSector, "segmentTriggerSector")
MuonVal::ScalarBranch< std::uint32_t > & m_runNumber
TGCL0_VECTOR_BRANCH(std::uint8_t, m_truthExtrapolatedStationMask, "truthExtrapolatedStationMask")
TGCL0_VECTOR_BRANCH(std::uint8_t, m_segmentNStations, "segmentNStations")
TGCL0_VECTOR_BRANCH(float, m_truthM3Phi, "truthM3Phi")
MuonVal::ScalarBranch< std::uint32_t > & m_lumiBlock
TGCL0_VECTOR_BRANCH(float, m_truthPt, "truthPt")
TGCL0_VECTOR_BRANCH(std::uint8_t, m_truthUnmatchedReason, "truthUnmatchedReason")
TGCL0_VECTOR_BRANCH(int, m_truthPdgId, "truthPdgId")
TGCL0_VECTOR_BRANCH(float, m_segmentPhi, "segmentPhi")
TGCL0_VECTOR_BRANCH(float, m_truthM1Phi, "truthM1Phi")
Gaudi::Property< bool > m_failOnInvalidData
TGCL0_VECTOR_BRANCH(float, m_truthWireSegmentMatchResidual, "truthWireSegmentMatchResidual")
TGCL0_VECTOR_BRANCH(float, m_truthM1Eta, "truthM1Eta")
TGCL0_VECTOR_BRANCH(float, m_truthM3Eta, "truthM3Eta")
TGCL0_VECTOR_BRANCH(int, m_candidateTruthIndex, "candidateTruthIndex")
TGCL0_VECTOR_BRANCH(float, m_segmentEta, "segmentEta")
TGCL0_VECTOR_BRANCH(std::uint8_t, m_truthStripSegmentMatched, "truthStripSegmentMatched")
MuonVal::MuonTesterTree m_tree
MuonVal::ScalarBranch< std::uint64_t > & m_eventNumber
TGCL0_VECTOR_BRANCH(float, m_truthEta, "truthEta")
SG::ReadHandleKey< TgcL0ValidationEvent > m_inputKey
TGCL0_VECTOR_BRANCH(std::uint8_t, m_segmentSummedQuality, "segmentSummedQuality")
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
TGCL0_VECTOR_BRANCH(float, m_truthM2Phi, "truthM2Phi")
TGCL0_VECTOR_BRANCH(float, m_truthM2Eta, "truthM2Eta")
TGCL0_VECTOR_BRANCH(float, m_candidateDeltaPhi, "candidateDeltaPhi")
AthHistogramAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
TGCL0_VECTOR_BRANCH(std::uint16_t, m_candidateSubdetectorId, "candidateSubdetectorId")
TGCL0_VECTOR_BRANCH(std::uint8_t, m_truthMatched, "truthMatched")
virtual StatusCode finalize() override
TGCL0_VECTOR_BRANCH(int, m_segmentTruthIndex, "segmentTruthIndex")
TGCL0_VECTOR_BRANCH(float, m_segmentConsistency, "segmentConsistency")
TGCL0_VECTOR_BRANCH(float, m_candidateEta, "candidateEta")
TGCL0_VECTOR_BRANCH(float, m_candidatePhi, "candidatePhi")
TGCL0_VECTOR_BRANCH(std::uint16_t, m_candidateReadoutSector, "candidateReadoutSector")
TGCL0_VECTOR_BRANCH(std::uint16_t, m_segmentBcTag, "segmentBcTag")
TGCL0_VECTOR_BRANCH(std::uint8_t, m_segmentStationMask, "segmentStationMask")
TGCL0_VECTOR_BRANCH(std::uint16_t, m_segmentSubdetectorId, "segmentSubdetectorId")
TGCL0_VECTOR_BRANCH(std::uint16_t, m_segmentPivotChannel, "segmentPivotChannel")
TGCL0_VECTOR_BRANCH(float, m_candidateDeltaTheta, "candidateDeltaTheta")
void copyToBranches(const TgcL0ValidationEvent &input)
TGCL0_VECTOR_BRANCH(std::uint8_t, m_segmentProjection, "segmentProjection")
Property holding a SG store/key/clid from which a ReadHandle is made.
ROOT-independent validation data for one event.