CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 

Private Attributes

bool _debug
 
bool _useKDTree
 

Detailed Description

Definition at line 7 of file TrackAndTrackLinker.cc.

Constructor & Destructor Documentation

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

Definition at line 9 of file TrackAndTrackLinker.cc.

9  :
11  _useKDTree(conf.getParameter<bool>("useKDTree")),
12  _debug(conf.getUntrackedParameter<bool>("debug",false)) {}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
BlockElementLinkerBase(const edm::ParameterSet &conf)

Member Function Documentation

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

Reimplemented from BlockElementLinkerBase.

Definition at line 29 of file TrackAndTrackLinker.cc.

References reco::PFBlockElement::isLinkedToDisplacedVertex().

30  {
31  return ( e1->isLinkedToDisplacedVertex() ||
33 }
virtual bool isLinkedToDisplacedVertex() const
double TrackAndTrackLinker::testLink ( const reco::PFBlockElement elem1,
const reco::PFBlockElement elem2 
) const
overridevirtual

Implements BlockElementLinkerBase.

Definition at line 36 of file TrackAndTrackLinker.cc.

References constexpr, 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().

37  {
42  double dist = -1.0;
43 
44  const reco::PFDisplacedTrackerVertexRef& ni1_TO_DISP =
45  elem1->displacedVertexRef(T_TO_DISP);
46  const reco::PFDisplacedTrackerVertexRef& ni2_TO_DISP =
47  elem2->displacedVertexRef(T_TO_DISP);
48  const reco::PFDisplacedTrackerVertexRef& ni1_FROM_DISP =
49  elem1->displacedVertexRef(T_FROM_DISP);
50  const reco::PFDisplacedTrackerVertexRef& ni2_FROM_DISP =
51  elem2->displacedVertexRef(T_FROM_DISP);
52 
53  if( ni1_TO_DISP.isNonnull() && ni2_FROM_DISP.isNonnull())
54  if( ni1_TO_DISP == ni2_FROM_DISP ) { dist = 1.0; }
55 
56  if( ni1_FROM_DISP.isNonnull() && ni2_TO_DISP.isNonnull())
57  if( ni1_FROM_DISP == ni2_TO_DISP ) { dist = 1.0; }
58 
59  if( ni1_FROM_DISP.isNonnull() && ni2_FROM_DISP.isNonnull())
60  if( ni1_FROM_DISP == ni2_FROM_DISP ) { dist = 1.0; }
61 
64  for( const auto& conv1 : elem1->convRefs() ) {
65  for( const auto& conv2 : elem2->convRefs() ) {
66  if( conv1.isNonnull() && conv2.isNonnull() &&
67  conv1 == conv2 ) {
68  dist=1.0;
69  break;
70  }
71  }
72  }
73  }
74 
77  if ( elem1->V0Ref().isNonnull() && elem2->V0Ref().isNonnull() ) {
78  if ( elem1->V0Ref() == elem2->V0Ref() ) {
79  dist=1.0;
80  }
81  }
82  }
83 
84  return dist;
85 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
#define constexpr
virtual const ConversionRefVector & convRefs() const
virtual const PFDisplacedTrackerVertexRef & displacedVertexRef(TrackType trType) const
virtual bool trackType(TrackType trType) const
virtual const VertexCompositeCandidateRef & V0Ref() const

Member Data Documentation

bool TrackAndTrackLinker::_debug
private
bool TrackAndTrackLinker::_useKDTree
private

Definition at line 21 of file TrackAndTrackLinker.cc.