CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GSFAndHCALLinker.cc
Go to the documentation of this file.
6 
8 public:
10  : BlockElementLinkerBase(conf),
11  useKDTree_(conf.getParameter<bool>("useKDTree")),
12  debug_(conf.getUntrackedParameter<bool>("debug", false)) {}
13 
14  double testLink(const reco::PFBlockElement*, const reco::PFBlockElement*) const override;
15 
16 private:
18 };
19 
21 
22 double GSFAndHCALLinker::testLink(const reco::PFBlockElement* elem1, const reco::PFBlockElement* elem2) const {
24  const reco::PFBlockElementCluster* hcalelem(nullptr);
25  const reco::PFBlockElementGsfTrack* gsfelem(nullptr);
26  double dist(-1.0);
27  if (elem1->type() < elem2->type()) {
28  hcalelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
29  gsfelem = static_cast<const reco::PFBlockElementGsfTrack*>(elem2);
30  } else {
31  hcalelem = 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 = hcalelem->clusterRef();
36  const reco::PFTrajectoryPoint& tkAtHCAL = track.extrapolatedPoint(HCALEnt);
37  if (tkAtHCAL.isValid()) {
38  dist = LinkByRecHit::testTrackAndClusterByRecHit(track, *clusterref, false, debug_);
39  }
40  if (debug_) {
41  if (dist > 0.) {
42  std::cout << " Here a link has been established"
43  << " between a GSF track an Hcal with dist " << dist << std::endl;
44  } else {
45  if (debug_)
46  std::cout << " No link found " << std::endl;
47  }
48  }
49 
50  return dist;
51 }
Abstract base class for a PFBlock element (track, cluster...)
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:20
Type type() const
GSFAndHCALLinker(const edm::ParameterSet &conf)
const GsfPFRecTrack & GsftrackPF() const
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:46
const PFClusterRef & clusterRef() const override
bool isValid() const
is this point valid ?
tuple cout
Definition: gather_cfg.py:144
#define DEFINE_EDM_PLUGIN(factory, type, name)
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:18
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override