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 BlockElementLinkerBase &)=delete
 
 BlockElementLinkerBase (const edm::ParameterSet &conf)
 
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::HFEMAndHFHADLinker ( const edm::ParameterSet conf)
inline

Definition at line 8 of file HFEMAndHFHADLinker.cc.

10  useKDTree_(conf.getParameter<bool>("useKDTree")),
11  debug_(conf.getUntrackedParameter<bool>("debug", false)) {}

Member Function Documentation

◆ testLink()

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

Implements BlockElementLinkerBase.

Definition at line 21 of file HFEMAndHFHADLinker.cc.

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 }

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

Member Data Documentation

◆ debug_

bool HFEMAndHFHADLinker::debug_
private

Definition at line 16 of file HFEMAndHFHADLinker.cc.

Referenced by testLink().

◆ useKDTree_

bool HFEMAndHFHADLinker::useKDTree_
private

Definition at line 16 of file HFEMAndHFHADLinker.cc.

edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
HFEMAndHFHADLinker::useKDTree_
bool useKDTree_
Definition: HFEMAndHFHADLinker.cc:16
edm::Ref< PFClusterCollection >
BlockElementLinkerBase::BlockElementLinkerBase
BlockElementLinkerBase(const edm::ParameterSet &conf)
Definition: BlockElementLinkerBase.h:12
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
reco::PFBlockElementCluster
Cluster Element.
Definition: PFBlockElementCluster.h:16
Exception
Definition: hltDiff.cc:245
HFEMAndHFHADLinker::debug_
bool debug_
Definition: HFEMAndHFHADLinker.cc:16
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
reco::PFBlockElement::type
Type type() const
Definition: PFBlockElement.h:69