Main Page
Namespaces
Classes
Package Documentation
JetMETCorrections
Modules
plugins
QGLikelihoodDBReader.cc
Go to the documentation of this file.
1
#include <memory>
2
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
3
#include "
FWCore/Framework/interface/EDAnalyzer.h
"
4
#include "
FWCore/Framework/interface/Event.h
"
5
#include "
FWCore/Framework/interface/MakerMacros.h
"
6
#include "
FWCore/Framework/interface/EventSetup.h
"
7
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
8
#include "
FWCore/Framework/interface/ESHandle.h
"
9
#include "
CondFormats/JetMETObjects/interface/QGLikelihoodObject.h
"
10
#include "
JetMETCorrections/Objects/interface/JetCorrectionsRecord.h
"
11
#include "
CondFormats/DataRecord/interface/QGLikelihoodRcd.h
"
12
13
class
QGLikelihoodDBReader
:
public
edm::EDAnalyzer
{
14
public
:
15
explicit
QGLikelihoodDBReader
(
const
edm::ParameterSet
&);
16
~QGLikelihoodDBReader
(){};
17
18
private
:
19
virtual
void
beginJob
()
override
{};
20
virtual
void
analyze
(
const
edm::Event
&,
const
edm::EventSetup
&)
override
;
21
virtual
void
endJob
()
override
{};
22
23
std::string
mPayloadName
;
24
bool
mCreateTextFile
,
mPrintScreen
;
25
};
26
27
28
QGLikelihoodDBReader::QGLikelihoodDBReader
(
const
edm::ParameterSet
& iConfig){
29
mPayloadName
= iConfig.
getUntrackedParameter
<
std::string
>(
"payloadName"
);
30
mPrintScreen
= iConfig.
getUntrackedParameter
<
bool
>(
"printScreen"
);
31
mCreateTextFile
= iConfig.
getUntrackedParameter
<
bool
>(
"createTextFile"
);
32
}
33
34
35
void
QGLikelihoodDBReader::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup){
36
edm::LogInfo
(
"UserOutput"
) <<
"Inspecting QGLikelihood payload with label:"
<<
mPayloadName
<< std::endl;
37
edm::ESHandle<QGLikelihoodObject>
QGLParamsColl;
38
QGLikelihoodRcd
const
& rcdhandle = iSetup.
get
<
QGLikelihoodRcd
>();
39
rcdhandle.
get
(
mPayloadName
, QGLParamsColl);
40
41
edm::LogInfo
(
"UserOutput"
) <<
"Ranges in which the QGTagger could be applied:"
42
<<
" pt: "
<< QGLParamsColl->
qgValidRange
.
PtMin
<<
" --> "
<< QGLParamsColl->
qgValidRange
.
PtMax
43
<<
", eta: "
<< QGLParamsColl->
qgValidRange
.
EtaMin
<<
" --> "
<< QGLParamsColl->
qgValidRange
.
EtaMax
44
<<
", rho: "
<< QGLParamsColl->
qgValidRange
.
RhoMin
<<
" --> "
<< QGLParamsColl->
qgValidRange
.
RhoMax
<< std::endl;
45
46
std::vector<QGLikelihoodObject::Entry>
const
&
data
= QGLParamsColl->
data
;
47
edm::LogInfo
(
"UserOutput"
) <<
"There are "
<< data.size() <<
" entries (categories with associated PDF):"
<< std::endl;
48
for
(
auto
idata = data.begin(); idata != data.end(); ++idata){
49
int
varIndex = idata->category.VarIndex;
50
int
qgBin = idata->category.QGIndex;
51
double
etaMin
= idata->category.EtaMin;
52
double
etaMax
= idata->category.EtaMax;
53
double
rhoMin
= idata->category.RhoMin;
54
double
rhoMax
= idata->category.RhoMax;
55
double
ptMin
= idata->category.PtMin;
56
double
ptMax
= idata->category.PtMax;
57
58
char
buff[1000];
59
sprintf(buff,
"var=%1d, qg=%1d, ptMin=%8.2f, ptMax=%8.2f, etaMin=%3.1f, etaMax=%3.1f, rhoMin=%6.2f, rhoMax=%6.2f"
, varIndex, qgBin, ptMin, ptMax, etaMin, etaMax, rhoMin, rhoMax);
60
edm::LogVerbatim
(
"UserOutput"
) << buff << std::endl;
61
}
62
}
63
64
DEFINE_FWK_MODULE
(
QGLikelihoodDBReader
);
QGLikelihoodDBReader
Definition:
QGLikelihoodDBReader.cc:13
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
QGLikelihoodCategory::EtaMin
float EtaMin
Definition:
QGLikelihoodObject.h:10
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
QGLikelihoodCategory::RhoMin
float RhoMin
Definition:
QGLikelihoodObject.h:10
Event.h
MakerMacros.h
EventSetup.h
QGLikelihoodObject::qgValidRange
QGLikelihoodCategory qgValidRange
Definition:
QGLikelihoodObject.h:32
QGLikelihoodObject.h
ALCARECOTkAlBeamHalo_cff.etaMin
etaMin
GeV.
Definition:
ALCARECOTkAlBeamHalo_cff.py:32
Frameworkfwd.h
QGLikelihoodRcd
Definition:
QGLikelihoodRcd.h:23
ParameterSet.h
QGLikelihoodCategory::EtaMax
float EtaMax
Definition:
QGLikelihoodObject.h:10
iEvent
int iEvent
Definition:
GenABIO.cc:230
edm::ESHandle
Definition:
DTSurvey.h:22
edm::eventsetup::EventSetupRecord::get
void get(HolderT &iHolder) const
Definition:
EventSetupRecord.h:93
QGLikelihoodDBReader::mCreateTextFile
bool mCreateTextFile
Definition:
QGLikelihoodDBReader.cc:24
QGLikelihoodCategory::RhoMax
float RhoMax
Definition:
QGLikelihoodObject.h:10
ESHandle.h
QGLikelihoodRcd.h
ALCARECOTkAlBeamHalo_cff.ptMin
ptMin
Definition:
ALCARECOTkAlBeamHalo_cff.py:30
edm::EventSetup
Definition:
EventSetup.h:44
QGLikelihoodCategory::PtMin
float PtMin
Definition:
QGLikelihoodObject.h:10
edm::LogVerbatim
Definition:
MessageLogger.h:242
ALCARECOTkAlBeamHalo_cff.etaMax
etaMax
Definition:
ALCARECOTkAlBeamHalo_cff.py:33
edm::EDAnalyzer
Definition:
EDAnalyzer.h:27
EDAnalyzer.h
QGLikelihoodDBReader::QGLikelihoodDBReader
QGLikelihoodDBReader(const edm::ParameterSet &)
Definition:
QGLikelihoodDBReader.cc:28
QGLikelihoodDBReader::mPrintScreen
bool mPrintScreen
Definition:
QGLikelihoodDBReader.cc:24
edm::LogInfo
Definition:
MessageLogger.h:216
QGLikelihoodDBReader::analyze
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
Definition:
QGLikelihoodDBReader.cc:35
QGLikelihoodDBReader::beginJob
virtual void beginJob() override
Definition:
QGLikelihoodDBReader.cc:19
AlignmentTrackSelector_cfi.ptMax
ptMax
Definition:
AlignmentTrackSelector_cfi.py:12
edm::EventSetup::get
const T & get() const
Definition:
EventSetup.h:55
QGLikelihoodCategory::PtMax
float PtMax
Definition:
QGLikelihoodObject.h:10
QGLikelihoodDBReader::~QGLikelihoodDBReader
~QGLikelihoodDBReader()
Definition:
QGLikelihoodDBReader.cc:16
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:82
QGLikelihoodObject::data
std::vector< Entry > data
Definition:
QGLikelihoodObject.h:33
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::Event
Definition:
Event.h:69
QGLikelihoodDBReader::mPayloadName
std::string mPayloadName
Definition:
QGLikelihoodDBReader.cc:21
electronConversionRejectionValidator.rhoMin
rhoMin
Definition:
electronConversionRejectionValidator.py:58
QGLikelihoodDBReader::endJob
virtual void endJob() override
Definition:
QGLikelihoodDBReader.cc:21
JetCorrectionsRecord.h
electronConversionRejectionValidator.rhoMax
rhoMax
Definition:
electronConversionRejectionValidator.py:59
Generated for CMSSW Reference Manual by
1.8.11