Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:52

0001 #ifndef ECAL_TPG_WEIGHTIDMAP_HANDLER_H
0002 #define ECAL_TPG_WEIGHTIDMAP_HANDLER_H
0003 
0004 #include <ctime>
0005 #include <iostream>
0006 #include <map>
0007 #include <string>
0008 #include <typeinfo>
0009 #include <vector>
0010 
0011 #include "CondCore/PopCon/interface/PopConSourceHandler.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
0013 
0014 #include "FWCore/ServiceRegistry/interface/Service.h"
0015 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
0016 #include "FWCore/Framework/interface/ESHandle.h"
0017 #include "FWCore/Framework/interface/Event.h"
0018 #include "FWCore/Framework/interface/MakerMacros.h"
0019 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 #include "DataFormats/Common/interface/Handle.h"
0022 #include "FWCore/Framework/interface/EventSetup.h"
0023 #include "FWCore/Framework/interface/EventSetupRecordKey.h"
0024 
0025 #include "CondFormats/EcalObjects/interface/EcalTPGWeightIdMap.h"
0026 #include "CondFormats/DataRecord/interface/EcalTPGWeightIdMapRcd.h"
0027 
0028 #include "OnlineDB/EcalCondDB/interface/all_monitoring_types.h"
0029 #include "OnlineDB/Oracle/interface/Oracle.h"
0030 #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
0031 
0032 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0033 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0034 #include "DataFormats/Provenance/interface/Timestamp.h"
0035 
0036 namespace edm {
0037   class ParameterSet;
0038   class Event;
0039   class EventSetup;
0040 }  // namespace edm
0041 
0042 namespace popcon {
0043 
0044   class EcalTPGWeightIdMapHandler : public popcon::PopConSourceHandler<EcalTPGWeightIdMap> {
0045   public:
0046     EcalTPGWeightIdMapHandler(edm::ParameterSet const&);
0047     ~EcalTPGWeightIdMapHandler() override;
0048 
0049     void getNewObjects() override;
0050 
0051     std::string id() const override { return m_name; }
0052 
0053     void readtxtFile();
0054     void readxmlFile();
0055 
0056     void readFromFile(const char* inputFile);
0057     void writeFile(const char* inputFile);
0058 
0059     EcalCondDBInterface* econn;
0060 
0061   private:
0062     std::string to_string(char value[]) {
0063       std::ostringstream streamOut;
0064       streamOut << value;
0065       return streamOut.str();
0066     }
0067 
0068     const EcalTPGWeightIdMap* myweightIdMap;
0069 
0070     unsigned int m_firstRun;
0071     unsigned int m_lastRun;
0072 
0073     std::string m_location;
0074     std::string m_gentag;
0075     std::string m_sid;
0076     std::string m_user;
0077     std::string m_pass;
0078     std::string m_locationsource;
0079     std::string m_name;
0080     unsigned int m_runnr;
0081     std::string m_runtype;
0082     std::string m_i_tag;
0083     std::string m_file_type;
0084     std::string m_file_name;
0085     int m_i_version;
0086     unsigned int m_i_run_number;
0087     int m_i_weightIdMap;
0088   };
0089 }  // namespace popcon
0090 #endif