CondTools
CTPPS
plugins
WritePPSAlignmentConfig.cc
Go to the documentation of this file.
1
/****************************************************************************
2
* Author:
3
* Mateusz Kocot (mateuszkocot99@gmail.com)
4
****************************************************************************/
5
6
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
7
#include "
FWCore/Framework/interface/one/EDAnalyzer.h
"
8
#include "
FWCore/Framework/interface/Event.h
"
9
#include "
FWCore/Framework/interface/EventSetup.h
"
10
#include "
FWCore/Framework/interface/ESHandle.h
"
11
#include "
FWCore/Framework/interface/MakerMacros.h
"
12
13
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
14
#include "
FWCore/ServiceRegistry/interface/Service.h
"
15
16
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
17
18
#include "
CondFormats/PPSObjects/interface/PPSAlignmentConfig.h
"
19
#include "
CondFormats/DataRecord/interface/PPSAlignmentConfigRcd.h
"
20
21
#include <memory>
22
23
class
WritePPSAlignmentConfig
:
public
edm::one::EDAnalyzer
<> {
24
public
:
25
explicit
WritePPSAlignmentConfig
(
const
edm::ParameterSet
&);
26
27
private
:
28
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
29
30
edm::ESGetToken<PPSAlignmentConfig, PPSAlignmentConfigRcd>
esToken_
;
31
};
32
33
WritePPSAlignmentConfig::WritePPSAlignmentConfig
(
const
edm::ParameterSet
&iConfig)
34
: esToken_(
esConsumes
<
PPSAlignmentConfig
,
PPSAlignmentConfigRcd
>(
35
edm
::
ESInputTag
(
""
, iConfig.getParameter<
std
::
string
>(
"label"
)))) {}
36
37
void
WritePPSAlignmentConfig::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
&iSetup) {
38
// get the data
39
const
auto
&ppsAlignmentConfig = iSetup.
getData
(
esToken_
);
40
41
// store the data in a DB object
42
edm::Service<cond::service::PoolDBOutputService>
poolDbService;
43
if
(poolDbService.
isAvailable
()) {
44
poolDbService->
writeOne
(&ppsAlignmentConfig, poolDbService->
currentTime
(),
"PPSAlignmentConfigRcd"
);
45
}
else
{
46
throw
cms::Exception
(
"WritePPSAlignmentConfig"
) <<
"PoolDBService required."
;
47
}
48
}
49
50
//define this as a plug-in
51
DEFINE_FWK_MODULE
(
WritePPSAlignmentConfig
);
EDAnalyzer.h
ESHandle.h
ESInputTag
PPSAlignmentConfigRcd
Definition:
PPSAlignmentConfigRcd.h:13
edm
HLT enums.
Definition:
AlignableModifier.h:19
PPSAlignmentConfigRcd.h
PPSAlignmentConfig
Definition:
PPSAlignmentConfig.h:96
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
edm::Service::isAvailable
bool isAvailable() const
Definition:
Service.h:40
MakerMacros.h
PoolDBOutputService.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
Service.h
WritePPSAlignmentConfig::esToken_
edm::ESGetToken< PPSAlignmentConfig, PPSAlignmentConfigRcd > esToken_
Definition:
WritePPSAlignmentConfig.cc:31
WritePPSAlignmentConfig
Definition:
WritePPSAlignmentConfig.cc:22
WritePPSAlignmentConfig::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
WritePPSAlignmentConfig.cc:36
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
WritePPSAlignmentConfig::WritePPSAlignmentConfig
WritePPSAlignmentConfig(const edm::ParameterSet &)
Definition:
WritePPSAlignmentConfig.cc:32
edm::Service< cond::service::PoolDBOutputService >
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup
Definition:
EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESGetToken< PPSAlignmentConfig, PPSAlignmentConfigRcd >
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition:
EventSetup.h:127
std
Definition:
JetResolutionObject.h:76
Frameworkfwd.h
Exception
Definition:
hltDiff.cc:245
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition:
PoolDBOutputService.h:63
EventSetup.h
ParameterSet.h
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition:
DeDxTools.cc:283
edm::Event
Definition:
Event.h:73
PPSAlignmentConfig.h
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition:
PoolDBOutputService.cc:217
Generated for CMSSW Reference Manual by
1.8.16