File indexing completed on 2024-04-06 12:22:57
0001 #ifndef ODWEIGHTSDAT_H
0002 #define ODWEIGHTSDAT_H
0003
0004 #include <vector>
0005 #include <stdexcept>
0006
0007 #include "OnlineDB/EcalCondDB/interface/IDataItem.h"
0008 #include "OnlineDB/EcalCondDB/interface/IODConfig.h"
0009 #include "OnlineDB/EcalCondDB/interface/EcalLogicID.h"
0010 #include "OnlineDB/EcalCondDB/interface/ODFEWeightsInfo.h"
0011
0012 class ODWeightsDat : public IODConfig {
0013 public:
0014 friend class EcalCondDBInterface;
0015 ODWeightsDat();
0016 ~ODWeightsDat() override;
0017
0018
0019 inline std::string getTable() override { return "DCC_WEIGHTS_DAT"; }
0020
0021 inline void setId(int dac) { m_ID = dac; }
0022 inline int getId() const { return m_ID; }
0023
0024 inline void setSMId(int dac) { m_sm = dac; }
0025 inline int getSMId() const { return m_sm; }
0026
0027 inline void setFedId(int dac) { m_fed = dac; }
0028 inline int getFedId() const { return m_fed; }
0029
0030 inline void setTTId(int dac) { m_tt = dac; }
0031 inline int getTTId() const { return m_tt; }
0032
0033 inline void setCrystalId(int dac) { m_xt = dac; }
0034 inline int getCrystalId() const { return m_xt; }
0035
0036 inline void setWeight0(float x) { m_wei0 = x; }
0037 inline void setWeight1(float x) { m_wei1 = x; }
0038 inline void setWeight2(float x) { m_wei2 = x; }
0039 inline void setWeight3(float x) { m_wei3 = x; }
0040 inline void setWeight4(float x) { m_wei4 = x; }
0041 inline void setWeight5(float x) { m_wei5 = x; }
0042
0043 inline void setWeight(int pos, float x) { m_wei[pos] = x; }
0044
0045 inline float getWeight0() const { return m_wei0; }
0046 inline float getWeight1() const { return m_wei1; }
0047 inline float getWeight2() const { return m_wei2; }
0048 inline float getWeight3() const { return m_wei3; }
0049 inline float getWeight4() const { return m_wei4; }
0050 inline float getWeight5() const { return m_wei5; }
0051
0052 inline std::vector<std::vector<float> > getWeight() const { return dccw; }
0053
0054 private:
0055 void clear();
0056 void prepareWrite() noexcept(false) override;
0057
0058 void writeDB(const ODWeightsDat* item, ODFEWeightsInfo* iov) noexcept(false);
0059
0060 void writeArrayDB(const std::vector<ODWeightsDat>& data, ODFEWeightsInfo* iov) noexcept(false);
0061
0062 void fetchData(std::vector<ODWeightsDat>* fillMap, ODFEWeightsInfo* iov) noexcept(false);
0063
0064 void fetchData(ODWeightsDat* p) noexcept(false);
0065
0066
0067 int m_sm;
0068 int m_fed;
0069 int m_tt;
0070 int m_xt;
0071 int m_ID;
0072
0073 float m_wei0;
0074 float m_wei1;
0075 float m_wei2;
0076 float m_wei3;
0077 float m_wei4;
0078 float m_wei5;
0079
0080 float m_wei[6];
0081 std::vector<std::vector<float> > dccw;
0082 };
0083
0084 #endif