ATLAS Offline Software
Loading...
Searching...
No Matches
gFexByteStreamTool.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//***************************************************************************
6// gFexByteStreamTool - description
7// -------------------
8// begin : 20 07 2022
9// email : cecilia.tosciri@cern.ch
10// ***************************************************************************/
11
12#ifndef GFEXBYTESTREAMTOOL_H
13#define GFEXBYTESTREAMTOOL_H
14
15// Trigger includes
17
21
25#include "TrigConfData/L1Menu.h"
27
28// Athena includes
32
33// Gaudi includes
34#include "Gaudi/Property.h"
35
36// STL includes
37#include <array>
38
43class gFexByteStreamTool : public extends<AthAlgTool, IL1TriggerByteStreamTool> {
44 public:
45 gFexByteStreamTool(const std::string& type, const std::string& name, const IInterface* parent);
46 virtual ~gFexByteStreamTool() override = default;
47
48 // ------------------------- IAlgTool methods --------------------------------
49 virtual StatusCode initialize() override;
50 virtual StatusCode start() override;
51
52 // ------------------------- IL1TriggerByteStreamTool methods ----------------------
54 virtual StatusCode convertFromBS(const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vrobf, const EventContext& eventContext)const override;
55
57 virtual StatusCode convertToBS(std::vector<OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment*>& vrobf, const EventContext& eventContext) override;
58
60 virtual const std::vector<uint32_t>& robIds() const override {
61 return m_robIds.value();
62 }
63
64 private:
65 // ------------------------- Properties --------------------------------------
66 ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"};
67 bool m_UseMonitoring = false;
68
69
70 // ROBIDs property required by the interface
71 Gaudi::Property<std::vector<uint32_t>> m_robIds {this, "ROBIDs", {}, "List of ROB IDs required for conversion to/from xAOD RoI"};
72 Gaudi::Property<bool> m_saveExtendedTOBs {this, "SaveExtendedTOBs", false, "Decode and write xTOBs instead of TOBs"};
73
74 int m_gJ_scale = 0;
75 int m_gLJ_scale = 0;
76 int m_gXE_scale = 0;
77 int m_gTE_scale = 0;
78
79 // Write handle keys for the L1Calo EDMs for BS->xAOD mode of operation
80 SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexRhoWriteKey {this,"gFexRhoOutputContainerWriteKey","L1_gFexRhoRoI","Write gFEX EDM gFexRho container"};
81 SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexBlockWriteKey {this,"gFexSRJetOutputContainerWriteKey","L1_gFexSRJetRoI","Write gFEX EDM gFexBlock container"};
82 SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetWriteKey {this,"gFexLRJetOutputContainerWriteKey","L1_gFexLRJetRoI","Write gFEX EDM gFexJet container"};
83 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarEJwojWriteKey {this,"gScalarEJwojOutputContainerWriteKey","L1_gScalarEJwoj","Write gFEX EDM Scalar MET and SumET (JwoJ) container"};
84 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gEspressoWriteKey {this,"gEspressoOutputContainerWriteKey","L1_gEspresso","Write gFEX EDM gEspresso container"};
85 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsJwojWriteKey {this,"gMETComponentsJwojOutputContainerWriteKey","L1_gMETComponentsJwoj","Write gFEX EDM total MET components (JwoJ) container"};
86 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMHTComponentsJwojWriteKey {this,"gMHTComponentsJwojOutputContainerWriteKey","L1_gMHTComponentsJwoj","Write gFEX EDM hard MET components (JwoJ) container"};
87 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMSTComponentsJwojWriteKey {this,"gMSTComponentsJwojOutputContainerWriteKey","L1_gMSTComponentsJwoj","Write gFEX EDM soft MET components (JwoJ) container"};
88 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsNoiseCutWriteKey {this,"gMETComponentsNoiseCutOutputContainerWriteKey","L1_gMETComponentsNoiseCut","Write gFEX EDM total MET components (NoiseCut) container"};
89 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsRmsWriteKey {this,"gMETComponentsRmsOutputContainerWriteKey","L1_gMETComponentsRms","Write gFEX EDM total MET components (RMS) container"};
90 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarENoiseCutWriteKey {this,"gScalarENoiseCutOutputContainerWriteKey","L1_gScalarENoiseCut","Write gFEX EDM Scalar MET and SumET (NoiseCut) container"};
91 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarERmsWriteKey {this,"gScalarERmsOutputContainerWriteKey","L1_gScalarERms","Write gFEX EDM Scalar MET and SumET (RMS) container"};
92
93 // Multi-slice (out-of-time) write handle keys for Jet TOBs
94 SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexRhoSliceWriteKey {this,"gFexRhoSliceContainerWriteKey","","Write gFEX EDM gFexRho out-of-time container"};
95 SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexBlockSliceWriteKey {this,"gFexSRJetSliceContainerWriteKey","","Write gFEX EDM gFexBlock out-of-time container"};
96 SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetSliceWriteKey {this,"gFexLRJetSliceContainerWriteKey","","Write gFEX EDM gFexJet out-of-time container"};
97 // Multi-slice (out-of-time) write handle keys for Global TOBs
98 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarEJwojSliceWriteKey {this,"gScalarEJwojSliceContainerWriteKey","","Write gFEX EDM Scalar (JwoJ) out-of-time container"};
99 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsJwojSliceWriteKey{this,"gMETComponentsJwojSliceContainerWriteKey","","Write gFEX EDM MET (JwoJ) out-of-time container"};
100 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMHTComponentsJwojSliceWriteKey{this,"gMHTComponentsJwojSliceContainerWriteKey","","Write gFEX EDM MHT (JwoJ) out-of-time container"};
101 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMSTComponentsJwojSliceWriteKey{this,"gMSTComponentsJwojSliceContainerWriteKey","","Write gFEX EDM MST (JwoJ) out-of-time container"};
102 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gEspressoSliceWriteKey {this,"gEspressoSliceContainerWriteKey","","Write gFEX EDM gEspresso out-of-time container"};
103 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsNoiseCutSliceWriteKey{this,"gMETComponentsNoiseCutSliceContainerWriteKey","","Write gFEX EDM MET (NoiseCut) out-of-time container"};
104 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarENoiseCutSliceWriteKey {this,"gScalarENoiseCutSliceContainerWriteKey","","Write gFEX EDM Scalar (NoiseCut) out-of-time container"};
105 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsRmsSliceWriteKey {this,"gMETComponentsRmsSliceContainerWriteKey","","Write gFEX EDM MET (Rms) out-of-time container"};
106 SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarERmsSliceWriteKey {this,"gScalarERmsSliceContainerWriteKey","","Write gFEX EDM Scalar (Rms) out-of-time container"};
107
108 // Slice number decoration keys for out-of-time containers only
109 // L1A containers always contain slice 0, so decoration is redundant there
110 // Out-of-time containers mix TOBs from slices 1,2,3,... so decoration is needed to identify which BC
111 // Jet TOB decorations (out-of-time containers)
112 SG::WriteDecorHandleKey<xAOD::gFexJetRoIContainer> m_gFexRhoOOTDecorKey {this,"gFexRhoOOTDecorKey",m_gFexRhoSliceWriteKey,"sliceNumber","Slice number decoration for gFexRho out-of-time"};
113 SG::WriteDecorHandleKey<xAOD::gFexJetRoIContainer> m_gFexBlockOOTDecorKey {this,"gFexBlockOOTDecorKey",m_gFexBlockSliceWriteKey,"sliceNumber","Slice number decoration for gFexBlock out-of-time"};
114 SG::WriteDecorHandleKey<xAOD::gFexJetRoIContainer> m_gFexJetOOTDecorKey {this,"gFexJetOOTDecorKey",m_gFexJetSliceWriteKey,"sliceNumber","Slice number decoration for gFexJet out-of-time"};
115 // Global TOB decorations (out-of-time containers)
116 SG::WriteDecorHandleKey<xAOD::gFexGlobalRoIContainer> m_gScalarEJwojOOTDecorKey {this,"gScalarEJwojOOTDecorKey",m_gScalarEJwojSliceWriteKey,"sliceNumber","Slice number decoration for gScalarEJwoj out-of-time"};
117 SG::WriteDecorHandleKey<xAOD::gFexGlobalRoIContainer> m_gMETComponentsJwojOOTDecorKey {this,"gMETComponentsJwojOOTDecorKey",m_gMETComponentsJwojSliceWriteKey,"sliceNumber","Slice number decoration for gMETComponentsJwoj out-of-time"};
118 SG::WriteDecorHandleKey<xAOD::gFexGlobalRoIContainer> m_gMHTComponentsJwojOOTDecorKey {this,"gMHTComponentsJwojOOTDecorKey",m_gMHTComponentsJwojSliceWriteKey,"sliceNumber","Slice number decoration for gMHTComponentsJwoj out-of-time"};
119 SG::WriteDecorHandleKey<xAOD::gFexGlobalRoIContainer> m_gMSTComponentsJwojOOTDecorKey {this,"gMSTComponentsJwojOOTDecorKey",m_gMSTComponentsJwojSliceWriteKey,"sliceNumber","Slice number decoration for gMSTComponentsJwoj out-of-time"};
120 SG::WriteDecorHandleKey<xAOD::gFexGlobalRoIContainer> m_gEspressoOOTDecorKey {this,"gEspressoOOTDecorKey",m_gEspressoSliceWriteKey,"sliceNumber","Slice number decoration for gEspresso out-of-time"};
121 SG::WriteDecorHandleKey<xAOD::gFexGlobalRoIContainer> m_gMETComponentsNoiseCutOOTDecorKey{this,"gMETComponentsNoiseCutOOTDecorKey",m_gMETComponentsNoiseCutSliceWriteKey,"sliceNumber","Slice number decoration for gMETComponentsNoiseCut out-of-time"};
122 SG::WriteDecorHandleKey<xAOD::gFexGlobalRoIContainer> m_gScalarENoiseCutOOTDecorKey {this,"gScalarENoiseCutOOTDecorKey",m_gScalarENoiseCutSliceWriteKey,"sliceNumber","Slice number decoration for gScalarENoiseCut out-of-time"};
123 SG::WriteDecorHandleKey<xAOD::gFexGlobalRoIContainer> m_gMETComponentsRmsOOTDecorKey {this,"gMETComponentsRmsOOTDecorKey",m_gMETComponentsRmsSliceWriteKey,"sliceNumber","Slice number decoration for gMETComponentsRms out-of-time"};
124 SG::WriteDecorHandleKey<xAOD::gFexGlobalRoIContainer> m_gScalarERmsOOTDecorKey {this,"gScalarERmsOOTDecorKey",m_gScalarERmsSliceWriteKey,"sliceNumber","Slice number decoration for gScalarERms out-of-time"};
125
126 // Read handle keys for the L1Calo EDMs for xAOD->BS mode of operation
127 SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexRhoReadKey {this,"gFexRhoOutputContainerReadKey","L1_gFexRhoRoI","Read gFEX EDM gFexRho container"};
128 SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexBlockReadKey {this,"gFexSRJetOutputContainerReadKey","L1_gFexSRJetRoI","Read gFEX EDM gFexBlock container"};
129 SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetReadKey {this,"gFexLRJetOutputContainerReadKey","L1_gFexLRJetRoI","Read gFEX EDM gFexJet container"};
130 SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarEJwojReadKey {this,"gScalarEJwojOutputContainerReadKey","L1_gScalarEJwoj","Read gFEX EDM Scalar MET and SumET (JwoJ) container"};
131 SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gEspressoReadKey {this,"gEspressoOutputContainerReadKey","L1_gEspresso","Read gFEX EDM gEspresso container"};
132 SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsJwojReadKey {this,"gMETComponentsJwojOutputContainerReadKey","L1_gMETComponentsJwoj","Read gFEX EDM total MET components (JwoJ) container"};
133 SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMHTComponentsJwojReadKey {this,"gMHTComponentsJwojOutputContainerReadKey","L1_gMHTComponentsJwoj","Read gFEX EDM hard MET components (JwoJ) container"};
134 SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMSTComponentsJwojReadKey {this,"gMSTComponentsJwojOutputContainerReadKey","L1_gMSTComponentsJwoj","Read gFEX EDM soft MET components (JwoJ) container"};
135 SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsNoiseCutReadKey {this,"gMETComponentsNoiseCutOutputContainerReadKey","L1_gMETComponentsNoiseCut","Read gFEX EDM total MET components (NoiseCut) container"};
136 SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsRmsReadKey {this,"gMETComponentsRmsOutputContainerReadKey","L1_gMETComponentsRms","Read gFEX EDM total MET components (RMS) container"};
137 SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarENoiseCutReadKey {this,"gScalarENoiseCutOutputContainerReadKey","L1_gScalarENoiseCut","Read gFEX EDM Scalar MET and SumET (NoiseCut) container"};
138 SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarERmsReadKey {this,"gScalarERmsOutputContainerReadKey","L1_gScalarERms","Read gFEX EDM Scalar MET and SumET (RMS) container"};
139
140 //Read handle key for the L1Menu
141 SG::ReadHandleKey<TrigConf::L1Menu> m_l1MenuKey {this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu","Name of the L1Menu object to read configuration from"};
142
143 void decodeGfexTobSlice( const uint32_t dataArray[], uint32_t blockType) const;
144
145 void printError(const std::string& location, const std::string& title, MSG::Level type, const std::string& detail) const;
146
147 int16_t fillGlobal(const std::array<uint32_t, 3> &tob, const int type, SG::WriteHandle<xAOD::gFexGlobalRoIContainer> &container, uint32_t sliceNumber, int16_t scalar = -1) const;
148
149 static constexpr uint8_t m_DEBUG=0;
150 static constexpr uint8_t m_WARNING=1;
151 static constexpr uint8_t m_ERROR=2;
152 static constexpr uint8_t m_FATAL=3;
153
154};
155
156#endif // GFEXBYTESTREAMTOOL_H
void printError()
Header file to be included by clients of the Monitored infrastructure.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsRmsWriteKey
virtual StatusCode start() override
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsNoiseCutWriteKey
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexRhoReadKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMHTComponentsJwojReadKey
virtual StatusCode initialize() override
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarENoiseCutSliceWriteKey
static constexpr uint8_t m_FATAL
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarERmsSliceWriteKey
SG::WriteDecorHandleKey< xAOD::gFexGlobalRoIContainer > m_gMSTComponentsJwojOOTDecorKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarEJwojReadKey
Gaudi::Property< bool > m_saveExtendedTOBs
virtual StatusCode convertFromBS(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vrobf, const EventContext &eventContext) const override
BS->xAOD conversion.
SG::WriteDecorHandleKey< xAOD::gFexJetRoIContainer > m_gFexRhoOOTDecorKey
virtual const std::vector< uint32_t > & robIds() const override
Declare ROB IDs for conversion.
SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexRhoSliceWriteKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gEspressoSliceWriteKey
gFexByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
SG::ReadHandleKey< TrigConf::L1Menu > m_l1MenuKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsJwojReadKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMSTComponentsJwojSliceWriteKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsNoiseCutReadKey
SG::WriteDecorHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetOOTDecorKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMSTComponentsJwojWriteKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarERmsReadKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarEJwojSliceWriteKey
ToolHandle< GenericMonitoringTool > m_monTool
static constexpr uint8_t m_WARNING
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetReadKey
SG::WriteDecorHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarENoiseCutOOTDecorKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMHTComponentsJwojWriteKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMHTComponentsJwojSliceWriteKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsNoiseCutSliceWriteKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarENoiseCutWriteKey
int16_t fillGlobal(const std::array< uint32_t, 3 > &tob, const int type, SG::WriteHandle< xAOD::gFexGlobalRoIContainer > &container, uint32_t sliceNumber, int16_t scalar=-1) const
virtual StatusCode convertToBS(std::vector< OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment * > &vrobf, const EventContext &eventContext) override
xAOD->BS conversion
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gEspressoReadKey
SG::WriteDecorHandleKey< xAOD::gFexGlobalRoIContainer > m_gMHTComponentsJwojOOTDecorKey
SG::WriteDecorHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarERmsOOTDecorKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsJwojWriteKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsRmsReadKey
virtual ~gFexByteStreamTool() override=default
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexBlockReadKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarEJwojWriteKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMSTComponentsJwojReadKey
SG::WriteDecorHandleKey< xAOD::gFexJetRoIContainer > m_gFexBlockOOTDecorKey
SG::WriteDecorHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsRmsOOTDecorKey
SG::WriteDecorHandleKey< xAOD::gFexGlobalRoIContainer > m_gEspressoOOTDecorKey
Gaudi::Property< std::vector< uint32_t > > m_robIds
SG::WriteDecorHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarEJwojOOTDecorKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gEspressoWriteKey
SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetWriteKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarENoiseCutReadKey
SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexBlockWriteKey
void decodeGfexTobSlice(const uint32_t dataArray[], uint32_t blockType) const
static constexpr uint8_t m_ERROR
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarERmsWriteKey
SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexRhoWriteKey
SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetSliceWriteKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsJwojSliceWriteKey
SG::WriteDecorHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsNoiseCutOOTDecorKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsRmsSliceWriteKey
SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexBlockSliceWriteKey
SG::WriteDecorHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsJwojOOTDecorKey
static constexpr uint8_t m_DEBUG