Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:59

0001 #ifndef ECALTPGDBAPP_H
0002 #define ECALTPGDBAPP_H
0003 
0004 #include <iostream>
0005 #include <string>
0006 #include <sstream>
0007 
0008 #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
0009 #include "OnlineDB/EcalCondDB/interface/RunDat.h"
0010 #include "OnlineDB/EcalCondDB/interface/RunList.h"
0011 #include "OnlineDB/EcalCondDB/interface/all_monitoring_types.h"
0012 #include "OnlineDB/EcalCondDB/interface/all_fe_config_types.h"
0013 
0014 //#include "OnlineDB/EcalCondDB/interface/FEConfigSpikeDat.h"
0015 
0016 class EcalTPGDBApp : public EcalCondDBInterface {
0017 public:
0018   EcalTPGDBApp(std::string host, std::string sid, std::string user, std::string pass, int port);
0019   EcalTPGDBApp(std::string sid, std::string user, std::string pass);
0020 
0021   inline std::string to_string(char value[]) {
0022     std::ostringstream streamOut;
0023     streamOut << value;
0024     return streamOut.str();
0025   }
0026 
0027   int writeToConfDB_TPGPedestals(const std::map<EcalLogicID, FEConfigPedDat>& pedset, int iovId, std::string tag);
0028   int writeToConfDB_TPGLinearCoef(const std::map<EcalLogicID, FEConfigLinDat>& linset,
0029                                   const std::map<EcalLogicID, FEConfigLinParamDat>& linparamset,
0030                                   int iovId,
0031                                   std::string tag);
0032   int writeToConfDB_TPGLUT(const std::map<EcalLogicID, FEConfigLUTGroupDat>& lutgroup,
0033                            const std::map<EcalLogicID, FEConfigLUTDat>& lutdat,
0034                            const std::map<EcalLogicID, FEConfigLUTParamDat>& lutparamset,
0035                            int iovId,
0036                            std::string tag);
0037   int writeToConfDB_TPGWeight(const std::map<EcalLogicID, FEConfigWeightGroupDat>& lutgroup,
0038                               const std::map<EcalLogicID, FEConfigWeightDat>& lutdat,
0039                               int iovId,
0040                               std::string tag);
0041   int writeToConfDB_TPGWeight_doubleWeights(const std::map<EcalLogicID, FEConfigOddWeightGroupDat>& lutgroupset,
0042                                             const std::map<EcalLogicID, FEConfigOddWeightDat>& lutset,
0043                                             const std::map<EcalLogicID, FEConfigOddWeightModeDat>& tpmode,
0044                                             int ngr,
0045                                             std::string tag);
0046   int writeToConfDB_TPGFgr(const std::map<EcalLogicID, FEConfigFgrGroupDat>& lutgroup,
0047                            const std::map<EcalLogicID, FEConfigFgrDat>& lutdat,
0048                            const std::map<EcalLogicID, FEConfigFgrParamDat>& fgrparamset,
0049                            const std::map<EcalLogicID, FEConfigFgrEETowerDat>& dataset3,
0050                            const std::map<EcalLogicID, FEConfigFgrEEStripDat>& dataset4,
0051                            int iovId,
0052                            std::string tag);
0053   int writeToConfDB_Spike(const std::map<EcalLogicID, FEConfigSpikeDat>& spikegroupset, std::string tag);
0054   int writeToConfDB_Delay(const std::map<EcalLogicID, FEConfigTimingDat>& delaygroupset,
0055                           std::string tag);  // modif here 31/1/2011
0056 
0057   int writeToConfDB_TPGSliding(const std::map<EcalLogicID, FEConfigSlidingDat>& sliset, int iovId, std::string tag);
0058 
0059   void readFromConfDB_TPGPedestals(int iconf_req);
0060   int readFromCondDB_Pedestals(std::map<EcalLogicID, MonPedestalsDat>& pedset, int runNb);
0061   int writeToConfDB_TPGMain(int ped,
0062                             int lin,
0063                             int lut,
0064                             int fgr,
0065                             int sli,
0066                             int wei,
0067                             int wei2,
0068                             int spi,
0069                             int tim,
0070                             int bxt,
0071                             int btt,
0072                             int bst,
0073                             int cok,
0074                             std::string tag,
0075                             int ver);
0076 
0077 private:
0078   uint64_t startmicros;
0079   uint64_t endmicros;
0080   run_t startrun;
0081   run_t endrun;
0082 
0083   void printTag(const RunTag* tag) const;
0084   void printIOV(const RunIOV* iov) const;
0085 };
0086 
0087 #endif