CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
HFEMAndHFHADLinker Class Reference
Inheritance diagram for HFEMAndHFHADLinker:
BlockElementLinkerBase

Public Member Functions

 HFEMAndHFHADLinker (const edm::ParameterSet &conf)
 
double testLink (const reco::PFBlockElement *, const reco::PFBlockElement *) const override
 
- Public Member Functions inherited from BlockElementLinkerBase
 BlockElementLinkerBase (const edm::ParameterSet &conf)
 
 BlockElementLinkerBase (const BlockElementLinkerBase &)=delete
 
virtual bool linkPrefilter (const reco::PFBlockElement *, const reco::PFBlockElement *) const
 
const std::string & name () const
 
BlockElementLinkerBaseoperator= (const BlockElementLinkerBase &)=delete
 

Private Attributes

bool _debug
 
bool _useKDTree
 

Detailed Description

Definition at line 6 of file HFEMAndHFHADLinker.cc.

Constructor & Destructor Documentation

HFEMAndHFHADLinker::HFEMAndHFHADLinker ( const edm::ParameterSet conf)
inline

Definition at line 8 of file HFEMAndHFHADLinker.cc.

8  :
10  _useKDTree(conf.getParameter<bool>("useKDTree")),
11  _debug(conf.getUntrackedParameter<bool>("debug",false)) {}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
BlockElementLinkerBase(const edm::ParameterSet &conf)

Member Function Documentation

double HFEMAndHFHADLinker::testLink ( const reco::PFBlockElement elem1,
const reco::PFBlockElement elem2 
) const
overridevirtual

Implements BlockElementLinkerBase.

Definition at line 26 of file HFEMAndHFHADLinker.cc.

References reco::PFBlockElementCluster::clusterRef(), Exception, edm::Ref< C, T, F >::isNull(), NULL, LinkByRecHit::testHFEMAndHFHADByRecHit(), and reco::PFBlockElement::type().

27  {
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 }
Type type() const
#define NULL
Definition: scimark2.h:8
bool isNull() const
Checks for null.
Definition: Ref.h:247
static double testHFEMAndHFHADByRecHit(const reco::PFCluster &clusterHFEM, const reco::PFCluster &clusterHFHAD, bool debug=false)
test association between HFEM and HFHAD, by rechit

Member Data Documentation

bool HFEMAndHFHADLinker::_debug
private
bool HFEMAndHFHADLinker::_useKDTree
private

Definition at line 18 of file HFEMAndHFHADLinker.cc.