00001
00002 #ifndef TrigConf_CTPConfig
00003 #define TrigConf_CTPConfig
00004
00005 #include <iosfwd>
00006
00007 #include "TrigConfL1Data/Menu.h"
00008 #include "TrigConfL1Data/PrescaleSet.h"
00009 #include "TrigConfL1Data/BunchGroupSet.h"
00010 #include "TrigConfL1Data/PrescaledClock.h"
00011 #include "TrigConfL1Data/DeadTime.h"
00012 #include "TrigConfL1Data/Random.h"
00013 #include "TrigConfL1Data/L1DataBaseclass.h"
00014 #include "TrigConfL1Data/CTPFiles.h"
00015 #include "TrigConfL1Data/PrioritySet.h"
00016 #include "TrigConfL1Data/Muctpi.h"
00017
00018 namespace TrigConf {
00019
00020 class DiffStruct;
00021
00022 class CTPConfig : public L1DataBaseclass {
00023 public:
00024 CTPConfig();
00025 ~CTPConfig();
00026
00027
00028 unsigned int ctpVersion() const { return m_ctpVersion; }
00029 unsigned int l1Version() const { return m_l1Version; }
00030 int prescaleSetId() const { return m_PrescaleSetId; }
00031 int bunchGroupSetId() const { return m_BunchGroupSetId; }
00032
00033 const Menu& menu() const { return m_Menu; }
00034 const PrescaleSet& prescaleSet(unsigned int partition=0) const { return m_PrescaleSets[partition]; }
00035 const BunchGroupSet& bunchGroupSet() const { return m_BunchGroupSet; }
00036 const PrescaledClock& prescaledClock() const { return m_PrescaledClock; }
00037 const DeadTime& deadTime() const { return m_DeadTime; }
00038 const Random& random() const { return m_Random; }
00039 const CTPFiles* ctpfiles() const { return m_CTPFiles; }
00040 const PrioritySet& prioritySet() const { return m_PrioritySet; }
00041 const Muctpi& muCTPi() const { return m_MuCTPi; }
00042
00043
00044 Menu& menu() { return m_Menu; }
00045 PrescaleSet& prescaleSet(unsigned int partition=0) { return m_PrescaleSets[partition]; }
00046 BunchGroupSet& bunchGroupSet() { return m_BunchGroupSet; }
00047 PrescaledClock& prescaledClock() { return m_PrescaledClock; }
00048 DeadTime& deadTime() { return m_DeadTime; }
00049 Random& random() { return m_Random; }
00050 CTPFiles* ctpfiles() { return m_CTPFiles; }
00051 PrioritySet& prioritySet() { return m_PrioritySet; }
00052 Muctpi& muCTPi() { return m_MuCTPi; }
00053
00054 bool loadCtpFiles() const { return m_LoadCtpFiles; }
00055 bool loadCtpcoreFiles() const { return m_LoadCtpcoreFiles; }
00056 bool loadCtpinFiles() const { return m_LoadCtpinFiles; }
00057 bool loadCtpmonFiles() const { return m_LoadCtpmonFiles; }
00058
00059
00060 void setCTPVersion( unsigned int v );
00061 void setL1Version( unsigned int v );
00062 void setPrescaleSetId(int id) { m_PrescaleSetId=id; }
00063 void setBunchGroupSetId(int id) { m_BunchGroupSetId=id; }
00064 void setMenu(const Menu& m ) { m_Menu = m; }
00065
00066 void clearPrescaleSets();
00067 void setPrescaleSet( const PrescaleSet& pss );
00068
00069 void setBunchGroupSet( const BunchGroupSet& m ) { m_BunchGroupSet = m; }
00070 void setPrescaledClock( const PrescaledClock& m ) { m_PrescaledClock = m; }
00071 void setDeadTime( const DeadTime& m ) { m_DeadTime = m; }
00072 void setRandom( const Random& m ) { m_Random = m; }
00073 void setCTPFiles( CTPFiles* ctp ) { m_CTPFiles = ctp; }
00074 void setPrioritySet( const PrioritySet& m ) { m_PrioritySet = m; }
00075 void setMuCTPi( const Muctpi& m ) { m_MuCTPi = m; }
00076 void setLoadCtpFiles (bool flag = true) {
00077 m_LoadCtpFiles=flag;
00078 m_LoadCtpcoreFiles=flag;
00079 m_LoadCtpinFiles=flag;
00080 m_LoadCtpmonFiles=flag;
00081 }
00082 void setLoadCtpcoreFiles (bool flag = true) { m_LoadCtpcoreFiles=flag; }
00083 void setLoadCtpinFiles (bool flag = true) { m_LoadCtpinFiles=flag; }
00084 void setLoadCtpmonFiles (bool flag = true) { m_LoadCtpmonFiles=flag; }
00085
00086
00087
00088 virtual void print(const std::string& indent="", unsigned int detail=1) const;
00089
00090 void writeXML(const std::string & filename, int indentWidth=2) const;
00091 void writeXML(std::ostream & xmlfile, int indentLevel=0, int indentWidth=2) const;
00092
00093 bool equals(const CTPConfig* other, const std::string& filename) const;
00094
00095 DiffStruct* compareTo(const CTPConfig* o) const;
00096
00097
00098 private:
00099
00100 unsigned int m_ctpVersion;
00101 unsigned int m_l1Version;
00102 int m_PrescaleSetId;
00103 int m_BunchGroupSetId;
00104 Menu m_Menu;
00105 PrescaleSet m_PrescaleSets[4];
00106 BunchGroupSet m_BunchGroupSet;
00107 PrescaledClock m_PrescaledClock;
00108 DeadTime m_DeadTime;
00109 Random m_Random;
00110 PrioritySet m_PrioritySet;
00111 Muctpi m_MuCTPi;
00112
00113 bool m_LoadCtpFiles;
00114 bool m_LoadCtpcoreFiles;
00115 bool m_LoadCtpinFiles;
00116 bool m_LoadCtpmonFiles;
00117 CTPFiles* m_CTPFiles;
00118
00119 };
00120 }
00121
00122 #endif