CMS 3D CMS Logo

SiStripBaseDelayFakeESSource.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CalibTracker/SiStripESProducers
4 // Class: SiStripBaseDelayFakeESSource
5 //
14 // system include files
15 #include <memory>
16 
17 // user include files
20 
24 
26 public:
29 
31 
32  typedef std::shared_ptr<SiStripBaseDelay> ReturnType;
33  ReturnType produce(const SiStripBaseDelayRcd&);
34 
35 private:
36  uint16_t m_coarseDelay;
37  uint16_t m_fineDelay;
39 };
40 
43 
45 {
46  setWhatProduced(this);
47  findingRecord<SiStripBaseDelayRcd>();
48 
49  m_coarseDelay = iConfig.getParameter<uint32_t>("CoarseDelay");
50  m_fineDelay = iConfig.getParameter<uint32_t>("FineDelay");
51  m_file = iConfig.getParameter<edm::FileInPath>("file");
52 }
53 
55 
57 {
58  iValidity = edm::ValidityInterval{iov.beginOfTime(), iov.endOfTime()};
59 }
60 
61 // ------------ method called to produce the data ------------
64 {
65  using namespace edm::es;
66 
67  std::shared_ptr<SiStripBaseDelay> baseDelay{new SiStripBaseDelay};
68 
70 
71  const auto detInfos = reader.getAllData();
72  if ( detInfos.empty() ) {
73  edm::LogError("SiStripBaseDelayGenerator") << "Error: detInfo map is empty.";
74  }
75  for ( const auto& elm : reader.getAllData() ) {
76  baseDelay->put(elm.first, m_coarseDelay, m_fineDelay);
77  }
78 
79  return baseDelay;
80 }
81 
82 //define this as a plug-in
T getParameter(std::string const &) const
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
ReturnType produce(const SiStripBaseDelayRcd &)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
static const IOVSyncValue & beginOfTime()
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:92
std::shared_ptr< SiStripBaseDelay > ReturnType
SiStripBaseDelayFakeESSource(const edm::ParameterSet &)
std::string fullPath() const
Definition: FileInPath.cc:184
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &iov, edm::ValidityInterval &iValidity)