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 BlockElementLinkerBase &)=delete
 
 BlockElementLinkerBase (const edm::ParameterSet &conf)
 
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)) {}

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.

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 }

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().

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.

edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
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
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Ref< PFClusterCollection >
BlockElementLinkerBase::BlockElementLinkerBase
BlockElementLinkerBase(const edm::ParameterSet &conf)
Definition: BlockElementLinkerBase.h:12
TrackAndHOLinker::debug_
bool debug_
Definition: TrackAndHOLinker.cc:17
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
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::PFBlockElementCluster
Cluster Element.
Definition: PFBlockElementCluster.h:16
Exception
Definition: hltDiff.cc:246
reco::PFBlockElementTrack
Track Element.
Definition: PFBlockElementTrack.h:17
reco::PFBlockElement::type
Type type() const
Definition: PFBlockElement.h:69