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