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->writeOne(
45
ptr1.get(), firstSinceTime, (
isO2Opayload
?
"L1TMuonGlobalParamsO2ORcd"
:
"L1TMuonGlobalParamsRcd"
));
46
}
47
}
48
49
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
50
#include "
FWCore/Framework/interface/MakerMacros.h
"
51
#include "
FWCore/Framework/interface/ModuleFactory.h
"
52
53
DEFINE_FWK_MODULE
(
L1TMuonGlobalParamsWriter
);
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
L1TMuonGlobalParamsWriter::L1TMuonGlobalParamsWriter
L1TMuonGlobalParamsWriter(const edm::ParameterSet &pset)
Definition:
L1TMuonGlobalParamsWriter.cc:25
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition:
PoolDBOutputService.cc:187
ESHandle.h
L1TMuonGlobalParamsWriter::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
L1TMuonGlobalParamsWriter.cc:31
edm
HLT enums.
Definition:
AlignableModifier.h:19
L1TMuonGlobalParamsWriter
Definition:
L1TMuonGlobalParamsWriter.cc:18
L1TMuonGlobalParams
Definition:
L1TMuonGlobalParams.h:21
edm::EDAnalyzer::EDAnalyzer
EDAnalyzer()
Definition:
EDAnalyzer.cc:27
EDAnalyzer.h
edm::EDAnalyzer
Definition:
EDAnalyzer.h:28
MakerMacros.h
PoolDBOutputService.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:80
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
Service.h
L1TMuonGlobalParamsWriter::~L1TMuonGlobalParamsWriter
~L1TMuonGlobalParamsWriter(void) override
Definition:
L1TMuonGlobalParamsWriter.cc:28
edm::ESHandle
Definition:
DTSurvey.h:22
L1TMuonGlobalParamsO2ORcd.h
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
L1TMuonGlobalParams.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
edm::EventSetup
Definition:
EventSetup.h:57
L1TMuonGlobalParamsWriter::isO2Opayload
bool isO2Opayload
Definition:
L1TMuonGlobalParamsWriter.cc:20
get
#define get
L1TMuonGlobalParamsRcd
Definition:
L1TMuonGlobalParamsRcd.h:23
ModuleFactory.h
L1TMuonGlobalParamsO2ORcd
Definition:
L1TMuonGlobalParamsO2ORcd.h:26
EventSetup.h
ParameterSet.h
edm::Event
Definition:
Event.h:73
L1TMuonGlobalParamsRcd.h
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
Generated for CMSSW Reference Manual by
1.8.16