ATLAS Offline Software
Loading...
Searching...
No Matches
ChainGroup.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGGER_DECISION_TOOL_CHAIN_GROUP_H
6#define TRIGGER_DECISION_TOOL_CHAIN_GROUP_H
7
8/**********************************************************************************
9 * @Project: TrigDecisionTool
10 * @Package: TrigDecisionTool
11 * @class : ChainGroup
12 *
13 * @brief container to hold trigger chains
14 *
15 * @author Michael Begel <michael.begel@cern.ch> - Brookhaven National Laboratory
16 * @author Joerg Stelzer <Joerg.Stelzer@cern.ch> - DESY
17 * @author Tomasz Bold <Tomasz.Bold@cern.ch> - UC Irvine - AGH-UST Krakow
18 *
19 ***********************************************************************************/
20
21
22
31
32#include <iterator>
33#include <vector>
34#include <string>
35#include <string_view>
36
37namespace HLT {
38 class Chain;
39}
40
41namespace LVL1CTP {
42 class Lvl1Item;
43}
44
45namespace TrigConf {
46 class TriggerItem;
47 class HLTChain;
49}
50
51
52namespace Trig {
53
54 class ChainGroup : public virtual Logger {
55
56 friend class CacheGlobalMemory;
57
58 public:
59
60 ChainGroup(const std::vector< std::string >& triggerNames,
62 ~ChainGroup() = default;
63
64 typedef std::vector<std::string>::const_iterator const_iterator;
66 bool operator==(const Trig::ChainGroup& rhs);
67 bool operator!=(const Trig::ChainGroup& rhs);
68
72 void addAlias(const std::string& alias);
73
74
79 bool isPassed(unsigned int condition=TrigDefs::Physics) const;
80
87 std::vector<bool> isPassedForEach(unsigned int condition=TrigDefs::Physics) const;
88
94 float getPrescale(unsigned int condition=TrigDefs::Physics) const;
95
96
97 std::vector< std::string > getListOfTriggers() const; // cppcheck-suppress returnByReference; for consistency
98 std::vector< std::string > getListOfStreams() const;
99 std::vector< std::string > getListOfGroups() const;
100 std::vector< std::string > getListOfThresholds() const;
101 std::vector< std::string > getListOfSignatures() const;
102 std::vector< std::vector< std::string > > getListOfTriggerElements() const;
103 std::vector< std::vector< TrigConf::HLTTriggerElement* > > getHLTTriggerElements() const;
104
105
110 unsigned int isPassedBits() const;
111
115 std::vector<unsigned int> isPassedBitsForEach() const;
116
117
124 HLT::ErrorCode error() const;
125
126
131 const FeatureContainer features(unsigned int condition = TrigDefs::Physics) const;
132
145 template<class CONTAINER>
146 std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> > features(const asg::EventStoreType* eventStore,
148 unsigned int condition = TrigDefs::Physics,
149 std::string_view containerSGKey = "",
150 const unsigned int featureCollectionMode = TrigDefs::lastFeatureOfType,
151 const std::string& navElementLinkKey = TrigCompositeUtils::featureString(),
152 const int restrictToLegIndex = -1) const;
153
154 //
155 const std::vector< std::string >& patterns() const {return m_patterns;}
156 private:
157
158 bool isPassed(const TrigConf::HLTChain& chain, unsigned int condition) const;
159 bool isCorrelatedL1items(const std::string& item) const;
160 float correlatedL1Prescale(const std::string& item) const;
161 float calculatePrescale(unsigned int condition=TrigDefs::Physics);
162
163 void appendFeatures(std::vector< std::vector< HLT::TriggerElement*> >& tes, FeatureContainer& fc) const;
164
168 const std::vector< std::string >& names() const {return m_names;}
169
170 bool HLTResult(const std::string& chain, unsigned int condition) const;
171 bool L1Result(const std::string& item, unsigned int condition) const;
172
173 unsigned int HLTBits(const std::string& chain, const std::string& level, const TrigCompositeUtils::DecisionIDContainer& passExpress) const;
174 unsigned int L1Bits(const std::string& item) const;
175
176 float HLTPrescale(const std::string& chain, unsigned int condition) const;
177 float L1Prescale(const std::string& item, unsigned int condition) const;
178
179 std::string getLowerName(const std::string& EFname) const;
180
181 std::vector<std::string> m_patterns;
182
183 std::vector<const TrigConf::HLTChain*> m_confChains;
184 std::vector<const TrigConf::TriggerItem*> m_confItems;
185
186#ifndef __REFLEX__
187 // quick cache (external therefore reference) of the result per event
189#endif
190 std::vector< std::string > m_names;
191
192 const Trig::CacheGlobalMemory& cgm_assert() const;
193 const Trig::CacheGlobalMemory& cgm() const { return m_cgm; }
195
196 // update the configuration
197 void update(const TrigConf::HLTChainList* confChains,
198 const TrigConf::ItemContainer* confItems,
200
202
203 float m_prescale{0};
204
205 };
206} // End of namespace
207
208#include "ChainGroup.icc"
209
210#endif
This class represents one chain of signatures, i.e.
Definition Chain.h:61
Property holding a SG store/key/clid from which a ReadHandle is made.
list of all HLT chains in a trigger menu
HLT chain configuration information.
HLT trigger element configuration information.
float correlatedL1Prescale(const std::string &item) const
const std::vector< std::string > & patterns() const
Definition ChainGroup.h:155
std::vector< std::string > getListOfStreams() const
std::vector< std::string > getListOfThresholds() const
const Trig::CacheGlobalMemory & cgm() const
Definition ChainGroup.h:193
ChainGroup & operator=(const ChainGroup &)
const FeatureContainer features(unsigned int condition=TrigDefs::Physics) const
returns all features related to given chain group of HLT chains or L1 items Note: This does not yet w...
std::vector< std::string > getListOfGroups() const
std::vector< TrigCompositeUtils::LinkInfo< CONTAINER > > features(const asg::EventStoreType *eventStore, const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > &HLTSummaryKeyIn, unsigned int condition=TrigDefs::Physics, std::string_view containerSGKey="", const unsigned int featureCollectionMode=TrigDefs::lastFeatureOfType, const std::string &navElementLinkKey=TrigCompositeUtils::featureString(), const int restrictToLegIndex=-1) const
returns typed features related to given chain group of HLT chains or L1 items Note: This is a RUN 3 (...
friend class CacheGlobalMemory
Definition ChainGroup.h:56
HLT::ErrorCode error() const
returns most severe error in the chains composing that chain group for L1 it is just OK If there is s...
unsigned int isPassedBits() const
returns bits (OR ed) of the chain group Meaning of the returned bits can be understood by using masks...
std::vector< bool > isPassedForEach(unsigned int condition=TrigDefs::Physics) const
return vector with isPassed decision for each chain
bool isCorrelatedL1items(const std::string &item) const
ChainGroup(const std::vector< std::string > &triggerNames, Trig::CacheGlobalMemory &parent)
void addAlias(const std::string &alias)
adds alias (sort understandabel name) to the group
std::vector< std::string > m_names
names of trigger derived from patterns & current configuration
Definition ChainGroup.h:190
void update(const TrigConf::HLTChainList *confChains, const TrigConf::ItemContainer *confItems, TrigDefs::Group prop=TrigDefs::Group::Default)
float HLTPrescale(const std::string &chain, unsigned int condition) const
float getPrescale(unsigned int condition=TrigDefs::Physics) const
returns prescale factor for chain group with single chain in returns real prescale factor for real ch...
~ChainGroup()=default
const Trig::ChainGroup & operator+(const Trig::ChainGroup &rhs)
bool L1Result(const std::string &item, unsigned int condition) const
bool operator!=(const Trig::ChainGroup &rhs)
float calculatePrescale(unsigned int condition=TrigDefs::Physics)
std::vector< const TrigConf::HLTChain * > m_confChains
Definition ChainGroup.h:183
unsigned int HLTBits(const std::string &chain, const std::string &level, const TrigCompositeUtils::DecisionIDContainer &passExpress) const
const std::vector< std::string > & names() const
names of triggers within chain group
Definition ChainGroup.h:168
std::vector< std::vector< std::string > > getListOfTriggerElements() const
std::vector< std::string > m_patterns
patterns with which the CG was constructed
Definition ChainGroup.h:181
bool isPassed(unsigned int condition=TrigDefs::Physics) const
tells if chain group passed
Trig::CacheGlobalMemory & m_cgm
Definition ChainGroup.h:188
void appendFeatures(std::vector< std::vector< HLT::TriggerElement * > > &tes, FeatureContainer &fc) const
float L1Prescale(const std::string &item, unsigned int condition) const
std::vector< unsigned int > isPassedBitsForEach() const
return result of isPassedBits for each chain in the group
const Trig::CacheGlobalMemory & cgm_assert() const
Trig::CacheGlobalMemory & cgm()
Definition ChainGroup.h:194
std::vector< std::string >::const_iterator const_iterator
Definition ChainGroup.h:64
bool operator==(const Trig::ChainGroup &rhs)
std::vector< std::string > getListOfSignatures() const
std::string getLowerName(const std::string &EFname) const
std::vector< std::vector< TrigConf::HLTTriggerElement * > > getHLTTriggerElements() const
bool HLTResult(const std::string &chain, unsigned int condition) const
std::vector< const TrigConf::TriggerItem * > m_confItems
Definition ChainGroup.h:184
std::vector< std::string > getListOfTriggers() const
Logger()=default
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
const std::string & featureString()
std::set< DecisionID > DecisionIDContainer
Forward iterator to traverse the main components of the trigger configuration.
boost::multi_index::multi_index_container< TriggerItem *, boost::multi_index::indexed_by< boost::multi_index::random_access<>, boost::multi_index::ordered_unique< boost::multi_index::identity< TriggerItem > >, boost::multi_index::ordered_unique< boost::multi_index::tag< tag_ctpid >, boost::multi_index::const_mem_fun< TriggerItem, int, &TriggerItem::ctpId > >, boost::multi_index::hashed_unique< boost::multi_index::tag< tag_name_hash >, boost::multi_index::const_mem_fun< TrigConfData, const std::string &, &TrigConfData::name > > > > ItemContainer
Definition Menu.h:39
Group
Properties of a chain group.
static const unsigned int lastFeatureOfType
Run 3 "enum". Only return the final feature along each route through the navigation.
The common trigger namespace for trigger analysis tools.
StoreGateSvc EventStoreType
the type returned by AsgTool::evtStore