ATLAS Offline Software
eFexByteStreamTool.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 // eFexByteStreamTool - description
7 // -------------------
8 // begin : 11 05 2022
9 // email : will@cern.ch
10 // ***************************************************************************/
11 
12 #ifndef EFEXBYTESTREAMTOOL_H
13 #define EFEXBYTESTREAMTOOL_H
14 
15 
16 
17 // Trigger includes
19 
20 // Athena includes
22 
25 
27 
30 
32 
33 // Gaudi includes
34 #include "Gaudi/Property.h"
35 
40 class eFexByteStreamTool : public extends<AthAlgTool, IL1TriggerByteStreamTool> {
41  public:
42  eFexByteStreamTool(const std::string& type, const std::string& name, const IInterface* parent);
43  virtual ~eFexByteStreamTool() override = default;
44 
45  // ------------------------- IAlgTool methods --------------------------------
46  virtual StatusCode initialize() 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  ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"};
62 
65  public:
66  MonitoredLogging(ToolHandle<GenericMonitoringTool> tool) : m_monTool(tool) { }
67  virtual ~MonitoredLogging() = default;
68  virtual void err(const std::string& location, const std::string& title, const std::string& detail) const override;
69  ToolHandle<GenericMonitoringTool> m_monTool;
70  };
71 
72  // ------------------------- Properties --------------------------------------
73  // ROBIDs property required by the interface
74  Gaudi::Property<std::vector<uint32_t>> m_robIds {this, "ROBIDs", {}, "List of ROB IDs required for conversion to/from xAOD RoI"};
75 
76  // Only write keys should be set to non-empty string in python configuration if the tool is in BS->xAOD mode of operation
77  // Note that these are the keys for the triggered time slice. In multi-slice mode data from crossings
78  // before or after this will be stored in separate containers whose keys have the suffix "OutOfTime"
80  this, "eEMContainerWriteKey", "", "Write handle key to eEM TOB container for conversion from ByteStream"};
82  this, "eTAUContainerWriteKey", "", "Write handle key to eTAU TOB container for conversion from ByteStream"};
84  this, "eEMxContainerWriteKey", "", "Write handle key to eEM xTOB container for conversion from ByteStream"};
86  this, "eTAUxContainerWriteKey", "", "Write handle key to eTAU xTOB container for conversion from ByteStream"};
87  // Additional keys for multi-slice TOB readout
88  // Only decoding is implemented, encoding is not needed because simulation does not provide out-of time TOBs
90  this, "eEMSliceContainerWriteKey", "", "Write handle key to eEM TOB out-of-time container for conversion from ByteStream"};
92  this, "eTAUSliceContainerWriteKey", "", "Write handle key to eTAU TOB out-of-time container for conversion from ByteStream"};
93  // inputs (eTowers)
95  this, "eTowerContainerWriteKey", "", "Write handle key to ETower container for conversion from ByteStream"};
96 
97  // Only read keys should be set to non-empty string in python configuration if the tool is in xAOD->BS mode of operation
99  this, "eEMContainerReadKey", "", "Read handle key to eEM (x)TOB container for conversion to ByteStream"};
101  this, "eTAUContainerReadKey", "", "Read handle key to eTAU (x)TOB container for conversion to ByteStream"};
102 
103 
104 
105 
106 
107  std::unique_ptr<L1CaloBsDecoderRun3> m_decoder;
108 
109 };
110 
111 #endif // EFEXBYTESTREAMTOOL_H
eFexByteStreamTool::~eFexByteStreamTool
virtual ~eFexByteStreamTool() override=default
eFexByteStreamTool::m_decoder
std::unique_ptr< L1CaloBsDecoderRun3 > m_decoder
Definition: eFexByteStreamTool.h:107
eFexByteStreamTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: eFexByteStreamTool.h:61
eFexTowerContainer.h
L1CaloBsDecoderRun3::Logging
Interface class for logging, can be overriden to e.g.
Definition: L1CaloBsDecoderRun3.h:31
eFexByteStreamTool::MonitoredLogging::~MonitoredLogging
virtual ~MonitoredLogging()=default
eFexTauRoIContainer.h
eFexByteStreamTool::MonitoredLogging
Create a class to override logging interface in underlying decoder tool.
Definition: eFexByteStreamTool.h:64
detail
Definition: extract_histogram_tag.cxx:14
IL1TriggerByteStreamTool.h
eFexByteStreamTool::m_eTAUxWriteKey
SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eTAUxWriteKey
Definition: eFexByteStreamTool.h:85
eFexByteStreamTool::m_eTAUSliceWriteKey
SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eTAUSliceWriteKey
Definition: eFexByteStreamTool.h:91
eFexByteStreamTool::m_eTAUWriteKey
SG::WriteHandleKey< xAOD::eFexTauRoIContainer > m_eTAUWriteKey
Definition: eFexByteStreamTool.h:81
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
eFexByteStreamTool
Definition: eFexByteStreamTool.h:40
eFexByteStreamTool::initialize
virtual StatusCode initialize() override
Definition: eFexByteStreamTool.cxx:50
eFexByteStreamTool::convertFromBS
virtual StatusCode convertFromBS(const std::vector< const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment * > &vrobf, const EventContext &eventContext) const override
BS->xAOD conversion.
Definition: eFexByteStreamTool.cxx:97
eFexByteStreamTool::MonitoredLogging::err
virtual void err(const std::string &location, const std::string &title, const std::string &detail) const override
Definition: eFexByteStreamTool.cxx:84
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
eFexByteStreamTool::m_eTowerWriteKey
SG::WriteHandleKey< xAOD::eFexTowerContainer > m_eTowerWriteKey
Definition: eFexByteStreamTool.h:94
eFexByteStreamTool::m_eEMSliceWriteKey
SG::WriteHandleKey< xAOD::eFexEMRoIContainer > m_eEMSliceWriteKey
Definition: eFexByteStreamTool.h:89
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
eFexByteStreamTool::m_eEMxWriteKey
SG::WriteHandleKey< xAOD::eFexEMRoIContainer > m_eEMxWriteKey
Definition: eFexByteStreamTool.h:83
python.sizes.location
string location
Definition: sizes.py:11
covarianceTool.title
title
Definition: covarianceTool.py:542
eFexByteStreamTool::MonitoredLogging::MonitoredLogging
MonitoredLogging(ToolHandle< GenericMonitoringTool > tool)
Definition: eFexByteStreamTool.h:66
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
L1CaloBsDecoderRun3.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
eFexByteStreamTool::m_eTAUReadKey
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eTAUReadKey
Definition: eFexByteStreamTool.h:100
eFexByteStreamTool::robIds
virtual const std::vector< uint32_t > & robIds() const override
Declare ROB IDs for conversion.
Definition: eFexByteStreamTool.h:56
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
eFexByteStreamTool::MonitoredLogging::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: eFexByteStreamTool.h:69
L1CaloRdoEfexTob.h
eFexByteStreamTool::m_eEMReadKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eEMReadKey
Definition: eFexByteStreamTool.h:98
eFexByteStreamTool::m_eEMWriteKey
SG::WriteHandleKey< xAOD::eFexEMRoIContainer > m_eEMWriteKey
Definition: eFexByteStreamTool.h:79
eFexByteStreamTool::eFexByteStreamTool
eFexByteStreamTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: eFexByteStreamTool.cxx:45
eFexByteStreamTool::convertToBS
virtual StatusCode convertToBS(std::vector< OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment * > &vrobf, const EventContext &eventContext) override
xAOD->BS conversion
Definition: eFexByteStreamTool.cxx:260
eFexEMRoIContainer.h
eFexByteStreamTool::m_robIds
Gaudi::Property< std::vector< uint32_t > > m_robIds
Definition: eFexByteStreamTool.h:74