CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
14  ( const reco::PFBlockElement*,
15  const reco::PFBlockElement* ) const override;
16 
17 private:
19 };
20 
23  "HFEMAndHFHADLinker");
24 
26  ( const reco::PFBlockElement* elem1,
27  const reco::PFBlockElement* elem2) const {
28  const reco::PFBlockElementCluster *hfemelem(NULL), *hfhadelem(NULL);
29  if( elem1->type() < elem2->type() ) {
30  hfemelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
31  hfhadelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
32  } else {
33  hfemelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
34  hfhadelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
35  }
36  const reco::PFClusterRef& hfemref = hfemelem->clusterRef();
37  const reco::PFClusterRef& hfhadref = hfhadelem->clusterRef();
38  if( hfemref.isNull() || hfhadref.isNull() ) {
39  throw cms::Exception("BadClusterRefs")
40  << "PFBlockElementCluster's refs are null!";
41  }
42  return LinkByRecHit::testHFEMAndHFHADByRecHit( *hfemref, *hfhadref, _debug );
43 }
Abstract base class for a PFBlock element (track, cluster...)
Type type() const
#define NULL
Definition: scimark2.h:8
const PFClusterRef & clusterRef() const
bool isNull() const
Checks for null.
Definition: Ref.h:249
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)
volatile std::atomic< bool > shutdown_flag false