src
L1TriggerConfig
Utilities
src
L1MenuWriter.cc
Go to the documentation of this file.
1
#include <iomanip>
2
#include <iostream>
3
4
#include "
FWCore/Framework/interface/one/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/L1TObjects/interface/L1TUtmTriggerMenu.h
"
13
#include "
CondFormats/DataRecord/interface/L1TUtmTriggerMenuRcd.h
"
14
#include "
CondFormats/DataRecord/interface/L1TUtmTriggerMenuO2ORcd.h
"
15
16
#include "
FWCore/ServiceRegistry/interface/Service.h
"
17
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
18
19
class
L1MenuWriter
:
public
edm::one::EDAnalyzer
<> {
20
private
:
21
bool
isO2Opayload
;
22
23
public
:
24
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
25
const
edm::ESGetToken<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd>
l1GtMenuToken_
;
26
const
edm::ESGetToken<L1TUtmTriggerMenu, L1TUtmTriggerMenuO2ORcd>
l1GtMenuO2OToken_
;
27
28
explicit
L1MenuWriter
(
const
edm::ParameterSet
&
pset
)
29
:
edm
::
one
::
EDAnalyzer
<>(),
30
l1GtMenuToken_
(
esConsumes
<
L1TUtmTriggerMenu
,
L1TUtmTriggerMenuRcd
>()),
31
l1GtMenuO2OToken_
(
esConsumes
<
L1TUtmTriggerMenu
,
L1TUtmTriggerMenuO2ORcd
>()) {
32
isO2Opayload
=
pset
.getUntrackedParameter<
bool
>(
"isO2Opayload"
,
false
);
33
}
34
~L1MenuWriter
(
void
)
override
=
default
;
35
};
36
37
void
L1MenuWriter::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& evSetup) {
38
edm::ESHandle<L1TUtmTriggerMenu>
handle1;
39
40
if
(
isO2Opayload
)
41
handle1 = evSetup.
getHandle
(
l1GtMenuO2OToken_
);
42
else
43
handle1 = evSetup.
getHandle
(
l1GtMenuToken_
);
44
45
std::shared_ptr<L1TUtmTriggerMenu> ptr1(
new
L1TUtmTriggerMenu
(*(handle1.
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
?
"L1TUtmTriggerMenuO2ORcd"
:
"L1TUtmTriggerMenuRcd"
));
51
}
52
}
53
54
#include "
FWCore/PluginManager/interface/ModuleDef.h
"
55
#include "
FWCore/Framework/interface/MakerMacros.h
"
56
#include "
FWCore/Framework/interface/ModuleFactory.h
"
57
58
DEFINE_FWK_MODULE
(
L1MenuWriter
);
edm::one::EDAnalyzer<>::EDAnalyzer
EDAnalyzer()=default
edm::Service< cond::service::PoolDBOutputService >
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
L1TUtmTriggerMenuO2ORcd.h
one
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
L1MenuWriter::L1MenuWriter
L1MenuWriter(const edm::ParameterSet &pset)
Definition:
L1MenuWriter.cc:28
L1MenuWriter::isO2Opayload
bool isO2Opayload
Definition:
L1MenuWriter.cc:21
L1MenuWriter::~L1MenuWriter
~L1MenuWriter(void) override=default
L1MenuWriter::l1GtMenuToken_
const edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > l1GtMenuToken_
Definition:
L1MenuWriter.cc:25
ParameterSet.h
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition:
EDConsumerBase.h:207
L1TUtmTriggerMenuRcd.h
edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd >
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
L1TUtmTriggerMenuRcd
Definition:
L1TUtmTriggerMenuRcd.h:11
edm::ESHandle
Definition:
DTSurvey.h:22
ESHandle.h
Service.h
edm::EventSetup
Definition:
EventSetup.h:59
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition:
EventSetup.h:151
L1MenuWriter
Definition:
L1MenuWriter.cc:19
L1TUtmTriggerMenu.h
L1TUtmTriggerMenuO2ORcd
Definition:
L1TUtmTriggerMenuO2ORcd.h:17
L1MenuWriter::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
L1MenuWriter.cc:37
L1MenuWriter::l1GtMenuO2OToken_
const edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuO2ORcd > l1GtMenuO2OToken_
Definition:
L1MenuWriter.cc:26
EDAnalyzer.h
edm
HLT enums.
Definition:
AlignableModifier.h:19
L1TUtmTriggerMenu
Definition:
L1TUtmTriggerMenu.h:25
edm::ParameterSet
Definition:
ParameterSet.h:47
ModuleFactory.h
edm::Event
Definition:
Event.h:73
ModuleDef.h
edm::one::EDAnalyzer
Definition:
EDAnalyzer.h:30
Generated for CMSSW Reference Manual by
1.8.14