CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
EcalDBCopy Class Reference

#include <EcalDBCopy.h>

Inheritance diagram for EcalDBCopy:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &evt, const edm::EventSetup &evtSetup) override
 
 EcalDBCopy (const edm::ParameterSet &iConfig)
 
 ~EcalDBCopy () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void copyToDB (const edm::EventSetup &evtSetup, std::string container)
 
bool shouldCopy (const edm::EventSetup &evtSetup, std::string container)
 

Private Attributes

std::map< std::string, unsigned long long > m_cacheIDs
 
std::map< std::string, std::string > m_records
 
std::string m_timetype
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 18 of file EcalDBCopy.h.

Constructor & Destructor Documentation

EcalDBCopy::EcalDBCopy ( const edm::ParameterSet iConfig)
explicit

Definition at line 87 of file EcalDBCopy.cc.

References edm::ParameterSet::getParameter(), mps_fire::i, m_cacheIDs, m_records, record, AlCaHLTBitMon_QueryRunRegistry::string, and GlobalPosition_Frontier_DevDB_cff::tag.

87  :
88  m_timetype(iConfig.getParameter<std::string>("timetype")),
89  m_cacheIDs(),
90  m_records()
91 {
92 
93  std::string container;
96  typedef std::vector< edm::ParameterSet > Parameters;
97  Parameters toCopy = iConfig.getParameter<Parameters>("toCopy");
98  for(Parameters::iterator i = toCopy.begin(); i != toCopy.end(); ++i) {
99  container = i->getParameter<std::string>("container");
100  record = i->getParameter<std::string>("record");
101  m_cacheIDs.insert( std::make_pair(container, 0) );
102  m_records.insert( std::make_pair(container, record) );
103  }
104 
105 }
std::string m_timetype
Definition: EcalDBCopy.h:29
T getParameter(std::string const &) const
JetCorrectorParameters::Record record
Definition: classes.h:7
std::map< std::string, std::string > m_records
Definition: EcalDBCopy.h:31
vector< ParameterSet > Parameters
std::map< std::string, unsigned long long > m_cacheIDs
Definition: EcalDBCopy.h:30
EcalDBCopy::~EcalDBCopy ( )
override

Definition at line 108 of file EcalDBCopy.cc.

109 {
110 
111 }

Member Function Documentation

void EcalDBCopy::analyze ( const edm::Event evt,
const edm::EventSetup evtSetup 
)
override

Definition at line 113 of file EcalDBCopy.cc.

References copyToDB(), mps_fire::i, m_records, record, shouldCopy(), and AlCaHLTBitMon_QueryRunRegistry::string.

114 {
115 
116  std::string container;
118  typedef std::map<std::string, std::string>::const_iterator recordIter;
119  for (recordIter i = m_records.begin(); i != m_records.end(); ++i) {
120  container = (*i).first;
121  record = (*i).second;
122  if ( shouldCopy(evtSetup, container) ) {
123  copyToDB(evtSetup, container);
124  }
125  }
126 
127 }
bool shouldCopy(const edm::EventSetup &evtSetup, std::string container)
Definition: EcalDBCopy.cc:131
JetCorrectorParameters::Record record
Definition: classes.h:7
std::map< std::string, std::string > m_records
Definition: EcalDBCopy.h:31
void copyToDB(const edm::EventSetup &evtSetup, std::string container)
Definition: EcalDBCopy.cc:218
void EcalDBCopy::copyToDB ( const edm::EventSetup evtSetup,
std::string  container 
)
private

Definition at line 218 of file EcalDBCopy.cc.

References cond::service::PoolDBOutputService::beginOfTime(), popcon2dropbox::copy(), gather_cfg::cout, cond::service::PoolDBOutputService::createNewIOV(), EcalSamplesCorrelation::EBG12SamplesCorrelation, EcalSamplesCorrelation::EBG1SamplesCorrelation, EcalSamplesCorrelation::EBG6SamplesCorrelation, EcalTimeBiasCorrections::EBTimeCorrAmplitudeBins, EcalTimeBiasCorrections::EBTimeCorrShiftBins, EcalSamplesCorrelation::EEG12SamplesCorrelation, EcalSamplesCorrelation::EEG1SamplesCorrelation, EcalSamplesCorrelation::EEG6SamplesCorrelation, EcalTimeBiasCorrections::EETimeCorrAmplitudeBins, EcalTimeBiasCorrections::EETimeCorrShiftBins, cond::service::PoolDBOutputService::endOfTime(), Exception, edm::EventSetup::get(), cmsBatch::handle, edm::Service< T >::isAvailable(), m_records, GetRecoTauVFromDQM_MC_cff::obj, edm::ESHandle< T >::product(), align_cfg::recordName, AlCaHLTBitMon_QueryRunRegistry::string, and cond::service::PoolDBOutputService::writeOne().

Referenced by analyze().

219 {
221  if ( !dbOutput.isAvailable() ) {
222  throw cms::Exception("PoolDBOutputService is not available");
223  }
224 
225  std::string recordName = m_records[container];
226 
227  if (container == "EcalPedestals") {
229  evtSetup.get<EcalPedestalsRcd>().get(handle);
230  const EcalPedestals* obj = handle.product();
231  std::cout << "ped pointer is: "<< obj<< std::endl;
232  dbOutput->createNewIOV<const EcalPedestals>( new EcalPedestals(*obj), dbOutput->beginOfTime(),dbOutput->endOfTime(),recordName);
233 
234  } else if (container == "EcalADCToGeVConstant") {
236  evtSetup.get<EcalADCToGeVConstantRcd>().get(handle);
237  const EcalADCToGeVConstant* obj = handle.product();
238  std::cout << "adc pointer is: "<< obj<< std::endl;
239 
240  dbOutput->createNewIOV<const EcalADCToGeVConstant>( new EcalADCToGeVConstant(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
241 
242 
243  } else if (container == "EcalTimeCalibConstants") {
245  evtSetup.get<EcalTimeCalibConstantsRcd>().get(handle);
246  const EcalTimeCalibConstants* obj = handle.product();
247  std::cout << "adc pointer is: "<< obj<< std::endl;
248 
249  dbOutput->createNewIOV<const EcalTimeCalibConstants>( new EcalTimeCalibConstants(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
250 
251  } else if (container == "EcalChannelStatus") {
253  evtSetup.get<EcalChannelStatusRcd>().get(handle);
254  const EcalChannelStatus* obj = handle.product();
255  std::cout << "channel status pointer is: "<< obj<< std::endl;
256 
257  dbOutput->createNewIOV<const EcalChannelStatus>( new EcalChannelStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
258 
259  } else if (container == "EcalDQMChannelStatus") {
261  evtSetup.get<EcalDQMChannelStatusRcd>().get(handle);
262  const EcalDQMChannelStatus* obj = handle.product();
263  std::cout << "DQM channel status pointer is: "<< obj<< std::endl;
264  dbOutput->createNewIOV<const EcalDQMChannelStatus>( new EcalDQMChannelStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
265 
266  } else if (container == "EcalDQMTowerStatus") {
268  evtSetup.get<EcalDQMTowerStatusRcd>().get(handle);
269  const EcalDQMTowerStatus* obj = handle.product();
270  std::cout << "DQM Tower status pointer is: "<< obj<< std::endl;
271  dbOutput->createNewIOV<const EcalDQMTowerStatus>( new EcalDQMTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
272 
273  } else if (container == "EcalDCSTowerStatus") {
275  evtSetup.get<EcalDCSTowerStatusRcd>().get(handle);
276  const EcalDCSTowerStatus* obj = handle.product();
277  std::cout << "channel status pointer is: "<< obj<< std::endl;
278 
279  dbOutput->createNewIOV<const EcalDCSTowerStatus>( new EcalDCSTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
280 
281  } else if (container == "EcalDAQTowerStatus") {
283  evtSetup.get<EcalDAQTowerStatusRcd>().get(handle);
284  const EcalDAQTowerStatus* obj = handle.product();
285  std::cout << "DAQ channel status pointer is: "<< obj<< std::endl;
286 
287  dbOutput->createNewIOV<const EcalDAQTowerStatus>( new EcalDAQTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
288 
289 
290  } else if (container == "EcalTPGCrystalStatus") {
292  evtSetup.get<EcalTPGCrystalStatusRcd>().get(handle);
293  const EcalTPGCrystalStatus* obj = handle.product();
294  std::cout << "TPG channel status pointer is: "<< obj<< std::endl;
295 
296  dbOutput->createNewIOV<const EcalTPGCrystalStatus>( new EcalTPGCrystalStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
297 
298  } else if (container == "EcalTPGTowerStatus") {
300  evtSetup.get<EcalTPGTowerStatusRcd>().get(handle);
301  const EcalTPGTowerStatus* obj = handle.product();
302  std::cout << "TPG tower status pointer is: "<< obj<< std::endl;
303 
304  dbOutput->createNewIOV<const EcalTPGTowerStatus>( new EcalTPGTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
305 
306 
307  } else if (container == "EcalIntercalibConstants") {
309  evtSetup.get<EcalIntercalibConstantsRcd>().get(handle);
310  const EcalIntercalibConstants* obj = handle.product();
311  std::cout << "inter pointer is: "<< obj<< std::endl;
312  dbOutput->createNewIOV<const EcalIntercalibConstants>( new EcalIntercalibConstants(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
313 
314  } else if (container == "EcalLinearCorrections") {
316  evtSetup.get<EcalLinearCorrectionsRcd>().get(handle);
317  const EcalLinearCorrections* obj = handle.product();
318  std::cout << "inter pointer is: "<< obj<< std::endl;
319  dbOutput->createNewIOV<const EcalLinearCorrections>( new EcalLinearCorrections(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
320 
321  }
322 else if (container == "EcalIntercalibConstantsMC") {
324  evtSetup.get<EcalIntercalibConstantsMCRcd>().get(handle);
325  const EcalIntercalibConstantsMC* obj = handle.product();
326  std::cout << "intercalib MC pointer is: "<< obj<< std::endl;
327  dbOutput->createNewIOV<const EcalIntercalibConstantsMC>( new EcalIntercalibConstantsMC(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
328 
329  } else if (container == "EcalIntercalibErrors") {
331  evtSetup.get<EcalIntercalibErrorsRcd>().get(handle);
332  const EcalIntercalibErrors* obj = handle.product();
333  std::cout << "inter pointer is: "<< obj<< std::endl;
334  dbOutput->createNewIOV<const EcalIntercalibErrors>( new EcalIntercalibErrors(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
335 
336  } else if (container == "EcalGainRatios") {
338  evtSetup.get<EcalGainRatiosRcd>().get(handle);
339  const EcalGainRatios* obj = handle.product();
340  std::cout << "gain pointer is: "<< obj<< std::endl;
341  dbOutput->createNewIOV<const EcalGainRatios>( new EcalGainRatios(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
342 
343  } else if (container == "EcalWeightXtalGroups") {
345  evtSetup.get<EcalWeightXtalGroupsRcd>().get(handle);
346  const EcalWeightXtalGroups* obj = handle.product();
347  std::cout << "weight pointer is: "<< obj<< std::endl;
348  dbOutput->createNewIOV<const EcalWeightXtalGroups>( new EcalWeightXtalGroups(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
349 
350  } else if (container == "EcalTBWeights") {
352  evtSetup.get<EcalTBWeightsRcd>().get(handle);
353  const EcalTBWeights* obj = handle.product();
354  std::cout << "tbweight pointer is: "<< obj<< std::endl;
355  dbOutput->createNewIOV<const EcalTBWeights>( new EcalTBWeights(*obj), dbOutput->beginOfTime(),dbOutput->endOfTime(),recordName);
356 
357  } else if (container == "EcalLaserAlphas") {
359  evtSetup.get<EcalLaserAlphasRcd>().get(handle);
360  const EcalLaserAlphas* obj = handle.product();
361  std::cout << "ecalLaserAlpha pointer is: "<< obj<< std::endl;
362  dbOutput->createNewIOV<const EcalLaserAlphas>( new EcalLaserAlphas(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
363 
364  } else if (container == "EcalLaserAPDPNRatios") {
366  evtSetup.get<EcalLaserAPDPNRatiosRcd>().get(handle);
367  const EcalLaserAPDPNRatios* obj = handle.product();
368  std::cout << "tbweight pointer is: "<< obj<< std::endl;
369  dbOutput->createNewIOV<const EcalLaserAPDPNRatios>( new EcalLaserAPDPNRatios(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
370 
371  } else if (container == "EcalLaserAPDPNRatiosRef") {
373  evtSetup.get<EcalLaserAPDPNRatiosRefRcd>().get(handle);
374  const EcalLaserAPDPNRatiosRef* obj = handle.product();
375  std::cout << "tbweight pointer is: "<< obj<< std::endl;
376  dbOutput->createNewIOV<const EcalLaserAPDPNRatiosRef>( new EcalLaserAPDPNRatiosRef(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
377 
378 
379  } else if (container == "EcalClusterCrackCorrParameters") {
381  evtSetup.get<EcalClusterCrackCorrParametersRcd>().get(handle);
382  const EcalClusterCrackCorrParameters* obj = handle.product();
383  std::cout << "cluster crack pointer is: "<< obj<< std::endl;
385 
386  } else if (container == "EcalPFRecHitThresholds") {
388  evtSetup.get<EcalPFRecHitThresholdsRcd>().get(handle);
389  const EcalPFRecHitThresholds* obj = handle.product();
390  std::cout << "Ecal PF rec hit thresholds pointer is: "<< obj<< std::endl;
391  dbOutput->createNewIOV<const EcalPFRecHitThresholds>( new EcalPFRecHitThresholds(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
392 
393 
394  } else if (container == "EcalClusterEnergyUncertaintyParameters") {
396  evtSetup.get<EcalClusterEnergyUncertaintyParametersRcd>().get(handle);
397  const EcalClusterEnergyUncertaintyParameters* obj = handle.product();
398  std::cout << "tbweight pointer is: "<< obj<< std::endl;
400 
401 
402  } else if (container == "EcalClusterEnergyCorrectionParameters") {
404  evtSetup.get<EcalClusterEnergyCorrectionParametersRcd>().get(handle);
405  const EcalClusterEnergyCorrectionParameters* obj = handle.product();
406  std::cout << "tbweight pointer is: "<< obj<< std::endl;
408 
409  } else if (container == "EcalClusterEnergyCorrectionObjectSpecificParameters") {
413  std::cout << "tbweight pointer is: "<< obj<< std::endl;
415 
416 
417  } else if (container == "EcalClusterLocalContCorrParameters") {
419  evtSetup.get<EcalClusterLocalContCorrParametersRcd>().get(handle);
420  const EcalClusterLocalContCorrParameters* obj = handle.product();
421  std::cout << "tbweight pointer is: "<< obj<< std::endl;
423 
424  } else if (container == "EBAlignment") {
426  evtSetup.get<EBAlignmentRcd>().get(handle);
427  const Alignments* obj = handle.product();
428  std::cout << "EB alignment pointer is: "<< obj<< std::endl;
429  dbOutput->createNewIOV<const Alignments>( new Alignments(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
430 
431  } else if (container == "EEAlignment") {
433  evtSetup.get<EEAlignmentRcd>().get(handle);
434  const Alignments* obj = handle.product();
435  std::cout << "EE alignment pointer is: "<< obj<< std::endl;
436  dbOutput->createNewIOV<const Alignments>( new Alignments(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
437 
438  } else if (container == "ESAlignment") {
440  evtSetup.get<ESAlignmentRcd>().get(handle);
441  const Alignments* obj = handle.product();
442  std::cout << "ES alignment pointer is: "<< obj<< std::endl;
443  dbOutput->createNewIOV<const Alignments>( new Alignments(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
444 
445  } else if (container == "EcalTimeOffsetConstant") {
447  evtSetup.get<EcalTimeOffsetConstantRcd>().get(handle);
448  const EcalTimeOffsetConstant* obj = handle.product();
449  std::cout << "TimeOffset pointer is: "<< obj<< std::endl;
450  dbOutput->createNewIOV<const EcalTimeOffsetConstant>( new EcalTimeOffsetConstant(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
451 
452  } else if (container == "EcalSampleMask") {
454  evtSetup.get<EcalSampleMaskRcd>().get(handle);
455  const EcalSampleMask* obj = handle.product();
456  std::cout << "sample mask pointer is: "<< obj<< std::endl;
457  dbOutput->createNewIOV<const EcalSampleMask>( new EcalSampleMask(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
458 
459  } else if (container == "EcalTimeBiasCorrections") {
461  evtSetup.get<EcalTimeBiasCorrectionsRcd>().get(handle);
462  const EcalTimeBiasCorrections* obj = handle.product();
463  std::cout << "TimeBiasCorrections pointer is: "<< obj<< std::endl;
465  bias_ = new EcalTimeBiasCorrections();
466  std::vector<float> vect = obj->EBTimeCorrAmplitudeBins;
467  copy(vect.begin(), vect.end(), back_inserter(bias_->EBTimeCorrAmplitudeBins));
468  vect = obj->EBTimeCorrShiftBins;
469  copy(vect.begin(), vect.end(), back_inserter(bias_->EBTimeCorrShiftBins));
470  vect = obj->EETimeCorrAmplitudeBins;
471  copy(vect.begin(), vect.end(), back_inserter(bias_->EETimeCorrAmplitudeBins));
472  vect = obj->EETimeCorrShiftBins;
473  copy(vect.begin(), vect.end(), back_inserter(bias_->EETimeCorrShiftBins));
474  dbOutput->writeOne(bias_, dbOutput->beginOfTime(), "EcalTimeBiasCorrectionsRcd");
475 
476  } else if (container == "EcalSamplesCorrelation") {
478  evtSetup.get<EcalSamplesCorrelationRcd>().get(handle);
479  const EcalSamplesCorrelation* obj = handle.product();
480  std::cout << "SamplesCorrelation pointer is: "<< obj<< std::endl;
481  EcalSamplesCorrelation *correl_;
482  correl_ = new EcalSamplesCorrelation();
483  std::vector<double> vect = obj->EBG12SamplesCorrelation;
484  copy(vect.begin(), vect.end(), back_inserter(correl_->EBG12SamplesCorrelation));
485  vect = obj->EBG6SamplesCorrelation;
486  copy(vect.begin(), vect.end(), back_inserter(correl_->EBG6SamplesCorrelation));
487  vect = obj->EBG1SamplesCorrelation;
488  copy(vect.begin(), vect.end(), back_inserter(correl_->EBG1SamplesCorrelation));
489  vect = obj->EEG12SamplesCorrelation;
490  copy(vect.begin(), vect.end(), back_inserter(correl_->EEG12SamplesCorrelation));
491  vect = obj->EEG6SamplesCorrelation;
492  copy(vect.begin(), vect.end(), back_inserter(correl_->EEG6SamplesCorrelation));
493  vect = obj->EEG1SamplesCorrelation;
494  copy(vect.begin(), vect.end(), back_inserter(correl_->EEG1SamplesCorrelation));
495  dbOutput->writeOne(correl_, dbOutput->beginOfTime(), "EcalSamplesCorrelationRcd");
496 
497 } else {
498  throw cms::Exception("Unknown container");
499  }
500 
501  std::cout<< "EcalDBCopy wrote " << recordName << std::endl;
502 }
EcalDAQTowerStatusMap EcalDAQTowerStatus
EcalIntercalibConstantMCMap EcalIntercalibConstantsMC
EcalPFRecHitThresholdsMap EcalPFRecHitThresholds
std::vector< float > EBTimeCorrShiftBins
def copy(args, dbName)
EcalFunParams EcalClusterCrackCorrParameters
std::map< std::string, std::string > m_records
Definition: EcalDBCopy.h:31
std::vector< double > EBG12SamplesCorrelation
EcalCondObjectContainer< EcalXtalGroupId > EcalWeightXtalGroups
EcalLaserAPDPNRatiosRefMap EcalLaserAPDPNRatiosRef
EcalTimeDependentCorrections EcalLinearCorrections
std::vector< double > EBG6SamplesCorrelation
std::vector< float > EBTimeCorrAmplitudeBins
std::vector< float > EETimeCorrShiftBins
EcalDQMChannelStatusMap EcalDQMChannelStatus
EcalChannelStatusMap EcalChannelStatus
EcalGainRatioMap EcalGainRatios
EcalLaserAlphaMap EcalLaserAlphas
std::vector< float > EETimeCorrAmplitudeBins
EcalDCSTowerStatusMap EcalDCSTowerStatus
EcalDQMTowerStatusMap EcalDQMTowerStatus
bool isAvailable() const
Definition: Service.h:46
EcalTPGCrystalStatusMap EcalTPGCrystalStatus
EcalFunParams EcalClusterEnergyCorrectionObjectSpecificParameters
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
EcalIntercalibErrorMap EcalIntercalibErrors
EcalFunParams EcalClusterEnergyUncertaintyParameters
EcalPedestalsMap EcalPedestals
Definition: EcalPedestals.h:53
EcalTimeCalibConstantMap EcalTimeCalibConstants
std::vector< double > EBG1SamplesCorrelation
EcalFunParams EcalClusterLocalContCorrParameters
EcalIntercalibConstantMap EcalIntercalibConstants
std::vector< double > EEG1SamplesCorrelation
T get() const
Definition: EventSetup.h:63
EcalFunParams EcalClusterEnergyCorrectionParameters
std::vector< double > EEG12SamplesCorrelation
std::vector< double > EEG6SamplesCorrelation
T const * product() const
Definition: ESHandle.h:86
bool EcalDBCopy::shouldCopy ( const edm::EventSetup evtSetup,
std::string  container 
)
private

Definition at line 131 of file EcalDBCopy.cc.

References Exception, edm::EventSetup::get(), and m_cacheIDs.

Referenced by analyze().

132 {
133 
134  unsigned long long cacheID = 0;
135  if (container == "EcalPedestals") {
136  cacheID = evtSetup.get<EcalPedestalsRcd>().cacheIdentifier();
137  } else if (container == "EcalADCToGeVConstant") {
138  cacheID = evtSetup.get<EcalADCToGeVConstantRcd>().cacheIdentifier();
139  } else if (container == "EcalLinearCorrections") {
140  cacheID = evtSetup.get<EcalLinearCorrectionsRcd>().cacheIdentifier();
141  } else if (container == "EcalIntercalibConstants") {
142  cacheID = evtSetup.get<EcalIntercalibConstantsRcd>().cacheIdentifier();
143  } else if (container == "EcalIntercalibConstantsMC") {
144  cacheID = evtSetup.get<EcalIntercalibConstantsMCRcd>().cacheIdentifier();
145  } else if (container == "EcalIntercalibErrors") {
146  cacheID = evtSetup.get<EcalIntercalibErrorsRcd>().cacheIdentifier();
147  } else if (container == "EcalGainRatios") {
148  cacheID = evtSetup.get<EcalGainRatiosRcd>().cacheIdentifier();
149  } else if (container == "EcalWeightXtalGroups") {
150  cacheID = evtSetup.get<EcalWeightXtalGroupsRcd>().cacheIdentifier();
151  } else if (container == "EcalTBWeights") {
152  cacheID = evtSetup.get<EcalTBWeightsRcd>().cacheIdentifier();
153  } else if (container == "EcalLaserAPDPNRatios") {
154  cacheID = evtSetup.get<EcalLaserAPDPNRatiosRcd>().cacheIdentifier();
155  } else if (container == "EcalLaserAPDPNRatiosRef") {
156  cacheID = evtSetup.get<EcalTBWeightsRcd>().cacheIdentifier();
157  } else if (container == "EcalLaserAlphas") {
158  cacheID = evtSetup.get<EcalTBWeightsRcd>().cacheIdentifier();
159  } else if (container == "EcalChannelStatus") {
160  cacheID = evtSetup.get<EcalChannelStatusRcd>().cacheIdentifier();
161  } else if (container == "EcalDQMTowerStatus") {
162  cacheID = evtSetup.get<EcalDQMTowerStatusRcd>().cacheIdentifier();
163  } else if (container == "EcalDQMChannelStatus") {
164  cacheID = evtSetup.get<EcalDQMChannelStatusRcd>().cacheIdentifier();
165  } else if (container == "EcalDCSTowerStatus") {
166  cacheID = evtSetup.get<EcalDCSTowerStatusRcd>().cacheIdentifier();
167  } else if (container == "EcalDAQTowerStatus") {
168  cacheID = evtSetup.get<EcalDAQTowerStatusRcd>().cacheIdentifier();
169  } else if (container == "EcalTimeCalibConstants") {
170  cacheID = evtSetup.get<EcalTimeCalibConstantsRcd>().cacheIdentifier();
171  } else if (container == "EcalClusterCrackCorrParameters") {
172  cacheID = evtSetup.get<EcalClusterCrackCorrParametersRcd>().cacheIdentifier();
173  } else if (container == "EcalPFRecHitThresholds") {
174  cacheID = evtSetup.get<EcalPFRecHitThresholdsRcd>().cacheIdentifier();
175  } else if (container == "EcalClusterEnergyUncertaintyParameters") {
176  cacheID = evtSetup.get<EcalClusterEnergyUncertaintyParametersRcd>().cacheIdentifier();
177  } else if (container == "EcalClusterEnergyCorrectionParameters") {
178  cacheID = evtSetup.get<EcalClusterEnergyCorrectionParametersRcd>().cacheIdentifier();
179  } else if (container == "EcalClusterEnergyCorrectionObjectSpecificParameters") {
180  cacheID = evtSetup.get<EcalClusterEnergyCorrectionObjectSpecificParametersRcd>().cacheIdentifier();
181  } else if (container == "EcalClusterLocalContCorrParameters") {
182  cacheID = evtSetup.get<EcalClusterLocalContCorrParametersRcd>().cacheIdentifier();
183  } else if (container == "EcalTPGCrystalStatus") {
184  cacheID = evtSetup.get<EcalTPGCrystalStatusRcd>().cacheIdentifier();
185  } else if (container == "EcalTPGTowerStatus") {
186  cacheID = evtSetup.get<EcalTPGTowerStatusRcd>().cacheIdentifier();
187  } else if (container == "EBAlignment") {
188  cacheID = evtSetup.get<EBAlignmentRcd>().cacheIdentifier();
189  } else if (container == "EEAlignment") {
190  cacheID = evtSetup.get<EEAlignmentRcd>().cacheIdentifier();
191  } else if (container == "ESAlignment") {
192  cacheID = evtSetup.get<ESAlignmentRcd>().cacheIdentifier();
193  } else if (container == "EcalTimeOffsetConstant") {
194  cacheID = evtSetup.get<EcalTimeOffsetConstantRcd>().cacheIdentifier();
195  } else if (container == "EcalSampleMask") {
196  cacheID = evtSetup.get<EcalSampleMaskRcd>().cacheIdentifier();
197  } else if (container == "EcalTimeBiasCorrections") {
198  cacheID = evtSetup.get<EcalTimeBiasCorrectionsRcd>().cacheIdentifier();
199  } else if (container == "EcalSamplesCorrelation") {
200  cacheID = evtSetup.get<EcalSamplesCorrelationRcd>().cacheIdentifier();
201  }
202 
203  else {
204  throw cms::Exception("Unknown container");
205  }
206 
207  if (m_cacheIDs[container] == cacheID) {
208  return false;
209  } else {
210  m_cacheIDs[container] = cacheID;
211  return true;
212  }
213 
214 }
T get() const
Definition: EventSetup.h:63
std::map< std::string, unsigned long long > m_cacheIDs
Definition: EcalDBCopy.h:30

Member Data Documentation

std::map<std::string, unsigned long long> EcalDBCopy::m_cacheIDs
private

Definition at line 30 of file EcalDBCopy.h.

Referenced by EcalDBCopy(), and shouldCopy().

std::map<std::string, std::string> EcalDBCopy::m_records
private

Definition at line 31 of file EcalDBCopy.h.

Referenced by analyze(), copyToDB(), and EcalDBCopy().

std::string EcalDBCopy::m_timetype
private

Definition at line 29 of file EcalDBCopy.h.