00001 #ifndef FECONFWEIGHTGROUPDAT_H 00002 #define FECONFWEIGHTGROUPDAT_H 00003 00004 #include <vector> 00005 #include <stdexcept> 00006 00007 #include "OnlineDB/EcalCondDB/interface/IDataItem.h" 00008 #include "OnlineDB/EcalCondDB/interface/FEConfigWeightInfo.h" 00009 #include "OnlineDB/EcalCondDB/interface/EcalLogicID.h" 00010 00011 class FEConfigWeightGroupDat : public IDataItem { 00012 public: 00013 friend class EcalCondDBInterface; // XXX temp should not need 00014 FEConfigWeightGroupDat(); 00015 ~FEConfigWeightGroupDat(); 00016 00017 // User data methods 00018 inline std::string getTable() { return "FE_CONFIG_WEIGHT_PER_GROUP_DAT"; } 00019 00020 inline void setWeightGroupId(int x) { m_group_id = x; } 00021 inline int getWeightGroupId() const { return m_group_id; } 00022 00023 inline void setWeight0(float x) { m_w0 = x; } 00024 inline float getWeight0() const { return m_w0; } 00025 inline void setWeight1(float x) { m_w1 = x; } 00026 inline float getWeight1() const { return m_w1; } 00027 inline void setWeight2(float x) { m_w2 = x; } 00028 inline float getWeight2() const { return m_w2; } 00029 inline void setWeight3(float x) { m_w3 = x; } 00030 inline float getWeight3() const { return m_w3; } 00031 inline void setWeight4(float x) { m_w4 = x; } 00032 inline float getWeight4() const { return m_w4; } 00033 00034 private: 00035 void prepareWrite() 00036 throw(std::runtime_error); 00037 00038 void writeDB(const EcalLogicID* ecid, const FEConfigWeightGroupDat* item, FEConfigWeightInfo* iconf) 00039 throw(std::runtime_error); 00040 00041 00042 void writeArrayDB(const std::map< EcalLogicID, FEConfigWeightGroupDat>* data, FEConfigWeightInfo* iconf) 00043 throw(std::runtime_error); 00044 00045 00046 void fetchData(std::map< EcalLogicID, FEConfigWeightGroupDat >* fillMap, FEConfigWeightInfo* iconf) 00047 throw(std::runtime_error); 00048 00049 // User data 00050 int m_group_id; 00051 float m_w0; 00052 float m_w1; 00053 float m_w2; 00054 float m_w3; 00055 float m_w4; 00056 00057 }; 00058 00059 #endif