ATLAS Offline Software
ChainGroup.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 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 #include <iterator>
22 #include <vector>
23 #include <string>
24 
33 
34 namespace HLT {
35  class Chain;
36 }
37 
38 namespace LVL1CTP {
39  class Lvl1Item;
40 }
41 
42 namespace TrigConf {
43  class TriggerItem;
44  class HLTChain;
45  class HLTTriggerElement;
46 }
47 
48 
49 namespace Trig {
50 
51  class ChainGroup : public virtual Logger {
52 
53  friend class CacheGlobalMemory;
54 
55  public:
56 
57  ChainGroup(const std::vector< std::string >& triggerNames,
59  ~ChainGroup() = default;
60 
61  typedef std::vector<std::string>::const_iterator const_iterator;
62  const Trig::ChainGroup& operator+(const Trig::ChainGroup& rhs);
63  bool operator==(const Trig::ChainGroup& rhs);
64  bool operator!=(const Trig::ChainGroup& rhs);
65 
69  void addAlias(const std::string& alias);
70 
71 
76  bool isPassed(unsigned int condition=TrigDefs::Physics) const;
77 
84  std::vector<bool> isPassedForEach(unsigned int condition=TrigDefs::Physics) const;
85 
91  float getPrescale(unsigned int condition=TrigDefs::Physics) const;
92 
93 
94  std::vector< std::string > getListOfTriggers() const;
95  std::vector< std::string > getListOfStreams() const;
96  std::vector< std::string > getListOfGroups() const;
97  std::vector< std::string > getListOfThresholds() const;
98  std::vector< std::string > getListOfSignatures() const;
99  std::vector< std::vector< std::string > > getListOfTriggerElements() const;
100  std::vector< std::vector< TrigConf::HLTTriggerElement* > > getHLTTriggerElements() const;
101 
102 
107  unsigned int isPassedBits() const;
108 
112  std::vector<unsigned int> isPassedBitsForEach() const;
113 
114 
121  HLT::ErrorCode error() const;
122 
123 
128  const FeatureContainer features(unsigned int condition = TrigDefs::Physics) const;
129 
142  template<class CONTAINER>
143  std::vector< TrigCompositeUtils::LinkInfo<CONTAINER> > features(const asg::EventStoreType* eventStore,
145  unsigned int condition = TrigDefs::Physics,
146  const std::string& containerSGKey = "",
147  const unsigned int featureCollectionMode = TrigDefs::lastFeatureOfType,
148  const std::string& navElementLinkKey = TrigCompositeUtils::featureString(),
149  const int restrictToLegIndex = -1) const;
150 
151  //
152  const std::vector< std::string >& patterns() const {return m_patterns;}
153  private:
154 
155  bool isPassed(const TrigConf::HLTChain& chain, unsigned int condition) const;
156  bool isCorrelatedL1items(const std::string& item) const;
157  float correlatedL1Prescale(const std::string& item) const;
158  float calculatePrescale(unsigned int condition=TrigDefs::Physics);
159 
160  void appendFeatures(std::vector< std::vector< HLT::TriggerElement*> >& tes, FeatureContainer& fc) const;
161 
165  const std::vector< std::string >& names() const {return m_names;}
166 
167  bool HLTResult(const std::string& chain, unsigned int condition) const;
168  bool L1Result(const std::string& item, unsigned int condition) const;
169 
170  unsigned int HLTBits(const std::string& chain, const std::string& level, const TrigCompositeUtils::DecisionIDContainer& passExpress) const;
171  unsigned int L1Bits(const std::string& item) const;
172 
173  float HLTPrescale(const std::string& chain, unsigned int condition) const;
174  float L1Prescale(const std::string& item, unsigned int condition) const;
175 
176  std::string getLowerName(const std::string& EFname) const;
177 
178  std::vector<std::string> m_patterns;
179 
180  std::vector<const TrigConf::HLTChain*> m_confChains;
181  std::vector<const TrigConf::TriggerItem*> m_confItems;
182 
183 #ifndef __REFLEX__
184  // quick cache (external therefore reference) of the result per event
186 #endif
187  std::vector< std::string > m_names;
188 
189  const Trig::CacheGlobalMemory& cgm_assert() const;
190  const Trig::CacheGlobalMemory& cgm() const { return m_cgm; }
192 
193  // update the configuration
194  void update(const TrigConf::HLTChainList* confChains,
195  const TrigConf::ItemContainer* confItems,
197 
199 
200  float m_prescale{0};
201 
202  };
203 } // End of namespace
204 
205 #include "ChainGroup.icc"
206 
207 #endif
Trig::ChainGroup::isPassedBitsForEach
std::vector< unsigned int > isPassedBitsForEach() const
return result of isPassedBits for each chain in the group
Definition: ChainGroup.cxx:261
Trig::ChainGroup::update
void update(const TrigConf::HLTChainList *confChains, const TrigConf::ItemContainer *confItems, TrigDefs::Group prop=TrigDefs::Group::Default)
Definition: ChainGroup.cxx:591
Trig::ChainGroup::getListOfSignatures
std::vector< std::string > getListOfSignatures() const
Definition: ChainGroup.cxx:501
Trig::ChainGroup::correlatedL1Prescale
float correlatedL1Prescale(const std::string &item) const
Definition: ChainGroup.cxx:348
GroupProperties.h
Trig::ChainGroup::m_names
std::vector< std::string > m_names
names of trigger derived from patterns & current configuration
Definition: ChainGroup.h:187
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
Trig::ChainGroup::getLowerName
std::string getLowerName(const std::string &EFname) const
Definition: ChainGroup.cxx:160
Trig::ChainGroup::addAlias
void addAlias(const std::string &alias)
adds alias (sort understandabel name) to the group
Definition: ChainGroup.cxx:66
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
Trig::ChainGroup::operator!=
bool operator!=(const Trig::ChainGroup &rhs)
Definition: ChainGroup.cxx:62
TrigCompositeUtils.h
Trig
The common trigger namespace for trigger analysis tools.
Definition: LArCellMonAlg.h:33
FeatureContainer.h
HLT::ErrorCode
The definition of error codes in HLT. This is a class (note; before was simple enum) to enable safer ...
Definition: Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Enums.h:80
Trig::Logger
Logging adaptor to provide interfaces required for ATH_MSG macros.
Definition: Trigger/TrigAnalysis/TrigDecisionTool/TrigDecisionTool/Logger.h:24
Trig::ChainGroup::HLTResult
bool HLTResult(const std::string &chain, unsigned int condition) const
Definition: ChainGroup.cxx:78
Trig::ChainGroup::ChainGroup
ChainGroup(const std::vector< std::string > &triggerNames, Trig::CacheGlobalMemory &parent)
Definition: ChainGroup.cxx:41
Trig::ChainGroup::getListOfThresholds
std::vector< std::string > getListOfThresholds() const
Definition: ChainGroup.cxx:517
Trig::ChainGroup::m_cgm
Trig::CacheGlobalMemory & m_cgm
Definition: ChainGroup.h:185
Trig::ChainGroup::HLTBits
unsigned int HLTBits(const std::string &chain, const std::string &level, const TrigCompositeUtils::DecisionIDContainer &passExpress) const
Definition: ChainGroup.cxx:221
Enums.h
LArG4GenerateShowerLib.condition
condition
Definition: LArG4GenerateShowerLib.py:19
Trig::ChainGroup::calculatePrescale
float calculatePrescale(unsigned int condition=TrigDefs::Physics)
Definition: ChainGroup.cxx:413
Trig::CacheGlobalMemory
Definition: CacheGlobalMemory.h:67
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
TrigConf::HLTChain
HLT chain configuration information.
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:35
Conditions.h
Trig::ChainGroup::operator==
bool operator==(const Trig::ChainGroup &rhs)
Definition: ChainGroup.cxx:58
trigbs_dumpPrescaleBits.HLTChain
HLTChain
Definition: trigbs_dumpPrescaleBits.py:41
Trig::ChainGroup::operator+
const Trig::ChainGroup & operator+(const Trig::ChainGroup &rhs)
Definition: ChainGroup.cxx:48
TrigDefs::Group::Default
@ Default
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
Trig::ChainGroup::features
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...
Definition: ChainGroup.cxx:726
Trig::FeatureContainer
Definition: FeatureContainer.h:54
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
Trig::ChainGroup::m_confChains
std::vector< const TrigConf::HLTChain * > m_confChains
Definition: ChainGroup.h:180
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
Trig::ChainGroup::getListOfGroups
std::vector< std::string > getListOfGroups() const
Definition: ChainGroup.cxx:487
CacheGlobalMemory.h
Trig::ChainGroup::getListOfStreams
std::vector< std::string > getListOfStreams() const
Definition: ChainGroup.cxx:472
Trig::ChainGroup::m_prescale
float m_prescale
Definition: ChainGroup.h:200
Trig::ChainGroup::HLTPrescale
float HLTPrescale(const std::string &chain, unsigned int condition) const
Definition: ChainGroup.cxx:326
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
TrigConf::HLTChainList
list of all HLT chains in a trigger menu
Definition: HLTChainList.h:56
Trig::ChainGroup::features
std::vector< TrigCompositeUtils::LinkInfo< CONTAINER > > features(const asg::EventStoreType *eventStore, const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > &HLTSummaryKeyIn, unsigned int condition=TrigDefs::Physics, const std::string &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 (...
COOLRates.alias
alias
Definition: COOLRates.py:1172
Trig::ChainGroup::L1Prescale
float L1Prescale(const std::string &item, unsigned int condition) const
Definition: ChainGroup.cxx:374
ChainGroup.icc
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Logger.h
Trig::ChainGroup::L1Result
bool L1Result(const std::string &item, unsigned int condition) const
Definition: ChainGroup.cxx:129
Trig::ChainGroup::patterns
const std::vector< std::string > & patterns() const
Definition: ChainGroup.h:152
Trig::ChainGroup::appendFeatures
void appendFeatures(std::vector< std::vector< HLT::TriggerElement * > > &tes, FeatureContainer &fc) const
Definition: ChainGroup.cxx:788
Trig::ChainGroup
Definition: ChainGroup.h:51
Trig::ChainGroup::getHLTTriggerElements
std::vector< std::vector< TrigConf::HLTTriggerElement * > > getHLTTriggerElements() const
Definition: ChainGroup.cxx:577
TrigCompositeUtils::featureString
const std::string & featureString()
Definition: TrigCompositeUtilsRoot.cxx:884
Trig::ChainGroup::isPassed
bool isPassed(unsigned int condition=TrigDefs::Physics) const
tells if chain group passed
Definition: ChainGroup.cxx:208
Trig::ChainGroup::cgm
const Trig::CacheGlobalMemory & cgm() const
Definition: ChainGroup.h:190
Trig::ChainGroup::m_patterns
std::vector< std::string > m_patterns
patterns with which the CG was constructed
Definition: ChainGroup.h:178
item
Definition: ItemListSvc.h:43
Trig::ChainGroup::cgm_assert
const Trig::CacheGlobalMemory & cgm_assert() const
Definition: ChainGroup.cxx:70
TrigConf::ItemContainer
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
Trig::ChainGroup::names
const std::vector< std::string > & names() const
names of triggers within chain group
Definition: ChainGroup.h:165
Trig::ChainGroup::isPassedBits
unsigned int isPassedBits() const
returns bits (OR ed) of the chain group Meaning of the returned bits can be understood by using masks...
Definition: ChainGroup.cxx:305
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition: TrigComposite_v1.h:28
Trig::ChainGroup::const_iterator
std::vector< std::string >::const_iterator const_iterator
Definition: ChainGroup.h:61
Trig::ChainGroup::isCorrelatedL1items
bool isCorrelatedL1items(const std::string &item) const
Definition: ChainGroup.cxx:343
Trig::ChainGroup::getPrescale
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...
Definition: ChainGroup.cxx:407
Trig::ChainGroup::isPassedForEach
std::vector< bool > isPassedForEach(unsigned int condition=TrigDefs::Physics) const
return vector with isPassed decision for each chain
Definition: ChainGroup.cxx:193
Trig::ChainGroup::operator=
ChainGroup & operator=(const ChainGroup &)
LVL1CTP
Definition: Lvl1ResultAccessTool.h:20
Trig::ChainGroup::getListOfTriggerElements
std::vector< std::vector< std::string > > getListOfTriggerElements() const
Definition: ChainGroup.cxx:555
Trig::ChainGroup::~ChainGroup
~ChainGroup()=default
Trig::ChainGroup::error
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...
Definition: ChainGroup.cxx:315
Trig::ChainGroup::getListOfTriggers
std::vector< std::string > getListOfTriggers() const
Definition: ChainGroup.cxx:467
FeatureRequestDescriptor.h
Trig::ChainGroup::L1Bits
unsigned int L1Bits(const std::string &item) const
Definition: ChainGroup.cxx:244
Trig::ChainGroup::cgm
Trig::CacheGlobalMemory & cgm()
Definition: ChainGroup.h:191
Trig::ChainGroup::m_confItems
std::vector< const TrigConf::TriggerItem * > m_confItems
Definition: ChainGroup.h:181