Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-13 03:30:46

0001 #include "FWCore/ServiceRegistry/interface/Service.h"
0002 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
0003 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0004 #include "FWCore/Framework/interface/ESHandle.h"
0005 #include "FWCore/Framework/interface/EventSetup.h"
0006 #include "CondTools/Ecal/interface/EcalDBCopy.h"
0007 #include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h"
0008 #include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h"
0009 #include "CondFormats/DataRecord/interface/EcalADCToGeVConstantRcd.h"
0010 #include "CondFormats/DataRecord/interface/EcalTimeCalibConstantsRcd.h"
0011 #include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h"
0012 #include "CondFormats/DataRecord/interface/EcalLinearCorrectionsRcd.h"
0013 #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h"
0014 #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsMCRcd.h"
0015 #include "CondFormats/DataRecord/interface/EcalIntercalibErrorsRcd.h"
0016 #include "CondFormats/DataRecord/interface/EcalGainRatiosRcd.h"
0017 #include "CondFormats/DataRecord/interface/EcalWeightXtalGroupsRcd.h"
0018 #include "CondFormats/EcalObjects/interface/EcalTBWeights.h"
0019 #include "CondFormats/DataRecord/interface/EcalTBWeightsRcd.h"
0020 #include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h"
0021 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h"
0022 #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h"
0023 #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h"
0024 #include "CondFormats/DataRecord/interface/EcalTPGCrystalStatusRcd.h"
0025 #include "CondFormats/EcalObjects/interface/EcalTPGTowerStatus.h"
0026 #include "CondFormats/DataRecord/interface/EcalTPGTowerStatusRcd.h"
0027 #include "CondFormats/DataRecord/interface/EcalDCSTowerStatusRcd.h"
0028 #include "CondFormats/DataRecord/interface/EcalDAQTowerStatusRcd.h"
0029 #include "CondFormats/DataRecord/interface/EcalDQMTowerStatusRcd.h"
0030 #include "CondFormats/DataRecord/interface/EcalDQMChannelStatusRcd.h"
0031 #include "CondFormats/DataRecord/interface/EcalClusterCrackCorrParametersRcd.h"
0032 #include "CondFormats/DataRecord/interface/EcalPFRecHitThresholdsRcd.h"
0033 #include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionParametersRcd.h"
0034 #include "CondFormats/DataRecord/interface/EcalClusterEnergyUncertaintyParametersRcd.h"
0035 #include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionObjectSpecificParametersRcd.h"
0036 #include "CondFormats/DataRecord/interface/EcalClusterLocalContCorrParametersRcd.h"
0037 
0038 #include "CondFormats/Alignment/interface/Alignments.h"
0039 #include "CondFormats/AlignmentRecord/interface/EBAlignmentRcd.h"
0040 #include "CondFormats/AlignmentRecord/interface/EEAlignmentRcd.h"
0041 #include "CondFormats/AlignmentRecord/interface/ESAlignmentRcd.h"
0042 #include "CondFormats/EcalObjects/interface/EcalTimeOffsetConstant.h"
0043 #include "CondFormats/DataRecord/interface/EcalTimeOffsetConstantRcd.h"
0044 
0045 #include "CondFormats/EcalObjects/interface/EcalSampleMask.h"
0046 #include "CondFormats/DataRecord/interface/EcalSampleMaskRcd.h"
0047 
0048 #include "CondFormats/EcalObjects/interface/EcalTimeBiasCorrections.h"
0049 #include "CondFormats/DataRecord/interface/EcalTimeBiasCorrectionsRcd.h"
0050 
0051 #include "CondFormats/EcalObjects/interface/EcalSamplesCorrelation.h"
0052 #include "CondFormats/DataRecord/interface/EcalSamplesCorrelationRcd.h"
0053 
0054 #include "CondFormats/EcalObjects/interface/EcalSimPulseShape.h"
0055 #include "CondFormats/DataRecord/interface/EcalSimPulseShapeRcd.h"
0056 
0057 #include <vector>
0058 
0059 EcalDBCopy::EcalDBCopy(const edm::ParameterSet& iConfig)
0060     : m_timetype(iConfig.getParameter<std::string>("timetype")),
0061       m_cacheIDs(),
0062       m_records(),
0063       ecalPedestalToken_(esConsumes()),
0064       ecalADCtoGeVToken_(esConsumes()),
0065       ecalTimeCalibToken_(esConsumes()),
0066       ecalChannelStatusToken_(esConsumes()),
0067       ecalDQMChannelStatusToken_(esConsumes()),
0068       ecalDQMTowerStatusToken_(esConsumes()),
0069       ecalDCSTowerStatusToken_(esConsumes()),
0070       ecalDAQTowerStatusToken_(esConsumes()),
0071       ecalTPGCrystalStatusToken_(esConsumes()),
0072       ecalTPGTowerStatusToken_(esConsumes()),
0073       ecalIntercalibConstantsToken_(esConsumes()),
0074       ecalLinearCorrectionsToken_(esConsumes()),
0075       ecalIntercalibConstantsMCToken_(esConsumes()),
0076       ecalIntercalibErrorsToken_(esConsumes()),
0077       ecalGainRatiosToken_(esConsumes()),
0078       ecalWeightXtalGroupsToken_(esConsumes()),
0079       ecalTBWeightsToken_(esConsumes()),
0080       ecalLaserAlphasToken_(esConsumes()),
0081       ecalLaserAPDPNRatiosToken_(esConsumes()),
0082       ecalLaserAPDPNRatiosRefToken_(esConsumes()),
0083       ecalClusterCrackCorrParametersToken_(esConsumes()),
0084       ecalPFRecHitThresholdsToken_(esConsumes()),
0085       ecalClusterEnergyUncertaintyParametersToken_(esConsumes()),
0086       ecalClusterEnergyCorrectionParametersToken_(esConsumes()),
0087       ecalClusterEnergyCorrectionObjectSpecificParametersToken_(esConsumes()),
0088       ecalClusterLocalContCorrParametersToken_(esConsumes()),
0089       ebAlignmentToken_(esConsumes()),
0090       eeAlignmentToken_(esConsumes()),
0091       esAlignmentToken_(esConsumes()),
0092       ecalTimeOffsetConstantToken_(esConsumes()),
0093       ecalSampleMaskToken_(esConsumes()),
0094       ecalSimPulseShapeToken_(esConsumes()),
0095       ecalTimeBiasCorrectionsToken_(esConsumes()),
0096       ecalSamplesCorrelationToken_(esConsumes()) {
0097   std::string container;
0098   std::string record;
0099   typedef std::vector<edm::ParameterSet> Parameters;
0100   Parameters toCopy = iConfig.getParameter<Parameters>("toCopy");
0101   for (auto& iparam : toCopy) {
0102     container = iparam.getParameter<std::string>("container");
0103     record = iparam.getParameter<std::string>("record");
0104     m_cacheIDs.emplace(container, 0);
0105     m_records.emplace(container, record);
0106   }
0107 }
0108 
0109 EcalDBCopy::~EcalDBCopy() {}
0110 
0111 void EcalDBCopy::analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) {
0112   for (const auto& irec : m_records) {
0113     if (shouldCopy(evtSetup, irec.first)) {
0114       copyToDB(evtSetup, irec.first);
0115     }
0116   }
0117 }
0118 
0119 bool EcalDBCopy::shouldCopy(const edm::EventSetup& evtSetup, const std::string& container) {
0120   unsigned long long cacheID = 0;
0121   if (container == "EcalPedestals") {
0122     cacheID = evtSetup.get<EcalPedestalsRcd>().cacheIdentifier();
0123   } else if (container == "EcalADCToGeVConstant") {
0124     cacheID = evtSetup.get<EcalADCToGeVConstantRcd>().cacheIdentifier();
0125   } else if (container == "EcalLinearCorrections") {
0126     cacheID = evtSetup.get<EcalLinearCorrectionsRcd>().cacheIdentifier();
0127   } else if (container == "EcalIntercalibConstants") {
0128     cacheID = evtSetup.get<EcalIntercalibConstantsRcd>().cacheIdentifier();
0129   } else if (container == "EcalIntercalibConstantsMC") {
0130     cacheID = evtSetup.get<EcalIntercalibConstantsMCRcd>().cacheIdentifier();
0131   } else if (container == "EcalIntercalibErrors") {
0132     cacheID = evtSetup.get<EcalIntercalibErrorsRcd>().cacheIdentifier();
0133   } else if (container == "EcalGainRatios") {
0134     cacheID = evtSetup.get<EcalGainRatiosRcd>().cacheIdentifier();
0135   } else if (container == "EcalWeightXtalGroups") {
0136     cacheID = evtSetup.get<EcalWeightXtalGroupsRcd>().cacheIdentifier();
0137   } else if (container == "EcalTBWeights") {
0138     cacheID = evtSetup.get<EcalTBWeightsRcd>().cacheIdentifier();
0139   } else if (container == "EcalLaserAPDPNRatios") {
0140     cacheID = evtSetup.get<EcalLaserAPDPNRatiosRcd>().cacheIdentifier();
0141   } else if (container == "EcalLaserAPDPNRatiosRef") {
0142     cacheID = evtSetup.get<EcalTBWeightsRcd>().cacheIdentifier();
0143   } else if (container == "EcalLaserAlphas") {
0144     cacheID = evtSetup.get<EcalTBWeightsRcd>().cacheIdentifier();
0145   } else if (container == "EcalChannelStatus") {
0146     cacheID = evtSetup.get<EcalChannelStatusRcd>().cacheIdentifier();
0147   } else if (container == "EcalDQMTowerStatus") {
0148     cacheID = evtSetup.get<EcalDQMTowerStatusRcd>().cacheIdentifier();
0149   } else if (container == "EcalDQMChannelStatus") {
0150     cacheID = evtSetup.get<EcalDQMChannelStatusRcd>().cacheIdentifier();
0151   } else if (container == "EcalDCSTowerStatus") {
0152     cacheID = evtSetup.get<EcalDCSTowerStatusRcd>().cacheIdentifier();
0153   } else if (container == "EcalDAQTowerStatus") {
0154     cacheID = evtSetup.get<EcalDAQTowerStatusRcd>().cacheIdentifier();
0155   } else if (container == "EcalTimeCalibConstants") {
0156     cacheID = evtSetup.get<EcalTimeCalibConstantsRcd>().cacheIdentifier();
0157   } else if (container == "EcalClusterCrackCorrParameters") {
0158     cacheID = evtSetup.get<EcalClusterCrackCorrParametersRcd>().cacheIdentifier();
0159   } else if (container == "EcalPFRecHitThresholds") {
0160     cacheID = evtSetup.get<EcalPFRecHitThresholdsRcd>().cacheIdentifier();
0161   } else if (container == "EcalClusterEnergyUncertaintyParameters") {
0162     cacheID = evtSetup.get<EcalClusterEnergyUncertaintyParametersRcd>().cacheIdentifier();
0163   } else if (container == "EcalClusterEnergyCorrectionParameters") {
0164     cacheID = evtSetup.get<EcalClusterEnergyCorrectionParametersRcd>().cacheIdentifier();
0165   } else if (container == "EcalClusterEnergyCorrectionObjectSpecificParameters") {
0166     cacheID = evtSetup.get<EcalClusterEnergyCorrectionObjectSpecificParametersRcd>().cacheIdentifier();
0167   } else if (container == "EcalClusterLocalContCorrParameters") {
0168     cacheID = evtSetup.get<EcalClusterLocalContCorrParametersRcd>().cacheIdentifier();
0169   } else if (container == "EcalTPGCrystalStatus") {
0170     cacheID = evtSetup.get<EcalTPGCrystalStatusRcd>().cacheIdentifier();
0171   } else if (container == "EcalTPGTowerStatus") {
0172     cacheID = evtSetup.get<EcalTPGTowerStatusRcd>().cacheIdentifier();
0173   } else if (container == "EBAlignment") {
0174     cacheID = evtSetup.get<EBAlignmentRcd>().cacheIdentifier();
0175   } else if (container == "EEAlignment") {
0176     cacheID = evtSetup.get<EEAlignmentRcd>().cacheIdentifier();
0177   } else if (container == "ESAlignment") {
0178     cacheID = evtSetup.get<ESAlignmentRcd>().cacheIdentifier();
0179   } else if (container == "EcalTimeOffsetConstant") {
0180     cacheID = evtSetup.get<EcalTimeOffsetConstantRcd>().cacheIdentifier();
0181   } else if (container == "EcalSampleMask") {
0182     cacheID = evtSetup.get<EcalSampleMaskRcd>().cacheIdentifier();
0183   } else if (container == "EcalTimeBiasCorrections") {
0184     cacheID = evtSetup.get<EcalTimeBiasCorrectionsRcd>().cacheIdentifier();
0185   } else if (container == "EcalSimPulseShape") {
0186     cacheID = evtSetup.get<EcalSimPulseShapeRcd>().cacheIdentifier();
0187   } else if (container == "EcalSamplesCorrelation") {
0188     cacheID = evtSetup.get<EcalSamplesCorrelationRcd>().cacheIdentifier();
0189   }
0190 
0191   else {
0192     throw cms::Exception("Unknown container");
0193   }
0194 
0195   if (m_cacheIDs[container] == cacheID) {
0196     return false;
0197   } else {
0198     m_cacheIDs[container] = cacheID;
0199     return true;
0200   }
0201 }
0202 
0203 void EcalDBCopy::copyToDB(const edm::EventSetup& evtSetup, const std::string& container) {
0204   edm::Service<cond::service::PoolDBOutputService> dbOutput;
0205   if (!dbOutput.isAvailable()) {
0206     throw cms::Exception("PoolDBOutputService is not available");
0207   }
0208 
0209   std::string recordName = m_records[container];
0210 
0211   if (container == "EcalPedestals") {
0212     const auto& obj = evtSetup.getData(ecalPedestalToken_);
0213     edm::LogInfo("EcalDBCopy") << "ped pointer is: " << &obj << std::endl;
0214     dbOutput->createOneIOV<const EcalPedestals>(obj, dbOutput->beginOfTime(), recordName);
0215 
0216   } else if (container == "EcalADCToGeVConstant") {
0217     const auto& obj = evtSetup.getData(ecalADCtoGeVToken_);
0218     edm::LogInfo("EcalDBCopy") << "adc pointer is: " << &obj << std::endl;
0219     dbOutput->createOneIOV<const EcalADCToGeVConstant>(obj, dbOutput->beginOfTime(), recordName);
0220 
0221   } else if (container == "EcalTimeCalibConstants") {
0222     const auto& obj = evtSetup.getData(ecalTimeCalibToken_);
0223     edm::LogInfo("EcalDBCopy") << "adc pointer is: " << &obj << std::endl;
0224     dbOutput->createOneIOV<const EcalTimeCalibConstants>(obj, dbOutput->beginOfTime(), recordName);
0225 
0226   } else if (container == "EcalChannelStatus") {
0227     const auto& obj = evtSetup.getData(ecalChannelStatusToken_);
0228     edm::LogInfo("EcalDBCopy") << "channel status pointer is: " << &obj << std::endl;
0229     dbOutput->createOneIOV<const EcalChannelStatus>(obj, dbOutput->beginOfTime(), recordName);
0230 
0231   } else if (container == "EcalDQMChannelStatus") {
0232     const auto& obj = evtSetup.getData(ecalDQMChannelStatusToken_);
0233     edm::LogInfo("EcalDBCopy") << "DQM channel status pointer is: " << &obj << std::endl;
0234     dbOutput->createOneIOV<const EcalDQMChannelStatus>(obj, dbOutput->beginOfTime(), recordName);
0235 
0236   } else if (container == "EcalDQMTowerStatus") {
0237     const auto& obj = evtSetup.getData(ecalDQMTowerStatusToken_);
0238     edm::LogInfo("EcalDBCopy") << "DQM Tower status pointer is: " << &obj << std::endl;
0239     dbOutput->createOneIOV<const EcalDQMTowerStatus>(obj, dbOutput->beginOfTime(), recordName);
0240 
0241   } else if (container == "EcalDCSTowerStatus") {
0242     const auto& obj = evtSetup.getData(ecalDCSTowerStatusToken_);
0243     edm::LogInfo("EcalDBCopy") << "channel status pointer is: " << &obj << std::endl;
0244     dbOutput->createOneIOV<const EcalDCSTowerStatus>(obj, dbOutput->beginOfTime(), recordName);
0245 
0246   } else if (container == "EcalDAQTowerStatus") {
0247     const auto& obj = evtSetup.getData(ecalDAQTowerStatusToken_);
0248     edm::LogInfo("EcalDBCopy") << "DAQ channel status pointer is: " << &obj << std::endl;
0249     dbOutput->createOneIOV<const EcalDAQTowerStatus>(obj, dbOutput->beginOfTime(), recordName);
0250 
0251   } else if (container == "EcalTPGCrystalStatus") {
0252     const auto& obj = evtSetup.getData(ecalTPGCrystalStatusToken_);
0253     edm::LogInfo("EcalDBCopy") << "TPG channel status pointer is: " << &obj << std::endl;
0254     dbOutput->createOneIOV<const EcalTPGCrystalStatus>(obj, dbOutput->beginOfTime(), recordName);
0255 
0256   } else if (container == "EcalTPGTowerStatus") {
0257     const auto& obj = evtSetup.getData(ecalTPGTowerStatusToken_);
0258     edm::LogInfo("EcalDBCopy") << "TPG tower status pointer is: " << &obj << std::endl;
0259     dbOutput->createOneIOV<const EcalTPGTowerStatus>(obj, dbOutput->beginOfTime(), recordName);
0260 
0261   } else if (container == "EcalIntercalibConstants") {
0262     const auto& obj = evtSetup.getData(ecalIntercalibConstantsToken_);
0263     edm::LogInfo("EcalDBCopy") << "inter pointer is: " << &obj << std::endl;
0264     dbOutput->createOneIOV<const EcalIntercalibConstants>(obj, dbOutput->beginOfTime(), recordName);
0265 
0266   } else if (container == "EcalLinearCorrections") {
0267     const auto& obj = evtSetup.getData(ecalLinearCorrectionsToken_);
0268     edm::LogInfo("EcalDBCopy") << "inter pointer is: " << &obj << std::endl;
0269     dbOutput->createOneIOV<const EcalLinearCorrections>(obj, dbOutput->beginOfTime(), recordName);
0270 
0271   } else if (container == "EcalIntercalibConstantsMC") {
0272     const auto& obj = evtSetup.getData(ecalIntercalibConstantsMCToken_);
0273     edm::LogInfo("EcalDBCopy") << "intercalib MC pointer is: " << &obj << std::endl;
0274     dbOutput->createOneIOV<const EcalIntercalibConstantsMC>(obj, dbOutput->beginOfTime(), recordName);
0275 
0276   } else if (container == "EcalIntercalibErrors") {
0277     const auto& obj = evtSetup.getData(ecalIntercalibErrorsToken_);
0278     edm::LogInfo("EcalDBCopy") << "inter pointer is: " << &obj << std::endl;
0279     dbOutput->createOneIOV<const EcalIntercalibErrors>(obj, dbOutput->beginOfTime(), recordName);
0280 
0281   } else if (container == "EcalGainRatios") {
0282     const auto& obj = evtSetup.getData(ecalGainRatiosToken_);
0283     edm::LogInfo("EcalDBCopy") << "gain pointer is: " << &obj << std::endl;
0284     dbOutput->createOneIOV<const EcalGainRatios>(obj, dbOutput->beginOfTime(), recordName);
0285 
0286   } else if (container == "EcalWeightXtalGroups") {
0287     const auto& obj = evtSetup.getData(ecalWeightXtalGroupsToken_);
0288     edm::LogInfo("EcalDBCopy") << "weight pointer is: " << &obj << std::endl;
0289     dbOutput->createOneIOV<const EcalWeightXtalGroups>(obj, dbOutput->beginOfTime(), recordName);
0290 
0291   } else if (container == "EcalTBWeights") {
0292     const auto& obj = evtSetup.getData(ecalTBWeightsToken_);
0293     edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << &obj << std::endl;
0294     dbOutput->createOneIOV<const EcalTBWeights>(obj, dbOutput->beginOfTime(), recordName);
0295 
0296   } else if (container == "EcalLaserAlphas") {
0297     const auto& obj = evtSetup.getData(ecalLaserAlphasToken_);
0298     edm::LogInfo("EcalDBCopy") << "ecalLaserAlpha pointer is: " << &obj << std::endl;
0299     dbOutput->createOneIOV<const EcalLaserAlphas>(obj, dbOutput->beginOfTime(), recordName);
0300 
0301   } else if (container == "EcalLaserAPDPNRatios") {
0302     const auto& obj = evtSetup.getData(ecalLaserAPDPNRatiosToken_);
0303     edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << &obj << std::endl;
0304     dbOutput->createOneIOV<const EcalLaserAPDPNRatios>(obj, dbOutput->beginOfTime(), recordName);
0305 
0306   } else if (container == "EcalLaserAPDPNRatiosRef") {
0307     const auto& obj = evtSetup.getData(ecalLaserAPDPNRatiosRefToken_);
0308     edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << &obj << std::endl;
0309     dbOutput->createOneIOV<const EcalLaserAPDPNRatiosRef>(obj, dbOutput->beginOfTime(), recordName);
0310 
0311   } else if (container == "EcalClusterCrackCorrParameters") {
0312     const auto& obj = evtSetup.getData(ecalClusterCrackCorrParametersToken_);
0313     edm::LogInfo("EcalDBCopy") << "cluster crack pointer is: " << &obj << std::endl;
0314     dbOutput->createOneIOV<const EcalClusterCrackCorrParameters>(obj, dbOutput->beginOfTime(), recordName);
0315 
0316   } else if (container == "EcalPFRecHitThresholds") {
0317     const auto& obj = evtSetup.getData(ecalPFRecHitThresholdsToken_);
0318     edm::LogInfo("EcalDBCopy") << "Ecal PF rec hit thresholds pointer is: " << &obj << std::endl;
0319     dbOutput->createOneIOV<const EcalPFRecHitThresholds>(obj, dbOutput->beginOfTime(), recordName);
0320 
0321   } else if (container == "EcalClusterEnergyUncertaintyParameters") {
0322     const auto& obj = evtSetup.getData(ecalClusterEnergyUncertaintyParametersToken_);
0323     edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << &obj << std::endl;
0324     dbOutput->createOneIOV<const EcalClusterEnergyUncertaintyParameters>(obj, dbOutput->beginOfTime(), recordName);
0325 
0326   } else if (container == "EcalClusterEnergyCorrectionParameters") {
0327     const auto& obj = evtSetup.getData(ecalClusterEnergyCorrectionParametersToken_);
0328     edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << &obj << std::endl;
0329     dbOutput->createOneIOV<const EcalClusterEnergyCorrectionParameters>(obj, dbOutput->beginOfTime(), recordName);
0330 
0331   } else if (container == "EcalClusterEnergyCorrectionObjectSpecificParameters") {
0332     const auto& obj = evtSetup.getData(ecalClusterEnergyCorrectionObjectSpecificParametersToken_);
0333     edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << &obj << std::endl;
0334     dbOutput->createOneIOV<const EcalClusterEnergyCorrectionObjectSpecificParameters>(
0335         obj, dbOutput->beginOfTime(), recordName);
0336 
0337   } else if (container == "EcalClusterLocalContCorrParameters") {
0338     const auto& obj = evtSetup.getData(ecalClusterLocalContCorrParametersToken_);
0339     edm::LogInfo("EcalDBCopy") << "tbweight pointer is: " << &obj << std::endl;
0340     dbOutput->createOneIOV<const EcalClusterLocalContCorrParameters>(obj, dbOutput->beginOfTime(), recordName);
0341 
0342   } else if (container == "EBAlignment") {
0343     const auto& obj = evtSetup.getData(ebAlignmentToken_);
0344     edm::LogInfo("EcalDBCopy") << "EB alignment pointer is: " << &obj << std::endl;
0345     dbOutput->createOneIOV<const Alignments>(obj, dbOutput->beginOfTime(), recordName);
0346 
0347   } else if (container == "EEAlignment") {
0348     const auto& obj = evtSetup.getData(eeAlignmentToken_);
0349     edm::LogInfo("EcalDBCopy") << "EE alignment pointer is: " << &obj << std::endl;
0350     dbOutput->createOneIOV<const Alignments>(obj, dbOutput->beginOfTime(), recordName);
0351 
0352   } else if (container == "ESAlignment") {
0353     const auto& obj = evtSetup.getData(esAlignmentToken_);
0354     edm::LogInfo("EcalDBCopy") << "ES alignment pointer is: " << &obj << std::endl;
0355     dbOutput->createOneIOV<const Alignments>(obj, dbOutput->beginOfTime(), recordName);
0356 
0357   } else if (container == "EcalTimeOffsetConstant") {
0358     const auto& obj = evtSetup.getData(ecalTimeOffsetConstantToken_);
0359     edm::LogInfo("EcalDBCopy") << "TimeOffset pointer is: " << &obj << std::endl;
0360     dbOutput->createOneIOV<const EcalTimeOffsetConstant>(obj, dbOutput->beginOfTime(), recordName);
0361 
0362   } else if (container == "EcalSampleMask") {
0363     const auto& obj = evtSetup.getData(ecalSampleMaskToken_);
0364     edm::LogInfo("EcalDBCopy") << "sample mask pointer is: " << &obj << std::endl;
0365     dbOutput->createOneIOV<const EcalSampleMask>(obj, dbOutput->beginOfTime(), recordName);
0366 
0367   } else if (container == "EcalSimPulseShape") {
0368     const auto& obj = evtSetup.getData(ecalSimPulseShapeToken_);
0369     dbOutput->createOneIOV<const EcalSimPulseShape>(obj, dbOutput->beginOfTime(), recordName);
0370 
0371   } else if (container == "EcalTimeBiasCorrections") {
0372     const auto& obj = evtSetup.getData(ecalTimeBiasCorrectionsToken_);
0373     edm::LogInfo("EcalDBCopy") << "TimeBiasCorrections pointer is: " << &obj << std::endl;
0374     EcalTimeBiasCorrections bias_;
0375     std::vector<float> vect = obj.EBTimeCorrAmplitudeBins;
0376     copy(vect.begin(), vect.end(), back_inserter(bias_.EBTimeCorrAmplitudeBins));
0377     vect = obj.EBTimeCorrShiftBins;
0378     copy(vect.begin(), vect.end(), back_inserter(bias_.EBTimeCorrShiftBins));
0379     vect = obj.EETimeCorrAmplitudeBins;
0380     copy(vect.begin(), vect.end(), back_inserter(bias_.EETimeCorrAmplitudeBins));
0381     vect = obj.EETimeCorrShiftBins;
0382     copy(vect.begin(), vect.end(), back_inserter(bias_.EETimeCorrShiftBins));
0383     dbOutput->writeOneIOV(bias_, dbOutput->beginOfTime(), "EcalTimeBiasCorrectionsRcd");
0384 
0385   } else if (container == "EcalSamplesCorrelation") {
0386     const auto& obj = evtSetup.getData(ecalSamplesCorrelationToken_);
0387     edm::LogInfo("EcalDBCopy") << "SamplesCorrelation pointer is: " << &obj << std::endl;
0388     EcalSamplesCorrelation correl_;
0389     std::vector<double> vect = obj.EBG12SamplesCorrelation;
0390     copy(vect.begin(), vect.end(), back_inserter(correl_.EBG12SamplesCorrelation));
0391     vect = obj.EBG6SamplesCorrelation;
0392     copy(vect.begin(), vect.end(), back_inserter(correl_.EBG6SamplesCorrelation));
0393     vect = obj.EBG1SamplesCorrelation;
0394     copy(vect.begin(), vect.end(), back_inserter(correl_.EBG1SamplesCorrelation));
0395     vect = obj.EEG12SamplesCorrelation;
0396     copy(vect.begin(), vect.end(), back_inserter(correl_.EEG12SamplesCorrelation));
0397     vect = obj.EEG6SamplesCorrelation;
0398     copy(vect.begin(), vect.end(), back_inserter(correl_.EEG6SamplesCorrelation));
0399     vect = obj.EEG1SamplesCorrelation;
0400     copy(vect.begin(), vect.end(), back_inserter(correl_.EEG1SamplesCorrelation));
0401     dbOutput->writeOneIOV(correl_, dbOutput->beginOfTime(), "EcalSamplesCorrelationRcd");
0402 
0403   } else {
0404     throw cms::Exception("Unknown container");
0405   }
0406 
0407   edm::LogInfo("EcalDBCopy") << "EcalDBCopy wrote " << recordName << std::endl;
0408 }