ATLAS Offline Software
Loading...
Searching...
No Matches
PadTrig_ROD_Decoder.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <byteswap.h>
8#include <vector>
9
10#include "Identifier/Identifier.h"
11#include "eformat/Issue.h"
12#include "eformat/SourceIdentifier.h"
15
16namespace Muon {
17
18//=====================================================================
19PadTrig_ROD_Decoder::PadTrig_ROD_Decoder(const std::string& type, const std::string& name, const IInterface* parent)
20: AthAlgTool(type, name, parent)
21{
22 declareInterface<IPadTrig_ROD_Decoder>(this);
23}
24
25
26//=====================================================================
28{
29 try {
30 fragment.check();
31 } catch (const eformat::Issue& ex) {
32 ATH_MSG_ERROR(ex.what());
33 return StatusCode::FAILURE;
34 }
35
36 const std::string trigger{"PadL1A"};
37 const Muon::nsw::NSWTriggerCommonDecoder decoder{fragment, trigger};
38 for (const auto& baselink: decoder.get_elinks()) {
39 const auto link = static_cast<const Muon::nsw::NSWPadTriggerL1a*>(baselink.get());
40 auto *const collection = new NSW_PadTriggerData{
41 fragment.rob_source_id(),
42 link->getFlags(),
43 link->getEc(),
44 link->getFragid(),
45 link->getSecid(),
46 link->getSpare(),
47 link->getOrbit(),
48 link->getBcid(),
49 link->getL1id(),
50 link->getOrbitid(),
51 link->getOrbit1(),
52 link->getStatus(),
53 link->getNumberOfHits(),
54 link->getNumberOfPfebs(),
55 link->getNumberOfTriggers(),
56 link->getNumberOfBcids(),
57 link->getHitRelBcids(),
58 link->getHitPfebs(),
59 link->getHitTdsChannels(),
60 link->getHitVmmChannels(),
61 link->getHitVmms(),
62 link->getHitPadChannels(),
63 link->getPfebAddresses(),
64 link->getPfebNChannels(),
65 link->getPfebDisconnecteds(),
66 link->getTriggerBandIds(),
67 link->getTriggerPhiIds(),
68 link->getTriggerRelBcids(),
69 link->getBcidRels(),
70 link->getBcidStatuses(),
71 link->getBcidMultZeros(),
72 link->getBcidMultiplicities()
73 };
74 ATH_MSG_DEBUG("Pad trigger fillCollection " << std::hex << collection->getSourceid() << std::dec << " " << rdo.numberOfCollections());
75 ATH_CHECK(rdo.addCollection(collection, rdo.numberOfCollections()));
76 }
77
78 return StatusCode::SUCCESS;
79}
80
81} // namespace Muon
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
C++23-compatible byteswap()
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
virtual size_t numberOfCollections() const override final
return number of collections
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
StatusCode fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &fragment, NSW_PadTriggerDataContainer &rdo) const override
PadTrig_ROD_Decoder(const std::string &type, const std::string &name, const IInterface *parent)
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
eformat::ROBFragment< PointerType > ROBFragment
Definition RawEvent.h:27