src
L1TriggerConfig
Utilities
src
L1TMuonEndCapParamsWriter.cc
Go to the documentation of this file.
1
#include <iomanip>
2
#include <iostream>
3
4
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
5
6
#include "
FWCore/Framework/interface/Event.h
"
7
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
8
9
#include "
FWCore/Framework/interface/EventSetup.h
"
10
#include "
FWCore/Framework/interface/ESHandle.h
"
11
12
#include "
CondFormats/DataRecord/interface/L1TMuonEndCapParamsO2ORcd.h
"
13
#include "
CondFormats/DataRecord/interface/L1TMuonEndCapParamsRcd.h
"
14
#include "
CondFormats/L1TObjects/interface/L1TMuonEndCapParams.h
"
15
16
#include "
FWCore/ServiceRegistry/interface/Service.h
"
17
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
18
19
class
L1TMuonEndCapParamsWriter
:
public
edm::EDAnalyzer
{
20
private
:
21
bool
isO2Opayload
;
22
23
public
:
24
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
25
26
explicit
L1TMuonEndCapParamsWriter
(
const
edm::ParameterSet
&
pset
) :
edm
::
EDAnalyzer
() {
27
isO2Opayload
=
pset
.getUntrackedParameter<
bool
>(
"isO2Opayload"
,
false
);
28
}
29
~L1TMuonEndCapParamsWriter
(
void
)
override
{}
30
};
31
32
void
L1TMuonEndCapParamsWriter::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& evSetup) {
33
edm::ESHandle<L1TMuonEndCapParams>
handle1;
34
35
if
(
isO2Opayload
)
36
evSetup.
get
<
L1TMuonEndCapParamsO2ORcd
>().
get
(handle1);
37
else
38
evSetup.
get
<
L1TMuonEndCapParamsRcd
>().
get
(handle1);
39
40
std::shared_ptr<L1TMuonEndCapParams> ptr1(
new
L1TMuonEndCapParams
(*(handle1.
product
())));
41
42
edm::Service<cond::service::PoolDBOutputService>
poolDb;
43
if
(poolDb.isAvailable()) {
44
cond::Time_t
firstSinceTime = poolDb->
beginOfTime
();
45
poolDb->writeOneIOV(*ptr1, firstSinceTime, (
isO2Opayload
?
"L1TMuonEndCapParamsO2ORcd"
:
"L1TMuonEndCapParamsRcd"
));
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
(
L1TMuonEndCapParamsWriter
);
L1TMuonEndCapParamsWriter::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
L1TMuonEndCapParamsWriter.cc:32
L1TMuonEndCapParamsWriter::~L1TMuonEndCapParamsWriter
~L1TMuonEndCapParamsWriter(void) override
Definition:
L1TMuonEndCapParamsWriter.cc:29
edm::EDAnalyzer::EDAnalyzer
EDAnalyzer()
Definition:
EDAnalyzer.cc:28
edm::Service< cond::service::PoolDBOutputService >
L1TMuonEndCapParamsRcd.h
L1TMuonEndCapParamsRcd
Definition:
L1TMuonEndCapParamsRcd.h:11
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
L1TMuonEndCapParams
Definition:
L1TMuonEndCapParams.h:15
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
L1TMuonEndCapParamsWriter::isO2Opayload
bool isO2Opayload
Definition:
L1TMuonEndCapParamsWriter.cc:21
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
edm::ESHandle< L1TMuonEndCapParams >
ESHandle.h
edm::EventSetup::get
T get() const
Definition:
EventSetup.h:82
Service.h
edm::EventSetup
Definition:
EventSetup.h:59
edm::EDAnalyzer
Definition:
EDAnalyzer.h:35
EDAnalyzer.h
L1TMuonEndCapParamsWriter
Definition:
L1TMuonEndCapParamsWriter.cc:19
L1TMuonEndCapParamsO2ORcd
Definition:
L1TMuonEndCapParamsO2ORcd.h:16
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::ParameterSet
Definition:
ParameterSet.h:47
ModuleFactory.h
L1TMuonEndCapParamsO2ORcd.h
L1TMuonEndCapParams.h
edm::Event
Definition:
Event.h:73
ModuleDef.h
L1TMuonEndCapParamsWriter::L1TMuonEndCapParamsWriter
L1TMuonEndCapParamsWriter(const edm::ParameterSet &pset)
Definition:
L1TMuonEndCapParamsWriter.cc:26
Generated for CMSSW Reference Manual by
1.8.14