ATLAS Offline Software
Loading...
Searching...
No Matches
L0MuonEndcapAlg.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#include "L0MuonEndcapAlg.h"
6
7#include <cstdint>
8#include <memory>
9#include <vector>
10
14
15namespace L0Muon {
16namespace {
17
18constexpr int currentBcOffset = 0;
19// Board and fiber identifiers remain unset until their conventions are defined.
20constexpr std::uint16_t unsetBoardId = 0U;
21constexpr std::uint16_t unsetFiberId = 0U;
22
23} // namespace
24
26 ATH_CHECK(m_inputKey.initialize());
27 ATH_CHECK(m_outputKey.initialize());
28 return StatusCode::SUCCESS;
29}
30
31StatusCode L0MuonEndcapAlg::execute(const EventContext& ctx) const {
32 const xAOD::TGCCandDataContainer* inputHandle{};
33 ATH_CHECK(SG::get(inputHandle, m_inputKey, ctx));
34
37 output{};
38
39 for (const xAOD::TGCCandData* candidate : *inputHandle) {
40 if (candidate->tcId() == 0U) continue;
41
42 const TgcL0SectorLogicWords words =
44 xAOD::SectorLogicCandData* outputCandidate =
45 output->push_back(std::make_unique<xAOD::SectorLogicCandData>());
46 outputCandidate->initialize(
47 std::vector<std::uint32_t>{words.candWord, words.candExtraWord},
48 currentBcOffset, unsetBoardId, unsetFiberId);
49 }
50
51 ATH_MSG_DEBUG("Converted " << output->size() << " of "
52 << inputHandle->size()
53 << " TGC candidates to Sector Logic output");
54
55 ATH_CHECK(output.record(m_outputKey, ctx));
56 return StatusCode::SUCCESS;
57}
58
59} // namespace L0Muon
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
Handle class for reading from StoreGate.
size_type size() const noexcept
Returns the number of elements in the collection.
StatusCode execute(const EventContext &ctx) const override
SG::ReadHandleKey< xAOD::TGCCandDataContainer > m_inputKey
StatusCode initialize() override
SG::WriteHandleKey< xAOD::SectorLogicCandDataContainer > m_outputKey
static TgcL0SectorLogicWords encode(const xAOD::TGCCandData &candidate)
Encode one TGC candidate without MDT or overlap information.
void initialize(const std::vector< uint32_t > &data, int offset, uint16_t bID, uint16_t fID)
Initialise the object given some input data.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
SectorLogicCandDataContainer_v1 SectorLogicCandDataContainer
SectorLogicCandData_v1 SectorLogicCandData
SectorLogicCandDataAuxContainer_v1 SectorLogicCandDataAuxContainer
MuCTPI candidate words produced from one TGC candidate.