CMS 3D CMS Logo

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
 
virtual ~BlockElementLinkerBase ()=default
 

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.

References testLink().

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 21 of file HFEMAndHFHADLinker.cc.

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

Referenced by HFEMAndHFHADLinker().

21  {
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 }
Type type() const
bool isNull() const
Checks for null.
Definition: Ref.h:235
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

Definition at line 16 of file HFEMAndHFHADLinker.cc.

Referenced by testLink().

bool HFEMAndHFHADLinker::useKDTree_
private

Definition at line 16 of file HFEMAndHFHADLinker.cc.