Main Page
Namespaces
Classes
Package Documentation
src
RecoEgamma
ElectronIdentification
plugins
cuts
GsfEleValueMapIsoRhoCut.cc
Go to the documentation of this file.
1
#include "
PhysicsTools/SelectorUtils/interface/CutApplicatorWithEventContentBase.h
"
2
#include "
DataFormats/EgammaCandidates/interface/GsfElectron.h
"
3
#include "
DataFormats/Common/interface/ValueMap.h
"
4
#include "
RecoEgamma/ElectronIdentification/interface/EBEECutValues.h
"
5
6
class
GsfEleValueMapIsoRhoCut
:
public
CutApplicatorWithEventContentBase
{
7
public
:
8
GsfEleValueMapIsoRhoCut
(
const
edm::ParameterSet
&
c
);
9
10
result_type
operator()
(
const
reco::GsfElectronPtr
&)
const
final
;
11
12
void
setConsumes
(
edm::ConsumesCollector
&)
final
;
13
void
getEventContent
(
const
edm::EventBase
&)
final
;
14
15
double
value
(
const
reco::CandidatePtr
&
cand
)
const
final
;
16
17
CandidateType
candidateType
() const final {
18
return
ELECTRON
;
19
}
20
21
private
:
22
float
getRhoCorr
(
const
reco::GsfElectronPtr
& cand)
const
;
23
24
EBEECutValues
slopeTerm_
;
25
EBEECutValues
slopeStart_
;
26
EBEECutValues
constTerm_
;
27
EBEECutValues
rhoEtStart_
;
28
EBEECutValues
rhoEA_
;
29
30
bool
useRho_
;
31
32
edm::Handle<double>
rhoHandle_
;
33
edm::Handle<edm::ValueMap<float>
>
valueHandle_
;
34
};
35
36
DEFINE_EDM_PLUGIN
(
CutApplicatorFactory
,
37
GsfEleValueMapIsoRhoCut
,
38
"GsfEleValueMapIsoRhoCut"
);
39
40
GsfEleValueMapIsoRhoCut::GsfEleValueMapIsoRhoCut
(
const
edm::ParameterSet
& params) :
41
CutApplicatorWithEventContentBase
(params),
42
slopeTerm_
(params,
"slopeTerm"
),
43
slopeStart_
(params,
"slopeStart"
),
44
constTerm_
(params,
"constTerm"
),
45
rhoEtStart_
(params,
"rhoEtStart"
),
46
rhoEA_
(params,
"rhoEA"
)
47
{
48
auto
rho
= params.
getParameter
<
edm::InputTag
>(
"rho"
);
49
if
(!
rho
.label().empty()){
50
useRho_
=
true
;
51
contentTags_
.emplace(
"rho"
,
rho
);
52
}
else
useRho_
=
false
;
53
54
contentTags_
.emplace(
"value"
,params.
getParameter
<
edm::InputTag
>(
"value"
));
55
56
}
57
58
void
GsfEleValueMapIsoRhoCut::setConsumes
(
edm::ConsumesCollector
& cc) {
59
if
(
useRho_
)
contentTokens_
.emplace(
"rho"
,cc.
consumes
<
double
>(
contentTags_
[
"rho"
]));
60
contentTokens_
.emplace(
"value"
,cc.
consumes
<
edm::ValueMap<float>
>(
contentTags_
[
"value"
]));
61
}
62
63
void
GsfEleValueMapIsoRhoCut::getEventContent
(
const
edm::EventBase
&
ev
) {
64
if
(
useRho_
) ev.
getByLabel
(
contentTags_
[
"rho"
],
rhoHandle_
);
65
ev.
getByLabel
(
contentTags_
[
"value"
],
valueHandle_
);
66
}
67
68
CutApplicatorBase::result_type
69
GsfEleValueMapIsoRhoCut::
70
operator()
(
const
reco::GsfElectronPtr
&
cand
)
const
{
71
72
const
float
val
= (*valueHandle_)[cand];
73
74
const
float
et
= cand->
et
();
75
const
float
cutValue = et >
slopeStart_
(cand) ?
slopeTerm_
(cand)*(et-
slopeStart_
(cand)) +
constTerm_
(cand) :
constTerm_
(cand);
76
const
float
rhoCutValue =
getRhoCorr
(cand);
77
78
return
val < cutValue+rhoCutValue;
79
}
80
81
82
double
GsfEleValueMapIsoRhoCut::
83
value
(
const
reco::CandidatePtr
&
cand
)
const
{
84
reco::GsfElectronPtr
ele(cand);
85
return
(*
valueHandle_
)[cand];
86
}
87
88
float
GsfEleValueMapIsoRhoCut::getRhoCorr
(
const
reco::GsfElectronPtr
&
cand
)
const
{
89
if
(!
useRho_
)
return
0.;
90
else
{
91
const
double
rho
= (*rhoHandle_);
92
return
cand->
et
() >=
rhoEtStart_
(cand) ?
rhoEA_
(cand)*rho : 0.;
93
}
94
}
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition:
ConsumesCollector.h:52
DDAxes::rho
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CutApplicatorWithEventContentBase
Definition:
CutApplicatorWithEventContentBase.h:19
GsfEleValueMapIsoRhoCut::setConsumes
void setConsumes(edm::ConsumesCollector &) final
Definition:
GsfEleValueMapIsoRhoCut.cc:58
GsfEleValueMapIsoRhoCut::valueHandle_
edm::Handle< edm::ValueMap< float > > valueHandle_
Definition:
GsfEleValueMapIsoRhoCut.cc:33
CutApplicatorBase::ELECTRON
Definition:
CutApplicatorBase.h:48
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition:
CutApplicatorWithEventContentBase.h:44
GsfEleValueMapIsoRhoCut::rhoEA_
EBEECutValues rhoEA_
Definition:
GsfEleValueMapIsoRhoCut.cc:28
GsfEleValueMapIsoRhoCut::candidateType
CandidateType candidateType() const final
Definition:
GsfEleValueMapIsoRhoCut.cc:17
EnergyCorrector.c
c
Definition:
EnergyCorrector.py:43
edm::Handle< double >
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
GsfEleValueMapIsoRhoCut::value
double value(const reco::CandidatePtr &cand) const final
Definition:
GsfEleValueMapIsoRhoCut.cc:83
EBEECutValuesT< double >
ValueMap.h
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition:
CutApplicatorWithEventContentBase.h:39
edmplugin::PluginFactory
Definition:
PluginFactory.h:31
GsfEleValueMapIsoRhoCut
Definition:
GsfEleValueMapIsoRhoCut.cc:6
reco::LeafCandidate::et
double et() const final
transverse energy
Definition:
LeafCandidate.h:112
GsfEleValueMapIsoRhoCut::useRho_
bool useRho_
Definition:
GsfEleValueMapIsoRhoCut.cc:30
GsfEleValueMapIsoRhoCut::slopeStart_
EBEECutValues slopeStart_
Definition:
GsfEleValueMapIsoRhoCut.cc:25
CutApplicatorWithEventContentBase.h
edm::Ptr< reco::GsfElectron >
edm::EventBase
Definition:
EventBase.h:46
GsfEleValueMapIsoRhoCut::rhoHandle_
edm::Handle< double > rhoHandle_
Definition:
GsfEleValueMapIsoRhoCut.cc:32
GsfElectron.h
GsfEleValueMapIsoRhoCut::rhoEtStart_
EBEECutValues rhoEtStart_
Definition:
GsfEleValueMapIsoRhoCut.cc:27
edm::ValueMap< float >
EBEECutValues.h
stringResolutionProvider_cfi.et
et
define resolution functions of each parameter
Definition:
stringResolutionProvider_cfi.py:13
GsfEleValueMapIsoRhoCut::getEventContent
void getEventContent(const edm::EventBase &) final
Definition:
GsfEleValueMapIsoRhoCut.cc:63
edm::EventBase::getByLabel
bool getByLabel(InputTag const &, Handle< T > &) const
Definition:
EventBase.h:94
edm::InputTag
Definition:
InputTag.h:15
GsfEleValueMapIsoRhoCut::operator()
result_type operator()(const reco::GsfElectronPtr &) const final
Definition:
GsfEleValueMapIsoRhoCut.cc:70
CutApplicatorBase::CandidateType
CandidateType
Definition:
CutApplicatorBase.h:47
edm::ParameterSet
Definition:
ParameterSet.h:36
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:101
cand
Definition:
decayParser.h:34
heppy_batch.val
val
Definition:
heppy_batch.py:349
GsfEleValueMapIsoRhoCut::constTerm_
EBEECutValues constTerm_
Definition:
GsfEleValueMapIsoRhoCut.cc:26
GsfEleValueMapIsoRhoCut::getRhoCorr
float getRhoCorr(const reco::GsfElectronPtr &cand) const
Definition:
GsfEleValueMapIsoRhoCut.cc:88
GsfEleValueMapIsoRhoCut::GsfEleValueMapIsoRhoCut
GsfEleValueMapIsoRhoCut(const edm::ParameterSet &c)
Definition:
GsfEleValueMapIsoRhoCut.cc:40
GsfEleValueMapIsoRhoCut::slopeTerm_
EBEECutValues slopeTerm_
Definition:
GsfEleValueMapIsoRhoCut.cc:24
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
Generated for CMSSW Reference Manual by
1.8.11