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  SiStripDetInfoFileReader{iConfig.getParameter<edm::FileInPath>("SiStripDetInfoFile").fullPath()};
54 }
55 
57 
59  const edm::IOVSyncValue& iov,
60  edm::ValidityInterval& iValidity) {
61  iValidity = edm::ValidityInterval{iov.beginOfTime(), iov.endOfTime()};
62 }
63 
64 // ------------ method called to produce the data ------------
66  using namespace edm::es;
67 
68  auto baseDelay = std::make_unique<SiStripBaseDelay>();
69 
70  const auto& detInfos = m_detInfoFileReader.getAllData();
71  if (detInfos.empty()) {
72  edm::LogError("SiStripBaseDelayGenerator") << "Error: detInfo map is empty.";
73  }
74  for (const auto& elm : m_detInfoFileReader.getAllData()) {
75  baseDelay->put(elm.first, m_coarseDelay, m_fineDelay);
76  }
77 
78  return baseDelay;
79 }
80 
81 //define this as a plug-in
MessageLogger.h
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
SiStripBaseDelayFakeESSource::m_detInfoFileReader
SiStripDetInfoFileReader m_detInfoFileReader
Definition: SiStripBaseDelayFakeESSource.cc:43
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:56
SiStripDetInfoFileReader
Definition: SiStripDetInfoFileReader.h:30
edm::EventSetupRecordIntervalFinder
Definition: EventSetupRecordIntervalFinder.h:33
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
SiStripBaseDelayFakeESSource::SiStripBaseDelayFakeESSource
SiStripBaseDelayFakeESSource(const edm::ParameterSet &)
Definition: SiStripBaseDelayFakeESSource.cc:46
edm::FileInPath
Definition: FileInPath.h:64
SiStripBaseDelayFakeESSource
Definition: SiStripBaseDelayFakeESSource.cc:28
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
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
SiStripDetInfoFileReader::getAllData
const std::map< uint32_t, DetInfo > & getAllData() const
Definition: SiStripDetInfoFileReader.h:58
SiStripBaseDelayRcd
Definition: SiStripCondDataRecords.h:38
SiStripBaseDelayFakeESSource::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &iov, edm::ValidityInterval &iValidity) override
Definition: SiStripBaseDelayFakeESSource.cc:58
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:65
SiStripBaseDelayFakeESSource::m_coarseDelay
uint16_t m_coarseDelay
Definition: SiStripBaseDelayFakeESSource.cc:41
edm::ESProducer
Definition: ESProducer.h:104
ParameterSet.h