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
#include "
RecoEgamma/EgammaTools/interface/EBEECutValues.h
"
5
6
class
GsfEleEmHadD1IsoRhoCut
:
public
CutApplicatorWithEventContentBase
{
7
public
:
8
GsfEleEmHadD1IsoRhoCut
(
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 {
return
ELECTRON
; }
18
19
private
:
20
float
rhoConstant_
;
21
EBEECutValues
slopeTerm_
;
22
EBEECutValues
slopeStart_
;
23
EBEECutValues
constTerm_
;
24
EleEnergyRetriever
energyRetriever_
;
25
26
edm::Handle<double>
rhoHandle_
;
27
};
28
29
DEFINE_EDM_PLUGIN
(
CutApplicatorFactory
,
GsfEleEmHadD1IsoRhoCut
,
"GsfEleEmHadD1IsoRhoCut"
);
30
31
GsfEleEmHadD1IsoRhoCut::GsfEleEmHadD1IsoRhoCut
(
const
edm::ParameterSet
&
params
)
32
:
CutApplicatorWithEventContentBase
(
params
),
33
rhoConstant_(
params
.getParameter<double>(
"rhoConstant"
)),
34
slopeTerm_(
params
,
"slopeTerm"
),
35
slopeStart_(
params
,
"slopeStart"
),
36
constTerm_(
params
,
"constTerm"
),
37
energyRetriever_(
params
.getParameter<
std
::
string
>(
"energyType"
)) {
38
edm::InputTag
rhoTag
=
params
.getParameter<
edm::InputTag
>(
"rho"
);
39
contentTags_
.emplace(
"rho"
,
rhoTag
);
40
}
41
42
void
GsfEleEmHadD1IsoRhoCut::setConsumes
(
edm::ConsumesCollector
&
cc
) {
43
auto
rho
=
cc
.consumes<
double
>(
contentTags_
[
"rho"
]);
44
contentTokens_
.emplace(
"rho"
,
rho
);
45
}
46
47
void
GsfEleEmHadD1IsoRhoCut::getEventContent
(
const
edm::EventBase
&
ev
) {
48
ev
.getByLabel(
contentTags_
[
"rho"
],
rhoHandle_
);
49
}
50
51
CutApplicatorBase::result_type
GsfEleEmHadD1IsoRhoCut::operator()
(
const
reco::GsfElectronPtr
&
cand
)
const
{
52
const
double
rho
= (*rhoHandle_);
53
54
const
float
isolEmHadDepth1 =
cand
->dr03EcalRecHitSumEt() +
cand
->dr03HcalDepth1TowerSumEt();
55
56
const
float
sinTheta =
cand
->p() != 0. ?
cand
->pt() /
cand
->p() : 0.;
57
const
float
et
=
energyRetriever_
(*
cand
) * sinTheta;
58
59
const
float
cutValue =
60
et
>
slopeStart_
(
cand
) ?
slopeTerm_
(
cand
) * (
et
-
slopeStart_
(
cand
)) +
constTerm_
(
cand
) :
constTerm_
(
cand
);
61
return
isolEmHadDepth1 < cutValue +
rhoConstant_
*
rho
;
62
}
63
64
double
GsfEleEmHadD1IsoRhoCut::value
(
const
reco::CandidatePtr
&
cand
)
const
{
65
reco::GsfElectronPtr
ele(
cand
);
66
return
ele->
dr03EcalRecHitSumEt
() + ele->
dr03HcalDepth1TowerSumEt
();
67
}
CalibrationSummaryClient_cfi.params
params
Definition:
CalibrationSummaryClient_cfi.py:14
GsfEleEmHadD1IsoRhoCut::getEventContent
void getEventContent(const edm::EventBase &) final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:47
EBEECutValues.h
GsfEleEmHadD1IsoRhoCut::rhoConstant_
float rhoConstant_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:20
EleEnergyRetriever
Definition:
EleEnergyRetriever.h:7
GsfEleEmHadD1IsoRhoCut
Definition:
GsfEleEmHadD1IsoRhoCut.cc:6
watchdog.const
const
Definition:
watchdog.py:83
edm::Handle< double >
GsfEleEmHadD1IsoRhoCut::candidateType
CandidateType candidateType() const final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:17
GsfEleEmHadD1IsoRhoCut::value
double value(const reco::CandidatePtr &cand) const final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:64
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition:
CutApplicatorWithEventContentBase.h:35
HLT_FULL_cff.rhoTag
rhoTag
Definition:
HLT_FULL_cff.py:14986
candidate_functions::CandidateCut::result_type
bool result_type
Definition:
CandidateCut.h:11
GsfEleEmHadD1IsoRhoCut::GsfEleEmHadD1IsoRhoCut
GsfEleEmHadD1IsoRhoCut(const edm::ParameterSet &c)
Definition:
GsfEleEmHadD1IsoRhoCut.cc:31
CutApplicatorWithEventContentBase.h
EleEnergyRetriever.h
GsfEleEmHadD1IsoRhoCut::slopeStart_
EBEECutValues slopeStart_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:22
GsfElectron.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:124
DDAxes::rho
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
GsfEleEmHadD1IsoRhoCut::slopeTerm_
EBEECutValues slopeTerm_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:21
edm::ParameterSet
Definition:
ParameterSet.h:47
CutApplicatorBase::CandidateType
CandidateType
Definition:
CutApplicatorBase.h:47
GsfEleEmHadD1IsoRhoCut::setConsumes
void setConsumes(edm::ConsumesCollector &) final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:42
edmplugin::PluginFactory
Definition:
PluginFactory.h:34
reco::GsfElectron::dr03HcalDepth1TowerSumEt
float dr03HcalDepth1TowerSumEt() const
Definition:
GsfElectron.h:532
GsfEleEmHadD1IsoRhoCut::operator()
result_type operator()(const reco::GsfElectronPtr &) const final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:51
cand
Definition:
decayParser.h:32
EgHLTOffHistBins_cfi.et
et
Definition:
EgHLTOffHistBins_cfi.py:8
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:31
cc
edm::Ptr< reco::GsfElectron >
GsfEleEmHadD1IsoRhoCut::constTerm_
EBEECutValues constTerm_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:23
GsfEleEmHadD1IsoRhoCut::energyRetriever_
EleEnergyRetriever energyRetriever_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:24
std
Definition:
JetResolutionObject.h:76
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition:
CutApplicatorWithEventContentBase.h:40
edm::EventBase
Definition:
EventBase.h:46
GsfEleEmHadD1IsoRhoCut::rhoHandle_
edm::Handle< double > rhoHandle_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:26
EBEECutValuesT< double >
CutApplicatorBase::ELECTRON
Definition:
CutApplicatorBase.h:47
edm::InputTag
Definition:
InputTag.h:15
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
reco::GsfElectron::dr03EcalRecHitSumEt
float dr03EcalRecHitSumEt() const
Definition:
GsfElectron.h:531
CutApplicatorWithEventContentBase
Definition:
CutApplicatorWithEventContentBase.h:19
Generated for CMSSW Reference Manual by
1.8.16