CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HGCalandBREMLinker.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 
24  const reco::PFBlockElementCluster* ecalelem(nullptr);
25  const reco::PFBlockElementBrem* bremelem(nullptr);
26  double dist(-1.0);
27  if (elem1->type() > elem2->type()) {
28  ecalelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
29  bremelem = static_cast<const reco::PFBlockElementBrem*>(elem2);
30  } else {
31  ecalelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
32  bremelem = static_cast<const reco::PFBlockElementBrem*>(elem1);
33  }
34  const reco::PFClusterRef& clusterref = ecalelem->clusterRef();
35  const reco::PFRecTrack& track = bremelem->trackPF();
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  return dist;
46 }
const REPPoint & positionREP() const
trajectory position in (rho, eta, phi) base
Abstract base class for a PFBlock element (track, cluster...)
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:20
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
static double computeDist(double eta1, double phi1, double eta2, double phi2, bool etaPhi=true)
computes a chisquare
HGCalAndBREMLinker(const edm::ParameterSet &conf)
Type type() const
const reco::PFTrajectoryPoint & extrapolatedPoint(unsigned layerid) const
Definition: PFTrack.cc:46
const PFRecTrack & trackPF() const
const PFClusterRef & clusterRef() const override
bool isValid() const
is this point valid ?
#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.