CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GSFAndGSFLinker.cc
Go to the documentation of this file.
6 
8 public:
10  : BlockElementLinkerBase(conf),
11  useKDTree_(conf.getParameter<bool>("useKDTree")),
12  debug_(conf.getUntrackedParameter<bool>("debug", false)) {}
13 
14  double testLink(const reco::PFBlockElement*, const reco::PFBlockElement*) const override;
15 
16 private:
18 };
19 
21 
22 double GSFAndGSFLinker::testLink(const reco::PFBlockElement* elem1, const reco::PFBlockElement* elem2) const {
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 }
Abstract base class for a PFBlock element (track, cluster...)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
const GsfPFRecTrackRef & GsftrackRefPF() const
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
bool trackType(TrackType trType) const override
#define DEFINE_EDM_PLUGIN(factory, type, name)
GSFAndGSFLinker(const edm::ParameterSet &conf)