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
->dr03HcalTowerSumEt(1);
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->
dr03HcalTowerSumEt
(1);
67
}
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition:
ConsumesCollector.h:55
DDAxes::rho
makeMEIFBenchmarkPlots.ev
ev
Definition:
makeMEIFBenchmarkPlots.py:55
CutApplicatorWithEventContentBase
Definition:
CutApplicatorWithEventContentBase.h:19
GsfEleEmHadD1IsoRhoCut::operator()
result_type operator()(const reco::GsfElectronPtr &) const final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:51
GsfEleEmHadD1IsoRhoCut::constTerm_
EBEECutValues constTerm_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:23
EgHLTOffHistBins_cfi.et
et
Definition:
EgHLTOffHistBins_cfi.py:8
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition:
CutApplicatorWithEventContentBase.h:35
CutApplicatorBase::ELECTRON
Definition:
CutApplicatorBase.h:47
runTheMatrix.const
const
Definition:
runTheMatrix.py:337
GsfEleEmHadD1IsoRhoCut::energyRetriever_
EleEnergyRetriever energyRetriever_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:24
edm::Handle< double >
std
Definition:
JetResolutionObject.h:76
HLT_2022v12_cff.rhoTag
rhoTag
Definition:
HLT_2022v12_cff.py:11775
EBEECutValuesT< double >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
c
auto & c
Definition:
CAHitNtupletGeneratorKernelsImpl.h:56
GsfEleEmHadD1IsoRhoCut::rhoHandle_
edm::Handle< double > rhoHandle_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:26
edmplugin::PluginFactory
Definition:
PluginFactory.h:35
candidate_functions::CandidateCut::result_type
bool result_type
Definition:
CandidateCut.h:11
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:47
submitPVValidationJobs.params
def params
Definition:
submitPVValidationJobs.py:482
GsfElectron.h
EBEECutValues.h
GsfEleEmHadD1IsoRhoCut::rhoConstant_
float rhoConstant_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:20
GsfEleEmHadD1IsoRhoCut
Definition:
GsfEleEmHadD1IsoRhoCut.cc:6
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition:
CutApplicatorWithEventContentBase.h:40
EleEnergyRetriever.h
GsfEleEmHadD1IsoRhoCut::GsfEleEmHadD1IsoRhoCut
GsfEleEmHadD1IsoRhoCut(const edm::ParameterSet &c)
Definition:
GsfEleEmHadD1IsoRhoCut.cc:31
edm::InputTag
Definition:
InputTag.h:15
CutApplicatorBase::CandidateType
CandidateType
Definition:
CutApplicatorBase.h:47
GsfEleEmHadD1IsoRhoCut::candidateType
CandidateType candidateType() const final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:17
reco::GsfElectron::dr03EcalRecHitSumEt
float dr03EcalRecHitSumEt() const
Definition:
GsfElectron.h:559
GsfEleEmHadD1IsoRhoCut::slopeTerm_
EBEECutValues slopeTerm_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:21
edm::ParameterSet
Definition:
ParameterSet.h:47
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:123
cand
Definition:
decayParser.h:32
reco::GsfElectron::dr03HcalTowerSumEt
float dr03HcalTowerSumEt(int depth=0) const
Definition:
GsfElectron.h:576
GsfEleEmHadD1IsoRhoCut::slopeStart_
EBEECutValues slopeStart_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:22
GsfEleEmHadD1IsoRhoCut::setConsumes
void setConsumes(edm::ConsumesCollector &) final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:42
GsfEleEmHadD1IsoRhoCut::value
double value(const reco::CandidatePtr &cand) const final
Definition:
GsfEleEmHadD1IsoRhoCut.cc:64
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
Generated for CMSSW Reference Manual by
1.8.14