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 90 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.

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

112 {
113 
114 }

Member Function Documentation

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

Definition at line 116 of file EcalDBCopy.cc.

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

117 {
118 
119  std::string container;
121  typedef std::map<std::string, std::string>::const_iterator recordIter;
122  for (recordIter i = m_records.begin(); i != m_records.end(); ++i) {
123  container = (*i).first;
124  record = (*i).second;
125  if ( shouldCopy(evtSetup, container) ) {
126  copyToDB(evtSetup, container);
127  }
128  }
129 
130 }
bool shouldCopy(const edm::EventSetup &evtSetup, std::string container)
Definition: EcalDBCopy.cc:134
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:223
void EcalDBCopy::copyToDB ( const edm::EventSetup evtSetup,
std::string  container 
)
private

Definition at line 223 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, hgcalPlots::obj, edm::ESHandle< T >::product(), align_cfg::recordName, AlCaHLTBitMon_QueryRunRegistry::string, and cond::service::PoolDBOutputService::writeOne().

Referenced by analyze().

224 {
226  if ( !dbOutput.isAvailable() ) {
227  throw cms::Exception("PoolDBOutputService is not available");
228  }
229 
230  std::string recordName = m_records[container];
231 
232  if (container == "EcalPedestals") {
234  evtSetup.get<EcalPedestalsRcd>().get(handle);
235  const EcalPedestals* obj = handle.product();
236  std::cout << "ped pointer is: "<< obj<< std::endl;
237  dbOutput->createNewIOV<const EcalPedestals>( new EcalPedestals(*obj), dbOutput->beginOfTime(),dbOutput->endOfTime(),recordName);
238 
239  } else if (container == "EcalADCToGeVConstant") {
241  evtSetup.get<EcalADCToGeVConstantRcd>().get(handle);
242  const EcalADCToGeVConstant* obj = handle.product();
243  std::cout << "adc pointer is: "<< obj<< std::endl;
244 
245  dbOutput->createNewIOV<const EcalADCToGeVConstant>( new EcalADCToGeVConstant(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
246 
247 
248  } else if (container == "EcalTimeCalibConstants") {
250  evtSetup.get<EcalTimeCalibConstantsRcd>().get(handle);
251  const EcalTimeCalibConstants* obj = handle.product();
252  std::cout << "adc pointer is: "<< obj<< std::endl;
253 
254  dbOutput->createNewIOV<const EcalTimeCalibConstants>( new EcalTimeCalibConstants(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
255 
256  } else if (container == "EcalChannelStatus") {
258  evtSetup.get<EcalChannelStatusRcd>().get(handle);
259  const EcalChannelStatus* obj = handle.product();
260  std::cout << "channel status pointer is: "<< obj<< std::endl;
261 
262  dbOutput->createNewIOV<const EcalChannelStatus>( new EcalChannelStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
263 
264  } else if (container == "EcalDQMChannelStatus") {
266  evtSetup.get<EcalDQMChannelStatusRcd>().get(handle);
267  const EcalDQMChannelStatus* obj = handle.product();
268  std::cout << "DQM channel status pointer is: "<< obj<< std::endl;
269  dbOutput->createNewIOV<const EcalDQMChannelStatus>( new EcalDQMChannelStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
270 
271  } else if (container == "EcalDQMTowerStatus") {
273  evtSetup.get<EcalDQMTowerStatusRcd>().get(handle);
274  const EcalDQMTowerStatus* obj = handle.product();
275  std::cout << "DQM Tower status pointer is: "<< obj<< std::endl;
276  dbOutput->createNewIOV<const EcalDQMTowerStatus>( new EcalDQMTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
277 
278  } else if (container == "EcalDCSTowerStatus") {
280  evtSetup.get<EcalDCSTowerStatusRcd>().get(handle);
281  const EcalDCSTowerStatus* obj = handle.product();
282  std::cout << "channel status pointer is: "<< obj<< std::endl;
283 
284  dbOutput->createNewIOV<const EcalDCSTowerStatus>( new EcalDCSTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
285 
286  } else if (container == "EcalDAQTowerStatus") {
288  evtSetup.get<EcalDAQTowerStatusRcd>().get(handle);
289  const EcalDAQTowerStatus* obj = handle.product();
290  std::cout << "DAQ channel status pointer is: "<< obj<< std::endl;
291 
292  dbOutput->createNewIOV<const EcalDAQTowerStatus>( new EcalDAQTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
293 
294 
295  } else if (container == "EcalTPGCrystalStatus") {
297  evtSetup.get<EcalTPGCrystalStatusRcd>().get(handle);
298  const EcalTPGCrystalStatus* obj = handle.product();
299  std::cout << "TPG channel status pointer is: "<< obj<< std::endl;
300 
301  dbOutput->createNewIOV<const EcalTPGCrystalStatus>( new EcalTPGCrystalStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
302 
303  } else if (container == "EcalTPGTowerStatus") {
305  evtSetup.get<EcalTPGTowerStatusRcd>().get(handle);
306  const EcalTPGTowerStatus* obj = handle.product();
307  std::cout << "TPG tower status pointer is: "<< obj<< std::endl;
308 
309  dbOutput->createNewIOV<const EcalTPGTowerStatus>( new EcalTPGTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
310 
311 
312  } else if (container == "EcalIntercalibConstants") {
314  evtSetup.get<EcalIntercalibConstantsRcd>().get(handle);
315  const EcalIntercalibConstants* obj = handle.product();
316  std::cout << "inter pointer is: "<< obj<< std::endl;
317  dbOutput->createNewIOV<const EcalIntercalibConstants>( new EcalIntercalibConstants(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
318 
319  } else if (container == "EcalLinearCorrections") {
321  evtSetup.get<EcalLinearCorrectionsRcd>().get(handle);
322  const EcalLinearCorrections* obj = handle.product();
323  std::cout << "inter pointer is: "<< obj<< std::endl;
324  dbOutput->createNewIOV<const EcalLinearCorrections>( new EcalLinearCorrections(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
325 
326  }
327 else if (container == "EcalIntercalibConstantsMC") {
329  evtSetup.get<EcalIntercalibConstantsMCRcd>().get(handle);
330  const EcalIntercalibConstantsMC* obj = handle.product();
331  std::cout << "intercalib MC pointer is: "<< obj<< std::endl;
332  dbOutput->createNewIOV<const EcalIntercalibConstantsMC>( new EcalIntercalibConstantsMC(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
333 
334  } else if (container == "EcalIntercalibErrors") {
336  evtSetup.get<EcalIntercalibErrorsRcd>().get(handle);
337  const EcalIntercalibErrors* obj = handle.product();
338  std::cout << "inter pointer is: "<< obj<< std::endl;
339  dbOutput->createNewIOV<const EcalIntercalibErrors>( new EcalIntercalibErrors(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
340 
341  } else if (container == "EcalGainRatios") {
343  evtSetup.get<EcalGainRatiosRcd>().get(handle);
344  const EcalGainRatios* obj = handle.product();
345  std::cout << "gain pointer is: "<< obj<< std::endl;
346  dbOutput->createNewIOV<const EcalGainRatios>( new EcalGainRatios(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
347 
348  } else if (container == "EcalWeightXtalGroups") {
350  evtSetup.get<EcalWeightXtalGroupsRcd>().get(handle);
351  const EcalWeightXtalGroups* obj = handle.product();
352  std::cout << "weight pointer is: "<< obj<< std::endl;
353  dbOutput->createNewIOV<const EcalWeightXtalGroups>( new EcalWeightXtalGroups(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
354 
355  } else if (container == "EcalTBWeights") {
357  evtSetup.get<EcalTBWeightsRcd>().get(handle);
358  const EcalTBWeights* obj = handle.product();
359  std::cout << "tbweight pointer is: "<< obj<< std::endl;
360  dbOutput->createNewIOV<const EcalTBWeights>( new EcalTBWeights(*obj), dbOutput->beginOfTime(),dbOutput->endOfTime(),recordName);
361 
362  } else if (container == "EcalLaserAlphas") {
364  evtSetup.get<EcalLaserAlphasRcd>().get(handle);
365  const EcalLaserAlphas* obj = handle.product();
366  std::cout << "ecalLaserAlpha pointer is: "<< obj<< std::endl;
367  dbOutput->createNewIOV<const EcalLaserAlphas>( new EcalLaserAlphas(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
368 
369  } else if (container == "EcalLaserAPDPNRatios") {
371  evtSetup.get<EcalLaserAPDPNRatiosRcd>().get(handle);
372  const EcalLaserAPDPNRatios* obj = handle.product();
373  std::cout << "tbweight pointer is: "<< obj<< std::endl;
374  dbOutput->createNewIOV<const EcalLaserAPDPNRatios>( new EcalLaserAPDPNRatios(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
375 
376  } else if (container == "EcalLaserAPDPNRatiosRef") {
378  evtSetup.get<EcalLaserAPDPNRatiosRefRcd>().get(handle);
379  const EcalLaserAPDPNRatiosRef* obj = handle.product();
380  std::cout << "tbweight pointer is: "<< obj<< std::endl;
381  dbOutput->createNewIOV<const EcalLaserAPDPNRatiosRef>( new EcalLaserAPDPNRatiosRef(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
382 
383 
384  } else if (container == "EcalClusterCrackCorrParameters") {
386  evtSetup.get<EcalClusterCrackCorrParametersRcd>().get(handle);
387  const EcalClusterCrackCorrParameters* obj = handle.product();
388  std::cout << "cluster crack pointer is: "<< obj<< std::endl;
390 
391  } else if (container == "EcalPFRecHitThresholds") {
393  evtSetup.get<EcalPFRecHitThresholdsRcd>().get(handle);
394  const EcalPFRecHitThresholds* obj = handle.product();
395  std::cout << "Ecal PF rec hit thresholds pointer is: "<< obj<< std::endl;
396  dbOutput->createNewIOV<const EcalPFRecHitThresholds>( new EcalPFRecHitThresholds(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
397 
398 
399  } else if (container == "EcalClusterEnergyUncertaintyParameters") {
401  evtSetup.get<EcalClusterEnergyUncertaintyParametersRcd>().get(handle);
402  const EcalClusterEnergyUncertaintyParameters* obj = handle.product();
403  std::cout << "tbweight pointer is: "<< obj<< std::endl;
405 
406 
407  } else if (container == "EcalClusterEnergyCorrectionParameters") {
409  evtSetup.get<EcalClusterEnergyCorrectionParametersRcd>().get(handle);
410  const EcalClusterEnergyCorrectionParameters* obj = handle.product();
411  std::cout << "tbweight pointer is: "<< obj<< std::endl;
413 
414  } else if (container == "EcalClusterEnergyCorrectionObjectSpecificParameters") {
418  std::cout << "tbweight pointer is: "<< obj<< std::endl;
420 
421 
422  } else if (container == "EcalClusterLocalContCorrParameters") {
424  evtSetup.get<EcalClusterLocalContCorrParametersRcd>().get(handle);
425  const EcalClusterLocalContCorrParameters* obj = handle.product();
426  std::cout << "tbweight pointer is: "<< obj<< std::endl;
428 
429  } else if (container == "EBAlignment") {
431  evtSetup.get<EBAlignmentRcd>().get(handle);
432  const Alignments* obj = handle.product();
433  std::cout << "EB alignment pointer is: "<< obj<< std::endl;
434  dbOutput->createNewIOV<const Alignments>( 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>( new Alignments(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
442 
443  } else if (container == "ESAlignment") {
445  evtSetup.get<ESAlignmentRcd>().get(handle);
446  const Alignments* obj = handle.product();
447  std::cout << "ES alignment pointer is: "<< obj<< std::endl;
448  dbOutput->createNewIOV<const Alignments>( new Alignments(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
449 
450  } else if (container == "EcalTimeOffsetConstant") {
452  evtSetup.get<EcalTimeOffsetConstantRcd>().get(handle);
453  const EcalTimeOffsetConstant* obj = handle.product();
454  std::cout << "TimeOffset pointer is: "<< obj<< std::endl;
455  dbOutput->createNewIOV<const EcalTimeOffsetConstant>( new EcalTimeOffsetConstant(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
456 
457  } else if (container == "EcalSampleMask") {
459  evtSetup.get<EcalSampleMaskRcd>().get(handle);
460  const EcalSampleMask* obj = handle.product();
461  std::cout << "sample mask pointer is: "<< obj<< std::endl;
462  dbOutput->createNewIOV<const EcalSampleMask>( new EcalSampleMask(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
463 
464  } else if (container == "EcalSimPulseShape") {
466  evtSetup.get<EcalSimPulseShapeRcd>().get(handle);
467  const EcalSimPulseShape* obj = handle.product();
468  dbOutput->createNewIOV<const EcalSimPulseShape>( new EcalSimPulseShape(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
469 
470  } else if (container == "EcalTimeBiasCorrections") {
472  evtSetup.get<EcalTimeBiasCorrectionsRcd>().get(handle);
473  const EcalTimeBiasCorrections* obj = handle.product();
474  std::cout << "TimeBiasCorrections pointer is: "<< obj<< std::endl;
476  bias_ = new EcalTimeBiasCorrections();
477  std::vector<float> vect = obj->EBTimeCorrAmplitudeBins;
478  copy(vect.begin(), vect.end(), back_inserter(bias_->EBTimeCorrAmplitudeBins));
479  vect = obj->EBTimeCorrShiftBins;
480  copy(vect.begin(), vect.end(), back_inserter(bias_->EBTimeCorrShiftBins));
481  vect = obj->EETimeCorrAmplitudeBins;
482  copy(vect.begin(), vect.end(), back_inserter(bias_->EETimeCorrAmplitudeBins));
483  vect = obj->EETimeCorrShiftBins;
484  copy(vect.begin(), vect.end(), back_inserter(bias_->EETimeCorrShiftBins));
485  dbOutput->writeOne(bias_, dbOutput->beginOfTime(), "EcalTimeBiasCorrectionsRcd");
486 
487  } else if (container == "EcalSamplesCorrelation") {
489  evtSetup.get<EcalSamplesCorrelationRcd>().get(handle);
490  const EcalSamplesCorrelation* obj = handle.product();
491  std::cout << "SamplesCorrelation pointer is: "<< obj<< std::endl;
492  EcalSamplesCorrelation *correl_;
493  correl_ = new EcalSamplesCorrelation();
494  std::vector<double> vect = obj->EBG12SamplesCorrelation;
495  copy(vect.begin(), vect.end(), back_inserter(correl_->EBG12SamplesCorrelation));
496  vect = obj->EBG6SamplesCorrelation;
497  copy(vect.begin(), vect.end(), back_inserter(correl_->EBG6SamplesCorrelation));
498  vect = obj->EBG1SamplesCorrelation;
499  copy(vect.begin(), vect.end(), back_inserter(correl_->EBG1SamplesCorrelation));
500  vect = obj->EEG12SamplesCorrelation;
501  copy(vect.begin(), vect.end(), back_inserter(correl_->EEG12SamplesCorrelation));
502  vect = obj->EEG6SamplesCorrelation;
503  copy(vect.begin(), vect.end(), back_inserter(correl_->EEG6SamplesCorrelation));
504  vect = obj->EEG1SamplesCorrelation;
505  copy(vect.begin(), vect.end(), back_inserter(correl_->EEG1SamplesCorrelation));
506  dbOutput->writeOne(correl_, dbOutput->beginOfTime(), "EcalSamplesCorrelationRcd");
507 
508 } else {
509  throw cms::Exception("Unknown container");
510  }
511 
512  std::cout<< "EcalDBCopy wrote " << recordName << std::endl;
513 }
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: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:53
EcalTimeCalibConstantMap EcalTimeCalibConstants
std::vector< double > EBG1SamplesCorrelation
EcalFunParams EcalClusterLocalContCorrParameters
EcalIntercalibConstantMap EcalIntercalibConstants
std::vector< double > EEG1SamplesCorrelation
T get() const
Definition: EventSetup.h:71
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 134 of file EcalDBCopy.cc.

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

Referenced by analyze().

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