|
ATLAS Offline Software
|
Makes stream tags out of chain decisions.
More...
#include <StreamTagMakerTool.h>
|
using | StreamTagInfo = std::tuple< std::string, std::string, bool, bool > |
| Type describing StreamTag information needed by the tool: {name, type, obeysLumiBlock, forceFullEventBuilding}. More...
|
|
Makes stream tags out of chain decisions.
Definition at line 25 of file StreamTagMakerTool.h.
◆ StreamTagInfo
Type describing StreamTag information needed by the tool: {name, type, obeysLumiBlock, forceFullEventBuilding}.
Definition at line 36 of file StreamTagMakerTool.h.
◆ StreamTagMakerTool()
StreamTagMakerTool::StreamTagMakerTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~StreamTagMakerTool()
virtual StreamTagMakerTool::~StreamTagMakerTool |
( |
| ) |
|
|
overridevirtualdefault |
◆ fill()
Definition at line 96 of file StreamTagMakerTool.cxx.
100 if (!chainsHandle.isValid()) {
101 SmartIF<IAlgExecStateSvc> aess = svcLoc()->service<IAlgExecStateSvc>(
"AlgExecStateSvc",
false);
102 if (aess.isValid() && aess->eventStatus(ctx) != EventStatus::Success) {
104 return StatusCode::SUCCESS;
107 return StatusCode::FAILURE;
113 if (passNode==
nullptr) {
115 return StatusCode::FAILURE;
118 return StatusCode::SUCCESS;
124 if (passRawIDs.empty()) {
126 return StatusCode::SUCCESS;
133 std::unordered_map<unsigned int, PEBInfoWriterToolBase::PEBInfo> chainToPEBInfo;
145 return StatusCode::FAILURE;
148 const std::vector<StreamTagInfo>&
streams = mappingIter->second;
150 const auto& [st_name, st_type, obeysLB, forceFullEvent] = streamTagInfo;
152 <<
" (obeysLB=" << obeysLB <<
", forceFullEvent=" << forceFullEvent <<
")");
155 if (st_type ==
"express") {
156 const auto activeExpress =
std::find(passExpressIDs.begin(), passExpressIDs.end(),
chain);
158 if (activeExpress == passExpressIDs.end())
continue;
161 std::set<uint32_t>
robs;
162 std::set<eformat::SubDetector> subdets;
163 if (!forceFullEvent) {
164 auto it = chainToPEBInfo.find(
chain);
165 if (
it != chainToPEBInfo.end()) {
170 for (
const uint32_t subdetid :
it->second.subdets) {
171 subdets.insert(
static_cast<eformat::SubDetector
>( subdetid & 0xFF ));
176 eformat::helper::StreamTag streamTag(st_name, st_type, obeysLB,
robs, subdets);
182 return StatusCode::SUCCESS;
◆ fillPEBInfoMap()
Helper method to fill the chainID->PEBInfo map.
Definition at line 187 of file StreamTagMakerTool.cxx.
191 if (not handle.isValid()) {
202 ATH_MSG_DEBUG(
"No chain passed for this decision object, skip retrieving PEB info");
205 std::vector<uint32_t>
robs;
206 std::vector<uint32_t> subdets;
208 ATH_MSG_DEBUG(
"Retrieved a list of " <<
robs.size() <<
" ROBs for this decision");
212 <<
key.key() <<
", decision " << *
d);
213 return StatusCode::FAILURE;
216 ATH_MSG_DEBUG(
"Retrieved a list of " << subdets.size() <<
" SubDets for this decision");
220 <<
key.key() <<
", decision " << *
d);
221 return StatusCode::FAILURE;
224 for (
const unsigned int id :
ids) {
230 pebi.
subdets.insert(subdets.begin(),subdets.end());
233 ATH_MSG_ERROR(
"Empty PEB info for decision container " <<
key.key() <<
", decision " << *
d);
234 return StatusCode::FAILURE;
239 return StatusCode::SUCCESS;
◆ initialize()
StatusCode StreamTagMakerTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ start()
StatusCode StreamTagMakerTool::start |
( |
| ) |
|
|
overridevirtual |
Definition at line 39 of file StreamTagMakerTool.cxx.
42 if( ! hltMenu.isValid() ) {
43 ATH_MSG_FATAL(
"Failed to get the HLT menu from the DetectorStore");
44 return StatusCode::FAILURE;
47 ATH_MSG_INFO(
"Configuring from HLTMenu from DetStore with " << hltMenu->size() <<
" chains");
49 std::vector<TrigConf::DataStructure> allStreams = hltMenu->streams();
50 ATH_MSG_INFO(
"Menu has " << allStreams.size() <<
" streams defined");
51 std::map<std::string, StreamTagInfo> streamDictionary;
52 ATH_MSG_DEBUG(
"StreamTags [Name,type,obeyLB,forceFullEventBuilding]:");
55 std::string stream_name =
stream.getAttribute(
"name");
56 std::string stream_type =
stream.getAttribute(
"type");
57 std::string_view obeyLB =
stream.getAttribute(
"obeyLB");
58 std::string_view fullEventBuild =
stream.getAttribute(
"forceFullEventBuilding");
63 fullEventBuild ==
"true"
66 streamDictionary.insert(std::pair<std::string, StreamTagInfo>(
stream.getAttribute(
"name"),streamTag));
68 ATH_MSG_ERROR(
"Failure reading stream tag configuration from JSON: " << ex.what());
69 return StatusCode::FAILURE;
77 return StatusCode::FAILURE;
83 if (
const auto streamIt = streamDictionary.find(
stream); streamIt != streamDictionary.end()) {
87 return StatusCode::FAILURE;
91 return StatusCode::SUCCESS;
◆ m_finalChainDecisions
Initial value:{this, "ChainDecisions", "HLTNav_Summary",
"Container with final chain decisions" }
Definition at line 41 of file StreamTagMakerTool.h.
◆ m_hltMenuKey
◆ m_mapping
◆ m_pebDecisionKeys
Initial value:{this, "PEBDecisionKeys", {},
"Decisions including PEBInfo" }
Definition at line 44 of file StreamTagMakerTool.h.
The documentation for this class was generated from the following files:
const std::vector< eformat::helper::StreamTag > & getStreamTags() const
Const-getter for stream tags.
std::string find(const std::string &s)
return a remapped string
const std::string & summaryPassExpressNodeName()
TrigCompositeUtils::DecisionID numeric() const
numeric ID
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
StatusCode addStreamTag(const eformat::helper::StreamTag &streamTag)
Append one stream tag to the stored list.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Class used to describe composite objects in the HLT.
Base class for Trigger configuration data and wrapper around underlying representation.
const std::string & summaryPassNodeName()
bool isLegId(const HLT::Identifier &legIdentifier)
Recognise whether the chain ID is a leg ID.
std::set< DecisionID > DecisionIDContainer
#define ATH_MSG_WARNING(x)
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
std::string name() const
reports human redable name if it is enabled or, empty string
const Decision * getNodeByName(const DecisionContainer &container, const std::string &nodeName)
Returns the navigation node with a given name from a collection or nullptr if missing.
HLT::Identifier getIDFromLeg(const HLT::Identifier &legIdentifier)
Generate the HLT::Identifier which corresponds to the chain name from the leg name.