ATLAS Offline Software
Loading...
Searching...
No Matches
HitValAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// NSWValAlg inlcudes
6#include "HitValAlg.h"
7
9
10
11// Other NSW includes
13
14
15
16#include <mutex>
17
18using namespace MuonPRDTest;
19namespace MuonVal{
20
21
22
24 if (m_doSTGCHit) {
25 m_tree.addBranch(std::make_unique<sTGCSimHitVariables>(m_tree, m_sTgcSimKey, msgLevel()));
26 }
27 if (m_doMMHit) {
28 m_tree.addBranch(std::make_unique<MMSimHitVariables>(m_tree, m_MmSimKey, msgLevel()));
29 }
30 if (m_doCSCHit) {
31 m_tree.addBranch(std::make_unique<CSCSimHitVariables>(m_tree, m_CSC_SimContainerName, msgLevel()));
32 }
33 if (m_doMDTHit) {
34 m_tree.addBranch(std::make_unique<MDTSimHitVariables>(m_tree, m_MdtSimHitKey, msgLevel()));
35 }
36 if (m_doTGCHit) {
37 m_tree.addBranch(std::make_unique<TGCSimHitVariables>(m_tree, m_TgcSimHitKey, msgLevel()));
38 }
39 if (m_doRPCHit) {
40 m_tree.addBranch(std::make_unique<RPCSimHitVariables>(m_tree, m_RpcSimHitKey, msgLevel()));
41 }
42 return StatusCode::SUCCESS;
43}
45 if (m_doSTGCSDO) {
46 m_tree.addBranch(std::make_unique<sTgcSDOVariables>(m_tree, m_sTgcSdoKey, msgLevel()));
47 }
48 if (m_doMMSDO) {
49 m_tree.addBranch(std::make_unique<MMSDOVariables>(m_tree, m_MmSdoKey, msgLevel()));
50 }
51 if (m_doCSCSDO) {
52 m_tree.addBranch(std::make_unique<CscSDOVariables>(m_tree, m_CSC_SDOContainerName, msgLevel()));
53 }
54 if (m_doMDTSDO) {
55 m_tree.addBranch(std::make_unique<MdtSDOVariables>(m_tree, m_MdtSdoKey, msgLevel()));
56 }
57 if (m_doRPCSDO) {
58 m_tree.addBranch(std::make_unique<RpcSDOVariables>(m_tree, m_RpcSdoKey, msgLevel()));
59 }
60 if (m_doTGCSDO) {
61 m_tree.addBranch(std::make_unique<TgcSDOVariables>(m_tree, m_TgcSdoKey, msgLevel()));
62 }
63 return StatusCode::SUCCESS;
64}
66 if (m_doSTGCDigit) {
67 m_tree.addBranch(std::make_unique<sTgcDigitVariables>(m_tree, m_sTgcDigitKey, msgLevel()));
68 }
69 if (m_doMMDigit) {
70 m_tree.addBranch(std::make_unique<MMDigitVariables>(m_tree, m_MmDigitKey, msgLevel()));
71 }
72 if (m_doCSCDigit) {
73 m_tree.addBranch(std::make_unique<CscDigitVariables>(m_tree, m_CSC_DigitContainerName, msgLevel()));
74 }
75 if (m_doMDTDigit) {
76 m_tree.addBranch(std::make_unique<MdtDigitVariables>(m_tree, m_MdtDigitKey, msgLevel()));
77 }
78 if (m_doRPCDigit) {
79 m_tree.addBranch(std::make_unique<RpcDigitVariables>(m_tree, m_RpcDigitKey, msgLevel()));
80 }
81 if (m_doTGCDigit) {
82 m_tree.addBranch(std::make_unique<TgcDigitVariables>(m_tree, m_TgcDigitKey, msgLevel()));
83 }
84 return StatusCode::SUCCESS;
85}
87 if (m_doSTGCRDO) {
88 m_tree.addBranch(std::make_unique<sTGCRDOVariables>(m_tree, m_sTgcRdoKey, msgLevel()));
89 }
90 if (m_doMMRDO) {
91 m_tree.addBranch(std::make_unique<MMRDOVariables>(m_tree, m_MmRdoKey, msgLevel()));
92 }
93 if (m_doCSCRDO) {
94 ATH_CHECK(m_csc_decoder.retrieve());
95 m_tree.addBranch(std::make_unique<CSCRDOVariables>(m_tree, m_CSC_RDOContainerName, msgLevel(), &m_idHelperSvc->cscIdHelper(), m_csc_decoder.get()));
96 }
97 if (m_doTGCRDO) {
98 m_tree.addBranch(std::make_unique<TGCRDOVariables>(m_tree, m_TgcRdoKey, m_tgcCablingKey, msgLevel()));
99 }
100 return StatusCode::SUCCESS;
101}
103 if (m_doSTGCPRD) {
104 m_tree.addBranch(std::make_unique<sTGCPRDVariables>(m_tree, m_sTgcPRDKey, msgLevel()));
105 }
106 if (m_doMMPRD) {
107 m_tree.addBranch(std::make_unique<MMPRDVariables>(m_tree, m_MmPrdKey, msgLevel()));
108 }
109 if (m_doCSCPRD) {
110 m_tree.addBranch(std::make_unique<CSCPRDVariables>(m_tree, m_CSC_PRDContainerName, msgLevel()));
111 }
112 if (m_doTGCPRD) {
113 m_tree.addBranch(std::make_unique<TGCPRDVariables>(m_tree, m_TgcPrdKey, msgLevel()));
114 }
115 if (m_doMDTPRD) {
116 m_tree.addBranch(std::make_unique<MDTPRDVariables>(m_tree, m_MdtPrdKey, msgLevel()));
117 }
118 if (m_doRPCPRD) {
119 m_tree.addBranch(std::make_unique<RPCPRDVariables>(m_tree, m_RpcPrdKey, msgLevel()));
120 }
121 return StatusCode::SUCCESS;
122}
123
125 ATH_MSG_DEBUG("initialize()");
126 ATH_CHECK(m_evtInfo.initialize());
127 unsigned int ev_infomask{EventInfoBranch::writePileUp};
129 m_tree.addBranch(std::make_unique<EventInfoBranch>(m_tree,ev_infomask, m_evtInfo.key()));
130
131 ATH_CHECK(m_idHelperSvc.retrieve());
132
133 if (m_doTruth) {
134 m_tree.addBranch(std::make_unique<TruthVariables>(m_tree, m_Truth_ContainerName, msgLevel()));
135 }
136 if (m_doMuEntry) {
137 m_tree.addBranch(std::make_unique<MuEntryVariables>(m_tree, m_MuEntry_ContainerName, msgLevel()));
138 }
139 if (m_doSimHits) {
141 }
142 if (m_doDigits) {
144 }
145 if (m_doRDOs) {
147 }
148 if (m_doSDO) {
150 }
151 if (m_doPRDs) {
153 }
154
155 ATH_MSG_DEBUG("Init TTree");
156 ATH_CHECK(m_tree.init(this));
157
158 ATH_MSG_DEBUG("Finished with the initialization");
159 return StatusCode::SUCCESS;
160}
161
163 ATH_MSG_DEBUG("PrdValAlg:: Finalize + Matching");
164 ATH_CHECK(m_tree.write());
165 return StatusCode::SUCCESS;
166}
167
168StatusCode HitValAlg::execute() {
169 ATH_MSG_DEBUG("execute()");
170 const EventContext& ctx = Gaudi::Hive::currentContext();
171 ATH_MSG_DEBUG("Fill TTree");
172 if (!m_tree.fill(ctx)) return StatusCode::FAILURE;
173
174 return StatusCode::SUCCESS;
175}
176}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
@ writePileUp
Write pile-up information.
@ isMC
Flag determining whether the branch is simulation.
@ writeBeamSpot
Write the beamspot weight.
Gaudi::Property< std::string > m_RpcSdoKey
Definition HitValAlg.h:114
Gaudi::Property< bool > m_doSTGCRDO
Definition HitValAlg.h:54
Gaudi::Property< bool > m_doTGCPRD
Definition HitValAlg.h:83
StatusCode setupSimHits()
Definition HitValAlg.cxx:23
Gaudi::Property< std::string > m_CSC_DigitContainerName
Definition HitValAlg.h:104
Gaudi::Property< std::string > m_MmDigitKey
Definition HitValAlg.h:98
Gaudi::Property< bool > m_doCSCSDO
Definition HitValAlg.h:64
Gaudi::Property< bool > m_doSTGCDigit
Definition HitValAlg.h:53
Gaudi::Property< std::string > m_TgcDigitKey
Definition HitValAlg.h:120
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfo
Definition HitValAlg.h:86
Gaudi::Property< bool > m_doRPCSDO
Definition HitValAlg.h:75
Gaudi::Property< std::string > m_MmSimKey
Definition HitValAlg.h:96
StatusCode setupRDOs()
Definition HitValAlg.cxx:86
Gaudi::Property< bool > m_doRDOs
Switch to toggle the dumping of Digits in general.
Definition HitValAlg.h:48
Gaudi::Property< std::string > m_CSC_PRDContainerName
Definition HitValAlg.h:106
Gaudi::Property< bool > m_doMDTSDO
Definition HitValAlg.h:70
Gaudi::Property< bool > m_doTGCHit
Definition HitValAlg.h:79
Gaudi::Property< std::string > m_MmPrdKey
Definition HitValAlg.h:100
Gaudi::Property< bool > m_doTGCDigit
Definition HitValAlg.h:81
Gaudi::Property< std::string > m_RpcDigitKey
Definition HitValAlg.h:115
Gaudi::Property< std::string > m_TgcRdoKey
Definition HitValAlg.h:121
Gaudi::Property< bool > m_doMDTDigit
Definition HitValAlg.h:71
StatusCode setupDigits()
Definition HitValAlg.cxx:65
Gaudi::Property< bool > m_doCSCDigit
Definition HitValAlg.h:65
Gaudi::Property< bool > m_doCSCHit
Definition HitValAlg.h:63
Gaudi::Property< std::string > m_MmRdoKey
Definition HitValAlg.h:99
Gaudi::Property< bool > m_doRPCDigit
Definition HitValAlg.h:76
Gaudi::Property< bool > m_doCSCPRD
Definition HitValAlg.h:67
Gaudi::Property< bool > m_doRPCPRD
Definition HitValAlg.h:77
Gaudi::Property< bool > m_doTGCRDO
Definition HitValAlg.h:82
Gaudi::Property< std::string > m_MdtSdoKey
Definition HitValAlg.h:109
Gaudi::Property< std::string > m_sTgcPRDKey
Definition HitValAlg.h:94
Gaudi::Property< std::string > m_sTgcSdoKey
Definition HitValAlg.h:91
Gaudi::Property< bool > m_doSTGCHit
Switch to toggle the dumping of PRDs in general.
Definition HitValAlg.h:51
MuonVal::MuonTesterTree m_tree
Definition HitValAlg.h:34
Gaudi::Property< bool > m_doMMDigit
Definition HitValAlg.h:59
Gaudi::Property< bool > m_isData
Definition HitValAlg.h:41
Gaudi::Property< std::string > m_MdtPrdKey
Definition HitValAlg.h:111
Gaudi::Property< std::string > m_tgcCablingKey
Definition HitValAlg.h:36
Gaudi::Property< bool > m_doPRDs
Switch to toggle the dumping of RDOs in general.
Definition HitValAlg.h:49
Gaudi::Property< std::string > m_TgcSdoKey
Definition HitValAlg.h:119
Gaudi::Property< bool > m_doSimHits
Definition HitValAlg.h:45
StatusCode setupSDOs()
Definition HitValAlg.cxx:44
StatusCode initialize() override
StatusCode setupPRDs()
Gaudi::Property< std::string > m_Truth_ContainerName
Definition HitValAlg.h:87
PublicToolHandle< Muon::ICSC_RDO_Decoder > m_csc_decoder
Definition HitValAlg.h:39
Gaudi::Property< bool > m_doRPCHit
Definition HitValAlg.h:74
Gaudi::Property< bool > m_doSTGCSDO
Definition HitValAlg.h:52
Gaudi::Property< std::string > m_CSC_RDOContainerName
Definition HitValAlg.h:105
Gaudi::Property< bool > m_doSDO
Switch to toggle the dumping of sim hits in general.
Definition HitValAlg.h:46
Gaudi::Property< std::string > m_sTgcDigitKey
Definition HitValAlg.h:92
Gaudi::Property< bool > m_doMMHit
Definition HitValAlg.h:57
Gaudi::Property< bool > m_doMMRDO
Definition HitValAlg.h:60
StatusCode execute() override
Gaudi::Property< bool > m_doCSCRDO
Definition HitValAlg.h:66
Gaudi::Property< std::string > m_sTgcSimKey
Definition HitValAlg.h:90
Gaudi::Property< std::string > m_CSC_SDOContainerName
Definition HitValAlg.h:103
Gaudi::Property< std::string > m_MmSdoKey
Definition HitValAlg.h:97
Gaudi::Property< std::string > m_TgcSimHitKey
Definition HitValAlg.h:118
StatusCode finalize() override
Gaudi::Property< bool > m_doMMSDO
Definition HitValAlg.h:58
Gaudi::Property< std::string > m_MdtSimHitKey
Definition HitValAlg.h:108
Gaudi::Property< std::string > m_RpcSimHitKey
Definition HitValAlg.h:113
Gaudi::Property< std::string > m_TgcPrdKey
Definition HitValAlg.h:122
Gaudi::Property< bool > m_doMDTPRD
Definition HitValAlg.h:72
Gaudi::Property< std::string > m_MdtDigitKey
Definition HitValAlg.h:110
Gaudi::Property< bool > m_doMMPRD
Definition HitValAlg.h:61
Gaudi::Property< bool > m_doMDTHit
Definition HitValAlg.h:69
Gaudi::Property< bool > m_doDigits
Switch to toggle the dumping of SDOs in general.
Definition HitValAlg.h:47
Gaudi::Property< std::string > m_RpcPrdKey
Definition HitValAlg.h:116
Gaudi::Property< bool > m_doTruth
Definition HitValAlg.h:42
Gaudi::Property< std::string > m_MuEntry_ContainerName
Definition HitValAlg.h:88
Gaudi::Property< std::string > m_sTgcRdoKey
Definition HitValAlg.h:93
Gaudi::Property< std::string > m_CSC_SimContainerName
Definition HitValAlg.h:102
Gaudi::Property< bool > m_doSTGCPRD
Definition HitValAlg.h:55
Gaudi::Property< bool > m_doMuEntry
Definition HitValAlg.h:43
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition HitValAlg.h:38
Gaudi::Property< bool > m_doTGCSDO
Definition HitValAlg.h:80
Class to store array like branches into the n-tuples.
Definition HitValAlg.cxx:19