ATLAS Offline Software
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 
18 #include "xAODTrigger/gFexJetRoI.h"
21 
25 #include "TrigConfData/L1Menu.h"
27 
28 // Athena includes
31 
32 // Gaudi includes
33 #include "Gaudi/Property.h"
34 
39 class gFexByteStreamTool : public extends<AthAlgTool, IL1TriggerByteStreamTool> {
40  public:
41  gFexByteStreamTool(const std::string& type, const std::string& name, const IInterface* parent);
42  virtual ~gFexByteStreamTool() override = default;
43 
44  // ------------------------- IAlgTool methods --------------------------------
45  virtual StatusCode initialize() override;
46  virtual StatusCode start() override;
47 
48  // ------------------------- IL1TriggerByteStreamTool methods ----------------------
50  virtual StatusCode convertFromBS(const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vrobf, const EventContext& eventContext)const override;
51 
53  virtual StatusCode convertToBS(std::vector<OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment*>& vrobf, const EventContext& eventContext) override;
54 
56  virtual const std::vector<uint32_t>& robIds() const override {
57  return m_robIds.value();
58  }
59 
60  private:
61  // ------------------------- Properties --------------------------------------
62  ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"};
63  bool m_UseMonitoring = false;
64 
65 
66  // ROBIDs property required by the interface
67  Gaudi::Property<std::vector<uint32_t>> m_robIds {this, "ROBIDs", {}, "List of ROB IDs required for conversion to/from xAOD RoI"};
68  Gaudi::Property<bool> m_saveExtendedTOBs {this, "SaveExtendedTOBs", false, "Decode and write xTOBs instead of TOBs"};
69 
70  int m_gJ_scale = 0;
71  int m_gLJ_scale = 0;
72  int m_gXE_scale = 0;
73  int m_gTE_scale = 0;
74 
75  // Write handle keys for the L1Calo EDMs for BS->xAOD mode of operation
76  SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexRhoWriteKey {this,"gFexRhoOutputContainerWriteKey","L1_gFexRhoRoI","Write gFEX EDM gFexRho container"};
77  SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexBlockWriteKey {this,"gFexSRJetOutputContainerWriteKey","L1_gFexSRJetRoI","Write gFEX EDM gFexBlock container"};
78  SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetWriteKey {this,"gFexLRJetOutputContainerWriteKey","L1_gFexLRJetRoI","Write gFEX EDM gFexJet container"};
79  SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarEJwojWriteKey {this,"gScalarEJwojOutputContainerWriteKey","L1_gScalarEJwoj","Write gFEX EDM Scalar MET and SumET (JwoJ) container"};
80  SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsJwojWriteKey {this,"gMETComponentsJwojOutputContainerWriteKey","L1_gMETComponentsJwoj","Write gFEX EDM total MET components (JwoJ) container"};
81  SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMHTComponentsJwojWriteKey {this,"gMHTComponentsJwojOutputContainerWriteKey","L1_gMHTComponentsJwoj","Write gFEX EDM hard MET components (JwoJ) container"};
82  SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMSTComponentsJwojWriteKey {this,"gMSTComponentsJwojOutputContainerWriteKey","L1_gMSTComponentsJwoj","Write gFEX EDM soft MET components (JwoJ) container"};
83  SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsNoiseCutWriteKey {this,"gMETComponentsNoiseCutOutputContainerWriteKey","L1_gMETComponentsNoiseCut","Write gFEX EDM total MET components (NoiseCut) container"};
84  SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsRmsWriteKey {this,"gMETComponentsRmsOutputContainerWriteKey","L1_gMETComponentsRms","Write gFEX EDM total MET components (RMS) container"};
85  SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarENoiseCutWriteKey {this,"gScalarENoiseCutOutputContainerWriteKey","L1_gScalarENoiseCut","Write gFEX EDM Scalar MET and SumET (NoiseCut) container"};
86  SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarERmsWriteKey {this,"gScalarERmsOutputContainerWriteKey","L1_gScalarERms","Write gFEX EDM Scalar MET and SumET (RMS) container"};
87 
88 
89  // Read handle keys for the L1Calo EDMs for xAOD->BS mode of operation
90  SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexRhoReadKey {this,"gFexRhoOutputContainerReadKey","L1_gFexRhoRoI","Read gFEX EDM gFexRho container"};
91  SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexBlockReadKey {this,"gFexSRJetOutputContainerReadKey","L1_gFexSRJetRoI","Read gFEX EDM gFexBlock container"};
92  SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetReadKey {this,"gFexLRJetOutputContainerReadKey","L1_gFexLRJetRoI","Read gFEX EDM gFexJet container"};
93  SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarEJwojReadKey {this,"gScalarEJwojOutputContainerReadKey","L1_gScalarEJwoj","Read gFEX EDM Scalar MET and SumET (JwoJ) container"};
94  SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsJwojReadKey {this,"gMETComponentsJwojOutputContainerReadKey","L1_gMETComponentsJwoj","Read gFEX EDM total MET components (JwoJ) container"};
95  SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMHTComponentsJwojReadKey {this,"gMHTComponentsJwojOutputContainerReadKey","L1_gMHTComponentsJwoj","Read gFEX EDM hard MET components (JwoJ) container"};
96  SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMSTComponentsJwojReadKey {this,"gMSTComponentsJwojOutputContainerReadKey","L1_gMSTComponentsJwoj","Read gFEX EDM soft MET components (JwoJ) container"};
97  SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsNoiseCutReadKey {this,"gMETComponentsNoiseCutOutputContainerReadKey","L1_gMETComponentsNoiseCut","Read gFEX EDM total MET components (NoiseCut) container"};
98  SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsRmsReadKey {this,"gMETComponentsRmsOutputContainerReadKey","L1_gMETComponentsRms","Read gFEX EDM total MET components (RMS) container"};
99  SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarENoiseCutReadKey {this,"gScalarENoiseCutOutputContainerReadKey","L1_gScalarENoiseCut","Read gFEX EDM Scalar MET and SumET (NoiseCut) container"};
100  SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarERmsReadKey {this,"gScalarERmsOutputContainerReadKey","L1_gScalarERms","Read gFEX EDM Scalar MET and SumET (RMS) container"};
101 
102  //Read handle key for the L1Menu
103  SG::ReadHandleKey<TrigConf::L1Menu> m_l1MenuKey {this, "L1TriggerMenu", "DetectorStore+L1TriggerMenu","Name of the L1Menu object to read configuration from"};
104 
105  void decodeGfexTobSlice( const uint32_t dataArray[], uint32_t blockType) const;
106 
107  void printError(const std::string& location, const std::string& title, MSG::Level type, const std::string& detail) const;
108 
109  int16_t fillGlobal(const std::vector<uint32_t> &tob, const int type, SG::WriteHandle<xAOD::gFexGlobalRoIContainer> &container, int16_t scalar = -1) const;
110 
111  static constexpr uint8_t m_DEBUG=0;
112  static constexpr uint8_t m_WARNING=1;
113  static constexpr uint8_t m_ERROR=2;
114  static constexpr uint8_t m_FATAL=3;
115 
116 };
117 
118 #endif // GFEXBYTESTREAMTOOL_H
gFexByteStreamTool::m_gScalarERmsReadKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarERmsReadKey
Definition: gFexByteStreamTool.h:100
gFexByteStreamTool::fillGlobal
int16_t fillGlobal(const std::vector< uint32_t > &tob, const int type, SG::WriteHandle< xAOD::gFexGlobalRoIContainer > &container, int16_t scalar=-1) const
Definition: gFexByteStreamTool.cxx:448
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
gFexByteStreamTool::m_gScalarENoiseCutWriteKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarENoiseCutWriteKey
Definition: gFexByteStreamTool.h:85
gFexGlobalRoIContainer.h
L1Topo::blockType
L1Topo::BlockTypes blockType(const uint32_t word, uint32_t offset=28, uint32_t size=0x0f)
Function to return the block type of a data word from L1Topo
Definition: BlockTypes.cxx:9
gFexByteStreamTool::m_gMETComponentsNoiseCutReadKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsNoiseCutReadKey
Definition: gFexByteStreamTool.h:97
gFexByteStreamTool::~gFexByteStreamTool
virtual ~gFexByteStreamTool() override=default
detail
Definition: extract_histogram_tag.cxx:14
IL1TriggerByteStreamTool.h
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
gFexGlobalRoI.h
gFexByteStreamTool::m_gScalarEJwojWriteKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarEJwojWriteKey
Definition: gFexByteStreamTool.h:79
xAOD::int16_t
setScaleOne setStatusOne setSaturated int16_t
Definition: gFexGlobalRoI_v1.cxx:55
gFexByteStreamTool::m_gMHTComponentsJwojWriteKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMHTComponentsJwojWriteKey
Definition: gFexByteStreamTool.h:81
gFexByteStreamTool::m_gMETComponentsNoiseCutWriteKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsNoiseCutWriteKey
Definition: gFexByteStreamTool.h:83
gFexJetRoIAuxContainer.h
gFexByteStreamTool::m_saveExtendedTOBs
Gaudi::Property< bool > m_saveExtendedTOBs
Definition: gFexByteStreamTool.h:68
gFexByteStreamTool::m_gFexBlockReadKey
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexBlockReadKey
Definition: gFexByteStreamTool.h:91
gFexByteStreamTool::convertToBS
virtual StatusCode convertToBS(std::vector< OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment * > &vrobf, const EventContext &eventContext) override
xAOD->BS conversion
Definition: gFexByteStreamTool.cxx:515
gFexByteStreamTool::m_gFexRhoWriteKey
SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexRhoWriteKey
Definition: gFexByteStreamTool.h:76
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
gFexJetRoIContainer.h
gFexByteStreamTool::decodeGfexTobSlice
void decodeGfexTobSlice(const uint32_t dataArray[], uint32_t blockType) const
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
gFexByteStreamTool::m_gFexBlockWriteKey
SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexBlockWriteKey
Definition: gFexByteStreamTool.h:77
gFexByteStreamTool::m_gXE_scale
int m_gXE_scale
Definition: gFexByteStreamTool.h:72
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
covarianceTool.title
title
Definition: covarianceTool.py:542
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
gFexByteStreamTool::m_FATAL
static constexpr uint8_t m_FATAL
Definition: gFexByteStreamTool.h:114
gFexByteStreamTool::robIds
virtual const std::vector< uint32_t > & robIds() const override
Declare ROB IDs for conversion.
Definition: gFexByteStreamTool.h:56
gFexByteStreamTool::m_gFexJetReadKey
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetReadKey
Definition: gFexByteStreamTool.h:92
gFexByteStreamTool::m_gMHTComponentsJwojReadKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMHTComponentsJwojReadKey
Definition: gFexByteStreamTool.h:95
gFexByteStreamTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: gFexByteStreamTool.h:62
gFexByteStreamTool::m_DEBUG
static constexpr uint8_t m_DEBUG
Definition: gFexByteStreamTool.h:111
gFexByteStreamTool::m_l1MenuKey
SG::ReadHandleKey< TrigConf::L1Menu > m_l1MenuKey
Definition: gFexByteStreamTool.h:103
gFexByteStreamTool::m_gFexRhoReadKey
SG::ReadHandleKey< xAOD::gFexJetRoIContainer > m_gFexRhoReadKey
Definition: gFexByteStreamTool.h:90
gFexByteStreamTool::convertFromBS
virtual StatusCode convertFromBS(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vrobf, const EventContext &eventContext) const override
BS->xAOD conversion.
Definition: gFexByteStreamTool.cxx:158
gFexByteStreamTool::printError
void printError(const std::string &location, const std::string &title, MSG::Level type, const std::string &detail) const
Definition: gFexByteStreamTool.cxx:522
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
gFexByteStreamTool::m_gFexJetWriteKey
SG::WriteHandleKey< xAOD::gFexJetRoIContainer > m_gFexJetWriteKey
Definition: gFexByteStreamTool.h:78
gFexByteStreamTool
Definition: gFexByteStreamTool.h:39
gFexByteStreamTool::m_gTE_scale
int m_gTE_scale
Definition: gFexByteStreamTool.h:73
gFexByteStreamTool::m_gLJ_scale
int m_gLJ_scale
Definition: gFexByteStreamTool.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
gFexByteStreamTool::m_ERROR
static constexpr uint8_t m_ERROR
Definition: gFexByteStreamTool.h:113
gFexJetRoI.h
gFexByteStreamTool::m_gMETComponentsRmsWriteKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsRmsWriteKey
Definition: gFexByteStreamTool.h:84
gFexByteStreamTool::m_WARNING
static constexpr uint8_t m_WARNING
Definition: gFexByteStreamTool.h:112
gFexByteStreamTool::gFexByteStreamTool
gFexByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: gFexByteStreamTool.cxx:24
gFexByteStreamTool::m_gMSTComponentsJwojReadKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMSTComponentsJwojReadKey
Definition: gFexByteStreamTool.h:96
gFexByteStreamTool::m_robIds
Gaudi::Property< std::vector< uint32_t > > m_robIds
Definition: gFexByteStreamTool.h:67
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
gFexByteStreamTool::initialize
virtual StatusCode initialize() override
Definition: gFexByteStreamTool.cxx:29
gFexByteStreamTool::m_gScalarERmsWriteKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarERmsWriteKey
Definition: gFexByteStreamTool.h:86
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
gFexByteStreamTool::m_UseMonitoring
bool m_UseMonitoring
Definition: gFexByteStreamTool.h:63
gFexByteStreamTool::m_gMETComponentsRmsReadKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsRmsReadKey
Definition: gFexByteStreamTool.h:98
gFexByteStreamTool::m_gMSTComponentsJwojWriteKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMSTComponentsJwojWriteKey
Definition: gFexByteStreamTool.h:82
gFexByteStreamTool::m_gMETComponentsJwojWriteKey
SG::WriteHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsJwojWriteKey
Definition: gFexByteStreamTool.h:80
L1Menu.h
gFexByteStreamTool::m_gMETComponentsJwojReadKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gMETComponentsJwojReadKey
Definition: gFexByteStreamTool.h:94
gFexByteStreamTool::m_gScalarEJwojReadKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarEJwojReadKey
Definition: gFexByteStreamTool.h:93
gFexByteStreamTool::m_gScalarENoiseCutReadKey
SG::ReadHandleKey< xAOD::gFexGlobalRoIContainer > m_gScalarENoiseCutReadKey
Definition: gFexByteStreamTool.h:99
gFexGlobalRoIAuxContainer.h
gFexByteStreamTool::m_gJ_scale
int m_gJ_scale
Definition: gFexByteStreamTool.h:70
gFexByteStreamTool::start
virtual StatusCode start() override
Definition: gFexByteStreamTool.cxx:128
L1ThrExtraInfo.h