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
GSFAndECALLinker Class Reference
Inheritance diagram for GSFAndECALLinker:
BlockElementLinkerBase

Public Member Functions

 GSFAndECALLinker (const edm::ParameterSet &conf)
 
double testLink (const reco::PFBlockElement *, const reco::PFBlockElement *) const override
 
- 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 GSFAndECALLinker.cc.

Constructor & Destructor Documentation

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

Definition at line 9 of file GSFAndECALLinker.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 GSFAndECALLinker::testLink ( const reco::PFBlockElement elem1,
const reco::PFBlockElement elem2 
) const
overridevirtual

Implements BlockElementLinkerBase.

Definition at line 27 of file GSFAndECALLinker.cc.

References reco::PFBlockElementCluster::clusterRef(), constexpr, gather_cfg::cout, reco::PFTrajectoryPoint::ECALShowerMax, reco::PFTrack::extrapolatedPoint(), reco::PFBlockElementGsfTrack::GsftrackPF(), reco::PFTrajectoryPoint::isValid(), NULL, LinkByRecHit::testTrackAndClusterByRecHit(), and reco::PFBlockElement::type().

28  {
31  const reco::PFBlockElementCluster *ecalelem(NULL);
32  const reco::PFBlockElementGsfTrack *gsfelem(NULL);
33  double dist(-1.0);
34  if( elem1->type() < elem2->type() ) {
35  ecalelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
36  gsfelem = static_cast<const reco::PFBlockElementGsfTrack*>(elem2);
37  } else {
38  ecalelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
39  gsfelem = static_cast<const reco::PFBlockElementGsfTrack*>(elem1);
40  }
41  const reco::PFRecTrack& track = gsfelem->GsftrackPF();
42  const reco::PFClusterRef& clusterref = ecalelem->clusterRef();
43  const reco::PFTrajectoryPoint& tkAtECAL =
44  track.extrapolatedPoint( ECALShowerMax );
45  if( tkAtECAL.isValid() ) {
46  dist = LinkByRecHit::testTrackAndClusterByRecHit( track, *clusterref,
47  false, _debug );
48  }
49  if ( _debug ) {
50  if ( dist > 0. ) {
51  std::cout << " Here a link has been established"
52  << " between a GSF track an Ecal with dist "
53  << dist << std::endl;
54  } else {
55  if( _debug ) std::cout << " No link found " << std::endl;
56  }
57  }
58 
59  return dist;
60 }
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
Type type() const
#define NULL
Definition: scimark2.h:8
#define constexpr
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:76
bool isValid() const
is this point valid ?
tuple cout
Definition: gather_cfg.py:145
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
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 GSFAndECALLinker::_debug
private
bool GSFAndECALLinker::_useKDTree
private

Definition at line 19 of file GSFAndECALLinker.cc.