ATLAS Offline Software
Loading...
Searching...
No Matches
AlgToChainTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TrigCompositeUtils_AlgToChainTool_h
6#define TrigCompositeUtils_AlgToChainTool_h
7
8#ifndef XAOD_STANDALONE
9
10#include <string>
11#include <set>
12#include <vector>
13#include <map>
14
18
19
20namespace TrigCompositeUtils {
21
25
26 class AlgToChainTool : public AthAlgTool {
27 public:
28 // Helper struct to save chain info
29 struct ChainInfo {
31 std::string name;
32 std::vector<std::string> groups;
34 };
35
36 AlgToChainTool(const std::string& type, const std::string& name, const IInterface* parent);
37
38 virtual ~AlgToChainTool();
39
40 virtual StatusCode initialize() override;
41
42 virtual StatusCode start() override;
43
45 std::vector<std::string> getChainsForAlg(const std::string& algorithmName) const;
46
48 std::set<std::string> getActiveChainsForAlg(const std::string& algorithmName, const EventContext& context) const;
49
51 StatusCode getChainsForAllAlgs(const EventContext& context, std::map<std::string, std::set<std::string>>& algToChain) const;
52
54 std::set<TrigCompositeUtils::DecisionID> retrieveActiveChains(const EventContext& context, const std::string& collectionName = "") const;
55
57 StatusCode getAllChains(std::vector<TrigConf::Chain>&) const;
58
60 StatusCode getChainInfo(const EventContext& context, TrigCompositeUtils::DecisionID id, ChainInfo& info) const;
61
63 StatusCode getAllActiveSequences(const EventContext& context, std::map<std::string, std::string>& algToSeq);
64
66 void cacheSGKeys(const EventContext& context);
67
68 private:
69 SG::ReadHandle<TrigCompositeUtils::DecisionContainer> getDecisionFromStore(SmartIF<SGImplSvc>& eventStore, const std::string& key) const;
70
71 SG::ReadHandleKey<TrigConf::HLTMenu> m_HLTMenuKey{ this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu" };
72
73 std::map<std::string, std::vector<TrigConf::Chain>> m_sequencerToChainMap;
74 std::map<std::string, std::vector<std::string>> m_algToSequencersMap;
75
76 std::vector<std::string> m_cachedEventStoreKeys;
77 uint64_t m_cachedEventID{};
78
79 // Based on the sequence name create the first part of the name of collection from the decision store
80 std::string createCollectionName(const std::string& sequenceName) const;
81
83 std::vector<std::string> readSGKeys(const EventContext& context) const;
84
86 std::set<TrigCompositeUtils::DecisionID> retrieveActiveChainsForKeys(const EventContext& context, const std::string& collectionName, const std::vector<std::string>& keys) const;
87 };
88}
89
90#endif // XAOD_STANDALONE
91
92#endif // TrigCompositeUtils_AlgToChainTool_h
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Property holding a SG store/key/clid from which a ReadHandle is made.
std::string createCollectionName(const std::string &sequenceName) const
std::set< std::string > getActiveChainsForAlg(const std::string &algorithmName, const EventContext &context) const
Request set of active chains for given algorithm - dynamic lookup (navigation)
AlgToChainTool(const std::string &type, const std::string &name, const IInterface *parent)
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
std::vector< std::string > m_cachedEventStoreKeys
virtual StatusCode initialize() override
std::set< TrigCompositeUtils::DecisionID > retrieveActiveChainsForKeys(const EventContext &context, const std::string &collectionName, const std::vector< std::string > &keys) const
Request set of chains for given navigation collection and list of StoreGate keys.
SG::ReadHandle< TrigCompositeUtils::DecisionContainer > getDecisionFromStore(SmartIF< SGImplSvc > &eventStore, const std::string &key) const
void cacheSGKeys(const EventContext &context)
Cache the StoreGate keys.
virtual StatusCode start() override
StatusCode getChainsForAllAlgs(const EventContext &context, std::map< std::string, std::set< std::string > > &algToChain) const
Request set of chains for all algorithms in the menu.
std::map< std::string, std::vector< TrigConf::Chain > > m_sequencerToChainMap
StatusCode getChainInfo(const EventContext &context, TrigCompositeUtils::DecisionID id, ChainInfo &info) const
Retrieve chain information for gived chain id.
std::vector< std::string > readSGKeys(const EventContext &context) const
Read the keys from StoreGate.
std::vector< std::string > getChainsForAlg(const std::string &algorithmName) const
Request set of chains for given algorithm - static lookup (menu)
std::map< std::string, std::vector< std::string > > m_algToSequencersMap
StatusCode getAllChains(std::vector< TrigConf::Chain > &) const
Request all chains from the menu.
std::set< TrigCompositeUtils::DecisionID > retrieveActiveChains(const EventContext &context, const std::string &collectionName="") const
Read the cached or non cached SG kays and request set of chains for given navigation collection.
StatusCode getAllActiveSequences(const EventContext &context, std::map< std::string, std::string > &algToSeq)
Retrieve algorithms and their active sequences.
unsigned int DecisionID