00001 #ifndef ECALTPGDBAPP_H 00002 #define ECALTPGDBAPP_H 00003 00004 #include <iostream> 00005 #include <string> 00006 #include <sstream> 00007 00008 #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" 00009 #include "OnlineDB/EcalCondDB/interface/RunDat.h" 00010 #include "OnlineDB/EcalCondDB/interface/RunList.h" 00011 #include "OnlineDB/EcalCondDB/interface/all_monitoring_types.h" 00012 #include "OnlineDB/EcalCondDB/interface/all_fe_config_types.h" 00013 00014 class EcalTPGDBApp : public EcalCondDBInterface { 00015 public: 00016 00017 EcalTPGDBApp(std::string host, std::string sid, std::string user, std::string pass, int port) ; 00018 EcalTPGDBApp(std::string sid, std::string user, std::string pass) ; 00019 00020 inline std::string to_string( char value[]) 00021 { 00022 std::ostringstream streamOut; 00023 streamOut << value; 00024 return streamOut.str(); 00025 } 00026 00027 int writeToConfDB_TPGPedestals(const std::map<EcalLogicID, FEConfigPedDat> & pedset, int iovId, std::string tag) ; 00028 int writeToConfDB_TPGLinearCoef(const std::map<EcalLogicID, FEConfigLinDat> & linset, 00029 const std::map<EcalLogicID, FEConfigLinParamDat> & linparamset, int iovId, std::string tag) ; 00030 int writeToConfDB_TPGLUT(const std::map<EcalLogicID, FEConfigLUTGroupDat> & lutgroup, const std::map<EcalLogicID, FEConfigLUTDat> & lutdat, 00031 const std::map<EcalLogicID, FEConfigLUTParamDat> & lutparamset, int iovId, std::string tag) ; 00032 int writeToConfDB_TPGWeight(const std::map<EcalLogicID, FEConfigWeightGroupDat> & lutgroup, const std::map<EcalLogicID, FEConfigWeightDat> & lutdat, 00033 int iovId, std::string tag) ; 00034 int writeToConfDB_TPGFgr(const std::map<EcalLogicID, FEConfigFgrGroupDat> & lutgroup, const std::map<EcalLogicID, FEConfigFgrDat> & lutdat, 00035 const std::map<EcalLogicID, FEConfigFgrParamDat> & fgrparamset, 00036 const std::map<EcalLogicID, FEConfigFgrEETowerDat> & dataset3, 00037 const std::map<EcalLogicID, FEConfigFgrEEStripDat> & dataset4, 00038 int iovId, std::string tag) ; 00039 int writeToConfDB_TPGSliding(const std::map<EcalLogicID, FEConfigSlidingDat> & sliset, int iovId, std::string tag) ; 00040 00041 void readFromConfDB_TPGPedestals(int iconf_req) ; 00042 int readFromCondDB_Pedestals(std::map<EcalLogicID, MonPedestalsDat> & pedset, int runNb) ; 00043 int writeToConfDB_TPGMain(int ped, int lin, int lut, int fgr, int sli, int wei, int bxt, int btt, std::string tag, int ver) ; 00044 00045 00046 private: 00047 00048 uint64_t startmicros; 00049 uint64_t endmicros; 00050 run_t startrun; 00051 run_t endrun; 00052 00053 void printTag( const RunTag* tag) const ; 00054 void printIOV( const RunIOV* iov) const ; 00055 00056 }; 00057 00058 #endif 00059