CMS 3D CMS Logo

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 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 GSFAndGSFLinker.cc.

Constructor & Destructor Documentation

◆ GSFAndGSFLinker()

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

Definition at line 9 of file GSFAndGSFLinker.cc.

10  : BlockElementLinkerBase(conf),
11  useKDTree_(conf.getParameter<bool>("useKDTree")),
12  debug_(conf.getUntrackedParameter<bool>("debug", false)) {}

Member Function Documentation

◆ testLink()

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

Implements BlockElementLinkerBase.

Definition at line 22 of file GSFAndGSFLinker.cc.

22  {
24  double dist = -1.0;
25  const reco::PFBlockElementGsfTrack* gsfelem1 = static_cast<const reco::PFBlockElementGsfTrack*>(elem1);
26  const reco::PFBlockElementGsfTrack* gsfelem2 = static_cast<const reco::PFBlockElementGsfTrack*>(elem2);
27  const reco::GsfPFRecTrackRef& gsfref1 = gsfelem1->GsftrackRefPF();
28  const reco::GsfPFRecTrackRef& gsfref2 = gsfelem2->GsftrackRefPF();
29  if (gsfref1.isNonnull() && gsfref2.isNonnull()) {
30  if (gsfelem1->trackType(T_FROM_GAMMACONV) != // we want **one** primary GSF
31  gsfelem2->trackType(T_FROM_GAMMACONV) &&
32  gsfref1->trackId() == gsfref2->trackId()) {
33  dist = 0.001;
34  }
35  }
36  return dist;
37 }

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

Member Data Documentation

◆ debug_

bool GSFAndGSFLinker::debug_
private

Definition at line 17 of file GSFAndGSFLinker.cc.

◆ useKDTree_

bool GSFAndGSFLinker::useKDTree_
private

Definition at line 17 of file GSFAndGSFLinker.cc.

GSFAndGSFLinker::debug_
bool debug_
Definition: GSFAndGSFLinker.cc:17
reco::PFBlockElementGsfTrack::trackType
bool trackType(TrackType trType) const override
Definition: PFBlockElementGsfTrack.h:31
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Ref< GsfPFRecTrackCollection >
GSFAndGSFLinker::useKDTree_
bool useKDTree_
Definition: GSFAndGSFLinker.cc:17
BlockElementLinkerBase::BlockElementLinkerBase
BlockElementLinkerBase(const edm::ParameterSet &conf)
Definition: BlockElementLinkerBase.h:12
reco::PFBlockElement::TrackType
TrackType
Definition: PFBlockElement.h:47
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
reco::PFBlockElement::T_FROM_GAMMACONV
Definition: PFBlockElement.h:47
reco::PFBlockElementGsfTrack
Track Element.
Definition: PFBlockElementGsfTrack.h:18
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
reco::PFBlockElementGsfTrack::GsftrackRefPF
const GsfPFRecTrackRef & GsftrackRefPF() const
Definition: PFBlockElementGsfTrack.h:46