Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:56

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