src
L1TriggerConfig
Utilities
src
L1TMuonBarrelParamsWriter.cc
Go to the documentation of this file.
1
#include <iomanip>
2
#include <iostream>
3
4
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
5
#include "
FWCore/Framework/interface/Event.h
"
6
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
7
8
#include "
FWCore/Framework/interface/EventSetup.h
"
9
#include "
FWCore/Framework/interface/ESHandle.h
"
10
11
#include "
CondFormats/DataRecord/interface/L1TMuonBarrelParamsO2ORcd.h
"
12
#include "
CondFormats/DataRecord/interface/L1TMuonBarrelParamsRcd.h
"
13
#include "
CondFormats/L1TObjects/interface/L1TMuonBarrelParams.h
"
14
#include "
CondFormats/DataRecord/interface/L1TMuonBarrelKalmanParamsRcd.h
"
15
#include "
CondFormats/L1TObjects/interface/L1TMuonBarrelKalmanParams.h
"
16
17
#include "
FWCore/ServiceRegistry/interface/Service.h
"
18
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
19
20
class
L1TMuonBarrelParamsWriter
:
public
edm::EDAnalyzer
{
21
private
:
22
bool
isO2Opayload
;
23
24
public
:
25
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
26
27
explicit
L1TMuonBarrelParamsWriter
(
const
edm::ParameterSet
&
pset
) :
edm
::
EDAnalyzer
() {
28
isO2Opayload
=
pset
.getUntrackedParameter<
bool
>(
"isO2Opayload"
,
false
);
29
}
30
~L1TMuonBarrelParamsWriter
(
void
)
override
{}
31
};
32
33
void
L1TMuonBarrelParamsWriter::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& evSetup) {
34
edm::ESHandle<L1TMuonBarrelParams>
handle1;
35
edm::ESHandle<L1TMuonBarrelKalmanParams>
handle2;
36
37
if
(
isO2Opayload
)
38
evSetup.
get
<
L1TMuonBarrelParamsO2ORcd
>().
get
(handle1);
39
else
{
40
evSetup.
get
<
L1TMuonBarrelParamsRcd
>().
get
(handle1);
41
evSetup.
get
<
L1TMuonBarrelKalmanParamsRcd
>().
get
(handle2);
42
}
43
44
std::shared_ptr<L1TMuonBarrelParams> ptr1(
new
L1TMuonBarrelParams
(*(handle1.
product
())));
45
std::shared_ptr<L1TMuonBarrelKalmanParams> ptr2(
new
L1TMuonBarrelKalmanParams
(*(handle2.
product
())));
46
47
edm::Service<cond::service::PoolDBOutputService>
poolDb;
48
if
(poolDb.isAvailable()) {
49
cond::Time_t
firstSinceTime = poolDb->
beginOfTime
();
50
poolDb->writeOneIOV(*ptr1, firstSinceTime, (
isO2Opayload
?
"L1TMuonBarrelParamsO2ORcd"
:
"L1TMuonBarrelParamsRcd"
));
51
if
(not
isO2Opayload
)
52
poolDb->writeOneIOV(*ptr2, firstSinceTime, (
"L1TMuonBarrelKalmanParamsRcd"
));
53
}
54
}
55
56
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
57
#include "
FWCore/Framework/interface/MakerMacros.h
"
58
#include "
FWCore/Framework/interface/ModuleFactory.h
"
59
60
DEFINE_FWK_MODULE
(
L1TMuonBarrelParamsWriter
);
edm::EDAnalyzer::EDAnalyzer
EDAnalyzer()
Definition:
EDAnalyzer.cc:28
edm::Service< cond::service::PoolDBOutputService >
L1TMuonBarrelParamsRcd
Definition:
L1TMuonBarrelParamsRcd.h:14
L1TMuonBarrelKalmanParamsRcd.h
L1TMuonBarrelParamsWriter::L1TMuonBarrelParamsWriter
L1TMuonBarrelParamsWriter(const edm::ParameterSet &pset)
Definition:
L1TMuonBarrelParamsWriter.cc:27
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
Event.h
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition:
PoolDBOutputService.cc:258
L1TMuonBarrelParams
Definition:
L1TMuonBarrelParams.h:23
MakerMacros.h
EventSetup.h
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
L1TMuonBarrelParams.h
L1TMuonBarrelParamsWriter::~L1TMuonBarrelParamsWriter
~L1TMuonBarrelParamsWriter(void) override
Definition:
L1TMuonBarrelParamsWriter.cc:30
ParameterSet.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
cond::Time_t
unsigned long long Time_t
Definition:
Time.h:14
PoolDBOutputService.h
L1TMuonBarrelParamsO2ORcd.h
edm::ESHandle
Definition:
DTSurvey.h:22
ESHandle.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:82
Service.h
L1TMuonBarrelKalmanParamsRcd
Definition:
L1TMuonBarrelKalmanParamsRcd.h:13
edm::EventSetup
Definition:
EventSetup.h:59
edm::EDAnalyzer
Definition:
EDAnalyzer.h:35
EDAnalyzer.h
L1TMuonBarrelKalmanParams
Definition:
L1TMuonBarrelKalmanParams.h:21
L1TMuonBarrelParamsO2ORcd
Definition:
L1TMuonBarrelParamsO2ORcd.h:15
edm
HLT enums.
Definition:
AlignableModifier.h:19
L1TMuonBarrelParamsWriter::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
L1TMuonBarrelParamsWriter.cc:33
edm::ParameterSet
Definition:
ParameterSet.h:48
ModuleFactory.h
edm::Event
Definition:
Event.h:73
L1TMuonBarrelParamsWriter
Definition:
L1TMuonBarrelParamsWriter.cc:20
ModuleDef.h
L1TMuonBarrelParamsRcd.h
L1TMuonBarrelParamsWriter::isO2Opayload
bool isO2Opayload
Definition:
L1TMuonBarrelParamsWriter.cc:22
L1TMuonBarrelKalmanParams.h
Generated for CMSSW Reference Manual by
1.8.14