Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef CalibCalorimetry_EcalTPGTools_EcalTPGDBCopy_h
0002 #define CalibCalorimetry_EcalTPGTools_EcalTPGDBCopy_h
0003 
0004 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0005 #include "CondCore/CondDB/interface/Exception.h"
0006 
0007 #include "FWCore/Framework/interface/ConsumesCollector.h"
0008 #include "FWCore/Framework/interface/IOVSyncValue.h"
0009 
0010 #include "CondFormats/EcalObjects/interface/EcalTPGPedestals.h"
0011 #include "CondFormats/EcalObjects/interface/EcalTPGLinearizationConst.h"
0012 #include "CondFormats/EcalObjects/interface/EcalTPGSlidingWindow.h"
0013 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBIdMap.h"
0014 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainStripEE.h"
0015 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainTowerEE.h"
0016 #include "CondFormats/EcalObjects/interface/EcalTPGLutIdMap.h"
0017 #include "CondFormats/EcalObjects/interface/EcalTPGWeightIdMap.h"
0018 #include "CondFormats/EcalObjects/interface/EcalTPGWeightGroup.h"
0019 #include "CondFormats/EcalObjects/interface/EcalTPGOddWeightIdMap.h"
0020 #include "CondFormats/EcalObjects/interface/EcalTPGOddWeightGroup.h"
0021 #include "CondFormats/EcalObjects/interface/EcalTPGTPMode.h"
0022 #include "CondFormats/EcalObjects/interface/EcalTPGLutGroup.h"
0023 #include "CondFormats/EcalObjects/interface/EcalTPGFineGrainEBGroup.h"
0024 #include "CondFormats/EcalObjects/interface/EcalTPGPhysicsConst.h"
0025 #include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h"
0026 #include "CondFormats/EcalObjects/interface/EcalTPGSpike.h"
0027 #include "CondFormats/EcalObjects/interface/EcalTPGTowerStatus.h"
0028 #include "CondFormats/EcalObjects/interface/EcalTPGStripStatus.h"
0029 
0030 #include "CondFormats/DataRecord/interface/EcalTPGPedestalsRcd.h"
0031 #include "CondFormats/DataRecord/interface/EcalTPGLinearizationConstRcd.h"
0032 #include "CondFormats/DataRecord/interface/EcalTPGSlidingWindowRcd.h"
0033 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBIdMapRcd.h"
0034 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainStripEERcd.h"
0035 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainTowerEERcd.h"
0036 #include "CondFormats/DataRecord/interface/EcalTPGLutIdMapRcd.h"
0037 #include "CondFormats/DataRecord/interface/EcalTPGWeightIdMapRcd.h"
0038 #include "CondFormats/DataRecord/interface/EcalTPGWeightGroupRcd.h"
0039 #include "CondFormats/DataRecord/interface/EcalTPGOddWeightIdMapRcd.h"
0040 #include "CondFormats/DataRecord/interface/EcalTPGOddWeightGroupRcd.h"
0041 #include "CondFormats/DataRecord/interface/EcalTPGTPModeRcd.h"
0042 #include "CondFormats/DataRecord/interface/EcalTPGLutGroupRcd.h"
0043 #include "CondFormats/DataRecord/interface/EcalTPGFineGrainEBGroupRcd.h"
0044 #include "CondFormats/DataRecord/interface/EcalTPGPhysicsConstRcd.h"
0045 #include "CondFormats/DataRecord/interface/EcalTPGCrystalStatusRcd.h"
0046 #include "CondFormats/DataRecord/interface/EcalTPGTowerStatusRcd.h"
0047 #include "CondFormats/DataRecord/interface/EcalTPGSpikeRcd.h"
0048 #include "CondFormats/DataRecord/interface/EcalTPGStripStatusRcd.h"
0049 
0050 #include <string>
0051 #include <map>
0052 
0053 namespace edm {
0054   class ParameterSet;
0055   class Event;
0056   class EventSetup;
0057 }  // namespace edm
0058 
0059 class EcalTPGDBCopy : public edm::one::EDAnalyzer<> {
0060 public:
0061   explicit EcalTPGDBCopy(const edm::ParameterSet& iConfig);
0062   ~EcalTPGDBCopy() override;
0063 
0064   void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) override;
0065 
0066 private:
0067   void setConsumes(edm::ConsumesCollector& cc, const std::string& container);
0068   bool shouldCopy(const edm::EventSetup& evtSetup, const std::string& container);
0069   void copyToDB(const edm::EventSetup& evtSetup, const std::string& container);
0070 
0071   std::string m_timetype;
0072   std::map<std::string, unsigned long long> m_cacheIDs;
0073   std::map<std::string, std::string> m_records;
0074 
0075   edm::ESGetToken<EcalTPGPedestals, EcalTPGPedestalsRcd> pedestalsToken_;
0076   edm::ESGetToken<EcalTPGLinearizationConst, EcalTPGLinearizationConstRcd> linearizationConstToken_;
0077   edm::ESGetToken<EcalTPGSlidingWindow, EcalTPGSlidingWindowRcd> slidingWindowToken_;
0078   edm::ESGetToken<EcalTPGFineGrainEBIdMap, EcalTPGFineGrainEBIdMapRcd> fineGrainEBIdMapToken_;
0079   edm::ESGetToken<EcalTPGFineGrainStripEE, EcalTPGFineGrainStripEERcd> fineGrainStripEEToken_;
0080   edm::ESGetToken<EcalTPGFineGrainTowerEE, EcalTPGFineGrainTowerEERcd> fineGrainTowerEEToken_;
0081   edm::ESGetToken<EcalTPGLutIdMap, EcalTPGLutIdMapRcd> lutIdMapToken_;
0082   edm::ESGetToken<EcalTPGWeightIdMap, EcalTPGWeightIdMapRcd> weightIdMapToken_;
0083   edm::ESGetToken<EcalTPGWeightGroup, EcalTPGWeightGroupRcd> weightGroupToken_;
0084   edm::ESGetToken<EcalTPGOddWeightIdMap, EcalTPGOddWeightIdMapRcd> oddWeightIdMapToken_;
0085   edm::ESGetToken<EcalTPGOddWeightGroup, EcalTPGOddWeightGroupRcd> oddWeightGroupToken_;
0086   edm::ESGetToken<EcalTPGTPMode, EcalTPGTPModeRcd> tpModeToken_;
0087   edm::ESGetToken<EcalTPGLutGroup, EcalTPGLutGroupRcd> lutGroupToken_;
0088   edm::ESGetToken<EcalTPGFineGrainEBGroup, EcalTPGFineGrainEBGroupRcd> fineGrainEBGroupToken_;
0089   edm::ESGetToken<EcalTPGPhysicsConst, EcalTPGPhysicsConstRcd> physicsConstToken_;
0090   edm::ESGetToken<EcalTPGCrystalStatus, EcalTPGCrystalStatusRcd> crystalStatusToken_;
0091   edm::ESGetToken<EcalTPGTowerStatus, EcalTPGTowerStatusRcd> towerStatusToken_;
0092   edm::ESGetToken<EcalTPGSpike, EcalTPGSpikeRcd> spikeToken_;
0093   edm::ESGetToken<EcalTPGStripStatus, EcalTPGStripStatusRcd> stripStatusToken_;
0094 };
0095 
0096 #endif