ATLAS Offline Software
HLTResultMTMaker.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 TRIGOUTPUTHANDLING_HLTRESULTMTMAKER_H
6 #define TRIGOUTPUTHANDLING_HLTRESULTMTMAKER_H
7 
8 // Trigger includes
11 
12 // Athena includes
16 #include "StoreGate/ReadHandle.h"
17 #include "StoreGate/WriteHandle.h"
19 
20 // Gaudi includes
21 #include "Gaudi/Interfaces/IOptionsSvc.h"
22 
23 // System includes
24 #include <atomic>
25 
29 class HLTResultMTMaker : public AthAlgTool {
30 public:
32  HLTResultMTMaker(const std::string& type, const std::string& name, const IInterface* parent);
34  virtual ~HLTResultMTMaker() override = default;
35 
36  // ------------------------- IStateful methods -------------------------------
37  virtual StatusCode initialize() override;
38  virtual StatusCode start() override;
39  virtual StatusCode finalize() override;
40 
41  // ------------------------- Specific methods of this tool -------------------
43  StatusCode makeResult(const EventContext& eventContext) const;
45  StatusCode fillResult(HLT::HLTResultMT& hltResult, const EventContext& eventContext) const;
47  const std::string& resultName() const {return m_hltResultWHKey.key();}
48 
49 private:
50  // ------------------------- Methods -----------------------------------------
52  void validatePEBInfo(HLT::HLTResultMT& hltResult) const;
55 
56  // ------------------------- Properties --------------------------------------
59  this, "HLTResultWHKey", "HLTResultMT",
60  "Key of the output HLTResultMT object"
61  };
64  this, "HLTRuntimeMetadataWHKey", "HLT_RuntimeMetadata",
65  "Key of the output with additional runtime metadata" };
68  this, "ByteStreamMetadataRHKey", "InputMetaDataStore+ByteStreamMetadata",
69  "Key of the ByteStreamMetadataContainer to retrieve the detector mask"
70  };
72  ToolHandle<HLTResultMTMakerTool> m_streamTagMaker {
73  this, "StreamTagMaker", "",
74  "Tool creating stream tags (defines if event is accepted)"
75  };
77  ToolHandleArray<HLTResultMTMakerTool> m_makerTools {
78  this, "MakerTools", {},
79  "Set of additional tools that fill content of the HLTResultMT"
80  };
82  ToolHandle<GenericMonitoringTool> m_monTool {
83  this, "MonTool", "",
84  "Monitoring tool"
85  };
88  this, "JobOptionsSvc", "JobOptionsSvc",
89  "Job options service to retrieve DataFlowConfig"
90  };
92  Gaudi::Property<std::vector<uint32_t>> m_extraEnabledROBs {
93  this, "ExtraEnabledROBs", {},
94  "Extra ROBs which can be requested in a stream tag, but are not part of the ROS-ROB map"
95  };
97  Gaudi::Property<std::vector<uint32_t>> m_extraROBs {
98  this, "ExtraROBs", {},
99  "Same as ExtraEnabledROBs but checked against detector mask and dropped if SubDet is masked out"
100  };
102  Gaudi::Property<std::vector<uint32_t>> m_extraEnabledSubDets {
103  this, "ExtraEnabledSubDets", {},
104  "Extra SubDets which can be requested in a stream tag, but are not part of the ROS-ROB map"
105  };
107  Gaudi::Property<std::vector<uint32_t>> m_extraSubDets {
108  this, "ExtraSubDets", {},
109  "Same as ExtraEnabledSubDets but checked against detector mask and dropped if SubDet is masked out"
110  };
111 
112  // ------------------------- Other private members ---------------------------
114  std::set<uint32_t> m_enabledROBs;
116  std::set<eformat::SubDetector> m_enabledSubDets;
118  bool m_skipValidatePEBInfo {false};
120  mutable std::atomic_bool m_emptyPEBInfoErrorPrinted{false};
121 };
122 
123 #endif // TRIGOUTPUTHANDLING_HLTRESULTMTMAKER_H
HLTResultMTMaker::m_enabledSubDets
std::set< eformat::SubDetector > m_enabledSubDets
List of enabled SubDets retrieved during initialisation.
Definition: HLTResultMTMaker.h:116
HLTResultMTMaker::m_skipValidatePEBInfo
bool m_skipValidatePEBInfo
If true, don't call validatePEBInfo.
Definition: HLTResultMTMaker.h:118
HLTResultMTMaker::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Monitoring tool.
Definition: HLTResultMTMaker.h:82
HLTResultMTMaker::m_extraEnabledROBs
Gaudi::Property< std::vector< uint32_t > > m_extraEnabledROBs
Extra enabled ROBs.
Definition: HLTResultMTMaker.h:92
HLTResultMTMaker::m_enabledROBs
std::set< uint32_t > m_enabledROBs
List of enabled ROBs retrieved during initialisation.
Definition: HLTResultMTMaker.h:114
HLTResultMTMaker::finalize
virtual StatusCode finalize() override
Definition: HLTResultMTMaker.cxx:131
ByteStreamMetadataContainer.h
This file contains the class definition for the ByteStreamMetadataContainer class.
HLTResultMTMaker::m_extraROBs
Gaudi::Property< std::vector< uint32_t > > m_extraROBs
Extra enabled ROBs checked against detector mask.
Definition: HLTResultMTMaker.h:97
HLTResultMTMaker::resultName
const std::string & resultName() const
Return name of the HLTResultMT.
Definition: HLTResultMTMaker.h:47
HLT::HLTResultMT
A container class for data required to build online output from HLT.
Definition: HLTResultMT.h:38
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
SG::ReadHandleKey< ByteStreamMetadataContainer >
HLTResultMTMaker::m_jobOptionsSvc
ServiceHandle< Gaudi::Interfaces::IOptionsSvc > m_jobOptionsSvc
Handle to JobOptionsSvc used to retrieve the DataFlowConfig property.
Definition: HLTResultMTMaker.h:87
HLTResultMTMaker::~HLTResultMTMaker
virtual ~HLTResultMTMaker() override=default
Standard destructor.
HLTResultMTMaker
Tool to create the HLTResultMT at the end of each event.
Definition: HLTResultMTMaker.h:29
HLTResultMTMaker::m_streamTagMaker
ToolHandle< HLTResultMTMakerTool > m_streamTagMaker
Tool creating stream tags (defines if event is accepted)
Definition: HLTResultMTMaker.h:72
WriteHandle.h
Handle class for recording to StoreGate.
GenericMonitoringTool.h
SG::WriteHandleKey< HLT::HLTResultMT >
HLTResultMTMaker::m_hltResultWHKey
SG::WriteHandleKey< HLT::HLTResultMT > m_hltResultWHKey
StoreGate key for the HLTResultMT.
Definition: HLTResultMTMaker.h:58
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
HLTResultMTMaker::m_bsMetaDataContRHKey
SG::ReadHandleKey< ByteStreamMetadataContainer > m_bsMetaDataContRHKey
StoreGate key for the ByteStreamMetadata container to retrieve detector mask.
Definition: HLTResultMTMaker.h:67
AthAlgTool.h
HLTResultMTMaker::m_extraSubDets
Gaudi::Property< std::vector< uint32_t > > m_extraSubDets
Extra enabled SubDets checked against detector mask.
Definition: HLTResultMTMaker.h:107
test_pyathena.parent
parent
Definition: test_pyathena.py:15
HLTResultMTMakerTool.h
HLTResultMTMaker::makeResult
StatusCode makeResult(const EventContext &eventContext) const
Create and fill a new HLTResultMT, and record it in the event store.
Definition: HLTResultMTMaker.cxx:139
HLTResultMTMaker::initialize
virtual StatusCode initialize() override
Definition: HLTResultMTMaker.cxx:64
HLTResultMTMaker::validatePEBInfo
void validatePEBInfo(HLT::HLTResultMT &hltResult) const
Check ROB and SubDet lists in StreamTags and remove those which are disabled.
Definition: HLTResultMTMaker.cxx:194
TrigCompositeContainer.h
HLTResultMTMaker::m_runtimeMetadataWHKey
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_runtimeMetadataWHKey
StoreGate key for HLT Runtime Metadata container.
Definition: HLTResultMTMaker.h:63
HLTResultMTMaker::m_extraEnabledSubDets
Gaudi::Property< std::vector< uint32_t > > m_extraEnabledSubDets
Extra enabled SubDets.
Definition: HLTResultMTMaker.h:102
HLTResultMTMaker::m_makerTools
ToolHandleArray< HLTResultMTMakerTool > m_makerTools
Tools filling the HLTResultMT object.
Definition: HLTResultMTMaker.h:77
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
HLTResultMTMaker::HLTResultMTMaker
HLTResultMTMaker(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition: HLTResultMTMaker.cxx:58
HLTResultMT.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
HLTResultMTMaker::start
virtual StatusCode start() override
Definition: HLTResultMTMaker.cxx:80
ReadHandle.h
Handle class for reading from StoreGate.
AthAlgTool
Definition: AthAlgTool.h:26
HLTResultMTMaker::m_emptyPEBInfoErrorPrinted
std::atomic_bool m_emptyPEBInfoErrorPrinted
Flag if empty PEB list error was already printed.
Definition: HLTResultMTMaker.h:120
HLTResultMTMaker::fillResult
StatusCode fillResult(HLT::HLTResultMT &hltResult, const EventContext &eventContext) const
Fill an existing HLTResultMT with event information.
Definition: HLTResultMTMaker.cxx:150
HLTResultMTMaker::validateExtraROBsAndSubDets
StatusCode validateExtraROBsAndSubDets()
Check ExtraROBs and ExtraSubDets against the detector mask and drop the masked out IDs.
Definition: HLTResultMTMaker.cxx:255
ServiceHandle< Gaudi::Interfaces::IOptionsSvc >