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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 88 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.

89  : m_timetype(iConfig.getParameter<std::string>("timetype")), m_cacheIDs(), m_records() {
90  std::string container;
93  typedef std::vector<edm::ParameterSet> Parameters;
94  Parameters toCopy = iConfig.getParameter<Parameters>("toCopy");
95  for (Parameters::iterator i = toCopy.begin(); i != toCopy.end(); ++i) {
96  container = i->getParameter<std::string>("container");
97  record = i->getParameter<std::string>("record");
98  m_cacheIDs.insert(std::make_pair(container, 0));
99  m_records.insert(std::make_pair(container, record));
100  }
101 }
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 103 of file EcalDBCopy.cc.

103 {}

Member Function Documentation

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

Definition at line 105 of file EcalDBCopy.cc.

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

105  {
106  std::string container;
108  typedef std::map<std::string, std::string>::const_iterator recordIter;
109  for (recordIter i = m_records.begin(); i != m_records.end(); ++i) {
110  container = (*i).first;
111  record = (*i).second;
112  if (shouldCopy(evtSetup, container)) {
113  copyToDB(evtSetup, container);
114  }
115  }
116 }
bool shouldCopy(const edm::EventSetup &evtSetup, std::string container)
Definition: EcalDBCopy.cc:118
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:202
void EcalDBCopy::copyToDB ( const edm::EventSetup evtSetup,
std::string  container 
)
private

Definition at line 202 of file EcalDBCopy.cc.

References cond::service::PoolDBOutputService::beginOfTime(), filterCSVwithJSON::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(), patZpeak::handle, edm::Service< T >::isAvailable(), m_records, getGTfromDQMFile::obj, edm::ESHandle< T >::product(), align_cfg::recordName, AlCaHLTBitMon_QueryRunRegistry::string, and cond::service::PoolDBOutputService::writeOne().

Referenced by analyze().

202  {
204  if (!dbOutput.isAvailable()) {
205  throw cms::Exception("PoolDBOutputService is not available");
206  }
207 
208  std::string recordName = m_records[container];
209 
210  if (container == "EcalPedestals") {
212  evtSetup.get<EcalPedestalsRcd>().get(handle);
213  const EcalPedestals* obj = handle.product();
214  std::cout << "ped pointer is: " << obj << std::endl;
215  dbOutput->createNewIOV<const EcalPedestals>(
216  new EcalPedestals(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
217 
218  } else if (container == "EcalADCToGeVConstant") {
220  evtSetup.get<EcalADCToGeVConstantRcd>().get(handle);
221  const EcalADCToGeVConstant* obj = handle.product();
222  std::cout << "adc pointer is: " << obj << std::endl;
223 
224  dbOutput->createNewIOV<const EcalADCToGeVConstant>(
225  new EcalADCToGeVConstant(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
226 
227  } else if (container == "EcalTimeCalibConstants") {
229  evtSetup.get<EcalTimeCalibConstantsRcd>().get(handle);
230  const EcalTimeCalibConstants* obj = handle.product();
231  std::cout << "adc pointer is: " << obj << std::endl;
232 
233  dbOutput->createNewIOV<const EcalTimeCalibConstants>(
234  new EcalTimeCalibConstants(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
235 
236  } else if (container == "EcalChannelStatus") {
238  evtSetup.get<EcalChannelStatusRcd>().get(handle);
239  const EcalChannelStatus* obj = handle.product();
240  std::cout << "channel status pointer is: " << obj << std::endl;
241 
242  dbOutput->createNewIOV<const EcalChannelStatus>(
243  new EcalChannelStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
244 
245  } else if (container == "EcalDQMChannelStatus") {
247  evtSetup.get<EcalDQMChannelStatusRcd>().get(handle);
248  const EcalDQMChannelStatus* obj = handle.product();
249  std::cout << "DQM channel status pointer is: " << obj << std::endl;
250  dbOutput->createNewIOV<const EcalDQMChannelStatus>(
251  new EcalDQMChannelStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
252 
253  } else if (container == "EcalDQMTowerStatus") {
255  evtSetup.get<EcalDQMTowerStatusRcd>().get(handle);
256  const EcalDQMTowerStatus* obj = handle.product();
257  std::cout << "DQM Tower status pointer is: " << obj << std::endl;
258  dbOutput->createNewIOV<const EcalDQMTowerStatus>(
259  new EcalDQMTowerStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
260 
261  } else if (container == "EcalDCSTowerStatus") {
263  evtSetup.get<EcalDCSTowerStatusRcd>().get(handle);
264  const EcalDCSTowerStatus* obj = handle.product();
265  std::cout << "channel status pointer is: " << obj << std::endl;
266 
267  dbOutput->createNewIOV<const EcalDCSTowerStatus>(
268  new EcalDCSTowerStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
269 
270  } else if (container == "EcalDAQTowerStatus") {
272  evtSetup.get<EcalDAQTowerStatusRcd>().get(handle);
273  const EcalDAQTowerStatus* obj = handle.product();
274  std::cout << "DAQ channel status pointer is: " << obj << std::endl;
275 
276  dbOutput->createNewIOV<const EcalDAQTowerStatus>(
277  new EcalDAQTowerStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
278 
279  } else if (container == "EcalTPGCrystalStatus") {
281  evtSetup.get<EcalTPGCrystalStatusRcd>().get(handle);
282  const EcalTPGCrystalStatus* obj = handle.product();
283  std::cout << "TPG channel status pointer is: " << obj << std::endl;
284 
285  dbOutput->createNewIOV<const EcalTPGCrystalStatus>(
286  new EcalTPGCrystalStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
287 
288  } else if (container == "EcalTPGTowerStatus") {
290  evtSetup.get<EcalTPGTowerStatusRcd>().get(handle);
291  const EcalTPGTowerStatus* obj = handle.product();
292  std::cout << "TPG tower status pointer is: " << obj << std::endl;
293 
294  dbOutput->createNewIOV<const EcalTPGTowerStatus>(
295  new EcalTPGTowerStatus(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
296 
297  } else if (container == "EcalIntercalibConstants") {
299  evtSetup.get<EcalIntercalibConstantsRcd>().get(handle);
300  const EcalIntercalibConstants* obj = handle.product();
301  std::cout << "inter pointer is: " << obj << std::endl;
302  dbOutput->createNewIOV<const EcalIntercalibConstants>(
303  new EcalIntercalibConstants(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
304 
305  } else if (container == "EcalLinearCorrections") {
307  evtSetup.get<EcalLinearCorrectionsRcd>().get(handle);
308  const EcalLinearCorrections* obj = handle.product();
309  std::cout << "inter pointer is: " << obj << std::endl;
310  dbOutput->createNewIOV<const EcalLinearCorrections>(
311  new EcalLinearCorrections(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
312 
313  } else if (container == "EcalIntercalibConstantsMC") {
315  evtSetup.get<EcalIntercalibConstantsMCRcd>().get(handle);
316  const EcalIntercalibConstantsMC* obj = handle.product();
317  std::cout << "intercalib MC pointer is: " << obj << std::endl;
318  dbOutput->createNewIOV<const EcalIntercalibConstantsMC>(
319  new EcalIntercalibConstantsMC(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
320 
321  } else if (container == "EcalIntercalibErrors") {
323  evtSetup.get<EcalIntercalibErrorsRcd>().get(handle);
324  const EcalIntercalibErrors* obj = handle.product();
325  std::cout << "inter pointer is: " << obj << std::endl;
326  dbOutput->createNewIOV<const EcalIntercalibErrors>(
327  new EcalIntercalibErrors(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
328 
329  } else if (container == "EcalGainRatios") {
331  evtSetup.get<EcalGainRatiosRcd>().get(handle);
332  const EcalGainRatios* obj = handle.product();
333  std::cout << "gain pointer is: " << obj << std::endl;
334  dbOutput->createNewIOV<const EcalGainRatios>(
335  new EcalGainRatios(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
336 
337  } else if (container == "EcalWeightXtalGroups") {
339  evtSetup.get<EcalWeightXtalGroupsRcd>().get(handle);
340  const EcalWeightXtalGroups* obj = handle.product();
341  std::cout << "weight pointer is: " << obj << std::endl;
342  dbOutput->createNewIOV<const EcalWeightXtalGroups>(
343  new EcalWeightXtalGroups(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
344 
345  } else if (container == "EcalTBWeights") {
347  evtSetup.get<EcalTBWeightsRcd>().get(handle);
348  const EcalTBWeights* obj = handle.product();
349  std::cout << "tbweight pointer is: " << obj << std::endl;
350  dbOutput->createNewIOV<const EcalTBWeights>(
351  new EcalTBWeights(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
352 
353  } else if (container == "EcalLaserAlphas") {
355  evtSetup.get<EcalLaserAlphasRcd>().get(handle);
356  const EcalLaserAlphas* obj = handle.product();
357  std::cout << "ecalLaserAlpha pointer is: " << obj << std::endl;
358  dbOutput->createNewIOV<const EcalLaserAlphas>(
359  new EcalLaserAlphas(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
360 
361  } else if (container == "EcalLaserAPDPNRatios") {
363  evtSetup.get<EcalLaserAPDPNRatiosRcd>().get(handle);
364  const EcalLaserAPDPNRatios* obj = handle.product();
365  std::cout << "tbweight pointer is: " << obj << std::endl;
366  dbOutput->createNewIOV<const EcalLaserAPDPNRatios>(
367  new EcalLaserAPDPNRatios(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
368 
369  } else if (container == "EcalLaserAPDPNRatiosRef") {
371  evtSetup.get<EcalLaserAPDPNRatiosRefRcd>().get(handle);
372  const EcalLaserAPDPNRatiosRef* obj = handle.product();
373  std::cout << "tbweight pointer is: " << obj << std::endl;
374  dbOutput->createNewIOV<const EcalLaserAPDPNRatiosRef>(
375  new EcalLaserAPDPNRatiosRef(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
376 
377  } else if (container == "EcalClusterCrackCorrParameters") {
379  evtSetup.get<EcalClusterCrackCorrParametersRcd>().get(handle);
380  const EcalClusterCrackCorrParameters* obj = handle.product();
381  std::cout << "cluster crack pointer is: " << obj << std::endl;
383  new EcalClusterCrackCorrParameters(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
384 
385  } else if (container == "EcalPFRecHitThresholds") {
387  evtSetup.get<EcalPFRecHitThresholdsRcd>().get(handle);
388  const EcalPFRecHitThresholds* obj = handle.product();
389  std::cout << "Ecal PF rec hit thresholds pointer is: " << obj << std::endl;
390  dbOutput->createNewIOV<const EcalPFRecHitThresholds>(
391  new EcalPFRecHitThresholds(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
392 
393  } else if (container == "EcalClusterEnergyUncertaintyParameters") {
395  evtSetup.get<EcalClusterEnergyUncertaintyParametersRcd>().get(handle);
396  const EcalClusterEnergyUncertaintyParameters* obj = handle.product();
397  std::cout << "tbweight pointer is: " << obj << std::endl;
399  new EcalClusterEnergyUncertaintyParameters(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
400 
401  } else if (container == "EcalClusterEnergyCorrectionParameters") {
403  evtSetup.get<EcalClusterEnergyCorrectionParametersRcd>().get(handle);
404  const EcalClusterEnergyCorrectionParameters* obj = handle.product();
405  std::cout << "tbweight pointer is: " << obj << std::endl;
407  new EcalClusterEnergyCorrectionParameters(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
408 
409  } else if (container == "EcalClusterEnergyCorrectionObjectSpecificParameters") {
413  std::cout << "tbweight pointer is: " << obj << std::endl;
416  dbOutput->beginOfTime(),
417  dbOutput->endOfTime(),
418  recordName);
419 
420  } else if (container == "EcalClusterLocalContCorrParameters") {
422  evtSetup.get<EcalClusterLocalContCorrParametersRcd>().get(handle);
423  const EcalClusterLocalContCorrParameters* obj = handle.product();
424  std::cout << "tbweight pointer is: " << obj << std::endl;
426  new EcalClusterLocalContCorrParameters(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
427 
428  } else if (container == "EBAlignment") {
430  evtSetup.get<EBAlignmentRcd>().get(handle);
431  const Alignments* obj = handle.product();
432  std::cout << "EB alignment pointer is: " << obj << std::endl;
433  dbOutput->createNewIOV<const Alignments>(
434  new Alignments(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
435 
436  } else if (container == "EEAlignment") {
438  evtSetup.get<EEAlignmentRcd>().get(handle);
439  const Alignments* obj = handle.product();
440  std::cout << "EE alignment pointer is: " << obj << std::endl;
441  dbOutput->createNewIOV<const Alignments>(
442  new Alignments(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
443 
444  } else if (container == "ESAlignment") {
446  evtSetup.get<ESAlignmentRcd>().get(handle);
447  const Alignments* obj = handle.product();
448  std::cout << "ES alignment pointer is: " << obj << std::endl;
449  dbOutput->createNewIOV<const Alignments>(
450  new Alignments(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
451 
452  } else if (container == "EcalTimeOffsetConstant") {
454  evtSetup.get<EcalTimeOffsetConstantRcd>().get(handle);
455  const EcalTimeOffsetConstant* obj = handle.product();
456  std::cout << "TimeOffset pointer is: " << obj << std::endl;
457  dbOutput->createNewIOV<const EcalTimeOffsetConstant>(
458  new EcalTimeOffsetConstant(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
459 
460  } else if (container == "EcalSampleMask") {
462  evtSetup.get<EcalSampleMaskRcd>().get(handle);
463  const EcalSampleMask* obj = handle.product();
464  std::cout << "sample mask pointer is: " << obj << std::endl;
465  dbOutput->createNewIOV<const EcalSampleMask>(
466  new EcalSampleMask(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
467 
468  } else if (container == "EcalSimPulseShape") {
470  evtSetup.get<EcalSimPulseShapeRcd>().get(handle);
471  const EcalSimPulseShape* obj = handle.product();
472  dbOutput->createNewIOV<const EcalSimPulseShape>(
473  new EcalSimPulseShape(*obj), dbOutput->beginOfTime(), dbOutput->endOfTime(), recordName);
474 
475  } else if (container == "EcalTimeBiasCorrections") {
477  evtSetup.get<EcalTimeBiasCorrectionsRcd>().get(handle);
478  const EcalTimeBiasCorrections* obj = handle.product();
479  std::cout << "TimeBiasCorrections pointer is: " << obj << std::endl;
481  bias_ = new EcalTimeBiasCorrections();
482  std::vector<float> vect = obj->EBTimeCorrAmplitudeBins;
483  copy(vect.begin(), vect.end(), back_inserter(bias_->EBTimeCorrAmplitudeBins));
484  vect = obj->EBTimeCorrShiftBins;
485  copy(vect.begin(), vect.end(), back_inserter(bias_->EBTimeCorrShiftBins));
486  vect = obj->EETimeCorrAmplitudeBins;
487  copy(vect.begin(), vect.end(), back_inserter(bias_->EETimeCorrAmplitudeBins));
488  vect = obj->EETimeCorrShiftBins;
489  copy(vect.begin(), vect.end(), back_inserter(bias_->EETimeCorrShiftBins));
490  dbOutput->writeOne(bias_, dbOutput->beginOfTime(), "EcalTimeBiasCorrectionsRcd");
491 
492  } else if (container == "EcalSamplesCorrelation") {
494  evtSetup.get<EcalSamplesCorrelationRcd>().get(handle);
495  const EcalSamplesCorrelation* obj = handle.product();
496  std::cout << "SamplesCorrelation pointer is: " << obj << std::endl;
497  EcalSamplesCorrelation* correl_;
498  correl_ = new EcalSamplesCorrelation();
499  std::vector<double> vect = obj->EBG12SamplesCorrelation;
500  copy(vect.begin(), vect.end(), back_inserter(correl_->EBG12SamplesCorrelation));
501  vect = obj->EBG6SamplesCorrelation;
502  copy(vect.begin(), vect.end(), back_inserter(correl_->EBG6SamplesCorrelation));
503  vect = obj->EBG1SamplesCorrelation;
504  copy(vect.begin(), vect.end(), back_inserter(correl_->EBG1SamplesCorrelation));
505  vect = obj->EEG12SamplesCorrelation;
506  copy(vect.begin(), vect.end(), back_inserter(correl_->EEG12SamplesCorrelation));
507  vect = obj->EEG6SamplesCorrelation;
508  copy(vect.begin(), vect.end(), back_inserter(correl_->EEG6SamplesCorrelation));
509  vect = obj->EEG1SamplesCorrelation;
510  copy(vect.begin(), vect.end(), back_inserter(correl_->EEG1SamplesCorrelation));
511  dbOutput->writeOne(correl_, dbOutput->beginOfTime(), "EcalSamplesCorrelationRcd");
512 
513  } else {
514  throw cms::Exception("Unknown container");
515  }
516 
517  std::cout << "EcalDBCopy wrote " << recordName << std::endl;
518 }
EcalDAQTowerStatusMap EcalDAQTowerStatus
EcalIntercalibConstantMCMap EcalIntercalibConstantsMC
EcalPFRecHitThresholdsMap EcalPFRecHitThresholds
std::vector< float > EBTimeCorrShiftBins
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:40
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:50
EcalTimeCalibConstantMap EcalTimeCalibConstants
std::vector< double > EBG1SamplesCorrelation
EcalFunParams EcalClusterLocalContCorrParameters
EcalIntercalibConstantMap EcalIntercalibConstants
std::vector< double > EEG1SamplesCorrelation
T get() const
Definition: EventSetup.h:73
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 118 of file EcalDBCopy.cc.

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

Referenced by analyze().

118  {
119  unsigned long long cacheID = 0;
120  if (container == "EcalPedestals") {
121  cacheID = evtSetup.get<EcalPedestalsRcd>().cacheIdentifier();
122  } else if (container == "EcalADCToGeVConstant") {
123  cacheID = evtSetup.get<EcalADCToGeVConstantRcd>().cacheIdentifier();
124  } else if (container == "EcalLinearCorrections") {
125  cacheID = evtSetup.get<EcalLinearCorrectionsRcd>().cacheIdentifier();
126  } else if (container == "EcalIntercalibConstants") {
127  cacheID = evtSetup.get<EcalIntercalibConstantsRcd>().cacheIdentifier();
128  } else if (container == "EcalIntercalibConstantsMC") {
129  cacheID = evtSetup.get<EcalIntercalibConstantsMCRcd>().cacheIdentifier();
130  } else if (container == "EcalIntercalibErrors") {
131  cacheID = evtSetup.get<EcalIntercalibErrorsRcd>().cacheIdentifier();
132  } else if (container == "EcalGainRatios") {
133  cacheID = evtSetup.get<EcalGainRatiosRcd>().cacheIdentifier();
134  } else if (container == "EcalWeightXtalGroups") {
135  cacheID = evtSetup.get<EcalWeightXtalGroupsRcd>().cacheIdentifier();
136  } else if (container == "EcalTBWeights") {
137  cacheID = evtSetup.get<EcalTBWeightsRcd>().cacheIdentifier();
138  } else if (container == "EcalLaserAPDPNRatios") {
139  cacheID = evtSetup.get<EcalLaserAPDPNRatiosRcd>().cacheIdentifier();
140  } else if (container == "EcalLaserAPDPNRatiosRef") {
141  cacheID = evtSetup.get<EcalTBWeightsRcd>().cacheIdentifier();
142  } else if (container == "EcalLaserAlphas") {
143  cacheID = evtSetup.get<EcalTBWeightsRcd>().cacheIdentifier();
144  } else if (container == "EcalChannelStatus") {
145  cacheID = evtSetup.get<EcalChannelStatusRcd>().cacheIdentifier();
146  } else if (container == "EcalDQMTowerStatus") {
147  cacheID = evtSetup.get<EcalDQMTowerStatusRcd>().cacheIdentifier();
148  } else if (container == "EcalDQMChannelStatus") {
149  cacheID = evtSetup.get<EcalDQMChannelStatusRcd>().cacheIdentifier();
150  } else if (container == "EcalDCSTowerStatus") {
151  cacheID = evtSetup.get<EcalDCSTowerStatusRcd>().cacheIdentifier();
152  } else if (container == "EcalDAQTowerStatus") {
153  cacheID = evtSetup.get<EcalDAQTowerStatusRcd>().cacheIdentifier();
154  } else if (container == "EcalTimeCalibConstants") {
155  cacheID = evtSetup.get<EcalTimeCalibConstantsRcd>().cacheIdentifier();
156  } else if (container == "EcalClusterCrackCorrParameters") {
157  cacheID = evtSetup.get<EcalClusterCrackCorrParametersRcd>().cacheIdentifier();
158  } else if (container == "EcalPFRecHitThresholds") {
159  cacheID = evtSetup.get<EcalPFRecHitThresholdsRcd>().cacheIdentifier();
160  } else if (container == "EcalClusterEnergyUncertaintyParameters") {
161  cacheID = evtSetup.get<EcalClusterEnergyUncertaintyParametersRcd>().cacheIdentifier();
162  } else if (container == "EcalClusterEnergyCorrectionParameters") {
163  cacheID = evtSetup.get<EcalClusterEnergyCorrectionParametersRcd>().cacheIdentifier();
164  } else if (container == "EcalClusterEnergyCorrectionObjectSpecificParameters") {
165  cacheID = evtSetup.get<EcalClusterEnergyCorrectionObjectSpecificParametersRcd>().cacheIdentifier();
166  } else if (container == "EcalClusterLocalContCorrParameters") {
167  cacheID = evtSetup.get<EcalClusterLocalContCorrParametersRcd>().cacheIdentifier();
168  } else if (container == "EcalTPGCrystalStatus") {
169  cacheID = evtSetup.get<EcalTPGCrystalStatusRcd>().cacheIdentifier();
170  } else if (container == "EcalTPGTowerStatus") {
171  cacheID = evtSetup.get<EcalTPGTowerStatusRcd>().cacheIdentifier();
172  } else if (container == "EBAlignment") {
173  cacheID = evtSetup.get<EBAlignmentRcd>().cacheIdentifier();
174  } else if (container == "EEAlignment") {
175  cacheID = evtSetup.get<EEAlignmentRcd>().cacheIdentifier();
176  } else if (container == "ESAlignment") {
177  cacheID = evtSetup.get<ESAlignmentRcd>().cacheIdentifier();
178  } else if (container == "EcalTimeOffsetConstant") {
179  cacheID = evtSetup.get<EcalTimeOffsetConstantRcd>().cacheIdentifier();
180  } else if (container == "EcalSampleMask") {
181  cacheID = evtSetup.get<EcalSampleMaskRcd>().cacheIdentifier();
182  } else if (container == "EcalTimeBiasCorrections") {
183  cacheID = evtSetup.get<EcalTimeBiasCorrectionsRcd>().cacheIdentifier();
184  } else if (container == "EcalSimPulseShape") {
185  cacheID = evtSetup.get<EcalSimPulseShapeRcd>().cacheIdentifier();
186  } else if (container == "EcalSamplesCorrelation") {
187  cacheID = evtSetup.get<EcalSamplesCorrelationRcd>().cacheIdentifier();
188  }
189 
190  else {
191  throw cms::Exception("Unknown container");
192  }
193 
194  if (m_cacheIDs[container] == cacheID) {
195  return false;
196  } else {
197  m_cacheIDs[container] = cacheID;
198  return true;
199  }
200 }
T get() const
Definition: EventSetup.h:73
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.