Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TrigConfHLTData/TrigConfHLTData/HLTChain.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 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 
20 namespace TrigConf {
21  class HLTChain;
22  class HLTSignature;
23  class HLTTriggerType;
24  class HLTStreamTag;
25  class DiffStruct;
26 }
27 
28 bool HLTChain_lt(const TrigConf::HLTChain* ch1, const TrigConf::HLTChain* ch2);
29 
30 namespace 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; }
79  int lower_chain_counter () const { return m_lower_chain_counter; }
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 ( const std::string& level) { m_level = 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
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 
155  void createSignatureLabels();
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
TrigConf::HLTChain::streams
const std::vector< HLTStreamTag * > & streams() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:118
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
TrigConf::HLTPrescale
Definition: HLTPrescale.h:26
HLTLevel.h
TrigConf::HLTChain::set_lower_chain_counter
HLTChain & set_lower_chain_counter(int lower_chain_counter)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:98
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
TrigConf::operator<<
std::ostream & operator<<(std::ostream &os, const TrigConf::IsolationLegacy &iso)
Definition: L1ThresholdBase.cxx:339
TrigConf::TrigConfData::name
const std::string & name() const
Definition: TrigConfData.h:22
TrigConf::HLTChain::hasMultipleLowerChains
bool hasMultipleLowerChains() const
Definition: TrigConfHLTData/Root/HLTChain.cxx:104
HLTChain_lt
bool HLTChain_lt(const TrigConf::HLTChain *ch1, const TrigConf::HLTChain *ch2)
Definition: TrigConfHLTData/Root/HLTChain.cxx:23
TrigConf::HLTChain::level
const std::string & level() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:76
TrigConf::L2
@ L2
Definition: HLTLevel.h:12
TrigConf::HLTChain::signatureList
const std::vector< HLTSignature * > & signatureList() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:109
TrigConf::HLTChain::m_prescales
HLTPrescale m_prescales
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:181
TrigConf::HLTChain::clearStreams
void clearStreams()
Definition: TrigConfHLTData/Root/HLTChain.cxx:254
TrigConf::HLTChain::chain_name
const std::string & chain_name() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:73
TrigConf::HLTChain::lastStep
unsigned int lastStep() const
Definition: TrigConfHLTData/Root/HLTChain.cxx:168
TrigConf::HLTChain::prescale
float prescale() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:142
TrigConf::HLTChain::triggerTypeList
std::vector< HLTTriggerType * > & triggerTypeList()
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:89
TrigConf::HLTChain::set_EB_after_step
HLTChain & set_EB_after_step(int EB_after_step)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:103
TrigConf::HLTChain::m_lower_chain_counters
std::vector< int > m_lower_chain_counters
counters of the lower trigger items if more than 1
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:177
TrigConf::DiffStruct
Definition: DiffStruct.h:14
HLTPrescale.h
TrigConf::HLTChain::addGroup
void addGroup(const std::string &group)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:131
TrigConf::HLTChain::lower_chain_name
const std::string & lower_chain_name() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:78
TrigConf::HLTChain::prescales
const HLTPrescale & prescales() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:141
TrigConf::HLTChain::m_chain_hash_id
unsigned int m_chain_hash_id
hash value from m_chain_name, this is used to identify the chain in the HLTResult
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:171
TrigConf::HLTChain::addStream
void addStream(HLTStreamTag *)
Definition: TrigConfHLTData/Root/HLTChain.cxx:238
detail
Definition: extract_histogram_tag.cxx:14
TrigConf::HLTChain::signatures
const std::vector< HLTSignature * > & signatures() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:110
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
TrigConf::HLTChain
HLT chain configuration information.
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:35
TrigConf::HLTChain::m_streams
std::vector< HLTStreamTag * > m_streams
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:187
TrigConf::HLTChain::lower_chain_hash_id
unsigned int lower_chain_hash_id() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:81
TrigConf::HLTChain::set_level
HLTChain & set_level(const std::string &level)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:96
TrigConf::HLTChain::mergeCounter
struct TrigConf::HLTChain::@216 mergeCounter
TrigConf::HLTChain::signatureList
std::vector< HLTSignature * > & signatureList()
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:108
trigbs_dumpPrescaleBits.HLTChain
HLTChain
Definition: trigbs_dumpPrescaleBits.py:41
TrigConf::HLTChain::leg_multiplicities
const std::vector< size_t > & leg_multiplicities() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:83
TrigConf::HLTChain::l2
unsigned int l2
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:196
TrigConf::HLT
@ HLT
Definition: HLTLevel.h:12
TrigConf::HLTChain::m_lower_chain_hash_id
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
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:178
TrigConf::HLTChain::set_lower_chain_name
HLTChain & set_lower_chain_name(const std::string &lower_chain_name)
Definition: TrigConfHLTData/Root/HLTChain.cxx:154
TrigConf::HLTPrescale::setPassThrough
HLTPrescale & setPassThrough(float pass_through)
Definition: HLTPrescale.h:47
TrigConf::HLTChain::operator<
bool operator<(const HLTChain &e) const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:149
TrigConf::HLTChain::groups
const std::set< std::string > & groups() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:127
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition: Config.h:22
TrigConf::HLTChain::triggerTypeList
const std::vector< HLTTriggerType * > & triggerTypeList() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:90
TrigConf::HLTChain::chain_counter
int chain_counter() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:74
TrigConf::HLTChain::set_prescale
HLTChain & set_prescale(float prescale)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:136
TrigConf::HLTChain::writeXML
void writeXML(std::ofstream &xmlfile)
Definition: TrigConfHLTData/Root/HLTChain.cxx:321
TrigConf::HLTChain::HLTChain
HLTChain(void)
default constructor
Definition: TrigConfHLTData/Root/HLTChain.cxx:28
TrigConf::EF
@ EF
Definition: HLTLevel.h:12
TrigConf::HLTChain::stream_prescale
std::pair< bool, float > stream_prescale(const std::string &streamName) const
Definition: TrigConfHLTData/Root/HLTChain.cxx:274
TrigConf::HLTChain::streamTagList
const std::vector< HLTStreamTag * > & streamTagList() const __attribute__((deprecated))
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:120
TrigConf::HLTChain::ef
unsigned int ef
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:197
TrigConf::HLTChain::__str__
std::string __str__() const override
Definition: TrigConfHLTData/Root/HLTChain.cxx:462
TrigConf::HLTChain::set_chain_version
HLTChain & set_chain_version(int chain_version)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:95
TrigConfData.h
TrigConf::TrigConfData
Definition: TrigConfData.h:13
TrigConf::HLTChain::m_lower_chain_name
std::string m_lower_chain_name
name of the lower trigger chain (or the LVL1 trigger item)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:175
TrigConf::HLTChain::m_HLTSignatureList
std::vector< HLTSignature * > m_HLTSignatureList
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:183
TrigConf::HLTPrescale::pass_through
float pass_through() const
Definition: HLTPrescale.h:53
TrigConf::HLTChain::compareTo
DiffStruct * compareTo(const HLTChain *o) const
Definition: TrigConfHLTData/Root/HLTChain.cxx:297
TrigConf::HLTLevel
HLTLevel
Definition: HLTLevel.h:12
TrigConf::HLTChain::chain_version
int chain_version() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:75
TrigConf::HLTChain::EB_after_step
int EB_after_step() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:82
TrigConf::HLTPrescale::getRerunPrescale
std::pair< bool, float > getRerunPrescale(const std::string &targetName) const
Definition: HLTPrescale.cxx:35
TrigConf::HLTChain::set_chain_name
HLTChain & set_chain_name(const std::string &chain_name)
Definition: TrigConfHLTData/Root/HLTChain.cxx:135
TrigConf::HLTChain::m_level
std::string m_level
trigger level
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:174
TrigConf::HLTChain::rerun_prescale
std::pair< bool, float > rerun_prescale(const std::string &targetName) const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:144
TrigConf::HLTChain::set_groupList
HLTChain & set_groupList(const std::set< std::string > &groups)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:102
TrigConf::HLTChain::m_streams_map
std::unordered_map< std::string, HLTStreamTag * > m_streams_map
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:188
TrigConf::HLTChain::m_leg_multiplicities
std::vector< size_t > m_leg_multiplicities
Number of objects required per leg.
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:180
TrigConf::HLTChain::set_triggerTypeList
HLTChain & set_triggerTypeList(const std::vector< HLTTriggerType * > &trigList)
Definition: TrigConfHLTData/Root/HLTChain.cxx:142
WriteHiveWithMetaData.streamName
string streamName
Definition: WriteHiveWithMetaData.py:22
TrigConf::HLTChain::m_lower_chain_counter
int m_lower_chain_counter
counter of the lower trigger chain (or the ID of the LVL1 trigger item)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:176
TrigConf::HLTChain::lower_chain_hash_ids
std::vector< unsigned int > lower_chain_hash_ids() const
Definition: TrigConfHLTData/Root/HLTChain.cxx:124
TrigConf::HLTChain::shiftStepCounter
void shiftStepCounter(int shift)
Definition: TrigConfHLTData/Root/HLTChain.cxx:175
TrigConf::HLTChain::clearGroups
void clearGroups()
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:132
TrigConf::HLTChain::set_chain_counter
HLTChain & set_chain_counter(int chain_counter)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:94
TrigConf::HLTChain::rerun_prescale
float rerun_prescale() const __attribute__((deprecated))
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:146
TrigConf::HLTChain::operator<<
friend std::ostream & operator<<(std::ostream &, const HLTChain &)
TrigConf::HLTChain::groupList
const std::set< std::string > & groupList() const __attribute__((deprecated))
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:129
TrigConf::HLTChain::m_chain_version
int m_chain_version
chain version
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:173
TrigConf::HLTChain::m_groups
std::set< std::string > m_groups
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:185
TrigConf::HLTStreamTag
HLT stream configuration information.
Definition: HLTStreamTag.h:23
TrigConf::HLTPrescale::setPrescale
HLTPrescale & setPrescale(float prescale)
Definition: HLTPrescale.h:46
TrigConf::HLTChain::chain_hash_id
unsigned int chain_hash_id() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:80
TrigConf::HLTChain::set_signatureList
HLTChain & set_signatureList(const std::vector< HLTSignature * > &sigList)
Definition: TrigConfHLTData/Root/HLTChain.cxx:161
TrigConf::HLTChain::~HLTChain
virtual ~HLTChain() override
destructor
Definition: TrigConfHLTData/Root/HLTChain.cxx:96
TrigConf::HLTChain::set_pass_through
HLTChain & set_pass_through(float pass_through)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:138
runJobs.deprecated
deprecated
Definition: runJobs.py:191
TrigConf::HLTChain::m_streams_orig
std::vector< HLTStreamTag * > m_streams_orig
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:186
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
TrigConf::HLTChain::streams_orig
const std::vector< HLTStreamTag * > & streams_orig() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:122
TrigConf::HLTChain::level_enum
HLTLevel level_enum() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:77
TrigConf::HLTPrescale::setRerunPrescale
HLTPrescale & setRerunPrescale(const std::string &targetName, float ps)
Definition: HLTPrescale.cxx:29
TrigConf::HLTChain::set_prescales
HLTChain & set_prescales(const HLTPrescale &prescales)
Definition: TrigConfHLTData/Root/HLTChain.cxx:207
TrigConf::HLTChain::createSignatureLabels
void createSignatureLabels()
label the signatures
Definition: TrigConfHLTData/Root/HLTChain.cxx:182
TrigConf::HLTPrescale::prescale
float prescale() const
Definition: HLTPrescale.h:52
TrigConf::TrigConfData::indent
std::ostream & indent(std::ostream &o, int lvl, int size) const
Definition: TrigConfData.cxx:23
TrigConf::HLTChain::m_chain_counter
int m_chain_counter
chain counter
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:172
TrigConf::HLTChain::lower_chain_counters
const std::vector< int > & lower_chain_counters() const
Definition: TrigConfHLTData/Root/HLTChain.cxx:110
TrigConf::HLTChain::set_lower_chain_counters
HLTChain & set_lower_chain_counters(const std::vector< int > &low_ccs)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:99
TrigConf::HLTChain::prescales
HLTPrescale & prescales()
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:140
TrigConf::HLTChain::lower_chain_counter
int lower_chain_counter() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:79
TrigConf::HLTChain::set_rerun_prescale
HLTChain & set_rerun_prescale(float rerun_prescale)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:137
TrigConf::HLTChain::pass_through
float pass_through() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:143
TrigConf::HLTChain::m_HLTTriggerTypeList
std::vector< HLTTriggerType * > m_HLTTriggerTypeList
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:184
TrigConf::HLTChain::m_EB_after_step
int m_EB_after_step
EB_after_step flag.
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:179
TrigConf::HLTChain::print
void print(const std::string &indent="", unsigned int detail=1) const override
print the chain
Definition: TrigConfHLTData/Root/HLTChain.cxx:367
TrigConf::HLTChain::set_leg_multiplicities
HLTChain & set_leg_multiplicities(const std::vector< size_t > &mult)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:104