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

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.

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 }

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

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.

edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Ref< GsfPFRecTrackCollection >
reco::PFBlockElementBrem
Track Element.
Definition: PFBlockElementBrem.h:17
BlockElementLinkerBase::BlockElementLinkerBase
BlockElementLinkerBase(const edm::ParameterSet &conf)
Definition: BlockElementLinkerBase.h:12
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
GSFAndBREMLinker::debug_
bool debug_
Definition: GSFAndBREMLinker.cc:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::PFBlockElementGsfTrack
Track Element.
Definition: PFBlockElementGsfTrack.h:18
GSFAndBREMLinker::useKDTree_
bool useKDTree_
Definition: GSFAndBREMLinker.cc:17
reco::PFBlockElement::type
Type type() const
Definition: PFBlockElement.h:69