CMS 3D CMS Logo

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 }
electrons_cff.bool
bool
Definition: electrons_cff.py:372
funct::false
false
Definition: Factorize.h:34
PFBlockElementCluster.h
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
TrackAndHOLinker::testLink
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
Definition: TrackAndHOLinker.cc:22
reco::PFBlockElementTrack::trackRef
const reco::TrackRef & trackRef() const override
Definition: PFBlockElementTrack.h:49
reco::PFTrajectoryPoint::HOLayer
HO layer.
Definition: PFTrajectoryPoint.h:52
LinkByRecHit::testTrackAndClusterByRecHit
static double testTrackAndClusterByRecHit(const reco::PFRecTrack &track, const reco::PFCluster &cluster, bool isBrem=false, bool debug=false)
Definition: LinkByRecHit.cc:16
TrackAndHOLinker
Definition: TrackAndHOLinker.cc:7
BlockElementLinkerBase
Definition: BlockElementLinkerBase.h:10
edm::Ref< PFClusterCollection >
TrackAndHOLinker::TrackAndHOLinker
TrackAndHOLinker(const edm::ParameterSet &conf)
Definition: TrackAndHOLinker.cc:9
reco::PFBlockElementTrack::trackRefPF
const PFRecTrackRef & trackRefPF() const override
Definition: PFBlockElementTrack.h:46
PFCluster.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
edm::ParameterSet
Definition: ParameterSet.h:36
TrackAndHOLinker::debug_
bool debug_
Definition: TrackAndHOLinker.cc:17
edmplugin::PluginFactory
Definition: PluginFactory.h:34
LinkByRecHit.h
reco::PFTrajectoryPoint::LayerType
LayerType
Define the different layers where the track can be propagated.
Definition: PFTrajectoryPoint.h:34
TrackAndHOLinker::useKDTree_
bool useKDTree_
Definition: TrackAndHOLinker.cc:17
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition: PFBlockElement.h:26
reco::PFBlockElementCluster
Cluster Element.
Definition: PFBlockElementCluster.h:16
Exception
Definition: hltDiff.cc:246
reco::PFBlockElementTrack
Track Element.
Definition: PFBlockElementTrack.h:17
BlockElementLinkerBase.h
reco::PFBlockElementCluster::clusterRef
const PFClusterRef & clusterRef() const override
Definition: PFBlockElementCluster.h:29
reco::PFBlockElement::type
Type type() const
Definition: PFBlockElement.h:69
PFBlockElementTrack.h