00001
00002 #ifndef TrigConf_TriggerItem
00003 #define TrigConf_TriggerItem
00004
00005 #include "TrigConfL1Data/TriggerItemNode.h"
00006 #include "TrigConfL1Data/L1DataBaseclass.h"
00007
00008 #include <string>
00009 #include <stdexcept>
00010 #include <iostream>
00011
00012 namespace TrigConf {
00013
00014 class DiffStruct;
00015 class TriggerItem;
00016
00017 std::ostream & operator<<(std::ostream &, const TrigConf::TriggerItem &);
00018
00019
00020 class TriggerItem : public TrigConfData {
00021 public:
00022 TriggerItem();
00023 virtual ~TriggerItem();
00024
00025
00026 unsigned int complex_deadtime() const { return m_ComplexDeadtime; }
00027 const std::string& definition() const { return m_Definition; }
00028 unsigned int triggerType() const { return m_TriggerType; }
00029 int ctpId() const { return m_CtpId; }
00030 unsigned int partition() const { return m_Partition; }
00031 TriggerItemNode* topNode() const { return m_TopNode; }
00032 unsigned short monitor() const { return m_Monitor; }
00033 uint16_t bunchgroupMask() const;
00034
00035
00036 void setComplexDeadtime( unsigned int cmpldt ) { m_ComplexDeadtime = cmpldt; }
00037 void setPartition( unsigned int partition ) { m_Partition = partition; }
00038 void setTopNode(TriggerItemNode* ptrnode ) { m_TopNode = ptrnode; }
00039 void setTriggerType(unsigned int tt) { m_TriggerType = (tt & 0xff); }
00040 void setCtpId (int id) { m_CtpId = id; }
00041 void setDefinition(std::string def) { m_Definition = def; }
00042
00043 bool isTriggerTypeBitOn(int ibit) const { return ( (m_TriggerType & (1<<ibit) )!=0); }
00044
00045 virtual void print(const std::string& indent="", unsigned int detail=1) const;
00046
00047 void writeXML(std::ostream & xmlfile, int indentLevel=0, int indentWidth=2) const;
00048 void buildLogic(std::string & logic, std::vector<std::string> & conditionList) const;
00049 void setCondition(const std::string& logic,
00050 const std::vector<std::string>& conditions,
00051 const std::vector<TrigConf::TriggerThreshold*>& thrs);
00052
00053 void setMonitor(unsigned short monitor) { m_Monitor = monitor; }
00054
00055 inline bool operator<(const TriggerItem& e) const {
00056 return ctpId() < e.ctpId();
00057 }
00058
00059 DiffStruct* compareTo(const TriggerItem* o) const;
00060
00061 std::string __str__() const;
00062
00063 private:
00064 unsigned int m_ComplexDeadtime;
00065 std::string m_Definition;
00066 TriggerItemNode* m_TopNode;
00067 int m_CtpId;
00068 unsigned int m_TriggerType;
00069 unsigned int m_Partition;
00070 unsigned short m_Monitor;
00071 friend std::ostream & operator<<(std::ostream &, const TrigConf::TriggerItem &);
00072 };
00073
00074 }
00075 #endif
00076