ATLAS Offline Software
Loading...
Searching...
No Matches
RoIBResultByteStreamTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGT1RESULTBYTESTREAM_ROIBRESULTBYTESTREAMTOOL_H
6#define TRIGT1RESULTBYTESTREAM_ROIBRESULTBYTESTREAMTOOL_H
7
8// Trigger includes
11#include "TrigT1Result/Header.h"
14
15// Athena includes:
19
20// System includes
21#include <vector>
22
23// Forward declaration(s):
24namespace ROIB {
25 class RoIBResult;
26}
27
39class RoIBResultByteStreamTool : public extends<AthAlgTool, IL1TriggerByteStreamTool> {
40
41public:
43 RoIBResultByteStreamTool( const std::string& type, const std::string& name,
44 const IInterface* parent );
46 virtual ~RoIBResultByteStreamTool() = default;
47
49 virtual StatusCode initialize() override;
50
52 virtual StatusCode convertFromBS(const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vrobf,
53 const EventContext& eventContext) const override;
54
56 virtual StatusCode convertToBS(std::vector<OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment*>& vrobf,
57 const EventContext& eventContext) override;
58
60 virtual const std::vector<uint32_t>& robIds() const override {return m_configuredROBIds;}
61
62private:
63
64 // ------------------------- Private types -----------------------------------
66 struct DataStatus {
67 bool rob_error {false};
68 bool rod_error {false};
69 uint32_t status_word {0};
70 uint32_t status_info {0};
71 };
72
73 // ------------------------- Private methods ---------------------------------
79 ROIB::Header roibHeader(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment& rob, DataStatus& dataStatus) const;
80
86 template<typename RoIType> std::vector<RoIType> roibContent(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment& rob) const;
87
94
100 ROIB::Trailer roibTrailer(const DataStatus& dataStatus, const uint32_t dataSize) const;
101
102 // ------------------------- Properties --------------------------------------
106 Gaudi::Property<uint16_t> m_ctpModuleID {
107 this, "CTPModuleId", 1,
108 "Module ID of CTP ROB with RoI information. Value 0xFF disables CTP decoding/encoding in this tool."
109 };
110
111 Gaudi::Property<uint16_t> m_muCTPIModuleID {
112 this, "MUCTPIModuleId", 1,
113 "Module ID of MUCTPI ROB with RoI information. Value 0xFF disables MUCTPI decoding/encoding in this tool."
114 };
115
116 Gaudi::Property<std::vector<uint16_t>> m_jetModuleID {
117 this, "JetModuleIds", {0xac, 0xad},
118 "Vector of module IDs of Jet RoI ROBs. Empty vector disables Jet/Energy decoding/encoding in this tool."
119 };
120
121 Gaudi::Property<std::vector<uint16_t>> m_emModuleID {
122 this, "EMModuleIds", {0xa8, 0xa9, 0xaa, 0xab},
123 "Vector of module IDs of EM RoI ROBs. Empty vector disables EMTau decoding/encoding in this tool."
124 };
125
126 Gaudi::Property<std::vector<uint16_t>> m_l1TopoModuleID {
127 this, "L1TopoModuleIds", {0x81,0x91},
128 "Vector of module IDs of L1Topo RoI ROBs. Empty vector disables L1Topo decoding/encoding in this tool."
129 };
130
131
133 Gaudi::Property<uint16_t> m_detEvType {
134 this, "DetEvType", 1, // RB: It was hard-coded to 1 in the past, no idea why
135 "Detector event type to write when converting to ByteStream"
136 };
137
141 this, "RoIBResultWriteKey", "",
142 "Write handle key to RoIBResult for conversion from ByteStream"
143 };
145 this, "RoIBResultReadKey", "",
146 "Read handle key to RoIBResult for conversion to ByteStream"
147 };
148
149
150 // ------------------------- Other private members ---------------------------
152 std::vector<uint32_t> m_configuredROBIds;
154 SmartIF<IByteStreamEventAccess> m_byteStreamEventAccess;
157 bool m_doCTP {true};
158 bool m_doMuon {true};
159 bool m_doJetEnergy {true};
160 bool m_doEMTau {true};
161 bool m_doTopo {true};
163
164}; // class RoIBResultByteStreamTool
165
166#endif // TRIGT1RESULTBYTESTREAM_ROIBRESULTBYTESTREAMTOOL_H
The class that represents the raw data received from an L1Topo board.
Definition L1TopoRDO.h:29
Header models the LVL1 ROD Header.
Class holding the LVL1 RoIB result build by the RoIBuilder.
Definition RoIBResult.h:47
ROIB::Trailer models the LVL1 ROD Trailer.
Definition Trailer.h:37
virtual const std::vector< uint32_t > & robIds() const override
Vector of ROB IDs corresponding to the modules configured for decoding.
Gaudi::Property< std::vector< uint16_t > > m_l1TopoModuleID
L1Topo Module IDs to decode.
virtual StatusCode convertToBS(std::vector< OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment * > &vrobf, const EventContext &eventContext) override
Convert RoIBResult to ByteStream.
virtual ~RoIBResultByteStreamTool()=default
Default destructor.
Gaudi::Property< uint16_t > m_muCTPIModuleID
MUCTPI Module ID to decode.
ROIB::Trailer roibTrailer(const DataStatus &dataStatus, const uint32_t dataSize) const
Helper method to extract ROD trailer information @in dataStatus Structure to flag data errors (extrac...
virtual StatusCode convertFromBS(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vrobf, const EventContext &eventContext) const override
Convert ROB fragments to RoIBResult.
ROIB::Header roibHeader(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &rob, DataStatus &dataStatus) const
Helper method to extract ROD header information @in rob ROBFragment from which data are extracted @ou...
Gaudi::Property< uint16_t > m_ctpModuleID
RoIBResultByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
L1TopoRDO l1topoContent(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &rob) const
Helper method to extract ROD payload for L1Topo (different interface from other RoI data) @in ndata N...
Gaudi::Property< uint16_t > m_detEvType
Detector event type to write when converting to ByteStream.
virtual StatusCode initialize() override
Function to initialise the tool.
std::vector< uint32_t > m_configuredROBIds
Vector of ROB IDs corresponding to the modules configured for decoding.
Gaudi::Property< std::vector< uint16_t > > m_emModuleID
EM Module IDs to decode.
SG::WriteHandleKey< ROIB::RoIBResult > m_roibResultWriteKey
SmartIF< IByteStreamEventAccess > m_byteStreamEventAccess
Interface to get raw event pointer for updating event header when writing to BS.
std::vector< RoIType > roibContent(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &rob) const
Helper method to extract ROD payload @in ndata Number of data words @in data Data words.
SG::ReadHandleKey< ROIB::RoIBResult > m_roibResultReadKey
Gaudi::Property< std::vector< uint16_t > > m_jetModuleID
Jet Module IDs to decode.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
eformat::ROBFragment< PointerType > ROBFragment
Definition RawEvent.h:27
Namespace of the LVL1 RoIB simulation.
Structure holding the status words and rob/rod error flags.