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 }
HFEMAndHFHADLinker::testLink
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
Definition: HFEMAndHFHADLinker.cc:21
electrons_cff.bool
bool
Definition: electrons_cff.py:393
funct::false
false
Definition: Factorize.h:29
PFBlockElementCluster.h
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
HFEMAndHFHADLinker::HFEMAndHFHADLinker
HFEMAndHFHADLinker(const edm::ParameterSet &conf)
Definition: HFEMAndHFHADLinker.cc:8
HFEMAndHFHADLinker::useKDTree_
bool useKDTree_
Definition: HFEMAndHFHADLinker.cc:16
BlockElementLinkerBase
Definition: BlockElementLinkerBase.h:10
edm::Ref< PFClusterCollection >
PFCluster.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
edm::ParameterSet
Definition: ParameterSet.h:47
edmplugin::PluginFactory
Definition: PluginFactory.h:34
LinkByRecHit.h
LinkByRecHit::testHFEMAndHFHADByRecHit
static double testHFEMAndHFHADByRecHit(const reco::PFCluster &clusterHFEM, const reco::PFCluster &clusterHFHAD, bool debug=false)
test association between HFEM and HFHAD, by rechit
Definition: LinkByRecHit.cc:495
HFEMAndHFHADLinker
Definition: HFEMAndHFHADLinker.cc:6
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition: PFBlockElement.h:26
reco::PFBlockElementCluster
Cluster Element.
Definition: PFBlockElementCluster.h:16
Exception
Definition: hltDiff.cc:246
HFEMAndHFHADLinker::debug_
bool debug_
Definition: HFEMAndHFHADLinker.cc:16
BlockElementLinkerBase.h
reco::PFBlockElementCluster::clusterRef
const PFClusterRef & clusterRef() const override
Definition: PFBlockElementCluster.h:29
reco::PFBlockElement::type
Type type() const
Definition: PFBlockElement.h:69