RecoEgamma
PhotonIdentification
plugins
cuts
PhotonHcalOverEcalCut.cc
Go to the documentation of this file.
1
#include "
PhysicsTools/SelectorUtils/interface/CutApplicatorBase.h
"
2
#include "
DataFormats/EgammaCandidates/interface/Photon.h
"
3
4
template
<
bool
isBC>
5
class
PhotonHcalOverEcalCut
:
public
CutApplicatorBase
{
6
public
:
7
PhotonHcalOverEcalCut
(
const
edm::ParameterSet
&
c
)
8
:
CutApplicatorBase
(
c
),
9
_hcalOverEcalCutValueEB
(
c
.getParameter<double>(
"hcalOverEcalCutValueEB"
)),
10
_hcalOverEcalCutValueEE
(
c
.getParameter<double>(
"hcalOverEcalCutValueEE"
)),
11
_barrelCutOff
(
c
.getParameter<double>(
"barrelCutOff"
)) {}
12
13
result_type
operator()
(
const
reco::PhotonPtr
&)
const
final
;
14
15
double
value
(
const
reco::CandidatePtr
&
cand
)
const
final
;
16
17
CandidateType
candidateType
()
const
final {
return
PHOTON
; }
18
19
private
:
20
const
float
_hcalOverEcalCutValueEB
,
_hcalOverEcalCutValueEE
,
_barrelCutOff
;
21
};
22
23
DEFINE_EDM_PLUGIN
(
CutApplicatorFactory
,
PhotonHcalOverEcalCut<false>
,
"PhotonHcalOverEcalCut"
);
24
DEFINE_EDM_PLUGIN
(
CutApplicatorFactory
,
PhotonHcalOverEcalCut<true>
,
"PhotonHcalOverEcalBcCut"
);
25
26
template
<
bool
isBC>
27
CutApplicatorBase::result_type
PhotonHcalOverEcalCut<isBC>::operator()
(
const
reco::PhotonPtr
&
cand
)
const
{
28
const
float
hcalOverEcalCutValue =
29
(
std::abs
(
cand
->superCluster()->eta()) < _barrelCutOff ? _hcalOverEcalCutValueEB : _hcalOverEcalCutValueEE);
30
31
if
constexpr (isBC)
32
return
cand
->hcalOverEcalBc() < hcalOverEcalCutValue;
33
else
34
return
cand
->hcalOverEcal() < hcalOverEcalCutValue;
35
}
36
37
template
<
bool
isBC>
38
double
PhotonHcalOverEcalCut<isBC>::value
(
const
reco::CandidatePtr
&
cand
)
const
{
39
reco::PhotonPtr
pho(
cand
);
40
if
constexpr (isBC)
41
return
pho->hcalOverEcalBc();
42
else
43
return
pho->hcalOverEcal();
44
}
PhotonHcalOverEcalCut::value
double value(const reco::CandidatePtr &cand) const final
Definition:
PhotonHcalOverEcalCut.cc:38
CutApplicatorBase::PHOTON
Definition:
CutApplicatorBase.h:47
PhotonHcalOverEcalCut::PhotonHcalOverEcalCut
PhotonHcalOverEcalCut(const edm::ParameterSet &c)
Definition:
PhotonHcalOverEcalCut.cc:7
watchdog.const
const
Definition:
watchdog.py:83
PhotonHcalOverEcalCut::_barrelCutOff
const float _barrelCutOff
Definition:
PhotonHcalOverEcalCut.cc:20
candidate_functions::CandidateCut::result_type
bool result_type
Definition:
CandidateCut.h:11
PhotonHcalOverEcalCut
Definition:
PhotonHcalOverEcalCut.cc:5
Photon.h
PhotonHcalOverEcalCut::_hcalOverEcalCutValueEE
const float _hcalOverEcalCutValueEE
Definition:
PhotonHcalOverEcalCut.cc:20
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:124
edm::ParameterSet
Definition:
ParameterSet.h:47
CutApplicatorBase::CandidateType
CandidateType
Definition:
CutApplicatorBase.h:47
edmplugin::PluginFactory
Definition:
PluginFactory.h:34
cand
Definition:
decayParser.h:32
PhotonHcalOverEcalCut::_hcalOverEcalCutValueEB
const float _hcalOverEcalCutValueEB
Definition:
PhotonHcalOverEcalCut.cc:20
PhotonHcalOverEcalCut::candidateType
CandidateType candidateType() const final
Definition:
PhotonHcalOverEcalCut.cc:17
edm::Ptr
Definition:
AssociationVector.h:31
CutApplicatorBase
Definition:
CutApplicatorBase.h:45
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
CutApplicatorBase.h
c
auto & c
Definition:
CAHitNtupletGeneratorKernelsImpl.h:56
PhotonHcalOverEcalCut::operator()
result_type operator()(const reco::PhotonPtr &) const final
Definition:
PhotonHcalOverEcalCut.cc:27
Generated for CMSSW Reference Manual by
1.8.16