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 BlockElementLinkerBase &)=delete
 
 BlockElementLinkerBase (const edm::ParameterSet &conf)
 
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)) {}

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.

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

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

◆ testLink()

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

Implements BlockElementLinkerBase.

Definition at line 28 of file TrackAndTrackLinker.cc.

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 }

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().

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.

reco::PFBlockElement::trackType
virtual bool trackType(TrackType trType) const
Definition: PFBlockElement.h:72
reco::PFBlockElement::V0Ref
virtual const VertexCompositeCandidateRef & V0Ref() const
Definition: PFBlockElement.h:94
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
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Ref< PFDisplacedTrackerVertexCollection >
BlockElementLinkerBase::BlockElementLinkerBase
BlockElementLinkerBase(const edm::ParameterSet &conf)
Definition: BlockElementLinkerBase.h:12
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
reco::PFBlockElement::convRefs
virtual const ConversionRefVector & convRefs() const
Definition: PFBlockElement.h:92
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
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::displacedVertexRef
virtual const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const
Definition: PFBlockElement.h:91
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303