Main Page
Namespaces
Classes
Package Documentation
RecoEgamma
ElectronIdentification
plugins
cuts
GsfEleEmHadD1IsoRhoCut.cc
Go to the documentation of this file.
1
#include "
PhysicsTools/SelectorUtils/interface/CutApplicatorWithEventContentBase.h
"
2
#include "
DataFormats/EgammaCandidates/interface/GsfElectron.h
"
3
#include "
RecoEgamma/EgammaTools/interface/EleEnergyRetriever.h
"
4
5
#include "
RecoEgamma/ElectronIdentification/interface/EBEECutValues.h
"
6
7
class
GsfEleEmHadD1IsoRhoCut
:
public
CutApplicatorWithEventContentBase
{
8
public
:
9
GsfEleEmHadD1IsoRhoCut
(
const
edm::ParameterSet
&
c
);
10
11
result_type
operator()
(
const
reco::GsfElectronPtr
&)
const
final
;
12
13
void
setConsumes
(
edm::ConsumesCollector
&)
final
;
14
void
getEventContent
(
const
edm::EventBase
&)
final
;
15
16
double
value
(
const
reco::CandidatePtr
&
cand
)
const
final
;
17
18
CandidateType
candidateType
() const final {
19
return
ELECTRON
;
20
}
21
22
private
:
23
float
rhoConstant_
;
24
EBEECutValues
slopeTerm_
;
25
EBEECutValues
slopeStart_
;
26
EBEECutValues
constTerm_
;
27
EleEnergyRetriever
energyRetriever_
;
28
29
edm::Handle<double>
rhoHandle_
;
30
31
};
32
33
DEFINE_EDM_PLUGIN
(
CutApplicatorFactory
,
34
GsfEleEmHadD1IsoRhoCut
,
35
"GsfEleEmHadD1IsoRhoCut"
);
36
37
GsfEleEmHadD1IsoRhoCut::GsfEleEmHadD1IsoRhoCut
(
const
edm::ParameterSet
& params) :
38
CutApplicatorWithEventContentBase
(params),
39
rhoConstant_
(params.getParameter<double>(
"rhoConstant"
)),
40
slopeTerm_
(params,
"slopeTerm"
),
41
slopeStart_
(params,
"slopeStart"
),
42
constTerm_
(params,
"constTerm"
),
43
energyRetriever_
(params.getParameter<
std
::
string
>(
"energyType"
))
44
{
45
edm::InputTag
rhoTag
= params.
getParameter
<
edm::InputTag
>(
"rho"
);
46
contentTags_
.emplace(
"rho"
,rhoTag);
47
48
}
49
50
void
GsfEleEmHadD1IsoRhoCut::setConsumes
(
edm::ConsumesCollector
& cc) {
51
auto
rho
= cc.
consumes
<
double
>(
contentTags_
[
"rho"
]);
52
contentTokens_
.emplace(
"rho"
,
rho
);
53
}
54
55
void
GsfEleEmHadD1IsoRhoCut::getEventContent
(
const
edm::EventBase
&
ev
) {
56
ev.
getByLabel
(
contentTags_
[
"rho"
],
rhoHandle_
);
57
}
58
59
CutApplicatorBase::result_type
60
GsfEleEmHadD1IsoRhoCut::
61
operator()
(
const
reco::GsfElectronPtr
&
cand
)
const
{
62
const
double
rho
= (*rhoHandle_);
63
64
const
float
isolEmHadDepth1 = cand->
dr03EcalRecHitSumEt
() + cand->
dr03HcalDepth1TowerSumEt
();
65
66
const
float
sinTheta = cand->
p
()!=0. ? cand->
pt
()/cand->
p
() : 0.;
67
const
float
et
=
energyRetriever_
(*cand)*sinTheta;
68
69
const
float
cutValue = et >
slopeStart_
(cand) ?
slopeTerm_
(cand)*(et-
slopeStart_
(cand)) +
constTerm_
(cand) :
constTerm_
(cand);
70
return
isolEmHadDepth1 < cutValue +
rhoConstant_
*
rho
;
71
}
72
73
double
GsfEleEmHadD1IsoRhoCut::value
(
const
reco::CandidatePtr
&
cand
)
const
{
74
reco::GsfElectronPtr
ele(cand);
75
return
ele->
dr03EcalRecHitSumEt
() + ele->
dr03HcalDepth1TowerSumEt
();
76
}
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition:
ConsumesCollector.h:49
DDAxes::rho
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CutApplicatorWithEventContentBase
Definition:
CutApplicatorWithEventContentBase.h:19
GsfEleEmHadD1IsoRhoCut::constTerm_
EBEECutValues constTerm_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:26
CutApplicatorBase::ELECTRON
Definition:
CutApplicatorBase.h:48
GsfEleEmHadD1IsoRhoCut::candidateType
CandidateType candidateType() const final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:18
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition:
CutApplicatorWithEventContentBase.h:44
GsfEleEmHadD1IsoRhoCut::energyRetriever_
EleEnergyRetriever energyRetriever_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:27
EnergyCorrector.c
c
Definition:
EnergyCorrector.py:44
edm::Handle< double >
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition:
LeafCandidate.h:131
std
Definition:
JetResolutionObject.h:80
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
GsfEleEmHadD1IsoRhoCut::value
double value(const reco::CandidatePtr &cand) const final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:73
EBEECutValuesT< double >
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition:
CutApplicatorWithEventContentBase.h:39
GsfEleEmHadD1IsoRhoCut::rhoHandle_
edm::Handle< double > rhoHandle_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:29
edmplugin::PluginFactory
Definition:
PluginFactory.h:33
candidate_functions::CandidateCut::result_type
bool result_type
Definition:
CandidateCut.h:11
reco::GsfElectron::dr03HcalDepth1TowerSumEt
float dr03HcalDepth1TowerSumEt() const
Definition:
GsfElectron.h:555
GsfEleEmHadD1IsoRhoCut::operator()
result_type operator()(const reco::GsfElectronPtr &) const final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:61
CutApplicatorWithEventContentBase.h
edm::Ptr< reco::GsfElectron >
EleEnergyRetriever
Definition:
EleEnergyRetriever.h:7
edm::EventBase
Definition:
EventBase.h:46
GsfEleEmHadD1IsoRhoCut::getEventContent
void getEventContent(const edm::EventBase &) final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:55
GsfElectron.h
EBEECutValues.h
reco::LeafCandidate::p
double p() const final
magnitude of momentum vector
Definition:
LeafCandidate.h:108
GsfEleEmHadD1IsoRhoCut::rhoConstant_
float rhoConstant_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:23
GsfEleEmHadD1IsoRhoCut
Definition:
GsfEleEmHadD1IsoRhoCut.cc:7
EleEnergyRetriever.h
GsfEleEmHadD1IsoRhoCut::GsfEleEmHadD1IsoRhoCut
GsfEleEmHadD1IsoRhoCut(const edm::ParameterSet &c)
Definition:
GsfEleEmHadD1IsoRhoCut.cc:37
stringResolutionProvider_cfi.et
et
define resolution functions of each parameter
Definition:
stringResolutionProvider_cfi.py:13
reco::GsfElectron::dr03EcalRecHitSumEt
float dr03EcalRecHitSumEt() const
Definition:
GsfElectron.h:554
edm::EventBase::getByLabel
bool getByLabel(InputTag const &, Handle< T > &) const
Definition:
EventBase.h:92
edm::InputTag
Definition:
InputTag.h:15
CutApplicatorBase::CandidateType
CandidateType
Definition:
CutApplicatorBase.h:47
GsfEleEmHadD1IsoRhoCut::slopeTerm_
EBEECutValues slopeTerm_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:24
edm::ParameterSet
Definition:
ParameterSet.h:36
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:121
cand
Definition:
decayParser.h:34
GsfEleEmHadD1IsoRhoCut::slopeStart_
EBEECutValues slopeStart_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:25
lowPtGsfElectrons_cff.rhoTag
rhoTag
Definition:
lowPtGsfElectrons_cff.py:13
GsfEleEmHadD1IsoRhoCut::setConsumes
void setConsumes(edm::ConsumesCollector &) final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:50
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
Generated for CMSSW Reference Manual by
1.8.11