L1TriggerConfig
Utilities
src
L1TGlobalPrescalesVetosWriter.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/L1TGlobalPrescalesVetosO2ORcd.h
"
12
#include "
CondFormats/DataRecord/interface/L1TGlobalPrescalesVetosRcd.h
"
13
#include "
CondFormats/L1TObjects/interface/L1TGlobalPrescalesVetos.h
"
14
15
#include "
FWCore/ServiceRegistry/interface/Service.h
"
16
#include "
CondCore/DBOutputService/interface/PoolDBOutputService.h
"
17
18
class
L1TGlobalPrescalesVetosWriter
:
public
edm::EDAnalyzer
{
19
private
:
20
bool
isO2Opayload
;
21
22
public
:
23
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
24
25
explicit
L1TGlobalPrescalesVetosWriter
(
const
edm::ParameterSet
&
pset
) :
edm
::
EDAnalyzer
() {
26
isO2Opayload
=
pset
.getUntrackedParameter<
bool
>(
"isO2Opayload"
,
false
);
27
}
28
~L1TGlobalPrescalesVetosWriter
(
void
)
override
{}
29
};
30
31
void
L1TGlobalPrescalesVetosWriter::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& evSetup) {
32
edm::ESHandle<L1TGlobalPrescalesVetos>
handle1;
33
34
if
(
isO2Opayload
)
35
evSetup.
get
<
L1TGlobalPrescalesVetosO2ORcd
>().
get
(handle1);
36
else
37
evSetup.
get
<
L1TGlobalPrescalesVetosRcd
>().
get
(handle1);
38
39
std::shared_ptr<L1TGlobalPrescalesVetos> ptr1(
new
L1TGlobalPrescalesVetos
(*(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
?
"L1TGlobalPrescalesVetosO2ORcd"
:
"L1TGlobalPrescalesVetosRcd"
));
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
(
L1TGlobalPrescalesVetosWriter
);
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
PrescalesVetos_cff.L1TGlobalPrescalesVetos
L1TGlobalPrescalesVetos
Definition:
PrescalesVetos_cff.py:14
L1TGlobalPrescalesVetosRcd
Definition:
L1TGlobalPrescalesVetosRcd.h:11
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition:
PoolDBOutputService.cc:215
ESHandle.h
L1TGlobalPrescalesVetosWriter::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
L1TGlobalPrescalesVetosWriter.cc:31
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::EDAnalyzer::EDAnalyzer
EDAnalyzer()
Definition:
EDAnalyzer.cc:28
EDAnalyzer.h
L1TGlobalPrescalesVetosWriter::isO2Opayload
bool isO2Opayload
Definition:
L1TGlobalPrescalesVetosWriter.cc:20
edm::EDAnalyzer
Definition:
EDAnalyzer.h:28
L1TGlobalPrescalesVetosRcd.h
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
edm::ESHandle
Definition:
DTSurvey.h:22
L1TGlobalPrescalesVetosO2ORcd
Definition:
L1TGlobalPrescalesVetosO2ORcd.h:13
L1TGlobalPrescalesVetosO2ORcd.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
edm::EventSetup
Definition:
EventSetup.h:58
get
#define get
L1TGlobalPrescalesVetos.h
ModuleFactory.h
EventSetup.h
L1TGlobalPrescalesVetosWriter::~L1TGlobalPrescalesVetosWriter
~L1TGlobalPrescalesVetosWriter(void) override
Definition:
L1TGlobalPrescalesVetosWriter.cc:28
L1TGlobalPrescalesVetosWriter
Definition:
L1TGlobalPrescalesVetosWriter.cc:18
ParameterSet.h
edm::Event
Definition:
Event.h:73
L1TGlobalPrescalesVetosWriter::L1TGlobalPrescalesVetosWriter
L1TGlobalPrescalesVetosWriter(const edm::ParameterSet &pset)
Definition:
L1TGlobalPrescalesVetosWriter.cc:25
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
Generated for CMSSW Reference Manual by
1.8.16