CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TrackAndTrackLinker Class Reference
Inheritance diagram for TrackAndTrackLinker:
BlockElementLinkerBase

Public Member Functions

bool linkPrefilter (const reco::PFBlockElement *, const reco::PFBlockElement *) const override
 
double testLink (const reco::PFBlockElement *, const reco::PFBlockElement *) const override
 
 TrackAndTrackLinker (const edm::ParameterSet &conf)
 
- Public Member Functions inherited from BlockElementLinkerBase
 BlockElementLinkerBase (const edm::ParameterSet &conf)
 
 BlockElementLinkerBase (const BlockElementLinkerBase &)=delete
 
const std::string & name () const
 
BlockElementLinkerBaseoperator= (const BlockElementLinkerBase &)=delete
 
virtual ~BlockElementLinkerBase ()=default
 

Private Attributes

bool debug_
 
bool useKDTree_
 

Detailed Description

Definition at line 7 of file TrackAndTrackLinker.cc.

Constructor & Destructor Documentation

◆ TrackAndTrackLinker()

TrackAndTrackLinker::TrackAndTrackLinker ( const edm::ParameterSet conf)
inline

Definition at line 9 of file TrackAndTrackLinker.cc.

10  : BlockElementLinkerBase(conf),
11  useKDTree_(conf.getParameter<bool>("useKDTree")),
12  debug_(conf.getUntrackedParameter<bool>("debug", false)) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
T getUntrackedParameter(std::string const &, T const &) const
BlockElementLinkerBase(const edm::ParameterSet &conf)

Member Function Documentation

◆ linkPrefilter()

bool TrackAndTrackLinker::linkPrefilter ( const reco::PFBlockElement e1,
const reco::PFBlockElement e2 
) const
overridevirtual

Reimplemented from BlockElementLinkerBase.

Definition at line 24 of file TrackAndTrackLinker.cc.

References StorageManager_cfg::e1, and reco::PFBlockElement::isLinkedToDisplacedVertex().

24  {
25  return (e1->isLinkedToDisplacedVertex() || e2->isLinkedToDisplacedVertex());
26 }
virtual bool isLinkedToDisplacedVertex() const

◆ testLink()

double TrackAndTrackLinker::testLink ( const reco::PFBlockElement elem1,
const reco::PFBlockElement elem2 
) const
overridevirtual

Implements BlockElementLinkerBase.

Definition at line 28 of file TrackAndTrackLinker.cc.

References reco::PFBlockElement::convRefs(), reco::PFBlockElement::displacedVertexRef(), edm::Ref< C, T, F >::isNonnull(), reco::PFBlockElement::T_FROM_DISP, reco::PFBlockElement::T_FROM_GAMMACONV, reco::PFBlockElement::T_FROM_V0, reco::PFBlockElement::T_TO_DISP, reco::PFBlockElement::trackType(), and reco::PFBlockElement::V0Ref().

28  {
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 }
virtual const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const
virtual const ConversionRefVector & convRefs() const
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
virtual const VertexCompositeCandidateRef & V0Ref() const
virtual bool trackType(TrackType trType) const

Member Data Documentation

◆ debug_

bool TrackAndTrackLinker::debug_
private

Definition at line 19 of file TrackAndTrackLinker.cc.

◆ useKDTree_

bool TrackAndTrackLinker::useKDTree_
private

Definition at line 19 of file TrackAndTrackLinker.cc.