CMS 3D CMS Logo

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

Public Member Functions

 GSFAndHGCalLinker (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
 
virtual ~BlockElementLinkerBase ()=default
 

Private Attributes

bool _debug
 
bool _useKDTree
 

Detailed Description

Definition at line 7 of file GSFAndHGCalLinker.cc.

Constructor & Destructor Documentation

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

Definition at line 9 of file GSFAndHGCalLinker.cc.

References testLink().

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 GSFAndHGCalLinker::testLink ( const reco::PFBlockElement elem1,
const reco::PFBlockElement elem2 
) const
overridevirtual

Implements BlockElementLinkerBase.

Definition at line 27 of file GSFAndHGCalLinker.cc.

References _debug, reco::PFBlockElementCluster::clusterRef(), LinkByRecHit::computeDist(), constexpr, gather_cfg::cout, reco::PFTrajectoryPoint::ECALShowerMax, reco::PFTrack::extrapolatedPoint(), reco::PFBlockElementGsfTrack::GsftrackPF(), reco::PFTrajectoryPoint::isValid(), reco::PFTrajectoryPoint::positionREP(), HiIsolationCommonParameters_cff::track, and reco::PFBlockElement::type().

Referenced by GSFAndHGCalLinker().

28  {
31  const reco::PFBlockElementCluster *hgcalelem(nullptr);
32  const reco::PFBlockElementGsfTrack *gsfelem(nullptr);
33  double dist(-1.0);
34  if( elem1->type() > elem2->type() ) {
35  hgcalelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
36  gsfelem = static_cast<const reco::PFBlockElementGsfTrack*>(elem2);
37  } else {
38  hgcalelem = 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 = hgcalelem->clusterRef();
43  const reco::PFTrajectoryPoint& tkAtECAL =
44  track.extrapolatedPoint( ECALShowerMax );
45  if( tkAtECAL.isValid() ) {
46  dist = LinkByRecHit::computeDist( tkAtECAL.positionREP().eta(),
47  tkAtECAL.positionREP().phi(),
48  clusterref->positionREP().Eta(),
49  clusterref->positionREP().Phi() );
50  if( dist > 0.3 ) dist = -1.0;
51  }
52  if ( _debug ) {
53  if ( dist > 0. ) {
54  std::cout << " Here a link has been established"
55  << " between a GSF track an HGCal with dist "
56  << dist << std::endl;
57  } else {
58  if( _debug ) std::cout << " No link found " << std::endl;
59  }
60  }
61 
62  return dist;
63 }
const REPPoint & positionREP() const
trajectory position in (rho, eta, phi) base
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
static double computeDist(double eta1, double phi1, double eta2, double phi2, bool etaPhi=true)
computes a chisquare
Type type() const
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:76
bool isValid() const
is this point valid ?
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.
#define constexpr

Member Data Documentation

bool GSFAndHGCalLinker::_debug
private
bool GSFAndHGCalLinker::_useKDTree
private

Definition at line 19 of file GSFAndHGCalLinker.cc.