CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GSFAndBREMLinker.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 GSFAndBREMLinker::testLink(const reco::PFBlockElement* elem1, const reco::PFBlockElement* elem2) const {
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 }
Abstract base class for a PFBlock element (track, cluster...)
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
Type type() const
const GsfPFRecTrackRef & GsftrackRefPF() const
const GsfPFRecTrackRef & GsftrackRefPF() const
GSFAndBREMLinker(const edm::ParameterSet &conf)
#define DEFINE_EDM_PLUGIN(factory, type, name)
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override