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 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 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)) {}
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 GSFAndGSFLinker::testLink ( const reco::PFBlockElement elem1,
const reco::PFBlockElement elem2 
) const
overridevirtual

Implements BlockElementLinkerBase.

Definition at line 22 of file GSFAndGSFLinker.cc.

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

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 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
bool trackType(TrackType trType) const override
const GsfPFRecTrackRef & GsftrackRefPF() const

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.