src
L1TriggerConfig
Utilities
src
L1TMuonGlobalParamsWriter.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/L1TMuonGlobalParamsO2ORcd.h
"
12
#include "
CondFormats/DataRecord/interface/L1TMuonGlobalParamsRcd.h
"
13
#include "
CondFormats/L1TObjects/interface/L1TMuonGlobalParams.h
"
14
15
#include "
FWCore/ServiceRegistry/interface/Service.h
"
16
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
17
18
class
L1TMuonGlobalParamsWriter
:
public
edm::EDAnalyzer
{
19
private
:
20
bool
isO2Opayload
;
21
22
public
:
23
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
24
25
explicit
L1TMuonGlobalParamsWriter
(
const
edm::ParameterSet
&
pset
) :
edm
::
EDAnalyzer
() {
26
isO2Opayload
=
pset
.getUntrackedParameter<
bool
>(
"isO2Opayload"
,
false
);
27
}
28
~L1TMuonGlobalParamsWriter
(
void
)
override
{}
29
};
30
31
void
L1TMuonGlobalParamsWriter::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& evSetup) {
32
edm::ESHandle<L1TMuonGlobalParams>
handle1;
33
34
if
(
isO2Opayload
)
35
evSetup.
get
<
L1TMuonGlobalParamsO2ORcd
>().
get
(handle1);
36
else
37
evSetup.
get
<
L1TMuonGlobalParamsRcd
>().
get
(handle1);
38
39
std::shared_ptr<L1TMuonGlobalParams> ptr1(
new
L1TMuonGlobalParams
(*(handle1.
product
())));
40
41
edm::Service<cond::service::PoolDBOutputService>
poolDb;
42
if
(poolDb.isAvailable()) {
43
cond::Time_t
firstSinceTime = poolDb->
beginOfTime
();
44
poolDb->writeOneIOV(*ptr1, firstSinceTime, (
isO2Opayload
?
"L1TMuonGlobalParamsO2ORcd"
:
"L1TMuonGlobalParamsRcd"
));
45
}
46
}
47
48
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
49
#include "
FWCore/Framework/interface/MakerMacros.h
"
50
#include "
FWCore/Framework/interface/ModuleFactory.h
"
51
52
DEFINE_FWK_MODULE
(
L1TMuonGlobalParamsWriter
);
L1TMuonGlobalParamsWriter::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
L1TMuonGlobalParamsWriter.cc:31
L1TMuonGlobalParamsWriter
Definition:
L1TMuonGlobalParamsWriter.cc:18
edm::EDAnalyzer::EDAnalyzer
EDAnalyzer()
Definition:
EDAnalyzer.cc:28
edm::Service< cond::service::PoolDBOutputService >
L1TMuonGlobalParams
Definition:
L1TMuonGlobalParams.h:21
L1TMuonGlobalParamsRcd
Definition:
L1TMuonGlobalParamsRcd.h:23
L1TMuonGlobalParamsWriter::isO2Opayload
bool isO2Opayload
Definition:
L1TMuonGlobalParamsWriter.cc:20
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
MakerMacros.h
EventSetup.h
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
L1TMuonGlobalParamsWriter::~L1TMuonGlobalParamsWriter
~L1TMuonGlobalParamsWriter(void) override
Definition:
L1TMuonGlobalParamsWriter.cc:28
ParameterSet.h
L1TMuonGlobalParamsRcd.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
edm::ESHandle
Definition:
DTSurvey.h:22
ESHandle.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:82
Service.h
edm::EventSetup
Definition:
EventSetup.h:59
L1TMuonGlobalParamsWriter::L1TMuonGlobalParamsWriter
L1TMuonGlobalParamsWriter(const edm::ParameterSet &pset)
Definition:
L1TMuonGlobalParamsWriter.cc:25
edm::EDAnalyzer
Definition:
EDAnalyzer.h:35
EDAnalyzer.h
L1TMuonGlobalParams.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
L1TMuonGlobalParamsO2ORcd
Definition:
L1TMuonGlobalParamsO2ORcd.h:26
L1TMuonGlobalParamsO2ORcd.h
edm::ParameterSet
Definition:
ParameterSet.h:48
ModuleFactory.h
edm::Event
Definition:
Event.h:73
ModuleDef.h
Generated for CMSSW Reference Manual by
1.8.14