CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/OnlineDB/EcalCondDB/interface/ODWeightsDat.h

Go to the documentation of this file.
00001 #ifndef ODWEIGHTSDAT_H
00002 #define ODWEIGHTSDAT_H
00003 
00004 #include <vector>
00005 #include <stdexcept>
00006 
00007 #include "OnlineDB/EcalCondDB/interface/IDataItem.h"
00008 #include "OnlineDB/EcalCondDB/interface/IODConfig.h"
00009 #include "OnlineDB/EcalCondDB/interface/EcalLogicID.h"
00010 #include "OnlineDB/EcalCondDB/interface/ODFEWeightsInfo.h"
00011 
00012 class ODWeightsDat : public IODConfig {
00013  public:
00014   friend class EcalCondDBInterface;
00015   ODWeightsDat();
00016   ~ODWeightsDat();
00017 
00018   // User data methods
00019   inline std::string getTable() { return "DCC_WEIGHTS_DAT"; }
00020 
00021   inline void setId(int dac) { m_ID = dac; }
00022   inline int getId() const { return m_ID; }
00023 
00024   inline void setSMId(int dac) { m_sm = dac; }
00025   inline int getSMId() const { return m_sm; }
00026 
00027   inline void setFedId(int dac) { m_fed = dac; }
00028   inline int getFedId() const { return m_fed; }
00029 
00030   inline void setTTId(int dac) { m_tt = dac; }
00031   inline int getTTId() const { return m_tt; }
00032 
00033   inline void setCrystalId(int dac) { m_xt = dac; }
00034   inline int getCrystalId() const { return m_xt; }
00035 
00036   inline void setWeight0( float x) { m_wei0 = x; }
00037   inline void setWeight1( float x) { m_wei1 = x; }
00038   inline void setWeight2( float x) { m_wei2 = x; }
00039   inline void setWeight3( float x) { m_wei3 = x; }
00040   inline void setWeight4( float x) { m_wei4 = x; }
00041   inline void setWeight5( float x) { m_wei5 = x; }
00042 
00043   inline void setWeight( int pos, float x) { m_wei[pos] = x; }
00044 
00045   inline float getWeight0() const { return m_wei0; }
00046   inline float getWeight1() const { return m_wei1; }
00047   inline float getWeight2() const { return m_wei2; }
00048   inline float getWeight3() const { return m_wei3; }
00049   inline float getWeight4() const { return m_wei4; }
00050   inline float getWeight5() const { return m_wei5; }
00051 
00052   inline std::vector<std::vector<float> > getWeight() const { return dccw; }
00053 
00054  private:
00055   void clear();
00056   void prepareWrite() 
00057     throw(std::runtime_error);
00058 
00059   void writeDB(const ODWeightsDat* item, ODFEWeightsInfo* iov )
00060     throw(std::runtime_error);
00061 
00062   void writeArrayDB(const std::vector< ODWeightsDat > data, ODFEWeightsInfo* iov)
00063     throw(std::runtime_error);
00064 
00065 
00066   void fetchData(std::vector< ODWeightsDat >* fillMap, ODFEWeightsInfo* iov)
00067      throw(std::runtime_error);
00068 
00069   void fetchData(ODWeightsDat * p)     throw(std::runtime_error);
00070 
00071   // User data
00072   int m_sm;
00073   int m_fed;
00074   int m_tt;
00075   int m_xt;
00076   int m_ID;
00077   
00078   float m_wei0;
00079   float m_wei1;
00080   float m_wei2;
00081   float m_wei3;
00082   float m_wei4;
00083   float m_wei5;
00084   
00085   float m_wei[6];
00086   std::vector<std::vector<float> > dccw;
00087 };
00088 
00089 #endif