CMS 3D CMS Logo

TrackAndTrackLinker.cc
Go to the documentation of this file.
6 
8 public:
10  : BlockElementLinkerBase(conf),
11  useKDTree_(conf.getParameter<bool>("useKDTree")),
12  debug_(conf.getUntrackedParameter<bool>("debug", false)) {}
13 
14  bool linkPrefilter(const reco::PFBlockElement*, const reco::PFBlockElement*) const override;
15 
16  double testLink(const reco::PFBlockElement*, const reco::PFBlockElement*) const override;
17 
18 private:
20 };
21 
23 
25  return (e1->isLinkedToDisplacedVertex() || e2->isLinkedToDisplacedVertex());
26 }
27 
31  double dist = -1.0;
32 
33  const reco::PFDisplacedTrackerVertexRef& ni1_TO_DISP = elem1->displacedVertexRef(T_TO_DISP);
34  const reco::PFDisplacedTrackerVertexRef& ni2_TO_DISP = elem2->displacedVertexRef(T_TO_DISP);
35  const reco::PFDisplacedTrackerVertexRef& ni1_FROM_DISP = elem1->displacedVertexRef(T_FROM_DISP);
36  const reco::PFDisplacedTrackerVertexRef& ni2_FROM_DISP = elem2->displacedVertexRef(T_FROM_DISP);
37 
38  if (ni1_TO_DISP.isNonnull() && ni2_FROM_DISP.isNonnull())
39  if (ni1_TO_DISP == ni2_FROM_DISP) {
40  dist = 1.0;
41  }
42 
43  if (ni1_FROM_DISP.isNonnull() && ni2_TO_DISP.isNonnull())
44  if (ni1_FROM_DISP == ni2_TO_DISP) {
45  dist = 1.0;
46  }
47 
48  if (ni1_FROM_DISP.isNonnull() && ni2_FROM_DISP.isNonnull())
49  if (ni1_FROM_DISP == ni2_FROM_DISP) {
50  dist = 1.0;
51  }
52 
55  for (const auto& conv1 : elem1->convRefs()) {
56  for (const auto& conv2 : elem2->convRefs()) {
57  if (conv1.isNonnull() && conv2.isNonnull() && conv1 == conv2) {
58  dist = 1.0;
59  break;
60  }
61  }
62  }
63  }
64 
66  if (elem1->V0Ref().isNonnull() && elem2->V0Ref().isNonnull()) {
67  if (elem1->V0Ref() == elem2->V0Ref()) {
68  dist = 1.0;
69  }
70  }
71  }
72 
73  return dist;
74 }
reco::PFBlockElement::trackType
virtual bool trackType(TrackType trType) const
Definition: PFBlockElement.h:72
electrons_cff.bool
bool
Definition: electrons_cff.py:372
TrackAndTrackLinker
Definition: TrackAndTrackLinker.cc:7
TrackAndTrackLinker::testLink
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
Definition: TrackAndTrackLinker.cc:28
funct::false
false
Definition: Factorize.h:34
reco::PFBlockElement::V0Ref
virtual const VertexCompositeCandidateRef & V0Ref() const
Definition: PFBlockElement.h:94
PFBlockElementCluster.h
TrackAndTrackLinker::debug_
bool debug_
Definition: TrackAndTrackLinker.cc:19
reco::PFBlockElement::T_TO_DISP
Definition: PFBlockElement.h:47
reco::PFBlockElement::isLinkedToDisplacedVertex
virtual bool isLinkedToDisplacedVertex() const
Definition: PFBlockElement.h:111
BlockElementLinkerBase
Definition: BlockElementLinkerBase.h:10
edm::Ref< PFDisplacedTrackerVertexCollection >
PFCluster.h
TrackAndTrackLinker::linkPrefilter
bool linkPrefilter(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
Definition: TrackAndTrackLinker.cc:24
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
reco::PFBlockElement::T_FROM_V0
Definition: PFBlockElement.h:47
reco::PFBlockElement::TrackType
TrackType
Definition: PFBlockElement.h:47
reco::PFBlockElement::T_FROM_DISP
Definition: PFBlockElement.h:47
edm::ParameterSet
Definition: ParameterSet.h:36
reco::PFBlockElement::convRefs
virtual const ConversionRefVector & convRefs() const
Definition: PFBlockElement.h:92
edmplugin::PluginFactory
Definition: PluginFactory.h:34
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
LinkByRecHit.h
StorageManager_cfg.e1
e1
Definition: StorageManager_cfg.py:16
reco::PFBlockElement::T_FROM_GAMMACONV
Definition: PFBlockElement.h:47
TrackAndTrackLinker::useKDTree_
bool useKDTree_
Definition: TrackAndTrackLinker.cc:19
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition: PFBlockElement.h:26
reco::PFBlockElement::displacedVertexRef
virtual const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const
Definition: PFBlockElement.h:91
BlockElementLinkerBase.h
PFBlockElementTrack.h
TrackAndTrackLinker::TrackAndTrackLinker
TrackAndTrackLinker(const edm::ParameterSet &conf)
Definition: TrackAndTrackLinker.cc:9