CMS 3D CMS Logo

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