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

Public Member Functions

 GSFAndBREMLinker (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 GSFAndBREMLinker.cc.

Constructor & Destructor Documentation

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

Definition at line 9 of file GSFAndBREMLinker.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 GSFAndBREMLinker::testLink ( const reco::PFBlockElement elem1,
const reco::PFBlockElement elem2 
) const
overridevirtual

Implements BlockElementLinkerBase.

Definition at line 27 of file GSFAndBREMLinker.cc.

References reco::PFBlockElementBrem::GsftrackRefPF(), reco::PFBlockElementGsfTrack::GsftrackRefPF(), edm::Ref< C, T, F >::isNonnull(), NULL, and reco::PFBlockElement::type().

28  {
29  double dist = -1.0;
30  const reco::PFBlockElementGsfTrack * gsfelem(NULL);
31  const reco::PFBlockElementBrem * bremelem(NULL);
32  if( elem1->type() < elem2->type() ) {
33  gsfelem = static_cast<const reco::PFBlockElementGsfTrack *>(elem1);
34  bremelem = static_cast<const reco::PFBlockElementBrem *>(elem2);
35  } else {
36  gsfelem = static_cast<const reco::PFBlockElementGsfTrack *>(elem2);
37  bremelem = static_cast<const reco::PFBlockElementBrem *>(elem1);
38  }
39  const reco::GsfPFRecTrackRef& gsfref = gsfelem->GsftrackRefPF();
40  const reco::GsfPFRecTrackRef& bremref = bremelem->GsftrackRefPF();
41  if( gsfref.isNonnull() && bremref.isNonnull() && gsfref == bremref ) {
42  dist = 0.001;
43  }
44  return dist;
45 }
Type type() const
#define NULL
Definition: scimark2.h:8
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250

Member Data Documentation

bool GSFAndBREMLinker::_debug
private
bool GSFAndBREMLinker::_useKDTree
private

Definition at line 19 of file GSFAndBREMLinker.cc.