CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
25 
27 
29 public:
32 
34  const edm::IOVSyncValue& iov,
35  edm::ValidityInterval& iValidity) override;
36 
37  typedef std::unique_ptr<SiStripBaseDelay> ReturnType;
39 
40 private:
41  uint16_t m_coarseDelay;
42  uint16_t m_fineDelay;
44 };
45 
47  setWhatProduced(this);
48  findingRecord<SiStripBaseDelayRcd>();
49 
50  m_coarseDelay = iConfig.getParameter<uint32_t>("CoarseDelay");
51  m_fineDelay = iConfig.getParameter<uint32_t>("FineDelay");
53 }
54 
56 
58  const edm::IOVSyncValue& iov,
59  edm::ValidityInterval& iValidity) {
60  iValidity = edm::ValidityInterval{iov.beginOfTime(), iov.endOfTime()};
61 }
62 
63 // ------------ method called to produce the data ------------
65  using namespace edm::es;
66 
67  auto baseDelay = std::make_unique<SiStripBaseDelay>();
68 
69  const auto& detInfos = m_detInfo.getAllData();
70  if (detInfos.empty()) {
71  edm::LogError("SiStripBaseDelayGenerator") << "Error: detInfo map is empty.";
72  }
73  for (const auto& elm : detInfos) {
74  baseDelay->put(elm.first, m_coarseDelay, m_fineDelay);
75  }
76 
77  return baseDelay;
78 }
79 
80 //define this as a plug-in
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
std::unique_ptr< SiStripBaseDelay > ReturnType
Log< level::Error, false > LogError
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &iov, edm::ValidityInterval &iValidity) override
ReturnType produce(const SiStripBaseDelayRcd &)
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
SiStripDetInfo read(std::string filePath)
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:91
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const std::map< uint32_t, DetInfo > & getAllData() const noexcept
SiStripBaseDelayFakeESSource(const edm::ParameterSet &)
std::string fullPath() const
Definition: FileInPath.cc:161