MWPSlowController.hh
Go to the documentation of this file.00001
00051 #ifndef _M_WP_SLOW_CONTROLLER_HH_
00052 #define _M_WP_SLOW_CONTROLLER_HH_
00053
00054
00055 #include "QDriver.hh"
00056 #include "QError.hh"
00057 #include "QWPCommon.hh"
00058 #include "QLCConfigWriter.hh"
00059 #include "QLCConfigReader.hh"
00060
00061
00062 #include <list>
00063 #include <set>
00064 #include <vector>
00065
00066 class QEleChannelConfig;
00067
00068 class MWPSlowController : public QDriver {
00069
00070 public:
00072 MWPSlowController(QSequence* s);
00073
00075 virtual ~MWPSlowController();
00076
00084 Action Init();
00085
00092 Action Do(QEvent* ev);
00093
00095 Action Done();
00096
00097 private:
00102 std::vector< std::list<unsigned int> > fGroups;
00103
00104 std::map<unsigned int,QEleChannelConfig> fGroupStartConfigs;
00105 std::map<unsigned int,QEleChannelConfig> fDumpStartConfigs;
00106 std::set<unsigned int> fNextChannels;
00107 std::string fTmpConfigOutputFile;
00108 std::string fConfigOutputFile;
00109 QLCConfigWriter fFullCfgWriter;
00110 QLCConfigReader fCfgReader;
00111 QLCConfigWriter fCfgWriter;
00112 bool fGndMeasurement;
00113 int fRL;
00114 int fBias;
00115 double fExternalBias;
00116 bool fInvertPolarity;
00117 bool fAdjustOffset;
00118 bool fGGMeasurement;
00119 std::map<unsigned int,unsigned int> fEventsPerConfig;
00120 int fMaxEvPerConfig;
00121
00122
00123 QWPCommon::Step fStep;
00124 int fGain;
00125 unsigned int fDaqRun;
00126
00134 void GroupChannels(const std::list<unsigned int>& channels);
00135
00141 void InitConfig(QEleChannelConfig& conf);
00142
00149 QWPCommon::Step PopulateNextConfig(const QWPCommon::Step step);
00150 bool fReadConfigFromFile;
00151
00152 struct Offset {
00153 int Dac;
00154 int Hbit;
00155 bool Pol;
00156 bool Sbit;
00157 };
00158 std::map<unsigned int, Offset> fOffsetsMap;
00159
00160 };
00161
00162 #endif // _M_LC_SLOW_CONTROLLER_HH_