CMS 3D CMS Logo

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

Public Member Functions

 ECALAndECALLinker (const edm::ParameterSet &conf)
 
bool linkPrefilter (const reco::PFBlockElement *, const reco::PFBlockElement *) const override
 
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)
 
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 ECALAndECALLinker.cc.

Constructor & Destructor Documentation

◆ ECALAndECALLinker()

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

Definition at line 8 of file ECALAndECALLinker.cc.

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

Member Function Documentation

◆ linkPrefilter()

bool ECALAndECALLinker::linkPrefilter ( const reco::PFBlockElement elem1,
const reco::PFBlockElement elem2 
) const
overridevirtual

Reimplemented from BlockElementLinkerBase.

Definition at line 23 of file ECALAndECALLinker.cc.

23  {
24  const reco::PFBlockElementCluster* ecal1 = static_cast<const reco::PFBlockElementCluster*>(elem1);
25  const reco::PFBlockElementCluster* ecal2 = static_cast<const reco::PFBlockElementCluster*>(elem2);
26  return (ecal1->superClusterRef().isNonnull() && ecal2->superClusterRef().isNonnull());
27 }

References edm::Ref< C, T, F >::isNonnull(), and reco::PFBlockElementCluster::superClusterRef().

◆ testLink()

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

Implements BlockElementLinkerBase.

Definition at line 29 of file ECALAndECALLinker.cc.

29  {
30  double dist = -1.0;
31 
32  const reco::PFBlockElementCluster* ecal1 = static_cast<const reco::PFBlockElementCluster*>(elem1);
33  const reco::PFBlockElementCluster* ecal2 = static_cast<const reco::PFBlockElementCluster*>(elem2);
34 
35  const reco::SuperClusterRef& sc1 = ecal1->superClusterRef();
36  const reco::SuperClusterRef& sc2 = ecal2->superClusterRef();
37 
38  const reco::PFClusterRef& clus1 = ecal1->clusterRef();
39  const reco::PFClusterRef& clus2 = ecal2->clusterRef();
40 
41  if (sc1.isNonnull() && sc2.isNonnull() && sc1 == sc2) {
43  clus1->positionREP().Eta(), clus1->positionREP().Phi(), clus2->positionREP().Eta(), clus2->positionREP().Phi());
44  }
45 
46  return dist;
47 }

References reco::PFBlockElementCluster::clusterRef(), LinkByRecHit::computeDist(), edm::Ref< C, T, F >::isNonnull(), and reco::PFBlockElementCluster::superClusterRef().

Member Data Documentation

◆ debug_

bool ECALAndECALLinker::debug_
private

Definition at line 18 of file ECALAndECALLinker.cc.

◆ useKDTree_

bool ECALAndECALLinker::useKDTree_
private

Definition at line 18 of file ECALAndECALLinker.cc.

edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Ref< SuperClusterCollection >
reco::PFBlockElementCluster::superClusterRef
const SuperClusterRef & superClusterRef() const
Definition: PFBlockElementCluster.h:30
BlockElementLinkerBase::BlockElementLinkerBase
BlockElementLinkerBase(const edm::ParameterSet &conf)
Definition: BlockElementLinkerBase.h:12
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
ECALAndECALLinker::debug_
bool debug_
Definition: ECALAndECALLinker.cc:18
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::PFBlockElementCluster
Cluster Element.
Definition: PFBlockElementCluster.h:16
reco::PFBlockElementCluster::clusterRef
const PFClusterRef & clusterRef() const override
Definition: PFBlockElementCluster.h:29
ECALAndECALLinker::useKDTree_
bool useKDTree_
Definition: ECALAndECALLinker.cc:18
LinkByRecHit::computeDist
static double computeDist(double eta1, double phi1, double eta2, double phi2, bool etaPhi=true)
computes a chisquare
Definition: LinkByRecHit.cc:517