ATLAS Offline Software
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  const std::string& chain_name () const { return name(); }
73  int chain_counter () const { return m_chain_counter; }
74  int chain_version () const { return m_chain_version; }
75  const std::string& level () const { return m_level; }
76  HLTLevel level_enum () const { return m_level=="L2"?L2:(m_level=="EF"?EF:HLT); }
77  const std::string& lower_chain_name () const { return m_lower_chain_name; }
78  int lower_chain_counter () const { return m_lower_chain_counter; }
79  unsigned int chain_hash_id () const { return m_chain_hash_id; }
80  unsigned int lower_chain_hash_id () const { return m_lower_chain_hash_id; }
81  int EB_after_step () const { return m_EB_after_step; }
82  const std::vector<size_t>& leg_multiplicities () const { return m_leg_multiplicities; }
83  bool hasMultipleLowerChains() const;
84  const std::vector<int>& lower_chain_counters () const;
85  std::vector<unsigned int> lower_chain_hash_ids () const;
86 
87 
88  std::vector<HLTTriggerType*>& triggerTypeList() { return m_HLTTriggerTypeList; }
89  const std::vector<HLTTriggerType*>& triggerTypeList() const { return m_HLTTriggerTypeList; }
90 
91  // setters
92  HLTChain& set_chain_name ( const std::string& chain_name);
95  HLTChain& set_level ( const std::string& level) { m_level = level; return *this; }
96  HLTChain& set_lower_chain_name ( const std::string& lower_chain_name);
98  HLTChain& set_lower_chain_counters ( const std::vector<int>& low_ccs) { m_lower_chain_counters = low_ccs; return *this; }
99  HLTChain& set_signatureList ( const std::vector<HLTSignature*>& sigList);
100  HLTChain& set_triggerTypeList ( const std::vector<HLTTriggerType*>& trigList);
101  HLTChain& set_groupList ( const std::set<std::string>& groups) { m_groups = groups; return *this; }
103  HLTChain& set_leg_multiplicities ( const std::vector<size_t>& mult ) { m_leg_multiplicities = mult; return *this; }
104 
105 
106  // signatures
107  std::vector<HLTSignature*>& signatureList() { return m_HLTSignatureList; }
108  const std::vector<HLTSignature*>& signatureList() const { return m_HLTSignatureList; }
109  const std::vector<HLTSignature*>& signatures() const { return m_HLTSignatureList; }
110  unsigned int lastStep() const;
111  void shiftStepCounter(int shift);
112 
113 
114  // streams
115  void addStream(HLTStreamTag*);
116  void clearStreams();
117  const std::vector<HLTStreamTag*>& streams() const { return m_streams; }
118  #ifndef __GCCXML__
119  const std::vector<HLTStreamTag*>& streamTagList() const __attribute__ ((deprecated)) { return m_streams; } //deprecated
120  #endif
121  const std::vector<HLTStreamTag*>& streams_orig() const { return m_streams_orig; }
122  std::pair<bool, float> stream_prescale(const std::string& streamName) const;
123 
124 
125  // groups
126  const std::set<std::string>& groups() const { return m_groups; }
127  #ifndef __GCCXML__
128  const std::set<std::string>& groupList() const __attribute__ ((deprecated)) { return m_groups; }
129  #endif
130  void addGroup(const std::string& group) { m_groups.insert(group); }
131  void clearGroups() { m_groups.clear(); }
132 
133  // prescales
138 
140  const HLTPrescale& prescales() const { return m_prescales; }
141  float prescale() const { return prescales().prescale(); }
142  float pass_through() const { return prescales().pass_through(); }
143  std::pair<bool, float> rerun_prescale(const std::string& targetName) const { return prescales().getRerunPrescale(targetName); }
144  #ifndef __GCCXML__
145  float rerun_prescale() const __attribute__ ((deprecated)) { return prescales().getRerunPrescale("").second; }
146  #endif
147 
148  inline bool operator<(const HLTChain& e) const {
149  return m_level[0]>e.m_level[0] ||
150  (m_level[0]==e.m_level[0] && m_chain_counter<e.m_chain_counter);
151  }
152 
154  void createSignatureLabels();
155 
157  void print(const std::string& indent="", unsigned int detail=1) const override;
158 
159  void writeXML(std::ofstream & xmlfile);
160 
161  DiffStruct* compareTo(const HLTChain* o) const;
162 
163  // for python
164  std::string __str__() const override;
165 
166 
167  private:
168 
169 
170  unsigned int m_chain_hash_id;
173  std::string m_level;
174  std::string m_lower_chain_name;
176  std::vector<int> m_lower_chain_counters;
177  unsigned int m_lower_chain_hash_id;
179  std::vector<size_t> m_leg_multiplicities;
181 
182  std::vector<HLTSignature*> m_HLTSignatureList;
183  std::vector<HLTTriggerType*> m_HLTTriggerTypeList;
184  std::set<std::string> m_groups;
185  std::vector<HLTStreamTag*> m_streams_orig;
186  std::vector<HLTStreamTag*> m_streams;
187  std::unordered_map<std::string, HLTStreamTag*> m_streams_map;
188 
189  friend std::ostream & operator<<(std::ostream &, const HLTChain &);
190 
191  public:
192 
193  // temporary object to store the merge information
194  struct {
195  unsigned int l2{0};
196  unsigned int ef{0};
198  };
199 
200 }
201 
202 #endif
TrigConf::HLTChain::streams
const std::vector< HLTStreamTag * > & streams() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:117
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:97
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:75
TrigConf::L2
@ L2
Definition: HLTLevel.h:12
TrigConf::HLTChain::signatureList
const std::vector< HLTSignature * > & signatureList() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:108
TrigConf::HLTChain::m_prescales
HLTPrescale m_prescales
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:180
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:72
TrigConf::HLTChain::lastStep
unsigned int lastStep() const
Definition: TrigConfHLTData/Root/HLTChain.cxx:168
TrigConf::HLTChain::prescale
float prescale() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:141
TrigConf::HLTChain::triggerTypeList
std::vector< HLTTriggerType * > & triggerTypeList()
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:88
TrigConf::HLTChain::set_EB_after_step
HLTChain & set_EB_after_step(int EB_after_step)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:102
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:176
TrigConf::DiffStruct
Definition: DiffStruct.h:14
HLTPrescale.h
TrigConf::HLTChain::addGroup
void addGroup(const std::string &group)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:130
TrigConf::HLTChain::lower_chain_name
const std::string & lower_chain_name() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:77
TrigConf::HLTChain::prescales
const HLTPrescale & prescales() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:140
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:170
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:109
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:186
TrigConf::HLTChain::lower_chain_hash_id
unsigned int lower_chain_hash_id() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:80
TrigConf::HLTChain::set_level
HLTChain & set_level(const std::string &level)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:95
TrigConf::HLTChain::signatureList
std::vector< HLTSignature * > & signatureList()
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:107
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:82
TrigConf::HLTChain::l2
unsigned int l2
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:195
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:177
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:148
TrigConf::HLTChain::groups
const std::set< std::string > & groups() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:126
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:89
TrigConf::HLTChain::chain_counter
int chain_counter() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:73
TrigConf::HLTChain::set_prescale
HLTChain & set_prescale(float prescale)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:135
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:119
TrigConf::HLTChain::ef
unsigned int ef
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:196
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:94
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:174
TrigConf::HLTChain::m_HLTSignatureList
std::vector< HLTSignature * > m_HLTSignatureList
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:182
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:74
TrigConf::HLTChain::EB_after_step
int EB_after_step() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:81
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:173
TrigConf::HLTChain::rerun_prescale
std::pair< bool, float > rerun_prescale(const std::string &targetName) const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:143
TrigConf::HLTChain::set_groupList
HLTChain & set_groupList(const std::set< std::string > &groups)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:101
TrigConf::HLTChain::m_streams_map
std::unordered_map< std::string, HLTStreamTag * > m_streams_map
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:187
TrigConf::HLTChain::m_leg_multiplicities
std::vector< size_t > m_leg_multiplicities
Number of objects required per leg.
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:179
TrigConf::HLTChain::set_triggerTypeList
HLTChain & set_triggerTypeList(const std::vector< HLTTriggerType * > &trigList)
Definition: TrigConfHLTData/Root/HLTChain.cxx:142
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:175
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:131
TrigConf::HLTChain::set_chain_counter
HLTChain & set_chain_counter(int chain_counter)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:93
TrigConf::HLTChain::rerun_prescale
float rerun_prescale() const __attribute__((deprecated))
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:145
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:128
TrigConf::HLTChain::m_chain_version
int m_chain_version
chain version
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:172
TrigConf::HLTChain::m_groups
std::set< std::string > m_groups
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:184
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:79
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:137
runJobs.deprecated
deprecated
Definition: runJobs.py:191
AthenaPoolExample_Copy.streamName
string streamName
Definition: AthenaPoolExample_Copy.py:39
TrigConf::HLTChain::m_streams_orig
std::vector< HLTStreamTag * > m_streams_orig
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:185
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:121
TrigConf::HLTChain::mergeCounter
struct TrigConf::HLTChain::@215 mergeCounter
TrigConf::HLTChain::level_enum
HLTLevel level_enum() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:76
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:171
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:98
TrigConf::HLTChain::prescales
HLTPrescale & prescales()
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:139
TrigConf::HLTChain::lower_chain_counter
int lower_chain_counter() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:78
TrigConf::HLTChain::set_rerun_prescale
HLTChain & set_rerun_prescale(float rerun_prescale)
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:136
TrigConf::HLTChain::pass_through
float pass_through() const
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:142
TrigConf::HLTChain::m_HLTTriggerTypeList
std::vector< HLTTriggerType * > m_HLTTriggerTypeList
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:183
TrigConf::HLTChain::m_EB_after_step
int m_EB_after_step
EB_after_step flag.
Definition: TrigConfHLTData/TrigConfHLTData/HLTChain.h:178
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:103