00001 #ifndef TrigConf_HLTTriggerElement
00002 #define TrigConf_HLTTriggerElement
00003
00004 #include "TrigConfL1Data/TrigConfData.h"
00005
00006 #include <iosfwd>
00007 #include <fstream>
00008 #include <string>
00009 #include <map>
00010
00011 namespace TrigConf {
00012
00013 class HLTTriggerElement;
00014 std::ostream & operator<<(std::ostream &, const HLTTriggerElement &);
00015
00022 class HLTTriggerElement : public TrigConfData {
00023
00024 public:
00025
00027 HLTTriggerElement();
00028
00035 HLTTriggerElement( const std::string& name );
00036
00043 HLTTriggerElement( unsigned int i, const std::string& name );
00044
00049 HLTTriggerElement( const std::pair<unsigned int, std::string>& p);
00050
00052 virtual ~HLTTriggerElement();
00053
00054
00055 unsigned int hashId() const { return m_hashId; }
00056 unsigned int id() const { return m_hashId; }
00057
00058
00059
00060 void setHashId(unsigned int hashid) { m_hashId = hashid; }
00061
00062
00063
00065 virtual void print(const std::string& indent="", unsigned int detail=1) const;
00066 virtual void writeXML(std::ofstream & xmlfile);
00067
00068 void setL2(bool on=true) const { set(); if(on) m_level |= 0x1; else m_level &= 0x2; }
00069 void setEF(bool on=true) const { set(); if(on) m_level |= 0x2; else m_level &= 0x1; }
00070 void reset() const { m_level = 0x4; }
00071 bool inL2() const { return (m_level|0x1) != 0; }
00072 bool inEF() const { return (m_level|0x2) != 0; }
00073 bool isSet() const { return (m_level&0x4) == 0; }
00074
00075 private:
00076
00077 unsigned int m_hashId;
00078
00079 mutable unsigned int m_level;
00080
00081 void set() const { m_level &= 0x3; }
00082
00083 friend std::ostream & operator<<(std::ostream &, const TrigConf::HLTTriggerElement &);
00084
00085 public:
00091 static bool getLabel(unsigned int id, std::string & label);
00092
00098 static bool getId(const char * label, unsigned int & id);
00099
00100 private:
00101
00102 void CheckAndStoreHash() const;
00103
00104
00105 static std::map<unsigned int, std::string> m_IdToLabel;
00106 };
00107
00108 }
00109
00110 #endif