CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TrackAndHOLinker Class Reference
Inheritance diagram for TrackAndHOLinker:
BlockElementLinkerBase

Public Member Functions

double testLink (const reco::PFBlockElement *, const reco::PFBlockElement *) const override
 
 TrackAndHOLinker (const edm::ParameterSet &conf)
 
- Public Member Functions inherited from BlockElementLinkerBase
 BlockElementLinkerBase (const edm::ParameterSet &conf)
 
 BlockElementLinkerBase (const BlockElementLinkerBase &)=delete
 
virtual bool linkPrefilter (const reco::PFBlockElement *, const reco::PFBlockElement *) const
 
const std::string & name () const
 
BlockElementLinkerBaseoperator= (const BlockElementLinkerBase &)=delete
 
virtual ~BlockElementLinkerBase ()=default
 

Private Attributes

bool debug_
 
bool useKDTree_
 

Detailed Description

Definition at line 7 of file TrackAndHOLinker.cc.

Constructor & Destructor Documentation

◆ TrackAndHOLinker()

TrackAndHOLinker::TrackAndHOLinker ( const edm::ParameterSet conf)
inline

Definition at line 9 of file TrackAndHOLinker.cc.

10  : BlockElementLinkerBase(conf),
11  useKDTree_(conf.getParameter<bool>("useKDTree")),
12  debug_(conf.getUntrackedParameter<bool>("debug", false)) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T getUntrackedParameter(std::string const &, T const &) const
BlockElementLinkerBase(const edm::ParameterSet &conf)

Member Function Documentation

◆ testLink()

double TrackAndHOLinker::testLink ( const reco::PFBlockElement elem1,
const reco::PFBlockElement elem2 
) const
overridevirtual

Implements BlockElementLinkerBase.

Definition at line 22 of file TrackAndHOLinker.cc.

References reco::PFBlockElementCluster::clusterRef(), debug_, Exception, reco::PFTrajectoryPoint::HOLayer, edm::Ref< C, T, F >::isNull(), LinkByRecHit::testTrackAndClusterByRecHit(), reco::PFBlockElementTrack::trackRef(), reco::PFBlockElementTrack::trackRefPF(), and reco::PFBlockElement::type().

22  {
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 }
bool isNull() const
Checks for null.
Definition: Ref.h:235
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

Member Data Documentation

◆ debug_

bool TrackAndHOLinker::debug_
private

Definition at line 17 of file TrackAndHOLinker.cc.

Referenced by testLink().

◆ useKDTree_

bool TrackAndHOLinker::useKDTree_
private

Definition at line 17 of file TrackAndHOLinker.cc.