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 ATH_CHECK(m_cablingKey.initialize());
22 if (!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
23
24 return StatusCode::SUCCESS;
25}
26
27
28StatusCode TGCSimulation::execute(const EventContext& ctx) const {
29 ATH_MSG_DEBUG ("Executing " << name() << "...");
30
31 SG::ReadHandle tgcDigitContainer(m_keyTgcDigit, ctx);
32 ATH_CHECK(tgcDigitContainer.isPresent());
33 ATH_MSG_DEBUG("Number of TGC Digits: " << tgcDigitContainer->size());
34
35 // monitor some quantities
36 auto nTgcDigits = Monitored::Scalar<unsigned int>("nTgcDigits", tgcDigitContainer->size());
37 Monitored::Group(m_monTool, nTgcDigits);
38
39
40 // output RoIs container
42 ATH_CHECK(roiCont.record(std::make_unique<xAOD::MuonRoIContainer>(),
43 std::make_unique<xAOD::MuonRoIAuxContainer>()));
44
45 xAOD::MuonRoI* roi = roiCont->push_back(std::make_unique<xAOD::MuonRoI>());
46 uint32_t roiword = 0x0;
47 float roi_eta = 0.0;
48 float roi_phi = 0.0;
49 std::string thrname = "L0_MUx";
50 float thrvalue = 0.0;
51 roi->initialize(roiword, roi_eta, roi_phi, thrname, thrvalue, 0x1); // TODO: roiExtraWord is 1 for the time being.
52
53
54 return StatusCode::SUCCESS;
55}
56
57} // 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
SG::ReadCondHandleKey< Muon::TgcCablingMap > m_cablingKey
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