00001 #ifndef TRIGGER_DECISION_TOOL_CHAIN_GROUP_H
00002 #define TRIGGER_DECISION_TOOL_CHAIN_GROUP_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include <iterator>
00018 #include <vector>
00019 #include <map>
00020 #include <set>
00021 #include <string>
00022 #include <stack>
00023 #include <boost/algorithm/string.hpp>
00024
00025 #include "TrigDecisionTool/CacheGlobalMemory.h"
00026 #include "TrigDecisionTool/Conditions.h"
00027 #include "TrigDecisionTool/FeatureContainer.h"
00028 #include "TrigDecisionTool/Logger.h"
00029 #include "TrigSteeringEvent/Enums.h"
00030
00031
00032 namespace HLT {
00033 class Chain;
00034 }
00035
00036 namespace LVL1CTP {
00037 class Lvl1Item;
00038 }
00039
00040 namespace TrigConf {
00041 class TriggerItem;
00042 class HLTChain;
00043 class HLTTriggerElement;
00044 }
00045
00046
00047 namespace Trig {
00048
00049
00050
00051 class ChainGroup : public virtual Logger {
00052
00053 friend class CacheGlobalMemory;
00054
00055 public:
00056
00057 typedef std::vector<std::string>::const_iterator const_iterator;
00058 const Trig::ChainGroup& operator+(const Trig::ChainGroup& rhs);
00059 bool operator==(const Trig::ChainGroup& rhs);
00060 bool operator!=(const Trig::ChainGroup& rhs);
00061
00065 void addAlias(const std::string& alias);
00066
00067
00072 bool isPassed(unsigned int condition=TrigDefs::Physics) const;
00073
00074
00080 float getPrescale(unsigned int condition=TrigDefs::Physics) const;
00081
00082
00083 std::vector< std::string > getListOfTriggers() const;
00084 std::vector< std::string > getListOfStreams() const;
00085 std::vector< std::string > getListOfGroups() const;
00086 std::vector< std::string > getListOfThresholds() const;
00087 std::vector< std::string > getListOfSignatures() const;
00088 std::vector< std::vector< std::string > > getListOfTriggerElements() const;
00089 std::vector< std::vector< TrigConf::HLTTriggerElement* > > getHLTTriggerElements() const;
00090
00091
00096 unsigned int isPassedBits() const;
00097
00098
00105 HLT::ErrorCode error() const;
00106
00107
00112 const FeatureContainer features(unsigned int condition = TrigDefs::Physics) const;
00113
00114
00115 const std::vector< std::string >& patterns() const {return m_patterns;}
00116 private:
00117
00118
00119 ChainGroup(const std::vector< std::string >& triggerNames,
00120 const Trig::CacheGlobalMemory& parent);
00121
00122 ~ChainGroup();
00123
00124 float calculatePrescale(unsigned int condition=TrigDefs::Physics);
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 void appendFeatures(std::vector< std::vector< HLT::TriggerElement*> >& tes, FeatureContainer& fc) const;
00140
00144 const std::vector< std::string >& names() const {return m_names;}
00145
00146 bool HLTResult(const std::string& chain, unsigned int condition) const;
00147 bool L1Result(const std::string& item, unsigned int condition) const;
00148
00149 unsigned int HLTBits(const std::string& chain, const std::string& level) const;
00150 unsigned int L1Bits(const std::string& item) const;
00151
00152 float HLTPrescale(const std::string& chain, unsigned int condition) const;
00153 float L1Prescale(const std::string& item, unsigned int condition) const;
00154
00155 std::string getLowerName(const std::string& EFname) const;
00156
00157
00158
00159 typedef std::set<const TrigConf::TriggerItem*>::const_iterator const_conf_item_iterator;
00160 typedef std::set<const TrigConf::HLTChain*>::const_iterator const_conf_chain_iterator;
00161 const_conf_chain_iterator conf_chain_begin() const { return m_confChains.begin(); }
00162 const_conf_chain_iterator conf_chain_end() const { return m_confChains.end(); }
00163
00164 const_conf_item_iterator conf_item_begin() const { return m_confItems.begin(); }
00165 const_conf_item_iterator conf_item_end() const { return m_confItems.end(); }
00166
00167 std::vector<std::string> m_patterns;
00168
00169 std::set<const TrigConf::HLTChain*> m_confChains;
00170 std::set<const TrigConf::TriggerItem*> m_confItems;
00171
00172 #ifndef __REFLEX__
00173
00174 const Trig::CacheGlobalMemory& m_cgm;
00175 #endif
00176 std::vector< std::string > m_names;
00177
00178 const Trig::CacheGlobalMemory* cgm(bool onlyConfig=false) const;
00179
00180
00181 void update(const TrigConf::HLTChainList* confChains,
00182 const TrigConf::ItemContainer* confItems);
00183
00184 ChainGroup& operator= (const ChainGroup&);
00185
00186 float m_prescale;
00187
00188 };
00189 }
00190
00191 #endif