CMS 3D CMS Logo

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

Public Member Functions

 SCAndECALLinker (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 superClusterMatchByRef_
 
bool useKDTree_
 

Detailed Description

Definition at line 8 of file SCAndECALLinker.cc.

Constructor & Destructor Documentation

◆ SCAndECALLinker()

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

Definition at line 10 of file SCAndECALLinker.cc.

11  : BlockElementLinkerBase(conf),
12  useKDTree_(conf.getParameter<bool>("useKDTree")),
13  debug_(conf.getUntrackedParameter<bool>("debug", false)),
14  superClusterMatchByRef_(conf.getParameter<bool>("SuperClusterMatchByRef")) {}

Member Function Documentation

◆ testLink()

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

Implements BlockElementLinkerBase.

Definition at line 24 of file SCAndECALLinker.cc.

24  {
25  double dist = -1.0;
26  const reco::PFBlockElementCluster* ecalelem(nullptr);
27  const reco::PFBlockElementSuperCluster* scelem(nullptr);
28  if (elem1->type() < elem2->type()) {
29  ecalelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
30  scelem = static_cast<const reco::PFBlockElementSuperCluster*>(elem2);
31  } else {
32  ecalelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
33  scelem = static_cast<const reco::PFBlockElementSuperCluster*>(elem1);
34  }
35  const reco::PFClusterRef& clus = ecalelem->clusterRef();
36  const reco::SuperClusterRef& sclus = scelem->superClusterRef();
37  if (sclus.isNull()) {
38  throw cms::Exception("BadRef") << "SuperClusterRef is invalid!";
39  }
40 
42  if (sclus == ecalelem->superClusterRef())
43  dist = 0.001;
44  } else {
45  if (ClusterClusterMapping::overlap(*sclus, *clus)) {
47  sclus->position().eta(), sclus->position().phi(), clus->positionREP().Eta(), clus->positionREP().Phi());
48  }
49  }
50  return dist;
51 }

References reco::PFBlockElementCluster::clusterRef(), LinkByRecHit::computeDist(), Exception, edm::Ref< C, T, F >::isNull(), ClusterClusterMapping::overlap(), superClusterMatchByRef_, reco::PFBlockElementCluster::superClusterRef(), reco::PFBlockElementSuperCluster::superClusterRef(), and reco::PFBlockElement::type().

Member Data Documentation

◆ debug_

bool SCAndECALLinker::debug_
private

Definition at line 19 of file SCAndECALLinker.cc.

◆ superClusterMatchByRef_

bool SCAndECALLinker::superClusterMatchByRef_
private

Definition at line 19 of file SCAndECALLinker.cc.

Referenced by testLink().

◆ useKDTree_

bool SCAndECALLinker::useKDTree_
private

Definition at line 19 of file SCAndECALLinker.cc.

edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
reco::PFBlockElementSuperCluster
Cluster Element.
Definition: PFBlockElementSuperCluster.h:15
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Ref< PFClusterCollection >
ClusterClusterMapping::overlap
static bool overlap(const reco::CaloCluster &sc1, const reco::CaloCluster &sc, float minfrac=0.01, bool debug=false)
Definition: ClusterClusterMapping.cc:4
BlockElementLinkerBase::BlockElementLinkerBase
BlockElementLinkerBase(const edm::ParameterSet &conf)
Definition: BlockElementLinkerBase.h:12
SCAndECALLinker::superClusterMatchByRef_
bool superClusterMatchByRef_
Definition: SCAndECALLinker.cc:19
SCAndECALLinker::useKDTree_
bool useKDTree_
Definition: SCAndECALLinker.cc:19
SCAndECALLinker::debug_
bool debug_
Definition: SCAndECALLinker.cc:19
reco::PFBlockElementCluster
Cluster Element.
Definition: PFBlockElementCluster.h:16
Exception
Definition: hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
reco::PFBlockElement::type
Type type() const
Definition: PFBlockElement.h:69
LinkByRecHit::computeDist
static double computeDist(double eta1, double phi1, double eta2, double phi2, bool etaPhi=true)
computes a chisquare
Definition: LinkByRecHit.cc:519