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 edm::ParameterSet &conf)
 
 BlockElementLinkerBase (const BlockElementLinkerBase &)=delete
 
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")) {}
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

◆ testLink()

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

Implements BlockElementLinkerBase.

Definition at line 24 of file SCAndECALLinker.cc.

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().

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 }
static double computeDist(double eta1, double phi1, double eta2, double phi2, bool etaPhi=true)
computes a chisquare
static bool overlap(const reco::CaloCluster &sc1, const reco::CaloCluster &sc, float minfrac=0.01, bool debug=false)
bool isNull() const
Checks for null.
Definition: Ref.h:235

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.