CMS 3D CMS Logo

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

Public Member Functions

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

Constructor & Destructor Documentation

◆ SCAndHGCalLinker()

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

Definition at line 10 of file SCAndHGCalLinker.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 SCAndHGCalLinker::testLink ( const reco::PFBlockElement elem1,
const reco::PFBlockElement elem2 
) const
overridevirtual

Implements BlockElementLinkerBase.

Definition at line 24 of file SCAndHGCalLinker.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 
51  return dist;
52 }
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 SCAndHGCalLinker::debug_
private

Definition at line 19 of file SCAndHGCalLinker.cc.

◆ superClusterMatchByRef_

bool SCAndHGCalLinker::superClusterMatchByRef_
private

Definition at line 19 of file SCAndHGCalLinker.cc.

Referenced by testLink().

◆ useKDTree_

bool SCAndHGCalLinker::useKDTree_
private

Definition at line 19 of file SCAndHGCalLinker.cc.