Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
18 using namespace MuonPRDTest;
19 namespace 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  return StatusCode::SUCCESS;
117 }
118 
120  ATH_MSG_DEBUG("initialize()");
122  unsigned int ev_infomask{EventInfoBranch::writePileUp};
124  m_tree.addBranch(std::make_unique<EventInfoBranch>(m_tree,ev_infomask, m_evtInfo.key()));
125 
126  ATH_CHECK(m_idHelperSvc.retrieve());
127 
128  if (m_doTruth) {
129  m_tree.addBranch(std::make_unique<TruthVariables>(m_tree, m_Truth_ContainerName, msgLevel()));
130  }
131  if (m_doMuEntry) {
132  m_tree.addBranch(std::make_unique<MuEntryVariables>(m_tree, m_MuEntry_ContainerName, msgLevel()));
133  }
134  if (m_doSimHits) {
136  }
137  if (m_doDigits) {
139  }
140  if (m_doRDOs) {
141  ATH_CHECK(setupRDOs());
142  }
143  if (m_doSDO) {
144  ATH_CHECK(setupSDOs());
145  }
146  if (m_doPRDs) {
147  ATH_CHECK(setupPRDs());
148  }
149 
150  ATH_MSG_DEBUG("Init TTree");
151  ATH_CHECK(m_tree.init(this));
152 
153  ATH_MSG_DEBUG("Finished with the initialization");
154  return StatusCode::SUCCESS;
155 }
156 
158  ATH_MSG_DEBUG("PrdValAlg:: Finalize + Matching");
160  return StatusCode::SUCCESS;
161 }
162 
164  ATH_MSG_DEBUG("execute()");
165  const EventContext& ctx = Gaudi::Hive::currentContext();
166  ATH_MSG_DEBUG("Fill TTree");
167  if (!m_tree.fill(ctx)) return StatusCode::FAILURE;
168 
169  return StatusCode::SUCCESS;
170 }
171 }
MuonVal::HitValAlg::m_doRPCSDO
Gaudi::Property< bool > m_doRPCSDO
Definition: HitValAlg.h:75
MuonVal::HitValAlg::execute
StatusCode execute() override
Definition: HitValAlg.cxx:163
MuonVal::HitValAlg::m_doSTGCSDO
Gaudi::Property< bool > m_doSTGCSDO
Definition: HitValAlg.h:53
MuonVal::HitValAlg::m_doPRDs
Gaudi::Property< bool > m_doPRDs
Switch to toggle the dumping of RDOs in general.
Definition: HitValAlg.h:50
MuonVal::HitValAlg::m_CSC_RDOContainerName
Gaudi::Property< std::string > m_CSC_RDOContainerName
Definition: HitValAlg.h:104
MuonVal::HitValAlg::m_doTGCDigit
Gaudi::Property< bool > m_doTGCDigit
Definition: HitValAlg.h:80
MuonVal::MuonTesterTree::init
StatusCode init(OWNER *instance)
Initialize method.
MuonVal::HitValAlg::m_TgcPrdKey
Gaudi::Property< std::string > m_TgcPrdKey
Definition: HitValAlg.h:119
MuonVal::HitValAlg::m_sTgcDigitKey
Gaudi::Property< std::string > m_sTgcDigitKey
Definition: HitValAlg.h:91
MuonVal::HitValAlg::m_RpcSdoKey
Gaudi::Property< std::string > m_RpcSdoKey
Definition: HitValAlg.h:112
MuonVal::EventInfoBranch::isMC
@ isMC
Flag determining whether the branch is simulation.
Definition: EventInfoBranch.h:20
MuonVal::HitValAlg::m_tree
MuonVal::MuonTesterTree m_tree
Definition: HitValAlg.h:35
MuonVal::HitValAlg::m_sTgcRdoKey
Gaudi::Property< std::string > m_sTgcRdoKey
Definition: HitValAlg.h:92
MuonVal::HitValAlg::m_evtInfo
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfo
Definition: HitValAlg.h:85
MuonVal::HitValAlg::m_doMMRDO
Gaudi::Property< bool > m_doMMRDO
Definition: HitValAlg.h:61
MuonVal::EventInfoBranch::writeBeamSpot
@ writeBeamSpot
Write the beamspot weight.
Definition: EventInfoBranch.h:26
MuonVal::HitValAlg::m_doSTGCRDO
Gaudi::Property< bool > m_doSTGCRDO
Definition: HitValAlg.h:55
MuonVal::HitValAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: HitValAlg.h:39
MuonVal::HitValAlg::m_MmPrdKey
Gaudi::Property< std::string > m_MmPrdKey
Definition: HitValAlg.h:99
MuonVal::HitValAlg::m_doSTGCPRD
Gaudi::Property< bool > m_doSTGCPRD
Definition: HitValAlg.h:56
MuonVal::HitValAlg::m_TgcSdoKey
Gaudi::Property< std::string > m_TgcSdoKey
Definition: HitValAlg.h:116
MuonVal::HitValAlg::m_doCSCDigit
Gaudi::Property< bool > m_doCSCDigit
Definition: HitValAlg.h:66
MuonVal::HitValAlg::m_doSDO
Gaudi::Property< bool > m_doSDO
Switch to toggle the dumping of sim hits in general.
Definition: HitValAlg.h:47
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
MuonVal::HitValAlg::m_doMMDigit
Gaudi::Property< bool > m_doMMDigit
Definition: HitValAlg.h:60
MuonVal::HitValAlg::m_doMMSDO
Gaudi::Property< bool > m_doMMSDO
Definition: HitValAlg.h:59
MuonVal::HitValAlg::m_MdtSimHitKey
Gaudi::Property< std::string > m_MdtSimHitKey
Definition: HitValAlg.h:107
MuonVal::HitValAlg::m_doSTGCHit
Gaudi::Property< bool > m_doSTGCHit
Switch to toggle the dumping of PRDs in general.
Definition: HitValAlg.h:52
MuonVal::HitValAlg::finalize
StatusCode finalize() override
Definition: HitValAlg.cxx:157
MuonVal::HitValAlg::m_MmSdoKey
Gaudi::Property< std::string > m_MmSdoKey
Definition: HitValAlg.h:96
MuonVal::HitValAlg::m_tgcCabling
ServiceHandle< MuonTGC_CablingSvc > m_tgcCabling
Definition: HitValAlg.h:37
MuonVal::HitValAlg::m_CSC_SimContainerName
Gaudi::Property< std::string > m_CSC_SimContainerName
Definition: HitValAlg.h:101
MuonVal::HitValAlg::m_doTGCPRD
Gaudi::Property< bool > m_doTGCPRD
Definition: HitValAlg.h:82
MuonVal::HitValAlg::m_doCSCRDO
Gaudi::Property< bool > m_doCSCRDO
Definition: HitValAlg.h:67
MuonVal::HitValAlg::m_isData
Gaudi::Property< bool > m_isData
Definition: HitValAlg.h:42
MuonVal::HitValAlg::m_doMuEntry
Gaudi::Property< bool > m_doMuEntry
Definition: HitValAlg.h:44
MuonVal::HitValAlg::m_doCSCHit
Gaudi::Property< bool > m_doCSCHit
Definition: HitValAlg.h:64
MuonVal::HitValAlg::m_RpcSimHitKey
Gaudi::Property< std::string > m_RpcSimHitKey
Definition: HitValAlg.h:111
MuonVal::HitValAlg::m_sTgcPRDKey
Gaudi::Property< std::string > m_sTgcPRDKey
Definition: HitValAlg.h:93
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonVal::HitValAlg::setupRDOs
StatusCode setupRDOs()
Definition: HitValAlg.cxx:86
MuonPRDTestDict.h
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonVal::HitValAlg::m_CSC_SDOContainerName
Gaudi::Property< std::string > m_CSC_SDOContainerName
Definition: HitValAlg.h:102
MuonVal::HitValAlg::m_doSTGCDigit
Gaudi::Property< bool > m_doSTGCDigit
Definition: HitValAlg.h:54
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
MuonVal::HitValAlg::initialize
StatusCode initialize() override
Definition: HitValAlg.cxx:119
MuonVal::HitValAlg::m_sTgcSimKey
Gaudi::Property< std::string > m_sTgcSimKey
Definition: HitValAlg.h:89
MuonVal::HitValAlg::m_CSC_DigitContainerName
Gaudi::Property< std::string > m_CSC_DigitContainerName
Definition: HitValAlg.h:103
MuonVal::HitValAlg::m_doMDTSDO
Gaudi::Property< bool > m_doMDTSDO
Definition: HitValAlg.h:71
MuonVal::HitValAlg::m_TgcDigitKey
Gaudi::Property< std::string > m_TgcDigitKey
Definition: HitValAlg.h:117
MuonVal::HitValAlg::m_MmRdoKey
Gaudi::Property< std::string > m_MmRdoKey
Definition: HitValAlg.h:98
MuonVal::HitValAlg::m_CSC_PRDContainerName
Gaudi::Property< std::string > m_CSC_PRDContainerName
Definition: HitValAlg.h:105
MuonVal
Class to store array like branches into the n-tuples.
Definition: HitValAlg.cxx:19
MuonVal::HitValAlg::setupSDOs
StatusCode setupSDOs()
Definition: HitValAlg.cxx:44
MuonVal::HitValAlg::m_doCSCPRD
Gaudi::Property< bool > m_doCSCPRD
Definition: HitValAlg.h:68
MuonVal::HitValAlg::setupPRDs
StatusCode setupPRDs()
Definition: HitValAlg.cxx:103
MuonVal::HitValAlg::m_csc_decoder
PublicToolHandle< Muon::ICSC_RDO_Decoder > m_csc_decoder
Definition: HitValAlg.h:40
MuonDetectorManager.h
MuonVal::HitValAlg::m_doTGCSDO
Gaudi::Property< bool > m_doTGCSDO
Definition: HitValAlg.h:79
MuonVal::HitValAlg::m_doRPCDigit
Gaudi::Property< bool > m_doRPCDigit
Definition: HitValAlg.h:76
MuonVal::HitValAlg::m_Truth_ContainerName
Gaudi::Property< std::string > m_Truth_ContainerName
Definition: HitValAlg.h:86
MuonVal::HitValAlg::m_doTGCHit
Gaudi::Property< bool > m_doTGCHit
Definition: HitValAlg.h:78
MuonPRDTest
Definition: MuonHitTesterAlg.h:15
MuonVal::HitValAlg::m_doTruth
Gaudi::Property< bool > m_doTruth
Definition: HitValAlg.h:43
MuonVal::HitValAlg::setupDigits
StatusCode setupDigits()
Definition: HitValAlg.cxx:65
MuonVal::EventInfoBranch::writePileUp
@ writePileUp
Write pile-up information.
Definition: EventInfoBranch.h:22
MuonVal::HitValAlg::m_doRPCHit
Gaudi::Property< bool > m_doRPCHit
Definition: HitValAlg.h:74
MuonVal::MuonTesterTree::fill
bool fill(const EventContext &ctx)
Fills the tree per call.
Definition: MuonTesterTree.cxx:89
MuonVal::MuonTesterTree::write
StatusCode write()
Finally write the TTree objects.
Definition: MuonTesterTree.cxx:178
MuonVal::HitValAlg::m_doCSCSDO
Gaudi::Property< bool > m_doCSCSDO
Definition: HitValAlg.h:65
MuonVal::HitValAlg::m_sTgcSdoKey
Gaudi::Property< std::string > m_sTgcSdoKey
Definition: HitValAlg.h:90
MuonVal::HitValAlg::m_doRDOs
Gaudi::Property< bool > m_doRDOs
Switch to toggle the dumping of Digits in general.
Definition: HitValAlg.h:49
MuonVal::HitValAlg::m_doSimHits
Gaudi::Property< bool > m_doSimHits
Definition: HitValAlg.h:46
MuonVal::HitValAlg::m_RpcDigitKey
Gaudi::Property< std::string > m_RpcDigitKey
Definition: HitValAlg.h:113
HitValAlg.h
MuonVal::HitValAlg::m_doTGCRDO
Gaudi::Property< bool > m_doTGCRDO
Definition: HitValAlg.h:81
MuonVal::HitValAlg::m_TgcSimHitKey
Gaudi::Property< std::string > m_TgcSimHitKey
Definition: HitValAlg.h:115
MuonVal::HitValAlg::m_doMDTHit
Gaudi::Property< bool > m_doMDTHit
Definition: HitValAlg.h:70
MuonVal::HitValAlg::m_doMMPRD
Gaudi::Property< bool > m_doMMPRD
Definition: HitValAlg.h:62
MuonVal::HitValAlg::m_MdtSdoKey
Gaudi::Property< std::string > m_MdtSdoKey
Definition: HitValAlg.h:108
MuonVal::HitValAlg::m_doMDTDigit
Gaudi::Property< bool > m_doMDTDigit
Definition: HitValAlg.h:72
MuonVal::HitValAlg::m_MuEntry_ContainerName
Gaudi::Property< std::string > m_MuEntry_ContainerName
Definition: HitValAlg.h:87
MuonVal::HitValAlg::m_MdtDigitKey
Gaudi::Property< std::string > m_MdtDigitKey
Definition: HitValAlg.h:109
MuonVal::HitValAlg::setupSimHits
StatusCode setupSimHits()
Definition: HitValAlg.cxx:23
MuonVal::HitValAlg::m_TgcRdoKey
Gaudi::Property< std::string > m_TgcRdoKey
Definition: HitValAlg.h:118
MuonVal::HitValAlg::m_MmDigitKey
Gaudi::Property< std::string > m_MmDigitKey
Definition: HitValAlg.h:97
MuonVal::HitValAlg::m_doDigits
Gaudi::Property< bool > m_doDigits
Switch to toggle the dumping of SDOs in general.
Definition: HitValAlg.h:48
MuonVal::HitValAlg::m_MmSimKey
Gaudi::Property< std::string > m_MmSimKey
Definition: HitValAlg.h:95
MuonVal::MuonTesterTree::addBranch
bool addBranch(std::shared_ptr< IMuonTesterBranch > branch)
Branch is added to the tree without transferring the ownership.
Definition: MuonTesterTree.cxx:61
MuonVal::HitValAlg::m_doMMHit
Gaudi::Property< bool > m_doMMHit
Definition: HitValAlg.h:58