PhysicsTools
UtilAlgos
plugins
PlottingDevice.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: PlottingDevice
4
// Class: PlottingDevice
5
//
13
//
14
// Original Author: Jean-Roch Vlimant
15
// Created: Thu May 15 14:37:59 CEST 2008
16
//
17
//
18
19
// system include files
20
#include <memory>
21
22
// user include files
23
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
24
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
25
26
#include "
FWCore/Framework/interface/Event.h
"
27
#include "
FWCore/Framework/interface/MakerMacros.h
"
28
29
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
30
//
31
// class decleration
32
//
33
34
#include "
PhysicsTools/UtilAlgos/interface/Plotter.h
"
35
#include "
PhysicsTools/UtilAlgos/interface/VariableHelper.h
"
36
37
class
PlottingDevice
:
public
edm::EDAnalyzer
{
38
public
:
39
explicit
PlottingDevice
(
const
edm::ParameterSet
&);
40
~PlottingDevice
()
override
;
41
42
private
:
43
void
beginJob
()
override
;
44
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
45
void
endJob
()
override
;
46
47
// ----------member data ---------------------------
48
std::string
vHelperInstance_
;
49
std::string
plotDirectoryName_
;
50
std::unique_ptr<Plotter>
plotter_
;
51
};
52
53
//
54
// constants, enums and typedefs
55
//
56
57
//
58
// static data member definitions
59
//
60
61
//
62
// constructors and destructor
63
//
64
PlottingDevice::PlottingDevice
(
const
edm::ParameterSet
& iConfig) {
65
vHelperInstance_
= iConfig.
getParameter
<
std::string
>(
"@module_label"
);
66
plotDirectoryName_
=
"PlottingDevice"
;
67
68
//configure the inputtag distributor
69
if
(iConfig.
exists
(
"InputTags"
))
70
edm::Service<InputTagDistributorService>
()->init(
71
vHelperInstance_
, iConfig.
getParameter
<
edm::ParameterSet
>(
"InputTags"
),
consumesCollector
());
72
73
//configure the variable helper
74
edm::Service<VariableHelperService>
()->init(
75
vHelperInstance_
, iConfig.
getParameter
<
edm::ParameterSet
>(
"Variables"
),
consumesCollector
());
76
77
//configure the plotting device
78
edm::ParameterSet
plotPset
= iConfig.
getParameter
<
edm::ParameterSet
>(
"Plotter"
);
79
std::string
plotterName =
plotPset
.getParameter<
std::string
>(
"ComponentName"
);
80
plotter_
=
PlotterFactory::get
()->create(plotterName,
plotPset
);
81
}
82
83
PlottingDevice::~PlottingDevice
() {}
84
85
//
86
// member functions
87
//
88
89
// ------------ method called to for each event ------------
90
void
PlottingDevice::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
91
plotter_
->setDir(
plotDirectoryName_
);
92
93
plotter_
->fill(
plotDirectoryName_
,
iEvent
);
94
}
95
96
void
PlottingDevice::beginJob
() {}
97
void
PlottingDevice::endJob
() {}
98
99
//define this as a plug-in
100
DEFINE_FWK_MODULE
(
PlottingDevice
);
PlottingDevice::plotDirectoryName_
std::string plotDirectoryName_
Definition:
PlottingDevice.cc:49
PlottingDevice::plotter_
std::unique_ptr< Plotter > plotter_
Definition:
PlottingDevice.cc:50
Plotter.h
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition:
EDConsumerBase.cc:46
EDAnalyzer.h
PlottingDevice::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
PlottingDevice.cc:90
PlottingDevice::~PlottingDevice
~PlottingDevice() override
Definition:
PlottingDevice.cc:83
edm::EDAnalyzer
Definition:
EDAnalyzer.h:28
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet::exists
bool exists(std::string const ¶meterName) const
checks if a parameter exists
Definition:
ParameterSet.cc:681
PlottingDevice
Definition:
PlottingDevice.cc:37
edm::ParameterSet
Definition:
ParameterSet.h:47
Event.h
edm::Service
Definition:
Service.h:30
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup
Definition:
EventSetup.h:57
PlottingDevice::PlottingDevice
PlottingDevice(const edm::ParameterSet &)
Definition:
PlottingDevice.cc:64
get
#define get
PlottingDevice::beginJob
void beginJob() override
Definition:
PlottingDevice.cc:96
RecoTauValidation_cfi.plotPset
plotPset
Definition:
RecoTauValidation_cfi.py:217
PlottingDevice::vHelperInstance_
std::string vHelperInstance_
Definition:
PlottingDevice.cc:48
PlottingDevice::endJob
void endJob() override
Definition:
PlottingDevice.cc:97
Frameworkfwd.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
VariableHelper.h
ParameterSet.h
edm::Event
Definition:
Event.h:73
Generated for CMSSW Reference Manual by
1.8.16