ATLAS Offline Software
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 
25 class MuonRoIByteStreamTool : public extends<AthAlgTool, IL1TriggerByteStreamTool> {
26 public:
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 
43 private:
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 
76  const std::string m_barrelRoIFile = "TrigConfMuctpi/Data_ROI_Mapping_Barrel_040422.txt";
77  const std::string m_ecfRoIFile = "TrigConfMuctpi/Data_RoI_Mapping_EF_040422.txt";
78  const std::string m_side0LUTFile = "TrigConfMuctpi/lookup_0_040422.json";
79  const std::string m_side1LUTFile = "TrigConfMuctpi/lookup_1_040422.json";
80 
81  // ------------------------- Helper members ----------------------------------
83  short int m_readoutWindow{-1};
88  const std::vector<std::pair<size_t,size_t>>& slices,
89  std::vector<SG::WriteHandle<xAOD::MuonRoIContainer>>& handles,
90  size_t outputOffset,
91  const EventContext& eventContext) const;
94  const std::vector<std::pair<size_t,size_t>>& slices,
95  std::vector<SG::WriteHandle<xAOD::MuonRoIContainer>>& handles,
96  size_t outputOffset,
97  const EventContext& eventContext) const;
98 };
99 
100 #endif // TRIGT1RESULTBYTESTREAM_MUONROIBYTESTREAMTOOL_H
MuonRoIByteStreamTool::m_roiWriteKeys
SG::WriteHandleKeyArray< xAOD::MuonRoIContainer > m_roiWriteKeys
Definition: MuonRoIByteStreamTool.h:59
MuonRoIByteStreamTool::m_side0LUTFile
const std::string m_side0LUTFile
Definition: MuonRoIByteStreamTool.h:78
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
MuonRoIByteStreamTool::decodeRoiSlices
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.
Definition: MuonRoIByteStreamTool.cxx:428
MuonRoIByteStreamTool::m_roiReadKeys
SG::ReadHandleKeyArray< xAOD::MuonRoIContainer > m_roiReadKeys
Definition: MuonRoIByteStreamTool.h:63
MuonRoIByteStreamTool::m_rpcTool
ToolHandle< LVL1::ITrigT1MuonRecRoiTool > m_rpcTool
Definition: MuonRoIByteStreamTool.h:45
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
MuonRoIContainer.h
MuonRoIByteStreamTool::m_side1LUTFile
const std::string m_side1LUTFile
Definition: MuonRoIByteStreamTool.h:79
MuonRoIByteStreamTool::convertToBS
virtual StatusCode convertToBS(std::vector< OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment * > &vrobf, const EventContext &eventContext) override
xAOD->BS conversion
Definition: MuonRoIByteStreamTool.cxx:324
MuonRoIByteStreamTool::decodeTopoSlices
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.
Definition: MuonRoIByteStreamTool.cxx:493
ITrigThresholdDecisionTool.h
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
IL1TriggerByteStreamTool.h
MuonRoIByteStreamTool::m_MuCTPIL1TopoKeys
SG::WriteHandleKeyArray< xAOD::MuonRoIContainer > m_MuCTPIL1TopoKeys
Definition: MuonRoIByteStreamTool.h:66
TrigT1StoreGateKeys.h
MuonRoIByteStreamTool::m_tgcTool
ToolHandle< LVL1::ITrigT1MuonRecRoiTool > m_tgcTool
Definition: MuonRoIByteStreamTool.h:48
L1TopoLUT.h
MuonRoIByteStreamTool::m_l1topoLUT
LVL1MUCTPIPHASE1::L1TopoLUT m_l1topoLUT
Muctpi Topo TOB word lookup table interface: hemi, detector, sector, roi(EC&FWD)/lut-numbers(Barrel) ...
Definition: MuonRoIByteStreamTool.h:85
MuonRoIByteStreamTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: MuonRoIByteStreamTool.h:54
MuonRoIByteStreamTool
Tool for converting MUCTPI ROB from BS to xAOD and from xAOD to BS (IL1TriggerByteStreamTool interfac...
Definition: MuonRoIByteStreamTool.h:25
MuonRoIByteStreamTool::m_barrelRoIFile
const std::string m_barrelRoIFile
Definition: MuonRoIByteStreamTool.h:76
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonRoIByteStreamTool::m_thresholdTool
ToolHandle< LVL1::ITrigThresholdDecisionTool > m_thresholdTool
Definition: MuonRoIByteStreamTool.h:51
MuonRoIByteStreamTool::m_ecfRoIFile
const std::string m_ecfRoIFile
Definition: MuonRoIByteStreamTool.h:77
AthAlgTool.h
MuonRoIByteStreamTool::robIds
virtual const std::vector< uint32_t > & robIds() const override
Declare ROB IDs for conversion.
Definition: MuonRoIByteStreamTool.h:41
MuonRoIByteStreamTool::convertFromBS
virtual StatusCode convertFromBS(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vrobf, const EventContext &eventContext) const override
BS->xAOD conversion.
Definition: MuonRoIByteStreamTool.cxx:127
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ITrigT1MuonRecRoiTool.h
MuonRoIByteStreamTool::m_readoutWindow
short int m_readoutWindow
Expected readout window size calculated from the size of data handle key arrays, should be 1,...
Definition: MuonRoIByteStreamTool.h:83
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MuonRoIByteStreamTool::m_robIds
Gaudi::Property< std::vector< uint32_t > > m_robIds
Definition: MuonRoIByteStreamTool.h:71
MuonRoIByteStreamTool::MuonRoIByteStreamTool
MuonRoIByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MuonRoIByteStreamTool.cxx:67
LVL1MUCTPIPHASE1::L1TopoLUT
Definition: L1TopoLUT.h:41
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
MuonRoIByteStreamTool::m_doTopo
Gaudi::Property< bool > m_doTopo
Definition: MuonRoIByteStreamTool.h:73
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MuonRoIByteStreamTool::~MuonRoIByteStreamTool
virtual ~MuonRoIByteStreamTool() override=default
keylayer_zslicemap.slices
slices
Definition: keylayer_zslicemap.py:112
MuonRoIByteStreamTool::initialize
virtual StatusCode initialize() override
Definition: MuonRoIByteStreamTool.cxx:75