CMS 3D CMS Logo

HFEMAndHFHADLinker.cc
Go to the documentation of this file.
5 
7 public:
10  useKDTree_(conf.getParameter<bool>("useKDTree")),
11  debug_(conf.getUntrackedParameter<bool>("debug", false)) {}
12 
13  double testLink(const reco::PFBlockElement*, const reco::PFBlockElement*) const override;
14 
15 private:
17 };
18 
20 
22  const reco::PFBlockElementCluster *hfemelem(nullptr), *hfhadelem(nullptr);
23  if (elem1->type() < elem2->type()) {
24  hfemelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
25  hfhadelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
26  } else {
27  hfemelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
28  hfhadelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
29  }
30  const reco::PFClusterRef& hfemref = hfemelem->clusterRef();
31  const reco::PFClusterRef& hfhadref = hfhadelem->clusterRef();
32  if (hfemref.isNull() || hfhadref.isNull()) {
33  throw cms::Exception("BadClusterRefs") << "PFBlockElementCluster's refs are null!";
34  }
35  return LinkByRecHit::testHFEMAndHFHADByRecHit(*hfemref, *hfhadref, debug_);
36 }
Abstract base class for a PFBlock element (track, cluster...)
bool isNull() const
Checks for null.
Definition: Ref.h:229
const PFClusterRef & clusterRef() const override
static double testHFEMAndHFHADByRecHit(const reco::PFCluster &clusterHFEM, const reco::PFCluster &clusterHFHAD, bool debug=false)
test association between HFEM and HFHAD, by rechit
HFEMAndHFHADLinker(const edm::ParameterSet &conf)
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
#define DEFINE_EDM_PLUGIN(factory, type, name)