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::unique_ptr<SiStripBaseDelay> ReturnType;
33  ReturnType produce(const SiStripBaseDelayRcd&);
34 
35 private:
36  uint16_t m_coarseDelay;
37  uint16_t m_fineDelay;
38 };
39 
42 
44 {
45  setWhatProduced(this);
46  findingRecord<SiStripBaseDelayRcd>();
47 
48  m_coarseDelay = iConfig.getParameter<uint32_t>("CoarseDelay");
49  m_fineDelay = iConfig.getParameter<uint32_t>("FineDelay");
50 }
51 
53 
55 {
56  iValidity = edm::ValidityInterval{iov.beginOfTime(), iov.endOfTime()};
57 }
58 
59 // ------------ method called to produce the data ------------
62 {
63  using namespace edm::es;
64 
65  auto baseDelay = std::make_unique<SiStripBaseDelay>();
66 
68  const auto& detInfos = reader->getAllData();
69  if ( detInfos.empty() ) {
70  edm::LogError("SiStripBaseDelayGenerator") << "Error: detInfo map is empty.";
71  }
72  for ( const auto& elm : reader->getAllData() ) {
73  baseDelay->put(elm.first, m_coarseDelay, m_fineDelay);
74  }
75 
76  return baseDelay;
77 }
78 
79 //define this as a plug-in
T getParameter(std::string const &) const
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
std::unique_ptr< SiStripBaseDelay > ReturnType
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &iov, edm::ValidityInterval &iValidity) override
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
SiStripBaseDelayFakeESSource(const edm::ParameterSet &)