CMS 3D CMS Logo

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 }
34 
35 
36 std::unique_ptr<SiStripDelay> SiStripDelayESProducer::produce(const SiStripDelayRcd& iRecord)
37 {
38  edm::LogInfo("SiStripDelayESProducer") << "produce called" << std::endl;
39  auto delay = std::make_unique<SiStripDelay>();
40  delay->clear();
41 
43 
46  int sumSign = 0;
47 
48  for( Parameters::iterator itToGet = toGet.begin(); itToGet != toGet.end(); ++itToGet ) {
49  recordName = itToGet->getParameter<std::string>("Record");
50  label = itToGet->getParameter<std::string>("Label");
51  sumSign = itToGet->getParameter<int>("SumSign");
52 
53  edm::LogInfo("SiStripDelayESProducer") << "[SiStripDelayESProducer::produce] Getting data from record " << recordName << " with label " << label << std::endl;
54 
55  if( recordName=="SiStripBaseDelayRcd" ) {
56  iRecord.getRecord<SiStripBaseDelayRcd>().get(label, baseDelay);
57  delay->fillNewDelay( *(baseDelay.product()), sumSign, std::make_pair(recordName, label) );
58  } else {
59  edm::LogError("SiStripDelayESProducer") << "[SiStripDelayESProducer::produce] Skipping the requested data for unexisting record " << recordName << " with tag " << label << std::endl;
60  continue;
61  }
62  }
63 
64  delay->makeDelay();
65 
66  return delay;
67 }
68 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
SiStripDelayESProducer(const edm::ParameterSet &)
char const * label
std::unique_ptr< SiStripDelay > produce(const SiStripDelayRcd &)
T const * product() const
Definition: ESHandle.h:86
std::vector< edm::ParameterSet > Parameters