CondTools
SiStrip
plugins
SiStripApvSimulationParametersBuilder.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/EventSetup.h
"
2
#include "
FWCore/Framework/interface/one/EDAnalyzer.h
"
3
#include "
CondFormats/DataRecord/interface/SiStripCondDataRecords.h
"
4
#include "
CondFormats/SiStripObjects/interface/SiStripApvSimulationParameters.h
"
5
#include "
CommonTools/ConditionDBWriter/interface/ConditionDBWriter.h
"
6
7
class
SiStripApvSimulationParametersBuilder
:
public
edm::one::EDAnalyzer
<> {
8
public
:
9
explicit
SiStripApvSimulationParametersBuilder
(
const
edm::ParameterSet
& iConfig) :
m_parametersToken
(
esConsumes
()) {}
10
~SiStripApvSimulationParametersBuilder
()
override
{}
11
12
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
13
14
private
:
15
edm::ESGetToken<SiStripApvSimulationParameters, SiStripApvSimulationParametersRcd>
m_parametersToken
;
16
};
17
18
void
SiStripApvSimulationParametersBuilder::analyze
(
const
edm::Event
&,
const
edm::EventSetup
& evtSetup) {
19
// copy; DB service needs non-const pointer but does not take ownership
20
auto
obj
= std::make_unique<SiStripApvSimulationParameters>(evtSetup.
getData
(
m_parametersToken
));
21
22
edm::Service<cond::service::PoolDBOutputService>
mydbservice;
23
if
(mydbservice.isAvailable()) {
24
if
(mydbservice->isNewTagRequest(
"SiStripApvSimulationParametersRcd"
)) {
25
mydbservice->
createNewIOV
<
SiStripApvSimulationParameters
>(
26
obj
.get(), mydbservice->beginOfTime(), mydbservice->endOfTime(),
"SiStripApvSimulationParametersRcd"
);
27
}
else
{
28
mydbservice->appendSinceTime<
SiStripApvSimulationParameters
>(
29
obj
.get(), mydbservice->currentTime(),
"SiStripApvSimulationParametersRcd"
);
30
}
31
}
else
{
32
edm::LogError
(
"SiStripApvSimulationParametersBuilder"
) <<
"Service is unavailable"
;
33
}
34
}
35
36
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
37
#include "
FWCore/Framework/interface/MakerMacros.h
"
38
DEFINE_FWK_MODULE
(
SiStripApvSimulationParametersBuilder
);
EDAnalyzer.h
SiStripApvSimulationParametersBuilder::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
SiStripApvSimulationParametersBuilder.cc:18
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition:
PoolDBOutputService.h:116
SiStripApvSimulationParametersBuilder
Definition:
SiStripApvSimulationParametersBuilder.cc:7
getGTfromDQMFile.obj
obj
Definition:
getGTfromDQMFile.py:32
SiStripApvSimulationParametersBuilder::~SiStripApvSimulationParametersBuilder
~SiStripApvSimulationParametersBuilder() override
Definition:
SiStripApvSimulationParametersBuilder.cc:10
edm::ParameterSet
Definition:
ParameterSet.h:47
SiStripCondDataRecords.h
ModuleDef.h
edm::Service< cond::service::PoolDBOutputService >
edm::EventSetup
Definition:
EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition:
MessageLogger.h:123
edm::ESGetToken< SiStripApvSimulationParameters, SiStripApvSimulationParametersRcd >
ConditionDBWriter.h
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition:
EventSetup.h:127
SiStripApvSimulationParametersBuilder::SiStripApvSimulationParametersBuilder
SiStripApvSimulationParametersBuilder(const edm::ParameterSet &iConfig)
Definition:
SiStripApvSimulationParametersBuilder.cc:9
SiStripApvSimulationParameters.h
EventSetup.h
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition:
EDConsumerBase.h:206
edm::Event
Definition:
Event.h:73
SiStripApvSimulationParameters
Definition:
SiStripApvSimulationParameters.h:17
SiStripApvSimulationParametersBuilder::m_parametersToken
edm::ESGetToken< SiStripApvSimulationParameters, SiStripApvSimulationParametersRcd > m_parametersToken
Definition:
SiStripApvSimulationParametersBuilder.cc:15
Generated for CMSSW Reference Manual by
1.8.16