ATLAS Offline Software
Loading...
Searching...
No Matches
TGCSimulation.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#include "TGCSimulation.h"
6
8
9namespace L0Muon {
10
12 ATH_MSG_DEBUG("Initializing " << name() << "...");
13
14 ATH_CHECK(m_keyTgcDigit.initialize());
15
17 ATH_CHECK(m_outputMuonRoIKey.initialize());
18
19 // TGC cabling service
20 if (!m_cabling) {
21 ATH_CHECK(m_cabling.retrieve());
22 }
23
25 if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
26
27 return StatusCode::SUCCESS;
28}
29
30
31StatusCode TGCSimulation::execute(const EventContext& ctx) const {
32 ATH_MSG_DEBUG ("Executing " << name() << "...");
33
34 SG::ReadHandle tgcDigitContainer(m_keyTgcDigit, ctx);
35 ATH_CHECK(tgcDigitContainer.isPresent());
36 ATH_MSG_DEBUG("Number of TGC Digits: " << tgcDigitContainer->size());
37
38 // monitor some quantities
39 auto nTgcDigits = Monitored::Scalar<unsigned int>("nTgcDigits", tgcDigitContainer->size());
40 Monitored::Group(m_monTool, nTgcDigits);
41
42
43 // output RoIs container
45 ATH_CHECK(roiCont.record(std::make_unique<xAOD::MuonRoIContainer>(),
46 std::make_unique<xAOD::MuonRoIAuxContainer>()));
47
48 xAOD::MuonRoI* roi = roiCont->push_back(std::make_unique<xAOD::MuonRoI>());
49 uint32_t roiword = 0x0;
50 float roi_eta = 0.0;
51 float roi_phi = 0.0;
52 std::string thrname = "L0_MUx";
53 float thrvalue = 0.0;
54 roi->initialize(roiword, roi_eta, roi_phi, thrname, thrvalue, 0x1); // TODO: roiExtraWord is 1 for the time being.
55
56
57 return StatusCode::SUCCESS;
58}
59
60} // end of namespace
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
SG::WriteHandleKey< xAOD::MuonRoIContainer > m_outputMuonRoIKey
Output RoIs.
ToolHandle< GenericMonitoringTool > m_monTool
virtual StatusCode initialize() override
ServiceHandle< MuonTGC_CablingSvc > m_cabling
TGC cabling map.
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadHandleKey< TgcDigitContainer > m_keyTgcDigit
RPC Digit container.
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
bool isPresent() const
Is the referenced object present in SG?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
void initialize(uint32_t roiword, float eta, float phi, const std::string &thrname, float thrvalue, uint32_t extraword=0u)
Initialise the object with all its properties.
MuonRoI_v1 MuonRoI
Definition MuonRoI.h:15