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 
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
MessageLogger.h
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ValidityInterval
Definition: ValidityInterval.h:28
ESProducer.h
SiStripBaseDelayFakeESSource::~SiStripBaseDelayFakeESSource
~SiStripBaseDelayFakeESSource() override
Definition: SiStripBaseDelayFakeESSource.cc:55
edm::EventSetupRecordIntervalFinder
Definition: EventSetupRecordIntervalFinder.h:33
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
SiStripBaseDelayFakeESSource::SiStripBaseDelayFakeESSource
SiStripBaseDelayFakeESSource(const edm::ParameterSet &)
Definition: SiStripBaseDelayFakeESSource.cc:46
SiStripDetInfoFileReader::read
SiStripDetInfo read(std::string filePath)
Definition: SiStripDetInfoFileReader.cc:11
edm::FileInPath
Definition: FileInPath.h:61
SiStripBaseDelayFakeESSource
Definition: SiStripBaseDelayFakeESSource.cc:28
SiStripDetInfo::getAllData
const std::map< uint32_t, DetInfo > & getAllData() const noexcept
Definition: SiStripDetInfo.h:59
SiStripDetInfoFileReader.h
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
DEFINE_FWK_EVENTSETUP_SOURCE
#define DEFINE_FWK_EVENTSETUP_SOURCE(type)
Definition: SourceFactory.h:91
EventSetupRecordIntervalFinder.h
SourceFactory.h
SiStripBaseDelay.h
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripCondDataRecords.h
SiStripBaseDelayFakeESSource::m_detInfo
SiStripDetInfo m_detInfo
Definition: SiStripBaseDelayFakeESSource.cc:43
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
SiStripBaseDelayFakeESSource::m_fineDelay
uint16_t m_fineDelay
Definition: SiStripBaseDelayFakeESSource.cc:42
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
SiStripBaseDelayFakeESSource::ReturnType
std::unique_ptr< SiStripBaseDelay > ReturnType
Definition: SiStripBaseDelayFakeESSource.cc:37
SiStripBaseDelayRcd
Definition: SiStripCondDataRecords.h:38
SiStripBaseDelayFakeESSource::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &iov, edm::ValidityInterval &iValidity) override
Definition: SiStripBaseDelayFakeESSource.cc:57
edm::es
Definition: es_Label.h:33
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiStripBaseDelayFakeESSource::produce
ReturnType produce(const SiStripBaseDelayRcd &)
Definition: SiStripBaseDelayFakeESSource.cc:64
SiStripBaseDelayFakeESSource::m_coarseDelay
uint16_t m_coarseDelay
Definition: SiStripBaseDelayFakeESSource.cc:41
edm::ESProducer
Definition: ESProducer.h:104
SiStripDetInfo
Definition: SiStripDetInfo.h:29
ParameterSet.h
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:161