CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 

Private Attributes

bool _debug
 
bool _useKDTree
 

Detailed Description

Definition at line 7 of file TrackAndHOLinker.cc.

Constructor & Destructor Documentation

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

Definition at line 9 of file TrackAndHOLinker.cc.

9  :
11  _useKDTree(conf.getParameter<bool>("useKDTree")),
12  _debug(conf.getUntrackedParameter<bool>("debug",false)) {}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
BlockElementLinkerBase(const edm::ParameterSet &conf)

Member Function Documentation

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

Implements BlockElementLinkerBase.

Definition at line 27 of file TrackAndHOLinker.cc.

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

28  {
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 }
Type type() const
#define NULL
Definition: scimark2.h:8
#define constexpr
bool isNull() const
Checks for null.
Definition: Ref.h:249
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:10

Member Data Documentation

bool TrackAndHOLinker::_debug
private
bool TrackAndHOLinker::_useKDTree
private

Definition at line 19 of file TrackAndHOLinker.cc.