CalibTracker
SiStripESProducers
plugins
fake
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
18
#include "
FWCore/Framework/interface/ESProducer.h
"
19
#include "
FWCore/Framework/interface/EventSetupRecordIntervalFinder.h
"
20
21
#include "
CondFormats/SiStripObjects/interface/SiStripBaseDelay.h
"
22
#include "
CondFormats/DataRecord/interface/SiStripCondDataRecords.h
"
23
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
24
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
25
26
#include "
CalibTracker/SiStripCommon/interface/SiStripDetInfoFileReader.h
"
27
28
class
SiStripBaseDelayFakeESSource
:
public
edm::ESProducer
,
public
edm::EventSetupRecordIntervalFinder
{
29
public
:
30
SiStripBaseDelayFakeESSource
(
const
edm::ParameterSet
&);
31
~SiStripBaseDelayFakeESSource
()
override
;
32
33
void
setIntervalFor
(
const
edm::eventsetup::EventSetupRecordKey
&,
34
const
edm::IOVSyncValue
& iov,
35
edm::ValidityInterval
& iValidity)
override
;
36
37
typedef
std::unique_ptr<SiStripBaseDelay>
ReturnType
;
38
ReturnType
produce
(
const
SiStripBaseDelayRcd
&);
39
40
private
:
41
uint16_t
m_coarseDelay
;
42
uint16_t
m_fineDelay
;
43
SiStripDetInfoFileReader
m_detInfoFileReader
;
44
};
45
46
SiStripBaseDelayFakeESSource::SiStripBaseDelayFakeESSource
(
const
edm::ParameterSet
& iConfig) {
47
setWhatProduced
(
this
);
48
findingRecord<SiStripBaseDelayRcd>();
49
50
m_coarseDelay
= iConfig.
getParameter
<uint32_t>(
"CoarseDelay"
);
51
m_fineDelay
= iConfig.
getParameter
<uint32_t>(
"FineDelay"
);
52
m_detInfoFileReader
=
53
SiStripDetInfoFileReader
{iConfig.
getParameter
<
edm::FileInPath
>(
"SiStripDetInfoFile"
).
fullPath
()};
54
}
55
56
SiStripBaseDelayFakeESSource::~SiStripBaseDelayFakeESSource
() {}
57
58
void
SiStripBaseDelayFakeESSource::setIntervalFor
(
const
edm::eventsetup::EventSetupRecordKey
&,
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 ------------
65
SiStripBaseDelayFakeESSource::ReturnType
SiStripBaseDelayFakeESSource::produce
(
const
SiStripBaseDelayRcd
& iRecord) {
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
82
#include "
FWCore/Framework/interface/SourceFactory.h
"
83
DEFINE_FWK_EVENTSETUP_SOURCE
(
SiStripBaseDelayFakeESSource
);
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:138
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:36
edm::LogError
Definition:
MessageLogger.h:183
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::ParameterSet::getParameter
T getParameter(std::string const &) const
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
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:101
ParameterSet.h
Generated for CMSSW Reference Manual by
1.8.16