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 edm::ParameterSet &conf)
 
 BlockElementLinkerBase (const BlockElementLinkerBase &)=delete
 
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)) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T getUntrackedParameter(std::string const &, T const &) const
BlockElementLinkerBase(const edm::ParameterSet &conf)

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.

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

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 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
const SuperClusterRef & superClusterRef() const

◆ testLink()

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

Implements BlockElementLinkerBase.

Definition at line 29 of file ECALAndECALLinker.cc.

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

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 }
static double computeDist(double eta1, double phi1, double eta2, double phi2, bool etaPhi=true)
computes a chisquare
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
const SuperClusterRef & superClusterRef() const
const PFClusterRef & clusterRef() const override

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.