CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
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 }
Abstract base class for a PFBlock element (track, cluster...)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
TrackAndTrackLinker(const edm::ParameterSet &conf)
bool linkPrefilter(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
virtual const ConversionRefVector & convRefs() const
virtual const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const
virtual bool trackType(TrackType trType) const
#define DEFINE_EDM_PLUGIN(factory, type, name)
virtual bool isLinkedToDisplacedVertex() const
virtual const VertexCompositeCandidateRef & V0Ref() const