CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TrackAndHOLinker.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 TrackAndHOLinker::testLink(const reco::PFBlockElement* elem1, const reco::PFBlockElement* elem2) const {
24  const reco::PFBlockElementTrack* tkelem(nullptr);
25  const reco::PFBlockElementCluster* hoelem(nullptr);
26  double dist(-1.0);
27  if (elem1->type() < elem2->type()) {
28  tkelem = static_cast<const reco::PFBlockElementTrack*>(elem1);
29  hoelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
30  } else {
31  tkelem = static_cast<const reco::PFBlockElementTrack*>(elem2);
32  hoelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
33  }
34  const reco::PFClusterRef& horef = hoelem->clusterRef();
35  const reco::PFRecTrackRef& tkref = tkelem->trackRefPF();
36  if (horef.isNull() || tkref.isNull()) {
37  throw cms::Exception("BadClusterRefs") << "PFBlockElementCluster's refs are null!";
38  }
39  if (tkelem->trackRef()->pt() > 3.00001 && tkref->extrapolatedPoint(HOLayer).isValid()) {
40  dist = LinkByRecHit::testTrackAndClusterByRecHit(*tkref, *horef, false, debug_);
41  } else {
42  dist = -1.;
43  }
44  return dist;
45 }
Abstract base class for a PFBlock element (track, cluster...)
Type type() const
TrackAndHOLinker(const edm::ParameterSet &conf)
bool isNull() const
Checks for null.
Definition: Ref.h:235
const PFClusterRef & clusterRef() const override
const reco::TrackRef & trackRef() const override
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
#define DEFINE_EDM_PLUGIN(factory, type, name)
const PFRecTrackRef & trackRefPF() const override
LayerType
Define the different layers where the track can be propagated.
static double testTrackAndClusterByRecHit(const reco::PFRecTrack &track, const reco::PFCluster &cluster, bool isBrem=false, bool debug=false)
Definition: LinkByRecHit.cc:18