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->writeOne(
51
ptr1.get(), firstSinceTime, (
isO2Opayload
?
"L1TMuonBarrelParamsO2ORcd"
:
"L1TMuonBarrelParamsRcd"
));
52
if
(not
isO2Opayload
)
53
poolDb->writeOne(ptr2.get(), firstSinceTime, (
"L1TMuonBarrelKalmanParamsRcd"
));
54
}
55
}
56
57
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
58
#include "
FWCore/Framework/interface/MakerMacros.h
"
59
#include "
FWCore/Framework/interface/ModuleFactory.h
"
60
61
DEFINE_FWK_MODULE
(
L1TMuonBarrelParamsWriter
);
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
L1TMuonBarrelParamsWriter::L1TMuonBarrelParamsWriter
L1TMuonBarrelParamsWriter(const edm::ParameterSet &pset)
Definition:
L1TMuonBarrelParamsWriter.cc:27
L1TMuonBarrelParamsWriter::isO2Opayload
bool isO2Opayload
Definition:
L1TMuonBarrelParamsWriter.cc:22
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition:
PoolDBOutputService.cc:215
ESHandle.h
L1TMuonBarrelParamsO2ORcd.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
L1TMuonBarrelParams.h
edm::EDAnalyzer::EDAnalyzer
EDAnalyzer()
Definition:
EDAnalyzer.cc:28
EDAnalyzer.h
L1TMuonBarrelParamsO2ORcd
Definition:
L1TMuonBarrelParamsO2ORcd.h:15
L1TMuonBarrelParamsWriter::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
L1TMuonBarrelParamsWriter.cc:33
edm::EDAnalyzer
Definition:
EDAnalyzer.h:28
L1TMuonBarrelKalmanParams
Definition:
L1TMuonBarrelKalmanParams.h:21
MakerMacros.h
PoolDBOutputService.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:87
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
Service.h
L1TMuonBarrelParamsWriter
Definition:
L1TMuonBarrelParamsWriter.cc:20
edm::ESHandle< L1TMuonBarrelParams >
L1TMuonBarrelKalmanParams.h
L1TMuonBarrelParamsRcd.h
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
cond::Time_t
unsigned long long Time_t
Definition:
Time.h:14
ModuleDef.h
edm::Service< cond::service::PoolDBOutputService >
iEvent
int iEvent
Definition:
GenABIO.cc:224
L1TMuonBarrelKalmanParamsRcd
Definition:
L1TMuonBarrelKalmanParamsRcd.h:13
edm::EventSetup
Definition:
EventSetup.h:58
get
#define get
ModuleFactory.h
L1TMuonBarrelKalmanParamsRcd.h
L1TMuonBarrelParamsWriter::~L1TMuonBarrelParamsWriter
~L1TMuonBarrelParamsWriter(void) override
Definition:
L1TMuonBarrelParamsWriter.cc:30
EventSetup.h
L1TMuonBarrelParams
Definition:
L1TMuonBarrelParams.h:23
ParameterSet.h
edm::Event
Definition:
Event.h:73
L1TMuonBarrelParamsRcd
Definition:
L1TMuonBarrelParamsRcd.h:14
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
Generated for CMSSW Reference Manual by
1.8.16