CMS 3D CMS Logo

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