Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-16 03:23:37

0001 #ifndef ECALDBCOPY_H
0002 #define ECALDBCOPY_H
0003 
0004 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0005 #include "CondCore/CondDB/interface/Exception.h"
0006 
0007 #include "FWCore/Framework/interface/IOVSyncValue.h"
0008 #include "CondFormats/EcalObjects/interface/EcalPedestals.h"
0009 #include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h"
0010 #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
0011 #include "CondFormats/EcalObjects/interface/EcalDQMChannelStatus.h"
0012 #include "CondFormats/EcalObjects/interface/EcalDQMTowerStatus.h"
0013 #include "CondFormats/EcalObjects/interface/EcalDCSTowerStatus.h"
0014 #include "CondFormats/EcalObjects/interface/EcalDAQTowerStatus.h"
0015 #include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h"
0016 #include "CondFormats/EcalObjects/interface/EcalLinearCorrections.h"
0017 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
0018 #include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h"
0019 #include "CondFormats/EcalObjects/interface/EcalGainRatios.h"
0020 #include "CondFormats/EcalObjects/interface/EcalWeightXtalGroups.h"
0021 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h"
0022 #include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h"
0023 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h"
0024 #include "CondFormats/EcalObjects/interface/EcalClusterCrackCorrParameters.h"
0025 #include "CondFormats/EcalObjects/interface/EcalPFRecHitThresholds.h"
0026 #include "CondFormats/EcalObjects/interface/EcalClusterEnergyUncertaintyParameters.h"
0027 #include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionParameters.h"
0028 #include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionObjectSpecificParameters.h"
0029 #include "CondFormats/EcalObjects/interface/EcalClusterLocalContCorrParameters.h"
0030 #include <string>
0031 #include <map>
0032 
0033 namespace edm {
0034   class ParameterSet;
0035   class Event;
0036   class EventSetup;
0037 }  // namespace edm
0038 
0039 class EcalADCToGeVConstant;
0040 class EcalTPGTowerStatus;
0041 class EcalTBWeights;
0042 class EcalLaserAPDPNRatios;
0043 class Alignments;
0044 class EcalTimeOffsetConstant;
0045 class EcalSampleMask;
0046 class EcalSimPulseShape;
0047 class EcalTimeBiasCorrections;
0048 class EcalSamplesCorrelation;
0049 
0050 class EcalPedestalsRcd;
0051 class EcalADCToGeVConstantRcd;
0052 class EcalTimeCalibConstantsRcd;
0053 class EcalChannelStatusRcd;
0054 class EcalDQMChannelStatusRcd;
0055 class EcalDQMTowerStatusRcd;
0056 class EcalDCSTowerStatusRcd;
0057 class EcalTPGCrystalStatusRcd;
0058 class EcalDAQTowerStatusRcd;
0059 class EcalTPGTowerStatusRcd;
0060 class EcalTPGTowerStatusRcd;
0061 class EcalIntercalibConstantsRcd;
0062 class EcalLinearCorrectionsRcd;
0063 class EcalIntercalibConstantsMCRcd;
0064 class EcalIntercalibErrorsRcd;
0065 class EcalGainRatiosRcd;
0066 class EcalWeightXtalGroupsRcd;
0067 class EcalTBWeightsRcd;
0068 class EcalLaserAlphasRcd;
0069 class EcalLaserAPDPNRatiosRcd;
0070 class EcalLaserAPDPNRatiosRefRcd;
0071 class EcalClusterCrackCorrParametersRcd;
0072 class EcalPFRecHitThresholdsRcd;
0073 class EcalClusterEnergyUncertaintyParametersRcd;
0074 class EcalClusterEnergyCorrectionParametersRcd;
0075 class EcalClusterEnergyCorrectionObjectSpecificParametersRcd;
0076 class EcalClusterLocalContCorrParametersRcd;
0077 class EBAlignmentRcd;
0078 class EEAlignmentRcd;
0079 class ESAlignmentRcd;
0080 class EcalTimeOffsetConstantRcd;
0081 class EcalSampleMaskRcd;
0082 class EcalSimPulseShapeRcd;
0083 class EcalTimeBiasCorrectionsRcd;
0084 class EcalSamplesCorrelationRcd;
0085 
0086 class EcalDBCopy : public edm::one::EDAnalyzer<> {
0087 public:
0088   explicit EcalDBCopy(const edm::ParameterSet& iConfig);
0089   ~EcalDBCopy() override;
0090 
0091   void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) override;
0092 
0093 private:
0094   bool shouldCopy(const edm::EventSetup& evtSetup, const std::string& container);
0095   void copyToDB(const edm::EventSetup& evtSetup, const std::string& container);
0096 
0097   std::string m_timetype;
0098   std::map<std::string, unsigned long long> m_cacheIDs;
0099   std::map<std::string, std::string> m_records;
0100   edm::ESGetToken<EcalPedestals, EcalPedestalsRcd> ecalPedestalToken_;
0101   edm::ESGetToken<EcalADCToGeVConstant, EcalADCToGeVConstantRcd> ecalADCtoGeVToken_;
0102   edm::ESGetToken<EcalTimeCalibConstants, EcalTimeCalibConstantsRcd> ecalTimeCalibToken_;
0103   edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> ecalChannelStatusToken_;
0104   edm::ESGetToken<EcalDQMChannelStatus, EcalDQMChannelStatusRcd> ecalDQMChannelStatusToken_;
0105   edm::ESGetToken<EcalDQMTowerStatus, EcalDQMTowerStatusRcd> ecalDQMTowerStatusToken_;
0106   edm::ESGetToken<EcalDCSTowerStatus, EcalDCSTowerStatusRcd> ecalDCSTowerStatusToken_;
0107   edm::ESGetToken<EcalDAQTowerStatus, EcalDAQTowerStatusRcd> ecalDAQTowerStatusToken_;
0108   edm::ESGetToken<EcalTPGCrystalStatus, EcalTPGCrystalStatusRcd> ecalTPGCrystalStatusToken_;
0109   edm::ESGetToken<EcalTPGTowerStatus, EcalTPGTowerStatusRcd> ecalTPGTowerStatusToken_;
0110   edm::ESGetToken<EcalIntercalibConstants, EcalIntercalibConstantsRcd> ecalIntercalibConstantsToken_;
0111   edm::ESGetToken<EcalLinearCorrections, EcalLinearCorrectionsRcd> ecalLinearCorrectionsToken_;
0112   edm::ESGetToken<EcalIntercalibConstantsMC, EcalIntercalibConstantsMCRcd> ecalIntercalibConstantsMCToken_;
0113   edm::ESGetToken<EcalIntercalibErrors, EcalIntercalibErrorsRcd> ecalIntercalibErrorsToken_;
0114   edm::ESGetToken<EcalGainRatios, EcalGainRatiosRcd> ecalGainRatiosToken_;
0115   edm::ESGetToken<EcalWeightXtalGroups, EcalWeightXtalGroupsRcd> ecalWeightXtalGroupsToken_;
0116   edm::ESGetToken<EcalTBWeights, EcalTBWeightsRcd> ecalTBWeightsToken_;
0117   edm::ESGetToken<EcalLaserAlphas, EcalLaserAlphasRcd> ecalLaserAlphasToken_;
0118   edm::ESGetToken<EcalLaserAPDPNRatios, EcalLaserAPDPNRatiosRcd> ecalLaserAPDPNRatiosToken_;
0119   edm::ESGetToken<EcalLaserAPDPNRatiosRef, EcalLaserAPDPNRatiosRefRcd> ecalLaserAPDPNRatiosRefToken_;
0120   edm::ESGetToken<EcalClusterCrackCorrParameters, EcalClusterCrackCorrParametersRcd>
0121       ecalClusterCrackCorrParametersToken_;
0122   edm::ESGetToken<EcalPFRecHitThresholds, EcalPFRecHitThresholdsRcd> ecalPFRecHitThresholdsToken_;
0123   edm::ESGetToken<EcalClusterEnergyUncertaintyParameters, EcalClusterEnergyUncertaintyParametersRcd>
0124       ecalClusterEnergyUncertaintyParametersToken_;
0125   edm::ESGetToken<EcalClusterEnergyCorrectionParameters, EcalClusterEnergyCorrectionParametersRcd>
0126       ecalClusterEnergyCorrectionParametersToken_;
0127   edm::ESGetToken<EcalClusterEnergyCorrectionObjectSpecificParameters,
0128                   EcalClusterEnergyCorrectionObjectSpecificParametersRcd>
0129       ecalClusterEnergyCorrectionObjectSpecificParametersToken_;
0130   edm::ESGetToken<EcalClusterLocalContCorrParameters, EcalClusterLocalContCorrParametersRcd>
0131       ecalClusterLocalContCorrParametersToken_;
0132   edm::ESGetToken<Alignments, EBAlignmentRcd> ebAlignmentToken_;
0133   edm::ESGetToken<Alignments, EEAlignmentRcd> eeAlignmentToken_;
0134   edm::ESGetToken<Alignments, ESAlignmentRcd> esAlignmentToken_;
0135   edm::ESGetToken<EcalTimeOffsetConstant, EcalTimeOffsetConstantRcd> ecalTimeOffsetConstantToken_;
0136   edm::ESGetToken<EcalSampleMask, EcalSampleMaskRcd> ecalSampleMaskToken_;
0137   edm::ESGetToken<EcalSimPulseShape, EcalSimPulseShapeRcd> ecalSimPulseShapeToken_;
0138   edm::ESGetToken<EcalTimeBiasCorrections, EcalTimeBiasCorrectionsRcd> ecalTimeBiasCorrectionsToken_;
0139   edm::ESGetToken<EcalSamplesCorrelation, EcalSamplesCorrelationRcd> ecalSamplesCorrelationToken_;
0140 };
0141 
0142 #endif