CMS 3D CMS Logo

TrackAndHOLinker.cc
Go to the documentation of this file.
6 
8 public:
11  _useKDTree(conf.getParameter<bool>("useKDTree")),
12  _debug(conf.getUntrackedParameter<bool>("debug",false)) {}
13 
14  double testLink
15  ( const reco::PFBlockElement*,
16  const reco::PFBlockElement* ) const override;
17 
18 private:
20 };
21 
24  "TrackAndHOLinker");
25 
27  ( const reco::PFBlockElement* elem1,
28  const reco::PFBlockElement* elem2) const {
31  const reco::PFBlockElementTrack *tkelem(NULL);
32  const reco::PFBlockElementCluster *hoelem(NULL);
33  double dist(-1.0);
34  if( elem1->type() < elem2->type() ) {
35  tkelem = static_cast<const reco::PFBlockElementTrack*>(elem1);
36  hoelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
37  } else {
38  tkelem = static_cast<const reco::PFBlockElementTrack*>(elem2);
39  hoelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
40  }
41  const reco::PFClusterRef& horef = hoelem->clusterRef();
42  const reco::PFRecTrackRef& tkref = tkelem->trackRefPF();
43  if( horef.isNull() || tkref.isNull() ) {
44  throw cms::Exception("BadClusterRefs")
45  << "PFBlockElementCluster's refs are null!";
46  }
47  if ( tkelem->trackRef()->pt() > 3.00001 &&
48  tkref->extrapolatedPoint( HOLayer ).isValid() ) {
49  dist = LinkByRecHit::testTrackAndClusterByRecHit( *tkref, *horef,
50  false, _debug );
51  } else {
52  dist = -1.;
53  }
54  return dist;
55 }
Abstract base class for a PFBlock element (track, cluster...)
const reco::TrackRef & trackRef() const
Type type() const
#define NULL
Definition: scimark2.h:8
const PFClusterRef & clusterRef() const
#define constexpr
TrackAndHOLinker(const edm::ParameterSet &conf)
bool isNull() const
Checks for null.
Definition: Ref.h:249
const PFRecTrackRef & trackRefPF() const
#define DEFINE_EDM_PLUGIN(factory, type, name)
LayerType
Define the different layers where the track can be propagated.
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
static double testTrackAndClusterByRecHit(const reco::PFRecTrack &track, const reco::PFCluster &cluster, bool isBrem=false, bool debug=false)
Definition: LinkByRecHit.cc:18