CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HCALAndHOLinker Class Reference
Inheritance diagram for HCALAndHOLinker:
BlockElementLinkerBase

Public Member Functions

 HCALAndHOLinker (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 HCALAndHOLinker.cc.

Constructor & Destructor Documentation

◆ HCALAndHOLinker()

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

Definition at line 8 of file HCALAndHOLinker.cc.

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

Member Function Documentation

◆ testLink()

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

Implements BlockElementLinkerBase.

Definition at line 21 of file HCALAndHOLinker.cc.

21  {
22  const reco::PFBlockElementCluster *hcalelem(nullptr), *hoelem(nullptr);
23  double dist(-1.0);
24  if (elem1->type() < elem2->type()) {
25  hcalelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
26  hoelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
27  } else {
28  hcalelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
29  hoelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
30  }
31  const reco::PFClusterRef& hcalref = hcalelem->clusterRef();
32  const reco::PFClusterRef& horef = hoelem->clusterRef();
33  const reco::PFCluster::REPPoint& hcalreppos = hcalref->positionREP();
34  if (hcalref.isNull() || horef.isNull()) {
35  throw cms::Exception("BadClusterRefs") << "PFBlockElementCluster's refs are null!";
36  }
37  dist = (std::abs(hcalreppos.Eta()) < 1.5
39  hcalreppos.Eta(), hcalreppos.Phi(), horef->positionREP().Eta(), horef->positionREP().Phi())
40  : -1.0);
41  return (dist < 0.2 ? dist : -1.0);
42 }

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

Member Data Documentation

◆ debug_

bool HCALAndHOLinker::debug_
private

Definition at line 16 of file HCALAndHOLinker.cc.

◆ useKDTree_

bool HCALAndHOLinker::useKDTree_
private

Definition at line 16 of file HCALAndHOLinker.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
edm::Ref< PFClusterCollection >
HCALAndHOLinker::debug_
bool debug_
Definition: HCALAndHOLinker.cc:16
BlockElementLinkerBase::BlockElementLinkerBase
BlockElementLinkerBase(const edm::ParameterSet &conf)
Definition: BlockElementLinkerBase.h:12
HCALAndHOLinker::useKDTree_
bool useKDTree_
Definition: HCALAndHOLinker.cc:16
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::PFBlockElementCluster
Cluster Element.
Definition: PFBlockElementCluster.h:16
Exception
Definition: hltDiff.cc:246
reco::PFBlockElement::type
Type type() const
Definition: PFBlockElement.h:69
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::PFCluster::REPPoint
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< double > > REPPoint
Definition: PFCluster.h:52
LinkByRecHit::computeDist
static double computeDist(double eta1, double phi1, double eta2, double phi2, bool etaPhi=true)
computes a chisquare
Definition: LinkByRecHit.cc:517