src
RecoEgamma
PhotonIdentification
plugins
cuts
PhoGenericQuadraticRhoPtScaledCut.cc
Go to the documentation of this file.
1
#include "
PhysicsTools/SelectorUtils/interface/CutApplicatorWithEventContentBase.h
"
2
#include "
DataFormats/EgammaCandidates/interface/Photon.h
"
3
#include "
CommonTools/Egamma/interface/EffectiveAreas.h
"
4
#include "
CommonTools/Utils/interface/StringObjectFunction.h
"
5
#include "
CommonTools/Utils/interface/ThreadSafeFunctor.h
"
6
#include "
RecoEgamma/EgammaTools/interface/EBEECutValues.h
"
7
8
class
PhoGenericQuadraticRhoPtScaledCut
:
public
CutApplicatorWithEventContentBase
{
9
public
:
10
PhoGenericQuadraticRhoPtScaledCut
(
const
edm::ParameterSet
&
c
);
11
12
result_type
operator()
(
const
reco::PhotonPtr
&)
const
final
;
13
14
void
setConsumes
(
edm::ConsumesCollector
&)
final
;
15
void
getEventContent
(
const
edm::EventBase
&)
final
;
16
17
double
value
(
const
reco::CandidatePtr
&
cand
)
const
final
;
18
19
CandidateType
candidateType
()
const
final {
return
PHOTON
; }
20
21
private
:
22
ThreadSafeFunctor<StringObjectFunction<reco::Photon>
>
varFunc_
;
23
bool
lessThan_
;
24
//cut value is constTerm + linearRhoTerm_*rho + linearPtTerm*pt + quadraticPtTerm*pt*pt
25
//note EBEECutValues & Effective areas are conceptually the same thing, both are eta
26
//binned constants, just Effective areas have arbitary rather than barrel/endcap binnng
27
EBEECutValues
constTerm_
;
28
EffectiveAreas
rhoEA_
;
29
EBEECutValues
linearPtTerm_
;
30
EBEECutValues
quadraticPtTerm_
;
31
32
edm::Handle<double>
rhoHandle_
;
33
};
34
35
DEFINE_EDM_PLUGIN
(
CutApplicatorFactory
,
PhoGenericQuadraticRhoPtScaledCut
,
"PhoGenericQuadraticRhoPtScaledCut"
);
36
37
PhoGenericQuadraticRhoPtScaledCut::PhoGenericQuadraticRhoPtScaledCut
(
const
edm::ParameterSet
&
params
)
38
:
CutApplicatorWithEventContentBase
(
params
),
39
varFunc_(
params
.getParameter<
std
::
string
>(
"cutVariable"
)),
40
lessThan_(
params
.getParameter<
bool
>(
"lessThan"
)),
41
constTerm_(
params
,
"constTerm"
),
42
rhoEA_(
params
.getParameter<
edm
::FileInPath>(
"effAreasConfigFile"
).
fullPath
(),
43
params
.getParameter<
bool
>(
"quadEAflag"
)),
44
linearPtTerm_(
params
,
"linearPtTerm"
),
45
quadraticPtTerm_(
params
,
"quadraticPtTerm"
) {
46
edm::InputTag
rhoTag
=
params
.getParameter<
edm::InputTag
>(
"rho"
);
47
contentTags_
.emplace(
"rho"
,
rhoTag
);
48
}
49
50
void
PhoGenericQuadraticRhoPtScaledCut::setConsumes
(
edm::ConsumesCollector
&
cc
) {
51
auto
rho
=
cc
.consumes<
double
>(
contentTags_
[
"rho"
]);
52
contentTokens_
.emplace(
"rho"
,
rho
);
53
}
54
55
void
PhoGenericQuadraticRhoPtScaledCut::getEventContent
(
const
edm::EventBase
&
ev
) {
56
ev
.getByLabel(
contentTags_
[
"rho"
],
rhoHandle_
);
57
}
58
59
CutApplicatorBase::result_type
PhoGenericQuadraticRhoPtScaledCut::operator()
(
const
reco::PhotonPtr
& pho)
const
{
60
const
double
rho
= (*rhoHandle_);
61
62
const
float
var
=
varFunc_
(*pho);
63
64
const
float
et
= pho->et();
65
const
float
absEta =
std::abs
(pho->superCluster()->eta());
66
const
float
cutValue =
constTerm_
(pho) +
rhoEA_
.
getLinearEA
(absEta) *
rho
+
67
rhoEA_
.
getQuadraticEA
(absEta) *
rho
*
rho
+
linearPtTerm_
(pho) *
et
+
68
quadraticPtTerm_
(pho) *
et
*
et
;
69
if
(
lessThan_
)
70
return
var
< cutValue;
71
else
72
return
var
>= cutValue;
73
}
74
75
double
PhoGenericQuadraticRhoPtScaledCut::value
(
const
reco::CandidatePtr
&
cand
)
const
{
76
reco::PhotonPtr
pho(
cand
);
77
return
varFunc_
(*pho);
78
}
DDAxes::rho
makeMEIFBenchmarkPlots.ev
ev
Definition:
makeMEIFBenchmarkPlots.py:55
CutApplicatorWithEventContentBase
Definition:
CutApplicatorWithEventContentBase.h:19
PhoGenericQuadraticRhoPtScaledCut::value
double value(const reco::CandidatePtr &cand) const final
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:75
DummyCfis.c
c
Definition:
DummyCfis.py:86
CutApplicatorWithEventContentBase::contentTags_
std::unordered_map< std::string, edm::InputTag > contentTags_
Definition:
CutApplicatorWithEventContentBase.h:35
runTheMatrix.const
const
Definition:
runTheMatrix.py:374
trigObjTnPSource_cfi.var
var
Definition:
trigObjTnPSource_cfi.py:21
PhoGenericQuadraticRhoPtScaledCut
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:8
PhoGenericQuadraticRhoPtScaledCut::rhoEA_
EffectiveAreas rhoEA_
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:28
gpuPixelDoublets::cc
uint32_t cc[maxCellsPerHit]
Definition:
gpuFishbone.h:49
edm::Handle< double >
Photon.h
HLT_2024v13_cff.rhoTag
rhoTag
Definition:
HLT_2024v13_cff.py:18024
EffectiveAreas.h
std
Definition:
JetResolutionObject.h:76
PhoGenericQuadraticRhoPtScaledCut::getEventContent
void getEventContent(const edm::EventBase &) final
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:55
PhoGenericQuadraticRhoPtScaledCut::setConsumes
void setConsumes(edm::ConsumesCollector &) final
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:50
EBEECutValuesT< double >
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
PhoGenericQuadraticRhoPtScaledCut::operator()
result_type operator()(const reco::PhotonPtr &) const final
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:59
StringObjectFunction.h
PhoGenericQuadraticRhoPtScaledCut::varFunc_
ThreadSafeFunctor< StringObjectFunction< reco::Photon > > varFunc_
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:22
ThreadSafeFunctor
Definition:
ThreadSafeFunctor.h:12
edmplugin::PluginFactory
Definition:
PluginFactory.h:35
candidate_functions::CandidateCut::result_type
bool result_type
Definition:
CandidateCut.h:11
EffectiveAreas::getQuadraticEA
const float getQuadraticEA(float eta) const
Definition:
EffectiveAreas.cc:105
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
CutApplicatorWithEventContentBase.h
edm::Ptr
Definition:
AssociationVector.h:31
edm::EventBase
Definition:
EventBase.h:47
submitPVValidationJobs.params
def params
Definition:
submitPVValidationJobs.py:483
PhoGenericQuadraticRhoPtScaledCut::candidateType
CandidateType candidateType() const final
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:19
ThreadSafeFunctor.h
PhoGenericQuadraticRhoPtScaledCut::rhoHandle_
edm::Handle< double > rhoHandle_
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:32
EBEECutValues.h
CutApplicatorWithEventContentBase::contentTokens_
std::unordered_map< std::string, edm::EDGetToken > contentTokens_
Definition:
CutApplicatorWithEventContentBase.h:40
PhoGenericQuadraticRhoPtScaledCut::constTerm_
EBEECutValues constTerm_
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:27
nano_mu_local_reco_cff.bool
bool
Definition:
nano_mu_local_reco_cff.py:13
PhoGenericQuadraticRhoPtScaledCut::PhoGenericQuadraticRhoPtScaledCut
PhoGenericQuadraticRhoPtScaledCut(const edm::ParameterSet &c)
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:37
edm
HLT enums.
Definition:
AlignableModifier.h:19
PhoGenericQuadraticRhoPtScaledCut::quadraticPtTerm_
EBEECutValues quadraticPtTerm_
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:30
edm::InputTag
Definition:
InputTag.h:15
PhoGenericQuadraticRhoPtScaledCut::linearPtTerm_
EBEECutValues linearPtTerm_
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:29
CutApplicatorBase::CandidateType
CandidateType
Definition:
CutApplicatorBase.h:47
edm::ParameterSet
Definition:
ParameterSet.h:48
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:123
cand
Definition:
decayParser.h:32
PhoGenericQuadraticRhoPtScaledCut::lessThan_
bool lessThan_
Definition:
PhoGenericQuadraticRhoPtScaledCut.cc:23
CutApplicatorBase::PHOTON
Definition:
CutApplicatorBase.h:47
EffectiveAreas
Definition:
EffectiveAreas.h:7
EffectiveAreas::getLinearEA
const float getLinearEA(float eta) const
Definition:
EffectiveAreas.cc:90
l1tnanotables_cff.et
et
Definition:
l1tnanotables_cff.py:32
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
contentValuesFiles.fullPath
fullPath
Definition:
contentValuesFiles.py:64
Generated for CMSSW Reference Manual by
1.8.14