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 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 GSFAndHGCalLinker.cc.

Constructor & Destructor Documentation

◆ GSFAndHGCalLinker()

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

Definition at line 9 of file GSFAndHGCalLinker.cc.

10  : BlockElementLinkerBase(conf),
11  useKDTree_(conf.getParameter<bool>("useKDTree")),
12  debug_(conf.getUntrackedParameter<bool>("debug", false)) {}

Member Function Documentation

◆ testLink()

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

Implements BlockElementLinkerBase.

Definition at line 22 of file GSFAndHGCalLinker.cc.

22  {
24  const reco::PFBlockElementCluster* hgcalelem(nullptr);
25  const reco::PFBlockElementGsfTrack* gsfelem(nullptr);
26  double dist(-1.0);
27  if (elem1->type() > elem2->type()) {
28  hgcalelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
29  gsfelem = static_cast<const reco::PFBlockElementGsfTrack*>(elem2);
30  } else {
31  hgcalelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
32  gsfelem = static_cast<const reco::PFBlockElementGsfTrack*>(elem1);
33  }
34  const reco::PFRecTrack& track = gsfelem->GsftrackPF();
35  const reco::PFClusterRef& clusterref = hgcalelem->clusterRef();
36  const reco::PFTrajectoryPoint& tkAtECAL = track.extrapolatedPoint(ECALShowerMax);
37  if (tkAtECAL.isValid()) {
38  dist = LinkByRecHit::computeDist(tkAtECAL.positionREP().eta(),
39  tkAtECAL.positionREP().phi(),
40  clusterref->positionREP().Eta(),
41  clusterref->positionREP().Phi());
42  if (dist > 0.3)
43  dist = -1.0;
44  }
45  if (debug_) {
46  if (dist > 0.) {
47  std::cout << " Here a link has been established"
48  << " between a GSF track an HGCal with dist " << dist << std::endl;
49  } else {
50  if (debug_)
51  std::cout << " No link found " << std::endl;
52  }
53  }
54 
55  return dist;
56 }

References reco::PFBlockElementCluster::clusterRef(), LinkByRecHit::computeDist(), gather_cfg::cout, debug_, reco::PFTrajectoryPoint::ECALShowerMax, reco::PFBlockElementGsfTrack::GsftrackPF(), reco::PFTrajectoryPoint::isValid(), reco::PFTrajectoryPoint::positionREP(), HLT_2018_cff::track, and reco::PFBlockElement::type().

Member Data Documentation

◆ debug_

bool GSFAndHGCalLinker::debug_
private

Definition at line 17 of file GSFAndHGCalLinker.cc.

Referenced by testLink().

◆ useKDTree_

bool GSFAndHGCalLinker::useKDTree_
private

Definition at line 17 of file GSFAndHGCalLinker.cc.

GSFAndHGCalLinker::useKDTree_
bool useKDTree_
Definition: GSFAndHGCalLinker.cc:17
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Ref< PFClusterCollection >
reco::PFTrajectoryPoint::positionREP
const REPPoint & positionREP() const
trajectory position in (rho, eta, phi) base
Definition: PFTrajectoryPoint.h:103
reco::PFTrajectoryPoint::ECALShowerMax
Definition: PFTrajectoryPoint.h:46
BlockElementLinkerBase::BlockElementLinkerBase
BlockElementLinkerBase(const edm::ParameterSet &conf)
Definition: BlockElementLinkerBase.h:12
reco::PFTrajectoryPoint::LayerType
LayerType
Define the different layers where the track can be propagated.
Definition: PFTrajectoryPoint.h:34
reco::PFTrajectoryPoint::isValid
bool isValid() const
is this point valid ?
Definition: PFTrajectoryPoint.h:84
GSFAndHGCalLinker::debug_
bool debug_
Definition: GSFAndHGCalLinker.cc:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::PFBlockElementGsfTrack
Track Element.
Definition: PFBlockElementGsfTrack.h:18
reco::PFRecTrack
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
reco::PFTrajectoryPoint
A PFTrack holds several trajectory points, which basically contain the position and momentum of a tra...
Definition: PFTrajectoryPoint.h:26
reco::PFBlockElementCluster
Cluster Element.
Definition: PFBlockElementCluster.h:16
reco::PFBlockElement::type
Type type() const
Definition: PFBlockElement.h:69
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
LinkByRecHit::computeDist
static double computeDist(double eta1, double phi1, double eta2, double phi2, bool etaPhi=true)
computes a chisquare
Definition: LinkByRecHit.cc:517