test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void analyze (const edm::Event &evt, const edm::EventSetup &evtSetup)
 
 EcalDBCopy (const edm::ParameterSet &iConfig)
 
 ~EcalDBCopy ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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 &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 18 of file EcalDBCopy.h.

Constructor & Destructor Documentation

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

Definition at line 83 of file EcalDBCopy.cc.

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

83  :
84  m_timetype(iConfig.getParameter<std::string>("timetype")),
85  m_cacheIDs(),
86  m_records()
87 {
88 
89  std::string container;
92  typedef std::vector< edm::ParameterSet > Parameters;
93  Parameters toCopy = iConfig.getParameter<Parameters>("toCopy");
94  for(Parameters::iterator i = toCopy.begin(); i != toCopy.end(); ++i) {
95  container = i->getParameter<std::string>("container");
96  record = i->getParameter<std::string>("record");
97  m_cacheIDs.insert( std::make_pair(container, 0) );
98  m_records.insert( std::make_pair(container, record) );
99  }
100 
101 }
std::string m_timetype
Definition: EcalDBCopy.h:29
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
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 ( )

Definition at line 104 of file EcalDBCopy.cc.

105 {
106 
107 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 109 of file EcalDBCopy.cc.

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

110 {
111 
112  std::string container;
114  typedef std::map<std::string, std::string>::const_iterator recordIter;
115  for (recordIter i = m_records.begin(); i != m_records.end(); ++i) {
116  container = (*i).first;
117  record = (*i).second;
118  if ( shouldCopy(evtSetup, container) ) {
119  copyToDB(evtSetup, container);
120  }
121  }
122 
123 }
int i
Definition: DBlmapReader.cc:9
bool shouldCopy(const edm::EventSetup &evtSetup, std::string container)
Definition: EcalDBCopy.cc:127
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:212
void EcalDBCopy::copyToDB ( const edm::EventSetup evtSetup,
std::string  container 
)
private

Definition at line 212 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< class >::product(), align_cfg::recordName, AlCaHLTBitMon_QueryRunRegistry::string, and cond::service::PoolDBOutputService::writeOne().

Referenced by analyze().

213 {
215  if ( !dbOutput.isAvailable() ) {
216  throw cms::Exception("PoolDBOutputService is not available");
217  }
218 
219  std::string recordName = m_records[container];
220 
221  if (container == "EcalPedestals") {
223  evtSetup.get<EcalPedestalsRcd>().get(handle);
224  const EcalPedestals* obj = handle.product();
225  std::cout << "ped pointer is: "<< obj<< std::endl;
226  dbOutput->createNewIOV<const EcalPedestals>( new EcalPedestals(*obj), dbOutput->beginOfTime(),dbOutput->endOfTime(),recordName);
227 
228  } else if (container == "EcalADCToGeVConstant") {
230  evtSetup.get<EcalADCToGeVConstantRcd>().get(handle);
231  const EcalADCToGeVConstant* obj = handle.product();
232  std::cout << "adc pointer is: "<< obj<< std::endl;
233 
234  dbOutput->createNewIOV<const EcalADCToGeVConstant>( new EcalADCToGeVConstant(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
235 
236 
237  } else if (container == "EcalTimeCalibConstants") {
239  evtSetup.get<EcalTimeCalibConstantsRcd>().get(handle);
240  const EcalTimeCalibConstants* obj = handle.product();
241  std::cout << "adc pointer is: "<< obj<< std::endl;
242 
243  dbOutput->createNewIOV<const EcalTimeCalibConstants>( new EcalTimeCalibConstants(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
244 
245  } else if (container == "EcalChannelStatus") {
247  evtSetup.get<EcalChannelStatusRcd>().get(handle);
248  const EcalChannelStatus* obj = handle.product();
249  std::cout << "channel status pointer is: "<< obj<< std::endl;
250 
251  dbOutput->createNewIOV<const EcalChannelStatus>( new EcalChannelStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
252 
253  } else if (container == "EcalDQMChannelStatus") {
255  evtSetup.get<EcalDQMChannelStatusRcd>().get(handle);
256  const EcalDQMChannelStatus* obj = handle.product();
257  std::cout << "DQM channel status pointer is: "<< obj<< std::endl;
258  dbOutput->createNewIOV<const EcalDQMChannelStatus>( new EcalDQMChannelStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
259 
260  } else if (container == "EcalDQMTowerStatus") {
262  evtSetup.get<EcalDQMTowerStatusRcd>().get(handle);
263  const EcalDQMTowerStatus* obj = handle.product();
264  std::cout << "DQM Tower status pointer is: "<< obj<< std::endl;
265  dbOutput->createNewIOV<const EcalDQMTowerStatus>( new EcalDQMTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
266 
267  } else if (container == "EcalDCSTowerStatus") {
269  evtSetup.get<EcalDCSTowerStatusRcd>().get(handle);
270  const EcalDCSTowerStatus* obj = handle.product();
271  std::cout << "channel status pointer is: "<< obj<< std::endl;
272 
273  dbOutput->createNewIOV<const EcalDCSTowerStatus>( new EcalDCSTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
274 
275  } else if (container == "EcalDAQTowerStatus") {
277  evtSetup.get<EcalDAQTowerStatusRcd>().get(handle);
278  const EcalDAQTowerStatus* obj = handle.product();
279  std::cout << "DAQ channel status pointer is: "<< obj<< std::endl;
280 
281  dbOutput->createNewIOV<const EcalDAQTowerStatus>( new EcalDAQTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
282 
283 
284  } else if (container == "EcalTPGCrystalStatus") {
286  evtSetup.get<EcalTPGCrystalStatusRcd>().get(handle);
287  const EcalTPGCrystalStatus* obj = handle.product();
288  std::cout << "TPG channel status pointer is: "<< obj<< std::endl;
289 
290  dbOutput->createNewIOV<const EcalTPGCrystalStatus>( new EcalTPGCrystalStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
291 
292  } else if (container == "EcalTPGTowerStatus") {
294  evtSetup.get<EcalTPGTowerStatusRcd>().get(handle);
295  const EcalTPGTowerStatus* obj = handle.product();
296  std::cout << "TPG tower status pointer is: "<< obj<< std::endl;
297 
298  dbOutput->createNewIOV<const EcalTPGTowerStatus>( new EcalTPGTowerStatus(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
299 
300 
301  } else if (container == "EcalIntercalibConstants") {
303  evtSetup.get<EcalIntercalibConstantsRcd>().get(handle);
304  const EcalIntercalibConstants* obj = handle.product();
305  std::cout << "inter pointer is: "<< obj<< std::endl;
306  dbOutput->createNewIOV<const EcalIntercalibConstants>( new EcalIntercalibConstants(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
307 
308  } else if (container == "EcalLinearCorrections") {
310  evtSetup.get<EcalLinearCorrectionsRcd>().get(handle);
311  const EcalLinearCorrections* obj = handle.product();
312  std::cout << "inter pointer is: "<< obj<< std::endl;
313  dbOutput->createNewIOV<const EcalLinearCorrections>( new EcalLinearCorrections(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
314 
315  }
316 else if (container == "EcalIntercalibConstantsMC") {
318  evtSetup.get<EcalIntercalibConstantsMCRcd>().get(handle);
319  const EcalIntercalibConstantsMC* obj = handle.product();
320  std::cout << "intercalib MC pointer is: "<< obj<< std::endl;
321  dbOutput->createNewIOV<const EcalIntercalibConstantsMC>( new EcalIntercalibConstantsMC(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
322 
323  } else if (container == "EcalIntercalibErrors") {
325  evtSetup.get<EcalIntercalibErrorsRcd>().get(handle);
326  const EcalIntercalibErrors* obj = handle.product();
327  std::cout << "inter pointer is: "<< obj<< std::endl;
328  dbOutput->createNewIOV<const EcalIntercalibErrors>( new EcalIntercalibErrors(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
329 
330  } else if (container == "EcalGainRatios") {
332  evtSetup.get<EcalGainRatiosRcd>().get(handle);
333  const EcalGainRatios* obj = handle.product();
334  std::cout << "gain pointer is: "<< obj<< std::endl;
335  dbOutput->createNewIOV<const EcalGainRatios>( 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>( new EcalWeightXtalGroups(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
343 
344  } else if (container == "EcalTBWeights") {
346  evtSetup.get<EcalTBWeightsRcd>().get(handle);
347  const EcalTBWeights* obj = handle.product();
348  std::cout << "tbweight pointer is: "<< obj<< std::endl;
349  dbOutput->createNewIOV<const EcalTBWeights>( new EcalTBWeights(*obj), dbOutput->beginOfTime(),dbOutput->endOfTime(),recordName);
350 
351  } else if (container == "EcalLaserAlphas") {
353  evtSetup.get<EcalLaserAlphasRcd>().get(handle);
354  const EcalLaserAlphas* obj = handle.product();
355  std::cout << "ecalLaserAlpha pointer is: "<< obj<< std::endl;
356  dbOutput->createNewIOV<const EcalLaserAlphas>( new EcalLaserAlphas(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
357 
358  } else if (container == "EcalLaserAPDPNRatios") {
360  evtSetup.get<EcalLaserAPDPNRatiosRcd>().get(handle);
361  const EcalLaserAPDPNRatios* obj = handle.product();
362  std::cout << "tbweight pointer is: "<< obj<< std::endl;
363  dbOutput->createNewIOV<const EcalLaserAPDPNRatios>( new EcalLaserAPDPNRatios(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
364 
365  } else if (container == "EcalLaserAPDPNRatiosRef") {
367  evtSetup.get<EcalLaserAPDPNRatiosRefRcd>().get(handle);
368  const EcalLaserAPDPNRatiosRef* obj = handle.product();
369  std::cout << "tbweight pointer is: "<< obj<< std::endl;
370  dbOutput->createNewIOV<const EcalLaserAPDPNRatiosRef>( new EcalLaserAPDPNRatiosRef(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
371 
372 
373  } else if (container == "EcalClusterCrackCorrParameters") {
375  evtSetup.get<EcalClusterCrackCorrParametersRcd>().get(handle);
376  const EcalClusterCrackCorrParameters* obj = handle.product();
377  std::cout << "tbweight pointer is: "<< obj<< std::endl;
379 
380 
381  } else if (container == "EcalClusterEnergyUncertaintyParameters") {
383  evtSetup.get<EcalClusterEnergyUncertaintyParametersRcd>().get(handle);
384  const EcalClusterEnergyUncertaintyParameters* obj = handle.product();
385  std::cout << "tbweight pointer is: "<< obj<< std::endl;
387 
388 
389  } else if (container == "EcalClusterEnergyCorrectionParameters") {
391  evtSetup.get<EcalClusterEnergyCorrectionParametersRcd>().get(handle);
392  const EcalClusterEnergyCorrectionParameters* obj = handle.product();
393  std::cout << "tbweight pointer is: "<< obj<< std::endl;
395 
396  } else if (container == "EcalClusterEnergyCorrectionObjectSpecificParameters") {
400  std::cout << "tbweight pointer is: "<< obj<< std::endl;
402 
403 
404  } else if (container == "EcalClusterLocalContCorrParameters") {
406  evtSetup.get<EcalClusterLocalContCorrParametersRcd>().get(handle);
407  const EcalClusterLocalContCorrParameters* obj = handle.product();
408  std::cout << "tbweight pointer is: "<< obj<< std::endl;
410 
411  } else if (container == "EBAlignment") {
413  evtSetup.get<EBAlignmentRcd>().get(handle);
414  const Alignments* obj = handle.product();
415  std::cout << "EB alignment pointer is: "<< obj<< std::endl;
416  dbOutput->createNewIOV<const Alignments>( new Alignments(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
417 
418  } else if (container == "EEAlignment") {
420  evtSetup.get<EEAlignmentRcd>().get(handle);
421  const Alignments* obj = handle.product();
422  std::cout << "EE alignment pointer is: "<< obj<< std::endl;
423  dbOutput->createNewIOV<const Alignments>( new Alignments(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
424 
425  } else if (container == "ESAlignment") {
427  evtSetup.get<ESAlignmentRcd>().get(handle);
428  const Alignments* obj = handle.product();
429  std::cout << "ES alignment pointer is: "<< obj<< std::endl;
430  dbOutput->createNewIOV<const Alignments>( new Alignments(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
431 
432  } else if (container == "EcalTimeOffsetConstant") {
434  evtSetup.get<EcalTimeOffsetConstantRcd>().get(handle);
435  const EcalTimeOffsetConstant* obj = handle.product();
436  std::cout << "TimeOffset pointer is: "<< obj<< std::endl;
437  dbOutput->createNewIOV<const EcalTimeOffsetConstant>( new EcalTimeOffsetConstant(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
438 
439  } else if (container == "EcalSampleMask") {
441  evtSetup.get<EcalSampleMaskRcd>().get(handle);
442  const EcalSampleMask* obj = handle.product();
443  std::cout << "sample mask pointer is: "<< obj<< std::endl;
444  dbOutput->createNewIOV<const EcalSampleMask>( new EcalSampleMask(*obj),dbOutput->beginOfTime(), dbOutput->endOfTime(),recordName);
445 
446  } else if (container == "EcalTimeBiasCorrections") {
448  evtSetup.get<EcalTimeBiasCorrectionsRcd>().get(handle);
449  const EcalTimeBiasCorrections* obj = handle.product();
450  std::cout << "TimeBiasCorrections pointer is: "<< obj<< std::endl;
452  bias_ = new EcalTimeBiasCorrections();
453  std::vector<float> vect = obj->EBTimeCorrAmplitudeBins;
454  copy(vect.begin(), vect.end(), back_inserter(bias_->EBTimeCorrAmplitudeBins));
455  vect = obj->EBTimeCorrShiftBins;
456  copy(vect.begin(), vect.end(), back_inserter(bias_->EBTimeCorrShiftBins));
457  vect = obj->EETimeCorrAmplitudeBins;
458  copy(vect.begin(), vect.end(), back_inserter(bias_->EETimeCorrAmplitudeBins));
459  vect = obj->EETimeCorrShiftBins;
460  copy(vect.begin(), vect.end(), back_inserter(bias_->EETimeCorrShiftBins));
461  dbOutput->writeOne(bias_, dbOutput->beginOfTime(), "EcalTimeBiasCorrectionsRcd");
462 
463  } else if (container == "EcalSamplesCorrelation") {
465  evtSetup.get<EcalSamplesCorrelationRcd>().get(handle);
466  const EcalSamplesCorrelation* obj = handle.product();
467  std::cout << "SamplesCorrelation pointer is: "<< obj<< std::endl;
468  EcalSamplesCorrelation *correl_;
469  correl_ = new EcalSamplesCorrelation();
470  std::vector<double> vect = obj->EBG12SamplesCorrelation;
471  copy(vect.begin(), vect.end(), back_inserter(correl_->EBG12SamplesCorrelation));
472  vect = obj->EBG6SamplesCorrelation;
473  copy(vect.begin(), vect.end(), back_inserter(correl_->EBG6SamplesCorrelation));
474  vect = obj->EBG1SamplesCorrelation;
475  copy(vect.begin(), vect.end(), back_inserter(correl_->EBG1SamplesCorrelation));
476  vect = obj->EEG12SamplesCorrelation;
477  copy(vect.begin(), vect.end(), back_inserter(correl_->EEG12SamplesCorrelation));
478  vect = obj->EEG6SamplesCorrelation;
479  copy(vect.begin(), vect.end(), back_inserter(correl_->EEG6SamplesCorrelation));
480  vect = obj->EEG1SamplesCorrelation;
481  copy(vect.begin(), vect.end(), back_inserter(correl_->EEG1SamplesCorrelation));
482  dbOutput->writeOne(correl_, dbOutput->beginOfTime(), "EcalSamplesCorrelationRcd");
483 
484 } else {
485  throw cms::Exception("Unknown container");
486  }
487 
488  std::cout<< "EcalDBCopy wrote " << recordName << std::endl;
489 }
EcalDAQTowerStatusMap EcalDAQTowerStatus
EcalIntercalibConstantMCMap EcalIntercalibConstantsMC
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
tuple recordName
Definition: align_cfg.py:66
EcalTimeDependentCorrections EcalLinearCorrections
std::vector< double > EBG6SamplesCorrelation
std::vector< float > EBTimeCorrAmplitudeBins
std::vector< float > EETimeCorrShiftBins
EcalDQMChannelStatusMap EcalDQMChannelStatus
EcalChannelStatusMap EcalChannelStatus
EcalGainRatioMap EcalGainRatios
EcalLaserAlphaMap EcalLaserAlphas
std::vector< float > EETimeCorrAmplitudeBins
EcalDCSTowerStatusMap EcalDCSTowerStatus
EcalDQMTowerStatusMap EcalDQMTowerStatus
bool isAvailable() const
Definition: Service.h:46
EcalTPGCrystalStatusMap EcalTPGCrystalStatus
tuple handle
Definition: patZpeak.py:22
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
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
EcalFunParams EcalClusterLocalContCorrParameters
EcalIntercalibConstantMap EcalIntercalibConstants
std::vector< double > EEG1SamplesCorrelation
EcalFunParams EcalClusterEnergyCorrectionParameters
tuple cout
Definition: gather_cfg.py:145
std::vector< double > EEG12SamplesCorrelation
std::vector< double > EEG6SamplesCorrelation
bool EcalDBCopy::shouldCopy ( const edm::EventSetup evtSetup,
std::string  container 
)
private

Definition at line 127 of file EcalDBCopy.cc.

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

Referenced by analyze().

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