ATLAS Offline Software
Loading...
Searching...
No Matches
MuonRoIByteStreamTool.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_MUONROIBYTESTREAMTOOL_H
6#define TRIGT1RESULTBYTESTREAM_MUONROIBYTESTREAMTOOL_H
7
8
9// Trigger includes
16
17// Athena includes
20
25class MuonRoIByteStreamTool : public extends<AthAlgTool, IL1TriggerByteStreamTool> {
26public:
27 MuonRoIByteStreamTool(const std::string& type, const std::string& name, const IInterface* parent);
28 virtual ~MuonRoIByteStreamTool() override = default;
29
30 // ------------------------- IAlgTool methods --------------------------------
31 virtual StatusCode initialize() override;
32
33 // ------------------------- IL1TriggerByteStreamTool methods ----------------
35 virtual StatusCode convertFromBS(const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vrobf,
36 const EventContext& eventContext) const override;
38 virtual StatusCode convertToBS(std::vector<OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment*>& vrobf,
39 const EventContext& eventContext) override;
41 virtual const std::vector<uint32_t>& robIds() const override {return m_robIds.value();}
42
43private:
44 // ------------------------- Tool handles ------------------------------------
45 ToolHandle<LVL1::ITrigT1MuonRecRoiTool> m_rpcTool{
46 this, "RPCRecRoiTool", "LVL1::TrigT1RPCRecRoiTool/LVL1__TrigT1RPCRecRoiTool",
47 "Tool to get the eta/phi coordinates in the RPC"};
48 ToolHandle<LVL1::ITrigT1MuonRecRoiTool> m_tgcTool{
49 this, "TGCRecRoiTool", "LVL1::TrigT1TGCRecRoiTool/LVL1__TrigT1TGCRecRoiTool",
50 "Tool to get the eta/phi coordinates in the TGC"};
51 ToolHandle<LVL1::ITrigThresholdDecisionTool> m_thresholdTool{
52 this, "TrigThresholdDecisionTool", "LVL1::TrigThresholdDecisionTool/LVL1__TrigThresholdDecisionTool",
53 "Tool to get pass/fail of each trigger threshold"};
54 ToolHandle<GenericMonitoringTool> m_monTool{
55 this, "MonTool", "", "Monitoring tool"};
56
57 // ------------------------- Data handles ------------------------------------
58 // Only write keys should be set to non-empty array in python configuration if the tool is in BS->xAOD mode of operation
60 this, "MuonRoIContainerWriteKeys", {},
61 "Write handle keys to MuonRoIContainer for conversion from ByteStream (one key per BC in the readout window)"};
62 // Only read keys should be set to non-empty array in python configuration if the tool is in xAOD->BS mode of operation
64 this, "MuonRoIContainerReadKeys", {},
65 "Read handle keys to MuonRoIContainer for conversion to ByteStream (one key per BC in the readout window)"};
67 this, "L1TopoOutputLocID", {},
68 "Output keys for MuCTPItoL1Topo, one per time slice"};
69
70 // ------------------------- Other properties --------------------------------
71 Gaudi::Property<std::vector<uint32_t>> m_robIds {
72 this, "ROBIDs", {}, "List of ROB IDs required for conversion to/from xAOD RoI"};
73 Gaudi::Property<bool> m_doTopo {
74 this, "DoTopo", false, "Enable decoding/encoding MUCTPI Topo TOBs"};
75 Gaudi::Property<bool> m_writeDecodedMuonRoIs {
76 this, "WriteDecodedMuonRoIs", true, "Write the MuonRoIs"};
77
78 const std::string m_barrelRoIFile = "TrigConfMuctpi/Data_ROI_Mapping_Barrel_040422.txt";
79 const std::string m_ecfRoIFile = "TrigConfMuctpi/Data_RoI_Mapping_EF_040422.txt";
80 const std::string m_side0LUTFile = "TrigConfMuctpi/lookup_0_040422.json";
81 const std::string m_side1LUTFile = "TrigConfMuctpi/lookup_1_040422.json";
82
83 // ------------------------- Helper members ----------------------------------
85 short int m_readoutWindow{-1};
89 StatusCode decodeRoiSlices(const uint32_t* data,
90 const std::vector<std::pair<size_t,size_t>>& slices,
91 std::vector<SG::WriteHandle<xAOD::MuonRoIContainer>>& handles,
92 size_t outputOffset,
93 const EventContext& eventContext) const;
95 StatusCode decodeTopoSlices(const uint32_t* data,
96 const std::vector<std::pair<size_t,size_t>>& slices,
97 std::vector<SG::WriteHandle<xAOD::MuonRoIContainer>>& handles,
98 size_t outputOffset,
99 const EventContext& eventContext) const;
100};
101
102#endif // TRIGT1RESULTBYTESTREAM_MUONROIBYTESTREAMTOOL_H
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Header file to be included by clients of the Monitored infrastructure.
SG::ReadHandleKeyArray< xAOD::MuonRoIContainer > m_roiReadKeys
MuonRoIByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
ToolHandle< LVL1::ITrigThresholdDecisionTool > m_thresholdTool
SG::WriteHandleKeyArray< xAOD::MuonRoIContainer > m_MuCTPIL1TopoKeys
virtual ~MuonRoIByteStreamTool() override=default
short int m_readoutWindow
Expected readout window size calculated from the size of data handle key arrays, should be 1,...
const std::string m_barrelRoIFile
Gaudi::Property< bool > m_writeDecodedMuonRoIs
SG::WriteHandleKeyArray< xAOD::MuonRoIContainer > m_roiWriteKeys
const std::string m_side0LUTFile
ToolHandle< LVL1::ITrigT1MuonRecRoiTool > m_rpcTool
const std::string m_side1LUTFile
Gaudi::Property< std::vector< uint32_t > > m_robIds
ToolHandle< LVL1::ITrigT1MuonRecRoiTool > m_tgcTool
virtual StatusCode initialize() override
virtual StatusCode convertToBS(std::vector< OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment * > &vrobf, const EventContext &eventContext) override
xAOD->BS conversion
StatusCode decodeRoiSlices(const uint32_t *data, const std::vector< std::pair< size_t, size_t > > &slices, std::vector< SG::WriteHandle< xAOD::MuonRoIContainer > > &handles, size_t outputOffset, const EventContext &eventContext) const
Process raw RoI candidate words in all slices, convert and fill the output EDM.
virtual StatusCode convertFromBS(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vrobf, const EventContext &eventContext) const override
BS->xAOD conversion.
ToolHandle< GenericMonitoringTool > m_monTool
StatusCode decodeTopoSlices(const uint32_t *data, const std::vector< std::pair< size_t, size_t > > &slices, std::vector< SG::WriteHandle< xAOD::MuonRoIContainer > > &handles, size_t outputOffset, const EventContext &eventContext) const
Process raw Topo TOB words in all slices, convert and fill the output EDM.
Gaudi::Property< bool > m_doTopo
const std::string m_ecfRoIFile
virtual const std::vector< uint32_t > & robIds() const override
Declare ROB IDs for conversion.
LVL1MUCTPIPHASE1::L1TopoLUT m_l1topoLUT
Muctpi Topo TOB word lookup table interface: hemi, detector, sector, roi(EC&FWD)/lut-numbers(Barrel) ...
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
HandleKeyArray< WriteHandle< T >, WriteHandleKey< T >, Gaudi::DataHandle::Writer > WriteHandleKeyArray