Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-09 02:18:29

0001 #ifndef CondTools_Ecal_ESDBCopy_h
0002 #define CondTools_Ecal_ESDBCopy_h
0003 
0004 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0005 #include "CondCore/CondDB/interface/Exception.h"
0006 
0007 #include "CondFormats/ESObjects/interface/ESPedestals.h"
0008 #include "CondFormats/DataRecord/interface/ESPedestalsRcd.h"
0009 #include "CondFormats/ESObjects/interface/ESADCToGeVConstant.h"
0010 #include "CondFormats/DataRecord/interface/ESADCToGeVConstantRcd.h"
0011 #include "CondFormats/ESObjects/interface/ESChannelStatus.h"
0012 #include "CondFormats/DataRecord/interface/ESChannelStatusRcd.h"
0013 #include "CondFormats/ESObjects/interface/ESIntercalibConstants.h"
0014 #include "CondFormats/DataRecord/interface/ESIntercalibConstantsRcd.h"
0015 #include "CondFormats/ESObjects/interface/ESWeightStripGroups.h"
0016 #include "CondFormats/DataRecord/interface/ESWeightStripGroupsRcd.h"
0017 #include "CondFormats/ESObjects/interface/ESTBWeights.h"
0018 #include "CondFormats/DataRecord/interface/ESTBWeightsRcd.h"
0019 
0020 #include "FWCore/Framework/interface/IOVSyncValue.h"
0021 
0022 #include <string>
0023 #include <map>
0024 
0025 namespace edm {
0026   class ParameterSet;
0027   class Event;
0028   class EventSetup;
0029 }  // namespace edm
0030 
0031 class ESDBCopy : public edm::one::EDAnalyzer<> {
0032 public:
0033   explicit ESDBCopy(const edm::ParameterSet& iConfig);
0034   ~ESDBCopy() override;
0035 
0036   void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) override;
0037 
0038 private:
0039   bool shouldCopy(const edm::EventSetup& evtSetup, const std::string& container);
0040   void copyToDB(const edm::EventSetup& evtSetup, const std::string& container);
0041 
0042   std::string m_timetype;
0043   std::map<std::string, unsigned long long> m_cacheIDs;
0044   std::map<std::string, std::string> m_records;
0045 
0046   const edm::ESGetToken<ESPedestals, ESPedestalsRcd> esPedestalsToken_;
0047   const edm::ESGetToken<ESADCToGeVConstant, ESADCToGeVConstantRcd> esADCToGeVConstantToken_;
0048   const edm::ESGetToken<ESChannelStatus, ESChannelStatusRcd> esChannelStatusToken_;
0049   const edm::ESGetToken<ESIntercalibConstants, ESIntercalibConstantsRcd> esIntercalibConstantsToken_;
0050   const edm::ESGetToken<ESWeightStripGroups, ESWeightStripGroupsRcd> esWeightStripGroupsToken_;
0051   const edm::ESGetToken<ESTBWeights, ESTBWeightsRcd> esTBWeightsToken_;
0052 };
0053 
0054 #endif