RecoParticleFlow
PFProducer
plugins
linkers
GSFAndGSFLinker.cc
Go to the documentation of this file.
1
#include "
RecoParticleFlow/PFProducer/interface/BlockElementLinkerBase.h
"
2
#include "
DataFormats/ParticleFlowReco/interface/PFRecTrack.h
"
3
#include "
DataFormats/ParticleFlowReco/interface/PFBlockElementGsfTrack.h
"
4
#include "
DataFormats/ParticleFlowReco/interface/PFBlockElementBrem.h
"
5
#include "
RecoParticleFlow/PFClusterTools/interface/LinkByRecHit.h
"
6
7
class
GSFAndGSFLinker
:
public
BlockElementLinkerBase
{
8
public
:
9
GSFAndGSFLinker
(
const
edm::ParameterSet
& conf)
10
:
BlockElementLinkerBase
(conf),
11
useKDTree_
(conf.getParameter<
bool
>(
"useKDTree"
)),
12
debug_
(conf.getUntrackedParameter<
bool
>(
"debug"
,
false
)) {}
13
14
double
testLink
(
const
reco::PFBlockElement
*,
const
reco::PFBlockElement
*)
const override
;
15
16
private
:
17
bool
useKDTree_
,
debug_
;
18
};
19
20
DEFINE_EDM_PLUGIN
(
BlockElementLinkerFactory
,
GSFAndGSFLinker
,
"GSFAndGSFLinker"
);
21
22
double
GSFAndGSFLinker::testLink
(
const
reco::PFBlockElement
* elem1,
const
reco::PFBlockElement
* elem2)
const
{
23
constexpr
reco::PFBlockElement::TrackType
T_FROM_GAMMACONV =
reco::PFBlockElement::T_FROM_GAMMACONV
;
24
double
dist = -1.0;
25
const
reco::PFBlockElementGsfTrack
* gsfelem1 = static_cast<const reco::PFBlockElementGsfTrack*>(elem1);
26
const
reco::PFBlockElementGsfTrack
* gsfelem2 = static_cast<const reco::PFBlockElementGsfTrack*>(elem2);
27
const
reco::GsfPFRecTrackRef
& gsfref1 = gsfelem1->
GsftrackRefPF
();
28
const
reco::GsfPFRecTrackRef
& gsfref2 = gsfelem2->
GsftrackRefPF
();
29
if
(gsfref1.
isNonnull
() && gsfref2.
isNonnull
()) {
30
if
(gsfelem1->
trackType
(T_FROM_GAMMACONV) !=
// we want **one** primary GSF
31
gsfelem2->
trackType
(T_FROM_GAMMACONV) &&
32
gsfref1->trackId() == gsfref2->trackId()) {
33
dist = 0.001;
34
}
35
}
36
return
dist;
37
}
GSFAndGSFLinker::debug_
bool debug_
Definition:
GSFAndGSFLinker.cc:17
reco::PFBlockElementGsfTrack::trackType
bool trackType(TrackType trType) const override
Definition:
PFBlockElementGsfTrack.h:31
electrons_cff.bool
bool
Definition:
electrons_cff.py:393
funct::false
false
Definition:
Factorize.h:29
PFBlockElementBrem.h
BlockElementLinkerBase
Definition:
BlockElementLinkerBase.h:10
edm::Ref< GsfPFRecTrackCollection >
GSFAndGSFLinker::useKDTree_
bool useKDTree_
Definition:
GSFAndGSFLinker.cc:17
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:124
reco::PFBlockElement::TrackType
TrackType
Definition:
PFBlockElement.h:47
edm::ParameterSet
Definition:
ParameterSet.h:47
edmplugin::PluginFactory
Definition:
PluginFactory.h:34
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition:
Ref.h:238
LinkByRecHit.h
GSFAndGSFLinker::testLink
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
Definition:
GSFAndGSFLinker.cc:22
reco::PFBlockElement::T_FROM_GAMMACONV
Definition:
PFBlockElement.h:47
GSFAndGSFLinker::GSFAndGSFLinker
GSFAndGSFLinker(const edm::ParameterSet &conf)
Definition:
GSFAndGSFLinker.cc:9
PFRecTrack.h
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition:
PFBlockElement.h:26
GSFAndGSFLinker
Definition:
GSFAndGSFLinker.cc:7
reco::PFBlockElementGsfTrack
Track Element.
Definition:
PFBlockElementGsfTrack.h:18
BlockElementLinkerBase.h
reco::PFBlockElementGsfTrack::GsftrackRefPF
const GsfPFRecTrackRef & GsftrackRefPF() const
Definition:
PFBlockElementGsfTrack.h:44
PFBlockElementGsfTrack.h
Generated for CMSSW Reference Manual by
1.8.16