00001 #ifndef TrigConf_HLTChain
00002 #define TrigConf_HLTChain
00003
00004 #include "TrigConfL1Data/TrigConfData.h"
00005 #include "TrigConfHLTData/HLTPrescale.h"
00006 #include "TrigConfHLTData/HLTLevel.h"
00007
00008 #include <string>
00009 #include <iosfwd>
00010 #include <fstream>
00011 #include <vector>
00012 #include <map>
00013 #include <set>
00014
00015 #include "boost/unordered_map.hpp"
00016
00017 namespace TrigConf {
00018 class HLTChain;
00019 class HLTSignature;
00020 class HLTTriggerType;
00021 class HLTStreamTag;
00022 class DiffStruct;
00023 }
00024
00025 bool HLTChain_lt(const TrigConf::HLTChain* ch1, const TrigConf::HLTChain* ch2);
00026
00027 namespace TrigConf {
00028
00029 std::ostream & operator<<(std::ostream &, const HLTChain &);
00030
00032 class HLTChain : public TrigConfData {
00033 public:
00034
00036 HLTChain( void );
00037
00050 HLTChain( const std::string& chain_name,
00051 int chain_counter,
00052 int chain_version,
00053 const std::string& level,
00054 const std::string& lower_chain_name,
00055 int lower_chain_counter,
00056 const std::vector<HLTSignature*>& signatureList );
00057
00062 HLTChain( const HLTChain& ch );
00063
00065 ~HLTChain();
00066
00067
00068
00069 const std::string& chain_name () const { return name(); }
00070 int chain_counter () const { return m_chain_counter; }
00071 int chain_version () const { return m_chain_version; }
00072 const std::string& level () const { return m_level; }
00073 HLTLevel level_enum () const { return m_level=="L2"?L2:(m_level=="EF"?EF:HLT); }
00074 const std::string& lower_chain_name () const { return m_lower_chain_name; }
00075 int lower_chain_counter () const { return m_lower_chain_counter; }
00076 unsigned int chain_hash_id () const { return m_chain_hash_id; }
00077 unsigned int lower_chain_hash_id () const { return m_lower_chain_hash_id; }
00078 int EB_after_step () const { return m_EB_after_step; }
00079 bool hasMultipleLowerChains() const;
00080 const std::vector<int>& lower_chain_counters () const;
00081 std::vector<unsigned int> lower_chain_hash_ids () const;
00082
00083
00084 std::vector<HLTTriggerType*>& triggerTypeList() { return m_HLTTriggerTypeList; }
00085 const std::vector<HLTTriggerType*>& triggerTypeList() const { return m_HLTTriggerTypeList; }
00086
00087
00088 HLTChain& set_chain_name ( const std::string& chain_name);
00089 HLTChain& set_chain_counter ( int chain_counter) { m_chain_counter = chain_counter; return *this; }
00090 HLTChain& set_chain_version ( int chain_version) { m_chain_version = chain_version; return *this; }
00091 HLTChain& set_level ( const std::string& level) { m_level = level; return *this; }
00092 HLTChain& set_lower_chain_name ( const std::string& lower_chain_name);
00093 HLTChain& set_lower_chain_counter ( int lower_chain_counter) { m_lower_chain_counter = lower_chain_counter; return *this; }
00094 HLTChain& set_lower_chain_counters ( const std::vector<int>& low_ccs) { m_lower_chain_counters = low_ccs; return *this; }
00095 HLTChain& set_signatureList ( const std::vector<HLTSignature*>& sigList);
00096 HLTChain& set_triggerTypeList ( const std::vector<HLTTriggerType*>& trigList) { m_HLTTriggerTypeList = trigList; return *this; }
00097 HLTChain& set_groupList ( const std::set<std::string>& groups) { m_groups = groups; return *this; }
00098 HLTChain& set_EB_after_step ( int EB_after_step ) { m_EB_after_step = EB_after_step; return *this; }
00099
00100
00101
00102 std::vector<HLTSignature*>& signatureList() { return m_HLTSignatureList; }
00103 const std::vector<HLTSignature*>& signatureList() const { return m_HLTSignatureList; }
00104 const std::vector<HLTSignature*>& signatures() const { return m_HLTSignatureList; }
00105 unsigned int lastStep() const;
00106 void shiftStepCounter(int shift);
00107
00108
00109
00110 void addStream(HLTStreamTag*);
00111 void clearStreams();
00112 const std::vector<HLTStreamTag*>& streams() const { return m_streams; }
00113 #ifndef __GCCXML__
00114 const std::vector<HLTStreamTag*>& streamTagList() const __attribute__ ((deprecated)) { return m_streams; }
00115 #endif
00116 const std::vector<HLTStreamTag*>& streams_orig() const { return m_streams_orig; }
00117 std::pair<bool, float> stream_prescale(const std::string& streamName) const;
00118
00119
00120
00121 const std::set<std::string>& groups() const { return m_groups; }
00122 #ifndef __GCCXML__
00123 const std::set<std::string>& groupList() const __attribute__ ((deprecated)) { return m_groups; }
00124 #endif
00125 void addGroup(const std::string& group) { m_groups.insert(group); }
00126 void clearGroups() { m_groups.clear(); }
00127
00128
00129 HLTChain& set_prescales( const HLTPrescale& prescales);
00130 HLTChain& set_prescale( float prescale) { m_prescales.setPrescale(prescale); return *this; }
00131 HLTChain& set_rerun_prescale( float rerun_prescale) { m_prescales.setRerunPrescale("",rerun_prescale); return *this; }
00132 HLTChain& set_pass_through( float pass_through) { m_prescales.setPassThrough(pass_through); return *this; }
00133
00134 HLTPrescale& prescales() { return m_prescales; }
00135 const HLTPrescale& prescales() const { return m_prescales; }
00136 float prescale() const { return prescales().prescale(); }
00137 float pass_through() const { return prescales().pass_through(); }
00138 std::pair<bool, float> rerun_prescale(const std::string& targetName) const { return prescales().getRerunPrescale(targetName); }
00139 #ifndef __GCCXML__
00140 float rerun_prescale() const __attribute__ ((deprecated)) { return prescales().getRerunPrescale("").second; }
00141 #endif
00142
00143 inline bool operator<(const HLTChain& e) const {
00144 return m_level[0]>e.m_level[0] ||
00145 (m_level[0]==e.m_level[0] && m_chain_counter<e.m_chain_counter);
00146 }
00147
00149 void createSignatureLabels();
00150
00152 void print(const std::string& indent="", unsigned int detail=1) const;
00153
00154 void writeXML(std::ofstream & xmlfile);
00155
00156 DiffStruct* compareTo(const HLTChain* o) const;
00157
00158
00159 std::string __str__() const;
00160
00161
00162 private:
00163
00164
00165 unsigned int m_chain_hash_id;
00166 int m_chain_counter;
00167 int m_chain_version;
00168 std::string m_level;
00169 std::string m_lower_chain_name;
00170 int m_lower_chain_counter;
00171 std::vector<int> m_lower_chain_counters;
00172 unsigned int m_lower_chain_hash_id;
00173 int m_EB_after_step;
00174 HLTPrescale m_prescales;
00175
00176 std::vector<HLTSignature*> m_HLTSignatureList;
00177 std::vector<HLTTriggerType*> m_HLTTriggerTypeList;
00178 std::set<std::string> m_groups;
00179 std::vector<HLTStreamTag*> m_streams_orig;
00180 std::vector<HLTStreamTag*> m_streams;
00181 boost::unordered_map<std::string, HLTStreamTag*> m_streams_map;
00182
00183 friend std::ostream & operator<<(std::ostream &, const HLTChain &);
00184
00185 public:
00186
00187
00188 struct {
00189 unsigned int l2;
00190 unsigned int ef;
00191 } mergeCounter;
00192 };
00193
00194 }
00195
00196 #endif