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 // $Id: SiStripDelayESProducer.cc,v 1.1 2010/10/26 14:55:59 demattia Exp $
17 //
18 //
19 
20 
21 
23 
24 
25 
27  pset_(iConfig),
28  toGet(iConfig.getParameter<Parameters>("ListOfRecordToMerge"))
29 {
30  setWhatProduced(this);
31 
32  edm::LogInfo("SiStripDelayESProducer") << "ctor" << std::endl;
33 
34  delay.reset(new SiStripDelay());
35 }
36 
37 
38 boost::shared_ptr<SiStripDelay> SiStripDelayESProducer::produce(const SiStripDelayRcd& iRecord)
39 {
40  edm::LogInfo("SiStripDelayESProducer") << "produce called" << std::endl;
41 
42  delay->clear();
43 
45 
46  std::string label;
47  std::string recordName;
48  int sumSign = 0;
49 
50  for( Parameters::iterator itToGet = toGet.begin(); itToGet != toGet.end(); ++itToGet ) {
51  recordName = itToGet->getParameter<std::string>("Record");
52  label = itToGet->getParameter<std::string>("Label");
53  sumSign = itToGet->getParameter<int>("SumSign");
54 
55  edm::LogInfo("SiStripDelayESProducer") << "[SiStripDelayESProducer::produce] Getting data from record " << recordName << " with label " << label << std::endl;
56 
57  if( recordName=="SiStripBaseDelayRcd" ) {
58  iRecord.getRecord<SiStripBaseDelayRcd>().get(label, baseDelay);
59  delay->fillNewDelay( *(baseDelay.product()), sumSign, std::make_pair(recordName, label) );
60  } else {
61  edm::LogError("SiStripDelayESProducer") << "[SiStripDelayESProducer::produce] Skipping the requested data for unexisting record " << recordName << " with tag " << label << std::endl;
62  continue;
63  }
64  }
65 
66  delay->makeDelay();
67 
68  return delay;
69 }
70 
boost::shared_ptr< SiStripDelay > delay
SiStripDelayESProducer(const edm::ParameterSet &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
T const * product() const
Definition: ESHandle.h:62
boost::shared_ptr< SiStripDelay > produce(const SiStripDelayRcd &)
std::vector< edm::ParameterSet > Parameters