ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConfHLTData/TrigConfHLTData/HLTChain.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 TrigConf_HLTChain
6#define TrigConf_HLTChain
7
11
12#include <string>
13#include <iosfwd>
14#include <fstream>
15#include <vector>
16#include <set>
17
18#include <unordered_map>
19
20namespace TrigConf {
21 class HLTChain;
22 class HLTSignature;
23 class HLTTriggerType;
24 class HLTStreamTag;
25 class DiffStruct;
26}
27
28bool HLTChain_lt(const TrigConf::HLTChain* ch1, const TrigConf::HLTChain* ch2);
29
30namespace TrigConf {
31
32 std::ostream & operator<<(std::ostream &, const HLTChain &);
33
35 class HLTChain : public TrigConfData {
36 public:
37
39 HLTChain( void );
40
53 HLTChain( const std::string& chain_name,
54 int chain_counter,
55 int chain_version,
56 const std::string& level,
57 const std::string& lower_chain_name,
59 std::vector<HLTSignature*>&& signatureList );
60
65 HLTChain( const HLTChain& ch );
66
68 virtual ~HLTChain() override;
69
70
71 // getters
72 // cppcheck-suppress returnTempReference; name() returns const-ref to private member
73 const std::string& chain_name () const { return name(); }
74 int chain_counter () const { return m_chain_counter; }
75 int chain_version () const { return m_chain_version; }
76 const std::string& level () const { return m_level; }
77 HLTLevel level_enum () const { return m_level=="L2"?L2:(m_level=="EF"?EF:HLT); }
78 const std::string& lower_chain_name () const { return m_lower_chain_name; }
80 unsigned int chain_hash_id () const { return m_chain_hash_id; }
81 unsigned int lower_chain_hash_id () const { return m_lower_chain_hash_id; }
82 int EB_after_step () const { return m_EB_after_step; }
83 const std::vector<size_t>& leg_multiplicities () const { return m_leg_multiplicities; }
84 bool hasMultipleLowerChains() const;
85 const std::vector<int>& lower_chain_counters () const;
86 std::vector<unsigned int> lower_chain_hash_ids () const;
87
88
89 std::vector<HLTTriggerType*>& triggerTypeList() { return m_HLTTriggerTypeList; }
90 const std::vector<HLTTriggerType*>& triggerTypeList() const { return m_HLTTriggerTypeList; }
91
92 // setters
93 HLTChain& set_chain_name ( const std::string& chain_name);
96 HLTChain& set_level ( std::string_view level) { m_level.assign(level); return *this; }
97 HLTChain& set_lower_chain_name ( const std::string& lower_chain_name);
99 HLTChain& set_lower_chain_counters ( const std::vector<int>& low_ccs) { m_lower_chain_counters = low_ccs; return *this; }
100 HLTChain& set_signatureList ( const std::vector<HLTSignature*>& sigList);
101 HLTChain& set_triggerTypeList ( const std::vector<HLTTriggerType*>& trigList);
102 HLTChain& set_groupList ( const std::set<std::string>& groups) { m_groups = groups; return *this; }
104 HLTChain& set_leg_multiplicities ( const std::vector<size_t>& mult ) { m_leg_multiplicities = mult; return *this; }
105
106
107 // signatures
108 std::vector<HLTSignature*>& signatureList() { return m_HLTSignatureList; }
109 const std::vector<HLTSignature*>& signatureList() const { return m_HLTSignatureList; }
110 const std::vector<HLTSignature*>& signatures() const { return m_HLTSignatureList; }
111 unsigned int lastStep() const;
112 void shiftStepCounter(int shift);
113
114
115 // streams
116 void addStream(HLTStreamTag*);
117 void clearStreams();
118 const std::vector<HLTStreamTag*>& streams() const { return m_streams; }
119 #ifndef __GCCXML__
120 const std::vector<HLTStreamTag*>& streamTagList() const __attribute__ ((deprecated)) { return m_streams; } //deprecated
121 #endif
122 const std::vector<HLTStreamTag*>& streams_orig() const { return m_streams_orig; }
123 std::pair<bool, float> stream_prescale(const std::string& streamName) const;
124
125
126 // groups
127 const std::set<std::string>& groups() const { return m_groups; }
128 #ifndef __GCCXML__
129 const std::set<std::string>& groupList() const __attribute__ ((deprecated)) { return m_groups; }
130 #endif
131 void addGroup(const std::string& group) { m_groups.insert(group); }
132 void clearGroups() { m_groups.clear(); }
133
134 // prescales
136 HLTChain& set_prescale( float prescale) { m_prescales.setPrescale(prescale); return *this; }
137 HLTChain& set_rerun_prescale( float rerun_prescale) { m_prescales.setRerunPrescale("",rerun_prescale); return *this; }
138 HLTChain& set_pass_through( float pass_through) { m_prescales.setPassThrough(pass_through); return *this; }
139
141 const HLTPrescale& prescales() const { return m_prescales; }
142 float prescale() const { return prescales().prescale(); }
143 float pass_through() const { return prescales().pass_through(); }
144 std::pair<bool, float> rerun_prescale(const std::string& targetName) const { return prescales().getRerunPrescale(targetName); }
145 #ifndef __GCCXML__
146 float rerun_prescale() const __attribute__ ((deprecated)) { return prescales().getRerunPrescale("").second; }
147 #endif
148
149 inline bool operator<(const HLTChain& e) const {
150 return m_level[0]>e.m_level[0] ||
151 (m_level[0]==e.m_level[0] && m_chain_counter<e.m_chain_counter);
152 }
153
156
158 void print(const std::string& indent="", unsigned int detail=1) const override;
159
160 void writeXML(std::ofstream & xmlfile);
161
162 DiffStruct* compareTo(const HLTChain* o) const;
163
164 // for python
165 std::string __str__() const override;
166
167
168 private:
169
170
171 unsigned int m_chain_hash_id{};
174 std::string m_level;
175 std::string m_lower_chain_name;
177 std::vector<int> m_lower_chain_counters;
178 unsigned int m_lower_chain_hash_id{};
180 std::vector<size_t> m_leg_multiplicities;
182
183 std::vector<HLTSignature*> m_HLTSignatureList;
184 std::vector<HLTTriggerType*> m_HLTTriggerTypeList;
185 std::set<std::string> m_groups;
186 std::vector<HLTStreamTag*> m_streams_orig;
187 std::vector<HLTStreamTag*> m_streams;
188 std::unordered_map<std::string, HLTStreamTag*> m_streams_map;
189
190 friend std::ostream & operator<<(std::ostream &, const HLTChain &);
191
192 public:
193
194 // temporary object to store the merge information
195 struct {
196 unsigned int l2{0};
197 unsigned int ef{0};
199 };
200
201}
202
203#endif
__attribute__((always_inline)) inline uint16_t TileCalibDrawerBase
bool HLTChain_lt(const TrigConf::HLTChain *ch1, const TrigConf::HLTChain *ch2)
HLT chain configuration information.
std::pair< bool, float > stream_prescale(const std::string &streamName) const
HLTChain(void)
default constructor
DiffStruct * compareTo(const HLTChain *o) const
HLTChain & set_chain_version(int chain_version)
HLTChain & set_triggerTypeList(const std::vector< HLTTriggerType * > &trigList)
virtual ~HLTChain() override
destructor
HLTChain & set_leg_multiplicities(const std::vector< size_t > &mult)
const std::vector< HLTTriggerType * > & triggerTypeList() const
std::pair< bool, float > rerun_prescale(const std::string &targetName) const
const std::vector< HLTStreamTag * > & streams() const
std::vector< unsigned int > lower_chain_hash_ids() const
std::vector< size_t > m_leg_multiplicities
Number of objects required per leg.
const std::vector< HLTStreamTag * > & streams_orig() const
const std::string & lower_chain_name() const
HLTChain & set_pass_through(float pass_through)
std::unordered_map< std::string, HLTStreamTag * > m_streams_map
const std::set< std::string > & groups() const
std::vector< HLTSignature * > & signatureList()
const std::vector< int > & lower_chain_counters() const
HLTChain & set_rerun_prescale(float rerun_prescale)
const std::vector< size_t > & leg_multiplicities() const
std::vector< HLTStreamTag * > m_streams_orig
std::vector< int > m_lower_chain_counters
counters of the lower trigger items if more than 1
const std::vector< HLTSignature * > & signatureList() const
HLTChain & set_level(std::string_view level)
unsigned int m_lower_chain_hash_id
hash value from m_lower_chain_name, this is used to match to a chain from the previous trigger level
HLTChain & set_EB_after_step(int EB_after_step)
std::vector< HLTStreamTag * > m_streams
bool operator<(const HLTChain &e) const
HLTChain & set_signatureList(const std::vector< HLTSignature * > &sigList)
const std::vector< HLTStreamTag * > & streamTagList() const __attribute__((deprecated))
HLTChain & set_chain_name(const std::string &chain_name)
std::string __str__() const override
HLTChain & set_lower_chain_counters(const std::vector< int > &low_ccs)
HLTChain & set_lower_chain_counter(int lower_chain_counter)
HLTChain & set_groupList(const std::set< std::string > &groups)
void print(const std::string &indent="", unsigned int detail=1) const override
print the chain
std::string m_lower_chain_name
name of the lower trigger chain (or the LVL1 trigger item)
const std::set< std::string > & groupList() const __attribute__((deprecated))
void createSignatureLabels()
label the signatures
std::vector< HLTTriggerType * > & triggerTypeList()
float rerun_prescale() const __attribute__((deprecated))
void addGroup(const std::string &group)
unsigned int m_chain_hash_id
hash value from m_chain_name, this is used to identify the chain in the HLTResult
int m_lower_chain_counter
counter of the lower trigger chain (or the ID of the LVL1 trigger item)
HLTChain & set_chain_counter(int chain_counter)
struct TrigConf::HLTChain::@145022354365266131341076355027225065251152241206 mergeCounter
const std::vector< HLTSignature * > & signatures() const
void writeXML(std::ofstream &xmlfile)
std::vector< HLTSignature * > m_HLTSignatureList
friend std::ostream & operator<<(std::ostream &, const HLTChain &)
HLTChain & set_prescales(const HLTPrescale &prescales)
HLTChain & set_lower_chain_name(const std::string &lower_chain_name)
std::vector< HLTTriggerType * > m_HLTTriggerTypeList
float pass_through() const
Definition HLTPrescale.h:57
std::pair< bool, float > getRerunPrescale(std::string_view targetName) const
float prescale() const
Definition HLTPrescale.h:56
HLT signature configuration information.
HLT stream configuration information.
HLT trigger type configuration information.
std::ostream & indent(std::ostream &o, int lvl, int size) const
const std::string & name() const
TrigConfData(const std::string &name="")
static std::vector< std::string > xmlfile
Definition iLumiCalc.h:29
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Forward iterator to traverse the main components of the trigger configuration.
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)