Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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 "
DataFormats/EgammaCandidates/interface/ConversionFwd.h
"
4
#include "
DataFormats/EgammaCandidates/interface/Conversion.h
"
5
#include "
RecoEgamma/EgammaTools/interface/ConversionTools.h
"
6
7
#include "
RecoEgamma/ElectronIdentification/interface/EBEECutValues.h
"
8
9
class
GsfEleEmHadD1IsoRhoCut
:
public
CutApplicatorWithEventContentBase
{
10
public
:
11
GsfEleEmHadD1IsoRhoCut
(
const
edm::ParameterSet
&
c
);
12
13
result_type
operator()
(
const
reco::GsfElectronPtr
&)
const
override
final
;
14
15
void
setConsumes
(
edm::ConsumesCollector
&)
override
final
;
16
void
getEventContent
(
const
edm::EventBase
&)
override
final
;
17
18
double
value
(
const
reco::CandidatePtr
& cand)
const
override
final
;
19
20
CandidateType
candidateType
()
const
override final {
21
return
ELECTRON
;
22
}
23
24
private
:
25
float
rhoConstant_
;
26
EBEECutValues
slopeTerm_
;
27
EBEECutValues
slopeStart_
;
28
EBEECutValues
constTerm_
;
29
30
31
edm::Handle<double>
rhoHandle_
;
32
33
};
34
35
DEFINE_EDM_PLUGIN
(
CutApplicatorFactory
,
36
GsfEleEmHadD1IsoRhoCut
,
37
"GsfEleEmHadD1IsoRhoCut"
);
38
39
GsfEleEmHadD1IsoRhoCut::GsfEleEmHadD1IsoRhoCut
(
const
edm::ParameterSet
& params) :
40
CutApplicatorWithEventContentBase
(params),
41
rhoConstant_(params.getParameter<double>(
"rhoConstant"
)),
42
slopeTerm_(params,
"slopeTerm"
),
43
slopeStart_(params,
"slopeStart"
),
44
constTerm_(params,
"constTerm"
){
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
et = cand->et();
67
const
float
cutValue = et >
slopeStart_
(cand) ?
slopeTerm_
(cand)*(et-
slopeStart_
(cand)) +
constTerm_
(cand) :
constTerm_
(cand);
68
return
isolEmHadDepth1 < cutValue +
rhoConstant_
*
rho
;
69
}
70
71
double
GsfEleEmHadD1IsoRhoCut::value
(
const
reco::CandidatePtr
& cand)
const
{
72
reco::GsfElectronPtr
ele(cand);
73
return
ele->dr03EcalRecHitSumEt() + ele->dr03HcalDepth1TowerSumEt();
74
}
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
GsfEleEmHadD1IsoRhoCut::constTerm_
EBEECutValues constTerm_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:28
CutApplicatorBase::ELECTRON
Definition:
CutApplicatorBase.h:48
GsfEleEmHadD1IsoRhoCut::candidateType
CandidateType candidateType() const overridefinal
Definition:
GsfEleEmHadD1IsoRhoCut.cc:20
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition:
CutApplicatorWithEventContentBase.h:44
edm::Handle< double >
Conversion.h
ev
bool ev
Definition:
Hydjet2Hadronizer.cc:95
EnergyCorrector.c
tuple c
Definition:
EnergyCorrector.py:43
GsfEleEmHadD1IsoRhoCut::getEventContent
void getEventContent(const edm::EventBase &) overridefinal
Definition:
GsfEleEmHadD1IsoRhoCut.cc:55
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition:
CutApplicatorWithEventContentBase.h:39
GsfEleEmHadD1IsoRhoCut::rhoHandle_
edm::Handle< double > rhoHandle_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:31
EBEECutValues
Definition:
EBEECutValues.h:12
edmplugin::PluginFactory
Definition:
PluginFactory.h:31
ConversionTools.h
CutApplicatorWithEventContentBase.h
edm::Ptr< reco::GsfElectron >
GsfEleEmHadD1IsoRhoCut::value
double value(const reco::CandidatePtr &cand) const overridefinal
Definition:
GsfEleEmHadD1IsoRhoCut.cc:71
edm::EventBase
Definition:
EventBase.h:45
GsfElectron.h
EBEECutValues.h
GsfEleEmHadD1IsoRhoCut::rhoConstant_
float rhoConstant_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:25
GsfEleEmHadD1IsoRhoCut
Definition:
GsfEleEmHadD1IsoRhoCut.cc:9
GsfEleEmHadD1IsoRhoCut::GsfEleEmHadD1IsoRhoCut
GsfEleEmHadD1IsoRhoCut(const edm::ParameterSet &c)
Definition:
GsfEleEmHadD1IsoRhoCut.cc:39
compareJSON.const
string const
Definition:
compareJSON.py:14
ConversionFwd.h
edm::EventBase::getByLabel
bool getByLabel(InputTag const &, Handle< T > &) const
Definition:
EventBase.h:90
edm::InputTag
Definition:
InputTag.h:15
CutApplicatorBase::CandidateType
CandidateType
Definition:
CutApplicatorBase.h:47
GsfEleEmHadD1IsoRhoCut::slopeTerm_
EBEECutValues slopeTerm_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:26
edm::ParameterSet
Definition:
ParameterSet.h:36
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:101
GsfEleEmHadD1IsoRhoCut::operator()
result_type operator()(const reco::GsfElectronPtr &) const overridefinal
Definition:
GsfEleEmHadD1IsoRhoCut.cc:61
GsfEleEmHadD1IsoRhoCut::slopeStart_
EBEECutValues slopeStart_
Definition:
GsfEleEmHadD1IsoRhoCut.cc:27
GsfEleEmHadD1IsoRhoCut::setConsumes
void setConsumes(edm::ConsumesCollector &) overridefinal
Definition:
GsfEleEmHadD1IsoRhoCut.cc:50
edm::ConsumesCollector
Definition:
ConsumesCollector.h:39
Generated for CMSSW Reference Manual by
1.8.5