QLCConfigWriter.hh
Go to the documentation of this file.00001
00002 #ifndef _QLC_CONFIG_WRITER_HH_
00003 #define _QLC_CONFIG_WRITER_HH_
00004
00005 #include <map>
00006 #include <string>
00007 #include <vector>
00008 #include <set>
00009
00010 class QError;
00011 class QEleChannelConfig;
00012
00013 #include "QVector.hh"
00014
00015 namespace Cuore {
00016
00017 class QMatrix;
00018 }
00019
00026 class QLCConfigWriter
00027 {
00028 public:
00029
00035 enum Mode {
00036 M_UNKNOWN = 0,
00037 M_WP = 1,
00039 M_LC = 2,
00040 };
00041
00043 QLCConfigWriter();
00044
00046 virtual ~QLCConfigWriter() {};
00047
00049 void Clear();
00050
00052 QError Add(const QEleChannelConfig& config, const std::string& setName);
00053
00055 QError Add(const std::map<unsigned int, QEleChannelConfig>& configMap,
00056 const std::string& set);
00057
00059 QError SetActiveChannels(const std::set<int>& channels);
00060
00062 QError SetChannelsWithHeater(const std::set<int>& channels);
00063
00065 QError SetWrongPolarityChannels(const std::set<int>& channels);
00066
00068 QError Write(const Mode mode, const std::string& filename);
00069
00075 bool Contains(const QEleChannelConfig& config, const std::string& setName);
00076
00077 private:
00078
00080 Cuore::QMatrix vector2QMatrix(const std::vector<QEleChannelConfig>& configs,
00081 const Mode mode);
00082
00084 QError SetSet(const std::set<int>& theSet, const std::string& name);
00085
00090 std::map<std::string, std::vector<QEleChannelConfig> > fSets;
00091
00096 std::map<std::string, Cuore::QVector> fVectors;
00097 };
00098 #endif