00001
00002 #ifndef TrigConf_TriggerThreshold
00003 #define TrigConf_TriggerThreshold
00004
00005 #include "TrigConfL1Data/TriggerThresholdValue.h"
00006 #include "TrigConfL1Data/L1DataDef.h"
00007 #include "TrigConfL1Data/L1DataBaseclass.h"
00008
00009 #include <string>
00010 #include <vector>
00011 #include <iostream>
00012
00013 namespace TrigConf {
00014
00015 class TriggerThreshold : public L1DataBaseclass {
00016
00017 public:
00018 TriggerThreshold();
00019 TriggerThreshold( const TriggerThreshold& thr);
00020 virtual ~TriggerThreshold();
00021
00022 static TriggerThresholdValue* createThresholdValue(const std::string& type);
00023
00024
00025 L1DataDef::TriggerType ttype() const { return m_type; }
00026 const std::string& type() const { return m_SType; }
00027 bool active() const { return m_Active; }
00028 int mapping() const { return m_Mapping; }
00029 const std::string& cableName() const { return m_CableName; }
00030 const std::string& cableCtpin() const { return m_CableCtpin; }
00031 const std::string& cableConnector() const { return m_CableConnector; }
00032 int cableStart() const { return m_CableStart; }
00033 int cableEnd() const { return m_CableEnd; }
00034 unsigned int clock() const { return m_Clock; }
00035 int thresholdNumber() const { return m_ThresholdNumber; }
00036 int numberofValues() const { return m_TriggerThresholdValueVector.size(); }
00037 const std::string& zbSeedingThresholdName() const { return m_ZBSeedingThresholdName; }
00038 int zbSeedingThresholdMulti() const { return m_ZBSeedingThresholdMulti; }
00039 int bcDelay() const { return m_BCDelay; }
00040 unsigned int bitnum() const { return m_Bitnum; }
00041 const std::string& input() const { return m_Input; }
00042
00043
00044 void setType (L1DataDef::TriggerType type);
00045 void setType (const std::string& type);
00046 void setActive (bool x) { m_Active = x; }
00047 void setMapping (int m) { m_Mapping = m; }
00048 void setCableName (const std::string& cablename ) { m_CableName = cablename; }
00049 void setCableCtpin (const std::string& cablectpin) { m_CableCtpin = cablectpin; }
00050 void setCableConnector (const std::string& connector) { m_CableConnector = connector; }
00051 void setCableStart (int cable) { m_CableStart = cable; }
00052 void setCableEnd (int cable) { m_CableEnd = cable; }
00053 void setClock (unsigned int clock) { m_Clock = clock; }
00054 void setThresholdNumber (int number) { m_ThresholdNumber = number; }
00055 void setZBSeedingThresholdName (const std::string& seed) { m_ZBSeedingThresholdName = seed; }
00056 void setZBSeedingThresholdMulti (int seedmulti) { m_ZBSeedingThresholdMulti = seedmulti; }
00057 void setBCDelay (int bcdelay) { m_BCDelay = bcdelay; }
00058 void setBitnum (unsigned int bitnum) { m_Bitnum = bitnum; }
00059 void setInput (const std::string& input);
00060
00061
00062 bool isInternal() const;
00063
00064
00065 TriggerThresholdValue* triggerThresholdValue(int eta,int phi) const;
00066 const std::vector<TriggerThresholdValue*>& thresholdValueVector() const;
00067 void clearThresholdValues();
00068
00069 void addThresholdValue(TriggerThresholdValue* value);
00070 TriggerThresholdValue* addThresholdValue(const std::string& type);
00071
00072 virtual void print(const std::string& indent="", unsigned int detail=1) const;
00073 virtual void writeXML(std::ostream & xmlfile, int indentLevel=0, int indentWidth=2) const;
00074
00075 protected:
00076 L1DataDef::TriggerType m_type {L1DataDef::UNDEF};
00077 std::string m_SType {"dummy"};
00078 bool m_Active {true};
00079 int m_Mapping {-1};
00080 std::vector<TriggerThresholdValue*> m_TriggerThresholdValueVector{};
00081 std::string m_CableName{""};
00082 std::string m_CableCtpin{""};
00083 std::string m_CableConnector{""};
00084 int m_CableStart{0};
00085 int m_CableEnd{0};
00086 unsigned int m_Clock{0};
00087 int m_ThresholdNumber{-1};
00088
00089 std::string m_ZBSeedingThresholdName{""};
00090 int m_ZBSeedingThresholdMulti{0};
00091 int m_BCDelay{3564};
00092 unsigned int m_Bitnum{1};
00093 std::string m_Input{"ctpin"};
00094 };
00095
00096 }
00097
00098 #endif
00099