CMS 3D CMS Logo

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
 
virtual ~BlockElementLinkerBase ()=default
 

Private Attributes

bool debug_
 
bool useKDTree_
 

Detailed Description

Definition at line 7 of file GSFAndBREMLinker.cc.

Constructor & Destructor Documentation

◆ GSFAndBREMLinker()

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

Definition at line 9 of file GSFAndBREMLinker.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:307
T getUntrackedParameter(std::string const &, T const &) const
BlockElementLinkerBase(const edm::ParameterSet &conf)

Member Function Documentation

◆ testLink()

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

Implements BlockElementLinkerBase.

Definition at line 22 of file GSFAndBREMLinker.cc.

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

22  {
23  double dist = -1.0;
24  const reco::PFBlockElementGsfTrack* gsfelem(nullptr);
25  const reco::PFBlockElementBrem* bremelem(nullptr);
26  if (elem1->type() < elem2->type()) {
27  gsfelem = static_cast<const reco::PFBlockElementGsfTrack*>(elem1);
28  bremelem = static_cast<const reco::PFBlockElementBrem*>(elem2);
29  } else {
30  gsfelem = static_cast<const reco::PFBlockElementGsfTrack*>(elem2);
31  bremelem = static_cast<const reco::PFBlockElementBrem*>(elem1);
32  }
33  const reco::GsfPFRecTrackRef& gsfref = gsfelem->GsftrackRefPF();
34  const reco::GsfPFRecTrackRef& bremref = bremelem->GsftrackRefPF();
35  if (gsfref.isNonnull() && bremref.isNonnull() && gsfref == bremref) {
36  dist = 0.001;
37  }
38  return dist;
39 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238

Member Data Documentation

◆ debug_

bool GSFAndBREMLinker::debug_
private

Definition at line 17 of file GSFAndBREMLinker.cc.

◆ useKDTree_

bool GSFAndBREMLinker::useKDTree_
private

Definition at line 17 of file GSFAndBREMLinker.cc.