test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripDelayESProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiStripDelayESProducer
4 // Class: SiStripDelayESProducer
5 //
13 //
14 // Original Author: M. De Mattia
15 // Created: 26/10/2010
16 //
17 //
18 
19 
20 
22 
23 
24 
26  pset_(iConfig),
27  toGet(iConfig.getParameter<Parameters>("ListOfRecordToMerge"))
28 {
29  setWhatProduced(this);
30 
31  edm::LogInfo("SiStripDelayESProducer") << "ctor" << std::endl;
32 
33  delay.reset(new SiStripDelay());
34 }
35 
36 
37 boost::shared_ptr<SiStripDelay> SiStripDelayESProducer::produce(const SiStripDelayRcd& iRecord)
38 {
39  edm::LogInfo("SiStripDelayESProducer") << "produce called" << std::endl;
40 
41  delay->clear();
42 
44 
47  int sumSign = 0;
48 
49  for( Parameters::iterator itToGet = toGet.begin(); itToGet != toGet.end(); ++itToGet ) {
50  recordName = itToGet->getParameter<std::string>("Record");
51  label = itToGet->getParameter<std::string>("Label");
52  sumSign = itToGet->getParameter<int>("SumSign");
53 
54  edm::LogInfo("SiStripDelayESProducer") << "[SiStripDelayESProducer::produce] Getting data from record " << recordName << " with label " << label << std::endl;
55 
56  if( recordName=="SiStripBaseDelayRcd" ) {
57  iRecord.getRecord<SiStripBaseDelayRcd>().get(label, baseDelay);
58  delay->fillNewDelay( *(baseDelay.product()), sumSign, std::make_pair(recordName, label) );
59  } else {
60  edm::LogError("SiStripDelayESProducer") << "[SiStripDelayESProducer::produce] Skipping the requested data for unexisting record " << recordName << " with tag " << label << std::endl;
61  continue;
62  }
63  }
64 
65  delay->makeDelay();
66 
67  return delay;
68 }
69 
boost::shared_ptr< SiStripDelay > delay
SiStripDelayESProducer(const edm::ParameterSet &)
tuple recordName
Definition: align_cfg.py:66
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
T const * product() const
Definition: ESHandle.h:86
boost::shared_ptr< SiStripDelay > produce(const SiStripDelayRcd &)
std::vector< edm::ParameterSet > Parameters