ATLAS Offline Software
Loading...
Searching...
No Matches
HitValAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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 ATH_CHECK(m_tgcCabling.retrieve());
99 m_tree.addBranch(std::make_unique<TGCRDOVariables>(m_tree, m_TgcRdoKey, msgLevel(), m_tgcCabling));
100 }
101 return StatusCode::SUCCESS;
102}
104 if (m_doSTGCPRD) {
105 m_tree.addBranch(std::make_unique<sTGCPRDVariables>(m_tree, m_sTgcPRDKey, msgLevel()));
106 }
107 if (m_doMMPRD) {
108 m_tree.addBranch(std::make_unique<MMPRDVariables>(m_tree, m_MmPrdKey, msgLevel()));
109 }
110 if (m_doCSCPRD) {
111 m_tree.addBranch(std::make_unique<CSCPRDVariables>(m_tree, m_CSC_PRDContainerName, msgLevel()));
112 }
113 if (m_doTGCPRD) {
114 m_tree.addBranch(std::make_unique<TGCPRDVariables>(m_tree, m_TgcPrdKey, msgLevel()));
115 }
116 if (m_doMDTPRD) {
117 m_tree.addBranch(std::make_unique<MDTPRDVariables>(m_tree, m_MdtPrdKey, msgLevel()));
118 }
119 if (m_doRPCPRD) {
120 m_tree.addBranch(std::make_unique<RPCPRDVariables>(m_tree, m_RpcPrdKey, msgLevel()));
121 }
122 return StatusCode::SUCCESS;
123}
124
126 ATH_MSG_DEBUG("initialize()");
127 ATH_CHECK(m_evtInfo.initialize());
128 unsigned int ev_infomask{EventInfoBranch::writePileUp};
130 m_tree.addBranch(std::make_unique<EventInfoBranch>(m_tree,ev_infomask, m_evtInfo.key()));
131
132 ATH_CHECK(m_idHelperSvc.retrieve());
133
134 if (m_doTruth) {
135 m_tree.addBranch(std::make_unique<TruthVariables>(m_tree, m_Truth_ContainerName, msgLevel()));
136 }
137 if (m_doMuEntry) {
138 m_tree.addBranch(std::make_unique<MuEntryVariables>(m_tree, m_MuEntry_ContainerName, msgLevel()));
139 }
140 if (m_doSimHits) {
142 }
143 if (m_doDigits) {
145 }
146 if (m_doRDOs) {
148 }
149 if (m_doSDO) {
151 }
152 if (m_doPRDs) {
154 }
155
156 ATH_MSG_DEBUG("Init TTree");
157 ATH_CHECK(m_tree.init(this));
158
159 ATH_MSG_DEBUG("Finished with the initialization");
160 return StatusCode::SUCCESS;
161}
162
164 ATH_MSG_DEBUG("PrdValAlg:: Finalize + Matching");
165 ATH_CHECK(m_tree.write());
166 return StatusCode::SUCCESS;
167}
168
169StatusCode HitValAlg::execute() {
170 ATH_MSG_DEBUG("execute()");
171 const EventContext& ctx = Gaudi::Hive::currentContext();
172 ATH_MSG_DEBUG("Fill TTree");
173 if (!m_tree.fill(ctx)) return StatusCode::FAILURE;
174
175 return StatusCode::SUCCESS;
176}
177}
#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:115
Gaudi::Property< bool > m_doSTGCRDO
Definition HitValAlg.h:55
Gaudi::Property< bool > m_doTGCPRD
Definition HitValAlg.h:84
StatusCode setupSimHits()
Definition HitValAlg.cxx:23
ServiceHandle< MuonTGC_CablingSvc > m_tgcCabling
Definition HitValAlg.h:37
Gaudi::Property< std::string > m_CSC_DigitContainerName
Definition HitValAlg.h:105
Gaudi::Property< std::string > m_MmDigitKey
Definition HitValAlg.h:99
Gaudi::Property< bool > m_doCSCSDO
Definition HitValAlg.h:65
Gaudi::Property< bool > m_doSTGCDigit
Definition HitValAlg.h:54
Gaudi::Property< std::string > m_TgcDigitKey
Definition HitValAlg.h:121
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfo
Definition HitValAlg.h:87
Gaudi::Property< bool > m_doRPCSDO
Definition HitValAlg.h:76
Gaudi::Property< std::string > m_MmSimKey
Definition HitValAlg.h:97
StatusCode setupRDOs()
Definition HitValAlg.cxx:86
Gaudi::Property< bool > m_doRDOs
Switch to toggle the dumping of Digits in general.
Definition HitValAlg.h:49
Gaudi::Property< std::string > m_CSC_PRDContainerName
Definition HitValAlg.h:107
Gaudi::Property< bool > m_doMDTSDO
Definition HitValAlg.h:71
Gaudi::Property< bool > m_doTGCHit
Definition HitValAlg.h:80
Gaudi::Property< std::string > m_MmPrdKey
Definition HitValAlg.h:101
Gaudi::Property< bool > m_doTGCDigit
Definition HitValAlg.h:82
Gaudi::Property< std::string > m_RpcDigitKey
Definition HitValAlg.h:116
Gaudi::Property< std::string > m_TgcRdoKey
Definition HitValAlg.h:122
Gaudi::Property< bool > m_doMDTDigit
Definition HitValAlg.h:72
StatusCode setupDigits()
Definition HitValAlg.cxx:65
Gaudi::Property< bool > m_doCSCDigit
Definition HitValAlg.h:66
Gaudi::Property< bool > m_doCSCHit
Definition HitValAlg.h:64
Gaudi::Property< std::string > m_MmRdoKey
Definition HitValAlg.h:100
Gaudi::Property< bool > m_doRPCDigit
Definition HitValAlg.h:77
Gaudi::Property< bool > m_doCSCPRD
Definition HitValAlg.h:68
Gaudi::Property< bool > m_doRPCPRD
Definition HitValAlg.h:78
Gaudi::Property< bool > m_doTGCRDO
Definition HitValAlg.h:83
Gaudi::Property< std::string > m_MdtSdoKey
Definition HitValAlg.h:110
Gaudi::Property< std::string > m_sTgcPRDKey
Definition HitValAlg.h:95
Gaudi::Property< std::string > m_sTgcSdoKey
Definition HitValAlg.h:92
Gaudi::Property< bool > m_doSTGCHit
Switch to toggle the dumping of PRDs in general.
Definition HitValAlg.h:52
MuonVal::MuonTesterTree m_tree
Definition HitValAlg.h:35
Gaudi::Property< bool > m_doMMDigit
Definition HitValAlg.h:60
Gaudi::Property< bool > m_isData
Definition HitValAlg.h:42
Gaudi::Property< std::string > m_MdtPrdKey
Definition HitValAlg.h:112
Gaudi::Property< bool > m_doPRDs
Switch to toggle the dumping of RDOs in general.
Definition HitValAlg.h:50
Gaudi::Property< std::string > m_TgcSdoKey
Definition HitValAlg.h:120
Gaudi::Property< bool > m_doSimHits
Definition HitValAlg.h:46
StatusCode setupSDOs()
Definition HitValAlg.cxx:44
StatusCode initialize() override
StatusCode setupPRDs()
Gaudi::Property< std::string > m_Truth_ContainerName
Definition HitValAlg.h:88
PublicToolHandle< Muon::ICSC_RDO_Decoder > m_csc_decoder
Definition HitValAlg.h:40
Gaudi::Property< bool > m_doRPCHit
Definition HitValAlg.h:75
Gaudi::Property< bool > m_doSTGCSDO
Definition HitValAlg.h:53
Gaudi::Property< std::string > m_CSC_RDOContainerName
Definition HitValAlg.h:106
Gaudi::Property< bool > m_doSDO
Switch to toggle the dumping of sim hits in general.
Definition HitValAlg.h:47
Gaudi::Property< std::string > m_sTgcDigitKey
Definition HitValAlg.h:93
Gaudi::Property< bool > m_doMMHit
Definition HitValAlg.h:58
Gaudi::Property< bool > m_doMMRDO
Definition HitValAlg.h:61
StatusCode execute() override
Gaudi::Property< bool > m_doCSCRDO
Definition HitValAlg.h:67
Gaudi::Property< std::string > m_sTgcSimKey
Definition HitValAlg.h:91
Gaudi::Property< std::string > m_CSC_SDOContainerName
Definition HitValAlg.h:104
Gaudi::Property< std::string > m_MmSdoKey
Definition HitValAlg.h:98
Gaudi::Property< std::string > m_TgcSimHitKey
Definition HitValAlg.h:119
StatusCode finalize() override
Gaudi::Property< bool > m_doMMSDO
Definition HitValAlg.h:59
Gaudi::Property< std::string > m_MdtSimHitKey
Definition HitValAlg.h:109
Gaudi::Property< std::string > m_RpcSimHitKey
Definition HitValAlg.h:114
Gaudi::Property< std::string > m_TgcPrdKey
Definition HitValAlg.h:123
Gaudi::Property< bool > m_doMDTPRD
Definition HitValAlg.h:73
Gaudi::Property< std::string > m_MdtDigitKey
Definition HitValAlg.h:111
Gaudi::Property< bool > m_doMMPRD
Definition HitValAlg.h:62
Gaudi::Property< bool > m_doMDTHit
Definition HitValAlg.h:70
Gaudi::Property< bool > m_doDigits
Switch to toggle the dumping of SDOs in general.
Definition HitValAlg.h:48
Gaudi::Property< std::string > m_RpcPrdKey
Definition HitValAlg.h:117
Gaudi::Property< bool > m_doTruth
Definition HitValAlg.h:43
Gaudi::Property< std::string > m_MuEntry_ContainerName
Definition HitValAlg.h:89
Gaudi::Property< std::string > m_sTgcRdoKey
Definition HitValAlg.h:94
Gaudi::Property< std::string > m_CSC_SimContainerName
Definition HitValAlg.h:103
Gaudi::Property< bool > m_doSTGCPRD
Definition HitValAlg.h:56
Gaudi::Property< bool > m_doMuEntry
Definition HitValAlg.h:44
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition HitValAlg.h:39
Gaudi::Property< bool > m_doTGCSDO
Definition HitValAlg.h:81
Class to store array like branches into the n-tuples.
Definition HitValAlg.cxx:19