CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/CondTools/Ecal/src/EcalDBCopy.cc

Go to the documentation of this file.
00001 #include "FWCore/ServiceRegistry/interface/Service.h"
00002 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
00003 
00004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00005 
00006 
00007 #include "FWCore/Framework/interface/ESHandle.h"
00008 #include "FWCore/Framework/interface/EventSetup.h"
00009 
00010 
00011 #include "CondTools/Ecal/interface/EcalDBCopy.h"
00012 #include "CondFormats/EcalObjects/interface/EcalPedestals.h"
00013 #include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h"
00014 #include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h"
00015 #include "CondFormats/DataRecord/interface/EcalADCToGeVConstantRcd.h"
00016 #include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h"
00017 #include "CondFormats/DataRecord/interface/EcalTimeCalibConstantsRcd.h"
00018 #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
00019 #include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h"
00020 #include "CondFormats/EcalObjects/interface/EcalLinearCorrections.h"
00021 #include "CondFormats/DataRecord/interface/EcalLinearCorrectionsRcd.h"
00022 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
00023 #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h"
00024 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h"
00025 #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsMCRcd.h"
00026 #include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h"
00027 #include "CondFormats/DataRecord/interface/EcalIntercalibErrorsRcd.h"
00028 #include "CondFormats/EcalObjects/interface/EcalGainRatios.h"
00029 #include "CondFormats/DataRecord/interface/EcalGainRatiosRcd.h"
00030 #include "CondFormats/EcalObjects/interface/EcalWeightXtalGroups.h"
00031 #include "CondFormats/DataRecord/interface/EcalWeightXtalGroupsRcd.h"
00032 #include "CondFormats/EcalObjects/interface/EcalTBWeights.h"
00033 #include "CondFormats/DataRecord/interface/EcalTBWeightsRcd.h"
00034 #include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h"
00035 #include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h"
00036 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h"
00037 #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h"
00038 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h"
00039 #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h"
00040 #include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h"
00041 #include "CondFormats/DataRecord/interface/EcalTPGCrystalStatusRcd.h"
00042 
00043 #include "CondFormats/EcalObjects/interface/EcalDCSTowerStatus.h"
00044 #include "CondFormats/DataRecord/interface/EcalDCSTowerStatusRcd.h"
00045 #include "CondFormats/EcalObjects/interface/EcalDAQTowerStatus.h"
00046 #include "CondFormats/DataRecord/interface/EcalDAQTowerStatusRcd.h"
00047 #include "CondFormats/EcalObjects/interface/EcalDQMTowerStatus.h"
00048 #include "CondFormats/DataRecord/interface/EcalDQMTowerStatusRcd.h"
00049 #include "CondFormats/EcalObjects/interface/EcalDQMChannelStatus.h"
00050 #include "CondFormats/DataRecord/interface/EcalDQMChannelStatusRcd.h"
00051 
00052 #include "CondFormats/EcalObjects/interface/EcalClusterCrackCorrParameters.h"
00053 #include "CondFormats/DataRecord/interface/EcalClusterCrackCorrParametersRcd.h"
00054 #include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionParameters.h"
00055 #include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionParametersRcd.h"
00056 #include "CondFormats/EcalObjects/interface/EcalClusterEnergyUncertaintyParameters.h"
00057 #include "CondFormats/DataRecord/interface/EcalClusterEnergyUncertaintyParametersRcd.h"
00058 #include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionObjectSpecificParameters.h"
00059 #include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionObjectSpecificParametersRcd.h"
00060 #include "CondFormats/EcalObjects/interface/EcalClusterLocalContCorrParameters.h"
00061 #include "CondFormats/DataRecord/interface/EcalClusterLocalContCorrParametersRcd.h"
00062 
00063 #include "CondFormats/Alignment/interface/Alignments.h"
00064 #include "CondFormats/AlignmentRecord/interface/EBAlignmentRcd.h"
00065 #include "CondFormats/AlignmentRecord/interface/EEAlignmentRcd.h"
00066 #include "CondFormats/AlignmentRecord/interface/ESAlignmentRcd.h"
00067 #include "CondFormats/EcalObjects/interface/EcalTimeOffsetConstant.h"
00068 #include "CondFormats/DataRecord/interface/EcalTimeOffsetConstantRcd.h"
00069 
00070 #include "CondFormats/EcalObjects/interface/EcalSampleMask.h"
00071 #include "CondFormats/DataRecord/interface/EcalSampleMaskRcd.h"
00072 
00073 #include <vector>
00074 
00075 EcalDBCopy::EcalDBCopy(const edm::ParameterSet& iConfig) :
00076   m_timetype(iConfig.getParameter<std::string>("timetype")),
00077   m_cacheIDs(),
00078   m_records()
00079 {
00080 
00081   std::string container;
00082   std::string tag;
00083   std::string record;
00084   typedef std::vector< edm::ParameterSet > Parameters;
00085   Parameters toCopy = iConfig.getParameter<Parameters>("toCopy");
00086   for(Parameters::iterator i = toCopy.begin(); i != toCopy.end(); ++i) {
00087     container = i->getParameter<std::string>("container");
00088     record = i->getParameter<std::string>("record");
00089     m_cacheIDs.insert( std::make_pair(container, 0) );
00090     m_records.insert( std::make_pair(container, record) );
00091   }
00092   
00093 }
00094 
00095 
00096 EcalDBCopy::~EcalDBCopy()
00097 {
00098   
00099 }
00100 
00101 void EcalDBCopy::analyze( const edm::Event& evt, const edm::EventSetup& evtSetup)
00102 {
00103 
00104   std::string container;
00105   std::string record;
00106   typedef std::map<std::string, std::string>::const_iterator recordIter;
00107   for (recordIter i = m_records.begin(); i != m_records.end(); ++i) {
00108     container = (*i).first;
00109     record = (*i).second;
00110     if ( shouldCopy(evtSetup, container) ) {
00111       copyToDB(evtSetup, container);
00112     }
00113   }
00114   
00115 }
00116 
00117 
00118 
00119 bool EcalDBCopy::shouldCopy(const edm::EventSetup& evtSetup, std::string container)
00120 {
00121 
00122   unsigned long long cacheID = 0;
00123   if (container == "EcalPedestals") {
00124     cacheID = evtSetup.get<EcalPedestalsRcd>().cacheIdentifier();
00125   } else if (container == "EcalADCToGeVConstant") {
00126     cacheID = evtSetup.get<EcalADCToGeVConstantRcd>().cacheIdentifier();
00127   } else if (container == "EcalLinearCorrections") {
00128     cacheID = evtSetup.get<EcalLinearCorrectionsRcd>().cacheIdentifier();
00129   } else if (container == "EcalIntercalibConstants") {
00130     cacheID = evtSetup.get<EcalIntercalibConstantsRcd>().cacheIdentifier();
00131   } else if (container == "EcalIntercalibConstantsMC") {
00132     cacheID = evtSetup.get<EcalIntercalibConstantsMCRcd>().cacheIdentifier();
00133   } else if (container == "EcalIntercalibErrors") {
00134     cacheID = evtSetup.get<EcalIntercalibErrorsRcd>().cacheIdentifier();
00135   } else if (container == "EcalGainRatios") {
00136     cacheID = evtSetup.get<EcalGainRatiosRcd>().cacheIdentifier();
00137   } else if (container == "EcalWeightXtalGroups") {
00138     cacheID = evtSetup.get<EcalWeightXtalGroupsRcd>().cacheIdentifier();
00139   } else if (container == "EcalTBWeights") {
00140     cacheID = evtSetup.get<EcalTBWeightsRcd>().cacheIdentifier();
00141   } else if (container == "EcalLaserAPDPNRatios") {
00142     cacheID = evtSetup.get<EcalLaserAPDPNRatiosRcd>().cacheIdentifier();
00143   } else if (container == "EcalLaserAPDPNRatiosRef") {
00144     cacheID = evtSetup.get<EcalTBWeightsRcd>().cacheIdentifier();
00145   } else if (container == "EcalLaserAlphas") {
00146     cacheID = evtSetup.get<EcalTBWeightsRcd>().cacheIdentifier();
00147   } else if (container == "EcalChannelStatus") {
00148     cacheID = evtSetup.get<EcalChannelStatusRcd>().cacheIdentifier();
00149   } else if (container == "EcalDQMTowerStatus") {
00150     cacheID = evtSetup.get<EcalDQMTowerStatusRcd>().cacheIdentifier();
00151   } else if (container == "EcalDQMChannelStatus") {
00152     cacheID = evtSetup.get<EcalDQMChannelStatusRcd>().cacheIdentifier();
00153   } else if (container == "EcalDCSTowerStatus") {
00154     cacheID = evtSetup.get<EcalDCSTowerStatusRcd>().cacheIdentifier();
00155   } else if (container == "EcalDAQTowerStatus") {
00156     cacheID = evtSetup.get<EcalDAQTowerStatusRcd>().cacheIdentifier();
00157   } else if (container == "EcalTimeCalibConstants") {
00158     cacheID = evtSetup.get<EcalTimeCalibConstantsRcd>().cacheIdentifier();
00159   } else if (container == "EcalClusterCrackCorrParameters") {
00160     cacheID = evtSetup.get<EcalClusterCrackCorrParametersRcd>().cacheIdentifier();
00161   } else if (container == "EcalClusterEnergyUncertaintyParameters") {
00162     cacheID = evtSetup.get<EcalClusterEnergyUncertaintyParametersRcd>().cacheIdentifier();
00163   } else if (container == "EcalClusterEnergyCorrectionParameters") {
00164     cacheID = evtSetup.get<EcalClusterEnergyCorrectionParametersRcd>().cacheIdentifier();
00165   } else if (container == "EcalClusterEnergyCorrectionObjectSpecificParameters") {
00166     cacheID = evtSetup.get<EcalClusterEnergyCorrectionObjectSpecificParametersRcd>().cacheIdentifier();
00167   } else if (container == "EcalClusterLocalContCorrParameters") {
00168     cacheID = evtSetup.get<EcalClusterLocalContCorrParametersRcd>().cacheIdentifier();
00169   } else if (container == "EcalTPGCrystalStatus") {
00170     cacheID = evtSetup.get<EcalTPGCrystalStatusRcd>().cacheIdentifier();
00171   } else if (container == "EBAlignment") {
00172     cacheID = evtSetup.get<EBAlignmentRcd>().cacheIdentifier();
00173   } else if (container == "EEAlignment") {
00174     cacheID = evtSetup.get<EEAlignmentRcd>().cacheIdentifier();
00175   } else if (container == "ESAlignment") {
00176     cacheID = evtSetup.get<ESAlignmentRcd>().cacheIdentifier();
00177   } else if (container == "EcalTimeOffsetConstant") {
00178     cacheID = evtSetup.get<EcalTimeOffsetConstantRcd>().cacheIdentifier();
00179   } else if (container == "EcalSampleMask") {
00180     cacheID = evtSetup.get<EcalSampleMaskRcd>().cacheIdentifier();
00181   }
00182 
00183   else {
00184     throw cms::Exception("Unknown container");
00185   }
00186   
00187   if (m_cacheIDs[container] == cacheID) {
00188     return 0;
00189   } else {
00190     m_cacheIDs[container] = cacheID;
00191     return 1;
00192   }
00193 
00194 }
00195 
00196 
00197 
00198 void EcalDBCopy::copyToDB(const edm::EventSetup& evtSetup, std::string container)
00199 {
00200   edm::Service<cond::service::PoolDBOutputService> dbOutput;
00201   if ( !dbOutput.isAvailable() ) {
00202     throw cms::Exception("PoolDBOutputService is not available");
00203   }
00204 
00205   std::string recordName = m_records[container];
00206 
00207   if (container == "EcalPedestals") {
00208     edm::ESHandle<EcalPedestals> handle;
00209     evtSetup.get<EcalPedestalsRcd>().get(handle);
00210     const EcalPedestals* obj = handle.product();
00211     std::cout << "ped pointer is: "<< obj<< std::endl;
00212     dbOutput->createNewIOV<const EcalPedestals>( new EcalPedestals(*obj), dbOutput->beginOfTime(),dbOutput->endOfTime(),recordName);
00213 
00214   }  else if (container == "EcalADCToGeVConstant") {
00215     edm::ESHandle<EcalADCToGeVConstant> handle;
00216     evtSetup.get<EcalADCToGeVConstantRcd>().get(handle);
00217     const EcalADCToGeVConstant* obj = handle.product();
00218     std::cout << "adc pointer is: "<< obj<< std::endl;
00219 
00220    dbOutput->createNewIOV<const EcalADCToGeVConstant>( new EcalADCToGeVConstant(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00221 
00222 
00223   }  else if (container == "EcalTimeCalibConstants") {
00224     edm::ESHandle<EcalTimeCalibConstants> handle;
00225     evtSetup.get<EcalTimeCalibConstantsRcd>().get(handle);
00226     const EcalTimeCalibConstants* obj = handle.product();
00227     std::cout << "adc pointer is: "<< obj<< std::endl;
00228 
00229    dbOutput->createNewIOV<const EcalTimeCalibConstants>( new EcalTimeCalibConstants(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00230 
00231   }  else if (container == "EcalChannelStatus") {
00232     edm::ESHandle<EcalChannelStatus> handle;
00233     evtSetup.get<EcalChannelStatusRcd>().get(handle);
00234     const EcalChannelStatus* obj = handle.product();
00235     std::cout << "channel status pointer is: "<< obj<< std::endl;
00236 
00237    dbOutput->createNewIOV<const EcalChannelStatus>( new EcalChannelStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00238 
00239   }  else if (container == "EcalDQMChannelStatus") {
00240     edm::ESHandle<EcalDQMChannelStatus> handle;
00241     evtSetup.get<EcalDQMChannelStatusRcd>().get(handle);
00242     const EcalDQMChannelStatus* obj = handle.product();
00243     std::cout << "DQM channel status pointer is: "<< obj<< std::endl;
00244     dbOutput->createNewIOV<const EcalDQMChannelStatus>( new EcalDQMChannelStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00245 
00246   }  else if (container == "EcalDQMTowerStatus") {
00247     edm::ESHandle<EcalDQMTowerStatus> handle;
00248     evtSetup.get<EcalDQMTowerStatusRcd>().get(handle);
00249     const EcalDQMTowerStatus* obj = handle.product();
00250     std::cout << "DQM Tower status pointer is: "<< obj<< std::endl;
00251     dbOutput->createNewIOV<const EcalDQMTowerStatus>( new EcalDQMTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00252 
00253   }  else if (container == "EcalDCSTowerStatus") {
00254     edm::ESHandle<EcalDCSTowerStatus> handle;
00255     evtSetup.get<EcalDCSTowerStatusRcd>().get(handle);
00256     const EcalDCSTowerStatus* obj = handle.product();
00257     std::cout << "channel status pointer is: "<< obj<< std::endl;
00258 
00259    dbOutput->createNewIOV<const EcalDCSTowerStatus>( new EcalDCSTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00260 
00261   }  else if (container == "EcalDAQTowerStatus") {
00262     edm::ESHandle<EcalDAQTowerStatus> handle;
00263     evtSetup.get<EcalDAQTowerStatusRcd>().get(handle);
00264     const EcalDAQTowerStatus* obj = handle.product();
00265     std::cout << "DAQ channel status pointer is: "<< obj<< std::endl;
00266 
00267    dbOutput->createNewIOV<const EcalDAQTowerStatus>( new EcalDAQTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00268 
00269 
00270   }  else if (container == "EcalTPGCrystalStatus") {
00271     edm::ESHandle<EcalTPGCrystalStatus> handle;
00272     evtSetup.get<EcalTPGCrystalStatusRcd>().get(handle);
00273     const EcalTPGCrystalStatus* obj = handle.product();
00274     std::cout << "TPG channel status pointer is: "<< obj<< std::endl;
00275 
00276    dbOutput->createNewIOV<const EcalTPGCrystalStatus>( new EcalTPGCrystalStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00277 
00278 
00279   } else if (container == "EcalIntercalibConstants") {
00280     edm::ESHandle<EcalIntercalibConstants> handle;
00281     evtSetup.get<EcalIntercalibConstantsRcd>().get(handle);
00282     const EcalIntercalibConstants* obj = handle.product();
00283     std::cout << "inter pointer is: "<< obj<< std::endl;
00284    dbOutput->createNewIOV<const EcalIntercalibConstants>( new EcalIntercalibConstants(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00285 
00286   } else if (container == "EcalLinearCorrections") {
00287     edm::ESHandle<EcalLinearCorrections> handle;
00288     evtSetup.get<EcalLinearCorrectionsRcd>().get(handle);
00289     const EcalLinearCorrections* obj = handle.product();
00290     std::cout << "inter pointer is: "<< obj<< std::endl;
00291    dbOutput->createNewIOV<const EcalLinearCorrections>( new EcalLinearCorrections(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00292 
00293   }
00294 else if (container == "EcalIntercalibConstantsMC") {
00295     edm::ESHandle<EcalIntercalibConstantsMC> handle;
00296     evtSetup.get<EcalIntercalibConstantsMCRcd>().get(handle);
00297     const EcalIntercalibConstantsMC* obj = handle.product();
00298     std::cout << "intercalib MC pointer is: "<< obj<< std::endl;
00299    dbOutput->createNewIOV<const EcalIntercalibConstantsMC>( new EcalIntercalibConstantsMC(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00300 
00301   } else if (container == "EcalIntercalibErrors") {
00302     edm::ESHandle<EcalIntercalibErrors> handle;
00303     evtSetup.get<EcalIntercalibErrorsRcd>().get(handle);
00304     const EcalIntercalibErrors* obj = handle.product();
00305     std::cout << "inter pointer is: "<< obj<< std::endl;
00306    dbOutput->createNewIOV<const EcalIntercalibErrors>( new EcalIntercalibErrors(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00307 
00308   } else if (container == "EcalGainRatios") {
00309     edm::ESHandle<EcalGainRatios> handle;
00310     evtSetup.get<EcalGainRatiosRcd>().get(handle);
00311     const EcalGainRatios* obj = handle.product();
00312     std::cout << "gain pointer is: "<< obj<< std::endl;
00313    dbOutput->createNewIOV<const EcalGainRatios>( new EcalGainRatios(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00314 
00315   } else if (container == "EcalWeightXtalGroups") {
00316     edm::ESHandle<EcalWeightXtalGroups> handle;
00317     evtSetup.get<EcalWeightXtalGroupsRcd>().get(handle);
00318     const EcalWeightXtalGroups* obj = handle.product();
00319     std::cout << "weight pointer is: "<< obj<< std::endl;
00320    dbOutput->createNewIOV<const EcalWeightXtalGroups>( new EcalWeightXtalGroups(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00321 
00322   } else if (container == "EcalTBWeights") {
00323     edm::ESHandle<EcalTBWeights> handle;
00324     evtSetup.get<EcalTBWeightsRcd>().get(handle);
00325     const EcalTBWeights* obj = handle.product();
00326     std::cout << "tbweight pointer is: "<< obj<< std::endl;
00327    dbOutput->createNewIOV<const EcalTBWeights>( new EcalTBWeights(*obj), dbOutput->beginOfTime(),dbOutput->endOfTime(),recordName);
00328 
00329   } else if (container == "EcalLaserAlphas") {
00330     edm::ESHandle<EcalLaserAlphas> handle;
00331     evtSetup.get<EcalLaserAlphasRcd>().get(handle);
00332     const EcalLaserAlphas* obj = handle.product();
00333     std::cout << "ecalLaserAlpha pointer is: "<< obj<< std::endl;
00334    dbOutput->createNewIOV<const EcalLaserAlphas>( new EcalLaserAlphas(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00335 
00336   } else if (container == "EcalLaserAPDPNRatios") {
00337     edm::ESHandle<EcalLaserAPDPNRatios> handle;
00338     evtSetup.get<EcalLaserAPDPNRatiosRcd>().get(handle);
00339     const EcalLaserAPDPNRatios* obj = handle.product();
00340     std::cout << "tbweight pointer is: "<< obj<< std::endl;
00341    dbOutput->createNewIOV<const EcalLaserAPDPNRatios>( new EcalLaserAPDPNRatios(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00342 
00343   } else if (container == "EcalLaserAPDPNRatiosRef") {
00344     edm::ESHandle<EcalLaserAPDPNRatiosRef> handle;
00345     evtSetup.get<EcalLaserAPDPNRatiosRefRcd>().get(handle);
00346     const EcalLaserAPDPNRatiosRef* obj = handle.product();
00347     std::cout << "tbweight pointer is: "<< obj<< std::endl;
00348    dbOutput->createNewIOV<const EcalLaserAPDPNRatiosRef>( new EcalLaserAPDPNRatiosRef(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00349 
00350 
00351   } else if (container == "EcalClusterCrackCorrParameters") {
00352     edm::ESHandle<EcalClusterCrackCorrParameters> handle;
00353     evtSetup.get<EcalClusterCrackCorrParametersRcd>().get(handle);
00354     const EcalClusterCrackCorrParameters* obj = handle.product();
00355     std::cout << "tbweight pointer is: "<< obj<< std::endl;
00356    dbOutput->createNewIOV<const EcalClusterCrackCorrParameters>( new EcalClusterCrackCorrParameters(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00357 
00358 
00359   } else if (container == "EcalClusterEnergyUncertaintyParameters") {
00360     edm::ESHandle<EcalClusterEnergyUncertaintyParameters> handle;
00361     evtSetup.get<EcalClusterEnergyUncertaintyParametersRcd>().get(handle);
00362     const EcalClusterEnergyUncertaintyParameters* obj = handle.product();
00363     std::cout << "tbweight pointer is: "<< obj<< std::endl;
00364    dbOutput->createNewIOV<const EcalClusterEnergyUncertaintyParameters>( new EcalClusterEnergyUncertaintyParameters(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00365 
00366 
00367   } else if (container == "EcalClusterEnergyCorrectionParameters") {
00368     edm::ESHandle<EcalClusterEnergyCorrectionParameters> handle;
00369     evtSetup.get<EcalClusterEnergyCorrectionParametersRcd>().get(handle);
00370     const EcalClusterEnergyCorrectionParameters* obj = handle.product();
00371     std::cout << "tbweight pointer is: "<< obj<< std::endl;
00372    dbOutput->createNewIOV<const EcalClusterEnergyCorrectionParameters>( new EcalClusterEnergyCorrectionParameters(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00373 
00374   } else if (container == "EcalClusterEnergyCorrectionObjectSpecificParameters") {
00375     edm::ESHandle<EcalClusterEnergyCorrectionObjectSpecificParameters> handle;
00376     evtSetup.get<EcalClusterEnergyCorrectionObjectSpecificParametersRcd>().get(handle);
00377     const EcalClusterEnergyCorrectionObjectSpecificParameters* obj = handle.product();
00378     std::cout << "tbweight pointer is: "<< obj<< std::endl;
00379     dbOutput->createNewIOV<const EcalClusterEnergyCorrectionObjectSpecificParameters>( new EcalClusterEnergyCorrectionObjectSpecificParameters(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00380 
00381 
00382   } else if (container == "EcalClusterLocalContCorrParameters") {
00383     edm::ESHandle<EcalClusterLocalContCorrParameters> handle;
00384     evtSetup.get<EcalClusterLocalContCorrParametersRcd>().get(handle);
00385     const EcalClusterLocalContCorrParameters* obj = handle.product();
00386     std::cout << "tbweight pointer is: "<< obj<< std::endl;
00387    dbOutput->createNewIOV<const EcalClusterLocalContCorrParameters>( new EcalClusterLocalContCorrParameters(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00388 
00389   } else if (container == "EBAlignment") {
00390     edm::ESHandle<Alignments> handle;
00391     evtSetup.get<EBAlignmentRcd>().get(handle);
00392     const Alignments* obj = handle.product();
00393     std::cout << "EB alignment pointer is: "<< obj<< std::endl;
00394     dbOutput->createNewIOV<const Alignments>( new Alignments(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00395 
00396   } else if (container == "EEAlignment") {
00397     edm::ESHandle<Alignments> handle;
00398     evtSetup.get<EEAlignmentRcd>().get(handle);
00399     const Alignments* obj = handle.product();
00400     std::cout << "EE alignment pointer is: "<< obj<< std::endl;
00401     dbOutput->createNewIOV<const Alignments>( new Alignments(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00402 
00403   } else if (container == "ESAlignment") {
00404     edm::ESHandle<Alignments> handle;
00405     evtSetup.get<ESAlignmentRcd>().get(handle);
00406     const Alignments* obj = handle.product();
00407     std::cout << "ES alignment pointer is: "<< obj<< std::endl;
00408     dbOutput->createNewIOV<const Alignments>( new Alignments(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00409 
00410   } else if (container == "EcalTimeOffsetConstant") {
00411     edm::ESHandle<EcalTimeOffsetConstant> handle;
00412     evtSetup.get<EcalTimeOffsetConstantRcd>().get(handle);
00413     const EcalTimeOffsetConstant* obj = handle.product();
00414     std::cout << "TimeOffset pointer is: "<< obj<< std::endl;
00415     dbOutput->createNewIOV<const EcalTimeOffsetConstant>( new EcalTimeOffsetConstant(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00416 
00417  } else if (container == "EcalSampleMask") {
00418    edm::ESHandle<EcalSampleMask> handle;
00419    evtSetup.get<EcalSampleMaskRcd>().get(handle);
00420    const EcalSampleMask* obj = handle.product();
00421    std::cout << "sample mask pointer is: "<< obj<< std::endl;
00422    dbOutput->createNewIOV<const EcalSampleMask>( new EcalSampleMask(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
00423 
00424  } else {
00425     throw cms::Exception("Unknown container");
00426   }
00427 
00428   std::cout<< "EcalDBCopy wrote " << recordName << std::endl;
00429 }