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
GSFAndGSFLinker Class Reference
Inheritance diagram for GSFAndGSFLinker:
BlockElementLinkerBase

Public Member Functions

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

Private Attributes

bool _debug
 
bool _useKDTree
 

Detailed Description

Definition at line 7 of file GSFAndGSFLinker.cc.

Constructor & Destructor Documentation

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

Definition at line 9 of file GSFAndGSFLinker.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

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

Implements BlockElementLinkerBase.

Definition at line 27 of file GSFAndGSFLinker.cc.

References constexpr, reco::PFBlockElementGsfTrack::GsftrackRefPF(), edm::Ref< C, T, F >::isNonnull(), reco::PFBlockElement::T_FROM_GAMMACONV, and reco::PFBlockElementGsfTrack::trackType().

28  {
31  double dist = -1.0;
32  const reco::PFBlockElementGsfTrack * gsfelem1 =
33  static_cast<const reco::PFBlockElementGsfTrack *>(elem1);
34  const reco::PFBlockElementGsfTrack * gsfelem2 =
35  static_cast<const reco::PFBlockElementGsfTrack *>(elem2);
36  const reco::GsfPFRecTrackRef& gsfref1 = gsfelem1->GsftrackRefPF();
37  const reco::GsfPFRecTrackRef& gsfref2 = gsfelem2->GsftrackRefPF();
38  if( gsfref1.isNonnull() && gsfref2.isNonnull() ) {
39  if( gsfelem1->trackType(T_FROM_GAMMACONV) != // we want **one** primary GSF
40  gsfelem2->trackType(T_FROM_GAMMACONV) &&
41  gsfref1->trackId() == gsfref2->trackId() ) {
42  dist = 0.001;
43  }
44  }
45  return dist;
46 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
const GsfPFRecTrackRef & GsftrackRefPF() const
#define constexpr
virtual bool trackType(TrackType trType) const

Member Data Documentation

bool GSFAndGSFLinker::_debug
private
bool GSFAndGSFLinker::_useKDTree
private

Definition at line 19 of file GSFAndGSFLinker.cc.