CMS 3D CMS Logo

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 }
electrons_cff.bool
bool
Definition: electrons_cff.py:372
funct::false
false
Definition: Factorize.h:34
reco::PFBlockElementBrem::GsftrackRefPF
const GsfPFRecTrackRef & GsftrackRefPF() const
Definition: PFBlockElementBrem.h:29
GSFAndBREMLinker
Definition: GSFAndBREMLinker.cc:7
PFBlockElementBrem.h
BlockElementLinkerBase
Definition: BlockElementLinkerBase.h:10
edm::Ref< GsfPFRecTrackCollection >
reco::PFBlockElementBrem
Track Element.
Definition: PFBlockElementBrem.h:17
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
edm::ParameterSet
Definition: ParameterSet.h:36
edmplugin::PluginFactory
Definition: PluginFactory.h:34
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
LinkByRecHit.h
GSFAndBREMLinker::testLink
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
Definition: GSFAndBREMLinker.cc:22
PFRecTrack.h
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition: PFBlockElement.h:26
GSFAndBREMLinker::debug_
bool debug_
Definition: GSFAndBREMLinker.cc:17
reco::PFBlockElementGsfTrack
Track Element.
Definition: PFBlockElementGsfTrack.h:18
GSFAndBREMLinker::useKDTree_
bool useKDTree_
Definition: GSFAndBREMLinker.cc:17
BlockElementLinkerBase.h
reco::PFBlockElementGsfTrack::GsftrackRefPF
const GsfPFRecTrackRef & GsftrackRefPF() const
Definition: PFBlockElementGsfTrack.h:44
reco::PFBlockElement::type
Type type() const
Definition: PFBlockElement.h:69
PFBlockElementGsfTrack.h
GSFAndBREMLinker::GSFAndBREMLinker
GSFAndBREMLinker(const edm::ParameterSet &conf)
Definition: GSFAndBREMLinker.cc:9