RecoParticleFlow
PFProducer
plugins
linkers
TrackAndHOLinker.cc
Go to the documentation of this file.
1
#include "
RecoParticleFlow/PFProducer/interface/BlockElementLinkerBase.h
"
2
#include "
DataFormats/ParticleFlowReco/interface/PFCluster.h
"
3
#include "
DataFormats/ParticleFlowReco/interface/PFBlockElementCluster.h
"
4
#include "
DataFormats/ParticleFlowReco/interface/PFBlockElementTrack.h
"
5
#include "
RecoParticleFlow/PFClusterTools/interface/LinkByRecHit.h
"
6
7
class
TrackAndHOLinker
:
public
BlockElementLinkerBase
{
8
public
:
9
TrackAndHOLinker
(
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
,
TrackAndHOLinker
,
"TrackAndHOLinker"
);
21
22
double
TrackAndHOLinker::testLink
(
const
reco::PFBlockElement
* elem1,
const
reco::PFBlockElement
* elem2)
const
{
23
constexpr
reco::PFTrajectoryPoint::LayerType
HOLayer =
reco::PFTrajectoryPoint::HOLayer
;
24
const
reco::PFBlockElementTrack
* tkelem(
nullptr
);
25
const
reco::PFBlockElementCluster
* hoelem(
nullptr
);
26
double
dist(-1.0);
27
if
(elem1->
type
() < elem2->
type
()) {
28
tkelem = static_cast<const reco::PFBlockElementTrack*>(elem1);
29
hoelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
30
}
else
{
31
tkelem = static_cast<const reco::PFBlockElementTrack*>(elem2);
32
hoelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
33
}
34
const
reco::PFClusterRef
& horef = hoelem->
clusterRef
();
35
const
reco::PFRecTrackRef
& tkref = tkelem->
trackRefPF
();
36
if
(horef.
isNull
() || tkref.
isNull
()) {
37
throw
cms::Exception
(
"BadClusterRefs"
) <<
"PFBlockElementCluster's refs are null!"
;
38
}
39
if
(tkelem->
trackRef
()->pt() > 3.00001 && tkref->extrapolatedPoint(HOLayer).isValid()) {
40
dist =
LinkByRecHit::testTrackAndClusterByRecHit
(*tkref, *horef,
false
,
debug_
);
41
}
else
{
42
dist = -1.;
43
}
44
return
dist;
45
}
electrons_cff.bool
bool
Definition:
electrons_cff.py:372
funct::false
false
Definition:
Factorize.h:34
PFBlockElementCluster.h
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition:
Ref.h:235
TrackAndHOLinker::testLink
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
Definition:
TrackAndHOLinker.cc:22
reco::PFBlockElementTrack::trackRef
const reco::TrackRef & trackRef() const override
Definition:
PFBlockElementTrack.h:49
reco::PFTrajectoryPoint::HOLayer
HO layer.
Definition:
PFTrajectoryPoint.h:52
LinkByRecHit::testTrackAndClusterByRecHit
static double testTrackAndClusterByRecHit(const reco::PFRecTrack &track, const reco::PFCluster &cluster, bool isBrem=false, bool debug=false)
Definition:
LinkByRecHit.cc:16
TrackAndHOLinker
Definition:
TrackAndHOLinker.cc:7
BlockElementLinkerBase
Definition:
BlockElementLinkerBase.h:10
edm::Ref< PFClusterCollection >
TrackAndHOLinker::TrackAndHOLinker
TrackAndHOLinker(const edm::ParameterSet &conf)
Definition:
TrackAndHOLinker.cc:9
reco::PFBlockElementTrack::trackRefPF
const PFRecTrackRef & trackRefPF() const override
Definition:
PFBlockElementTrack.h:46
PFCluster.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:124
edm::ParameterSet
Definition:
ParameterSet.h:36
TrackAndHOLinker::debug_
bool debug_
Definition:
TrackAndHOLinker.cc:17
edmplugin::PluginFactory
Definition:
PluginFactory.h:34
LinkByRecHit.h
reco::PFTrajectoryPoint::LayerType
LayerType
Define the different layers where the track can be propagated.
Definition:
PFTrajectoryPoint.h:34
TrackAndHOLinker::useKDTree_
bool useKDTree_
Definition:
TrackAndHOLinker.cc:17
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition:
PFBlockElement.h:26
reco::PFBlockElementCluster
Cluster Element.
Definition:
PFBlockElementCluster.h:16
Exception
Definition:
hltDiff.cc:246
reco::PFBlockElementTrack
Track Element.
Definition:
PFBlockElementTrack.h:17
BlockElementLinkerBase.h
reco::PFBlockElementCluster::clusterRef
const PFClusterRef & clusterRef() const override
Definition:
PFBlockElementCluster.h:29
reco::PFBlockElement::type
Type type() const
Definition:
PFBlockElement.h:69
PFBlockElementTrack.h
Generated for CMSSW Reference Manual by
1.8.16