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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 18 of file EcalDBCopy.h.

Constructor & Destructor Documentation

◆ EcalDBCopy()

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

Definition at line 88 of file EcalDBCopy.cc.

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 }

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

◆ ~EcalDBCopy()

EcalDBCopy::~EcalDBCopy ( )
override

Definition at line 103 of file EcalDBCopy.cc.

103 {}

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 105 of file EcalDBCopy.cc.

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 }

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

◆ copyToDB()

void EcalDBCopy::copyToDB ( const edm::EventSetup evtSetup,
std::string  container 
)
private

Definition at line 202 of file EcalDBCopy.cc.

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") {
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") {
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") {
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") {
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") {
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") {
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") {
397  std::cout << "tbweight pointer is: " << obj << std::endl;
400 
401  } else if (container == "EcalClusterEnergyCorrectionParameters") {
405  std::cout << "tbweight pointer is: " << obj << std::endl;
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") {
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") {
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") {
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") {
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 }

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

Referenced by analyze().

◆ shouldCopy()

bool EcalDBCopy::shouldCopy ( const edm::EventSetup evtSetup,
std::string  container 
)
private

Definition at line 118 of file EcalDBCopy.cc.

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 }

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

Referenced by analyze().

Member Data Documentation

◆ m_cacheIDs

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

Definition at line 30 of file EcalDBCopy.h.

Referenced by EcalDBCopy(), and shouldCopy().

◆ m_records

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

Definition at line 31 of file EcalDBCopy.h.

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

◆ m_timetype

std::string EcalDBCopy::m_timetype
private

Definition at line 29 of file EcalDBCopy.h.

EcalTimeOffsetConstantRcd
Definition: EcalTimeOffsetConstantRcd.h:5
mps_fire.i
i
Definition: mps_fire.py:428
EcalLaserAPDPNRatiosRef
EcalLaserAPDPNRatiosRefMap EcalLaserAPDPNRatiosRef
Definition: EcalLaserAPDPNRatiosRef.h:13
EcalPFRecHitThresholdsRcd
Definition: EcalPFRecHitThresholdsRcd.h:5
EcalLaserAPDPNRatiosRcd
Definition: EcalLaserAPDPNRatiosRcd.h:24
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:215
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
EcalSamplesCorrelationRcd
Definition: EcalSamplesCorrelationRcd.h:12
EcalIntercalibErrorsRcd
Definition: EcalIntercalibErrorsRcd.h:5
EcalDQMTowerStatus
EcalDQMTowerStatusMap EcalDQMTowerStatus
Definition: EcalDQMTowerStatus.h:13
patZpeak.handle
handle
Definition: patZpeak.py:23
EcalLaserAlphas
EcalLaserAlphaMap EcalLaserAlphas
Definition: EcalLaserAlphas.h:12
EcalSamplesCorrelation::EEG1SamplesCorrelation
std::vector< double > EEG1SamplesCorrelation
Definition: EcalSamplesCorrelation.h:28
ESAlignmentRcd
Definition: ESAlignmentRcd.h:6
align_cfg.recordName
recordName
Definition: align_cfg.py:66
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalTPGCrystalStatusRcd
Definition: EcalTPGCrystalStatusRcd.h:5
EcalSampleMask
Definition: EcalSampleMask.h:16
EEAlignmentRcd
Definition: EEAlignmentRcd.h:6
EcalTimeBiasCorrectionsRcd
Definition: EcalTimeBiasCorrectionsRcd.h:12
GlobalPosition_Frontier_DevDB_cff.record
record
Definition: GlobalPosition_Frontier_DevDB_cff.py:10
EcalFunParams
Definition: EcalFunctionParameters.h:11
EcalDCSTowerStatusRcd
Definition: EcalDCSTowerStatusRcd.h:5
EcalTimeOffsetConstant
Definition: EcalTimeOffsetConstant.h:13
EcalPFRecHitThresholds
EcalPFRecHitThresholdsMap EcalPFRecHitThresholds
Definition: EcalPFRecHitThresholds.h:12
EcalADCToGeVConstant
Definition: EcalADCToGeVConstant.h:13
EcalDBCopy::copyToDB
void copyToDB(const edm::EventSetup &evtSetup, std::string container)
Definition: EcalDBCopy.cc:202
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
EcalGainRatios
EcalGainRatioMap EcalGainRatios
Definition: EcalGainRatios.h:12
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
EcalLaserAPDPNRatiosRefRcd
Definition: EcalLaserAPDPNRatiosRefRcd.h:24
EcalTimeBiasCorrections::EETimeCorrAmplitudeBins
std::vector< float > EETimeCorrAmplitudeBins
Definition: EcalTimeBiasCorrections.h:26
EcalTBWeightsRcd
Definition: EcalTBWeightsRcd.h:5
EcalTimeBiasCorrections::EETimeCorrShiftBins
std::vector< float > EETimeCorrShiftBins
Definition: EcalTimeBiasCorrections.h:27
EcalClusterEnergyCorrectionObjectSpecificParameters
EcalFunParams EcalClusterEnergyCorrectionObjectSpecificParameters
Definition: EcalClusterEnergyCorrectionObjectSpecificParameters.h:6
EcalCondTowerObjectContainer
Definition: EcalCondTowerObjectContainer.h:13
EcalSamplesCorrelation::EBG12SamplesCorrelation
std::vector< double > EBG12SamplesCorrelation
Definition: EcalSamplesCorrelation.h:22
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
EcalDBCopy::m_timetype
std::string m_timetype
Definition: EcalDBCopy.h:29
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition: PoolDBOutputService.h:116
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
EcalSampleMaskRcd
Definition: EcalSampleMaskRcd.h:5
EcalDBCopy::m_records
std::map< std::string, std::string > m_records
Definition: EcalDBCopy.h:31
EcalClusterEnergyCorrectionObjectSpecificParametersRcd
Definition: EcalClusterEnergyCorrectionObjectSpecificParametersRcd.h:5
EcalTimeBiasCorrections::EBTimeCorrAmplitudeBins
std::vector< float > EBTimeCorrAmplitudeBins
Definition: EcalTimeBiasCorrections.h:23
edm::ESHandle
Definition: DTSurvey.h:22
EcalIntercalibConstants
EcalIntercalibConstantMap EcalIntercalibConstants
Definition: EcalIntercalibConstants.h:12
EcalClusterEnergyUncertaintyParametersRcd
Definition: EcalClusterEnergyUncertaintyParametersRcd.h:5
EcalTimeBiasCorrections
Definition: EcalTimeBiasCorrections.h:16
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
EcalGainRatiosRcd
Definition: EcalGainRatiosRcd.h:5
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalPedestals
EcalPedestalsMap EcalPedestals
Definition: EcalPedestals.h:50
EcalDQMTowerStatusRcd
Definition: EcalDQMTowerStatusRcd.h:5
EcalIntercalibConstantsMCRcd
Definition: EcalIntercalibConstantsMCRcd.h:5
EcalChannelStatusRcd
Definition: EcalChannelStatusRcd.h:5
EcalWeightXtalGroups
EcalCondObjectContainer< EcalXtalGroupId > EcalWeightXtalGroups
Definition: EcalWeightXtalGroups.h:12
EcalLinearCorrections
EcalTimeDependentCorrections EcalLinearCorrections
Definition: EcalLinearCorrections.h:10
edm::Service< cond::service::PoolDBOutputService >
EcalDQMChannelStatusRcd
Definition: EcalDQMChannelStatusRcd.h:5
EcalLaserAlphasRcd
Definition: EcalLaserAlphasRcd.h:24
EcalLinearCorrectionsRcd
Definition: EcalLinearCorrectionsRcd.h:5
EcalSamplesCorrelation::EBG1SamplesCorrelation
std::vector< double > EBG1SamplesCorrelation
Definition: EcalSamplesCorrelation.h:24
EcalSamplesCorrelation::EEG12SamplesCorrelation
std::vector< double > EEG12SamplesCorrelation
Definition: EcalSamplesCorrelation.h:26
EcalDBCopy::m_cacheIDs
std::map< std::string, unsigned long long > m_cacheIDs
Definition: EcalDBCopy.h:30
EcalSimPulseShape
Definition: EcalSimPulseShape.h:7
EcalChannelStatus
EcalChannelStatusMap EcalChannelStatus
Definition: EcalChannelStatus.h:13
get
#define get
EcalTimeCalibConstantsRcd
Definition: EcalTimeCalibConstantsRcd.h:5
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:213
EcalTPGCrystalStatus
EcalTPGCrystalStatusMap EcalTPGCrystalStatus
Definition: EcalTPGCrystalStatus.h:19
EcalDBCopy::shouldCopy
bool shouldCopy(const edm::EventSetup &evtSetup, std::string container)
Definition: EcalDBCopy.cc:118
EcalDCSTowerStatus
EcalDCSTowerStatusMap EcalDCSTowerStatus
Definition: EcalDCSTowerStatus.h:13
EcalTPGTowerStatus
Definition: EcalTPGTowerStatus.h:9
EcalClusterCrackCorrParameters
EcalFunParams EcalClusterCrackCorrParameters
Definition: EcalClusterCrackCorrParameters.h:6
Exception
Definition: hltDiff.cc:245
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:63
EcalClusterLocalContCorrParameters
EcalFunParams EcalClusterLocalContCorrParameters
Definition: EcalClusterLocalContCorrParameters.h:6
EcalIntercalibErrors
EcalIntercalibErrorMap EcalIntercalibErrors
Definition: EcalIntercalibErrors.h:12
EBAlignmentRcd
Definition: EBAlignmentRcd.h:6
EcalDQMChannelStatus
EcalDQMChannelStatusMap EcalDQMChannelStatus
Definition: EcalDQMChannelStatus.h:10
EcalClusterEnergyCorrectionParametersRcd
Definition: EcalClusterEnergyCorrectionParametersRcd.h:5
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EcalClusterEnergyCorrectionParameters
EcalFunParams EcalClusterEnergyCorrectionParameters
Definition: EcalClusterEnergyCorrectionParameters.h:6
EcalClusterEnergyUncertaintyParameters
EcalFunParams EcalClusterEnergyUncertaintyParameters
Definition: EcalClusterEnergyUncertaintyParameters.h:6
EcalSamplesCorrelation::EBG6SamplesCorrelation
std::vector< double > EBG6SamplesCorrelation
Definition: EcalSamplesCorrelation.h:23
EcalLaserAPDPNRatios
Definition: EcalLaserAPDPNRatios.h:14
EcalWeightXtalGroupsRcd
Definition: EcalWeightXtalGroupsRcd.h:5
EcalPedestalsRcd
Definition: EcalPedestalsRcd.h:5
EcalDAQTowerStatus
EcalDAQTowerStatusMap EcalDAQTowerStatus
Definition: EcalDAQTowerStatus.h:13
EcalClusterLocalContCorrParametersRcd
Definition: EcalClusterLocalContCorrParametersRcd.h:5
EcalTimeCalibConstants
EcalTimeCalibConstantMap EcalTimeCalibConstants
Definition: EcalTimeCalibConstants.h:12
EcalTimeBiasCorrections::EBTimeCorrShiftBins
std::vector< float > EBTimeCorrShiftBins
Definition: EcalTimeBiasCorrections.h:24
EcalClusterCrackCorrParametersRcd
Definition: EcalClusterCrackCorrParametersRcd.h:5
Parameters
vector< ParameterSet > Parameters
Definition: HLTMuonPlotter.cc:25
EcalTPGTowerStatusRcd
Definition: EcalTPGTowerStatusRcd.h:5
EcalIntercalibConstantsRcd
Definition: EcalIntercalibConstantsRcd.h:5
Alignments
Definition: Alignments.h:10
EcalSamplesCorrelation::EEG6SamplesCorrelation
std::vector< double > EEG6SamplesCorrelation
Definition: EcalSamplesCorrelation.h:27
EcalADCToGeVConstantRcd
Definition: EcalADCToGeVConstantRcd.h:5
EcalIntercalibConstantsMC
EcalIntercalibConstantMCMap EcalIntercalibConstantsMC
Definition: EcalIntercalibConstantsMC.h:12
EcalDAQTowerStatusRcd
Definition: EcalDAQTowerStatusRcd.h:5
EcalTBWeights
Definition: EcalTBWeights.h:15
EcalTimeDependentCorrections
Definition: EcalTimeDependentCorrections.h:14
EcalSamplesCorrelation
Definition: EcalSamplesCorrelation.h:16
EcalSimPulseShapeRcd
Definition: EcalSimPulseShapeRcd.h:5