RecoEgamma
ElectronIdentification
plugins
cuts
GsfEleMissingHitsCut.cc
Go to the documentation of this file.
1
#include "
PhysicsTools/SelectorUtils/interface/CutApplicatorBase.h
"
2
#include "
DataFormats/EgammaCandidates/interface/GsfElectron.h
"
3
#include "
DataFormats/GsfTrackReco/interface/GsfTrack.h
"
4
5
class
GsfEleMissingHitsCut
:
public
CutApplicatorBase
{
6
public
:
7
GsfEleMissingHitsCut
(
const
edm::ParameterSet
&
c
)
8
:
CutApplicatorBase
(
c
),
9
_maxMissingHitsEB
(
c
.getParameter<unsigned>(
"maxMissingHitsEB"
)),
10
_maxMissingHitsEE
(
c
.getParameter<unsigned>(
"maxMissingHitsEE"
)),
11
_barrelCutOff
(
c
.getParameter<double>(
"barrelCutOff"
)) {}
12
13
result_type
operator()
(
const
reco::GsfElectronPtr
&)
const
final
;
14
15
double
value
(
const
reco::CandidatePtr
&
cand
)
const
final
;
16
17
CandidateType
candidateType
()
const
final {
return
ELECTRON
; }
18
19
private
:
20
const
unsigned
_maxMissingHitsEB
,
_maxMissingHitsEE
;
21
const
double
_barrelCutOff
;
22
};
23
24
DEFINE_EDM_PLUGIN
(
CutApplicatorFactory
,
GsfEleMissingHitsCut
,
"GsfEleMissingHitsCut"
);
25
26
CutApplicatorBase::result_type
GsfEleMissingHitsCut::operator()
(
const
reco::GsfElectronPtr
&
cand
)
const
{
27
constexpr
auto
missingHitType =
reco::HitPattern::MISSING_INNER_HITS
;
28
const
unsigned
maxMissingHits =
29
(
std::abs
(
cand
->superCluster()->position().eta()) <
_barrelCutOff
?
_maxMissingHitsEB
:
_maxMissingHitsEE
);
30
const
unsigned
mHits =
cand
->gsfTrack()->hitPattern().numberOfLostHits(missingHitType);
31
return
mHits <= maxMissingHits;
32
}
33
34
double
GsfEleMissingHitsCut::value
(
const
reco::CandidatePtr
&
cand
)
const
{
35
constexpr
auto
missingHitType =
reco::HitPattern::MISSING_INNER_HITS
;
36
reco::GsfElectronPtr
ele(
cand
);
37
const
unsigned
mHits = ele->
gsfTrack
()->hitPattern().numberOfLostHits(missingHitType);
38
return
mHits;
39
}
GsfEleMissingHitsCut::operator()
result_type operator()(const reco::GsfElectronPtr &) const final
Definition:
GsfEleMissingHitsCut.cc:26
reco::GsfElectron::gsfTrack
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition:
GsfElectron.h:164
watchdog.const
const
Definition:
watchdog.py:83
GsfEleMissingHitsCut::value
double value(const reco::CandidatePtr &cand) const final
Definition:
GsfEleMissingHitsCut.cc:34
GsfEleMissingHitsCut::_barrelCutOff
const double _barrelCutOff
Definition:
GsfEleMissingHitsCut.cc:21
candidate_functions::CandidateCut::result_type
bool result_type
Definition:
CandidateCut.h:11
GsfEleMissingHitsCut::candidateType
CandidateType candidateType() const final
Definition:
GsfEleMissingHitsCut.cc:17
GsfElectron.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:124
GsfEleMissingHitsCut
Definition:
GsfEleMissingHitsCut.cc:5
edm::ParameterSet
Definition:
ParameterSet.h:36
CutApplicatorBase::CandidateType
CandidateType
Definition:
CutApplicatorBase.h:47
edmplugin::PluginFactory
Definition:
PluginFactory.h:34
cand
Definition:
decayParser.h:34
GsfTrack.h
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:31
GsfEleMissingHitsCut::_maxMissingHitsEB
const unsigned _maxMissingHitsEB
Definition:
GsfEleMissingHitsCut.cc:20
edm::Ptr< reco::GsfElectron >
CutApplicatorBase
Definition:
CutApplicatorBase.h:45
reco::HitPattern::MISSING_INNER_HITS
Definition:
HitPattern.h:155
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
GsfEleMissingHitsCut::GsfEleMissingHitsCut
GsfEleMissingHitsCut(const edm::ParameterSet &c)
Definition:
GsfEleMissingHitsCut.cc:7
CutApplicatorBase.h
CutApplicatorBase::ELECTRON
Definition:
CutApplicatorBase.h:47
GsfEleMissingHitsCut::_maxMissingHitsEE
const unsigned _maxMissingHitsEE
Definition:
GsfEleMissingHitsCut.cc:20
Generated for CMSSW Reference Manual by
1.8.16