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 ( const edm::ParameterSet conf)
inline

Definition at line 10 of file SCAndECALLinker.cc.

References testLink().

10  :
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
T getUntrackedParameter(std::string const &, T const &) const
BlockElementLinkerBase(const edm::ParameterSet &conf)

Member Function Documentation

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

Implements BlockElementLinkerBase.

Definition at line 29 of file SCAndECALLinker.cc.

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

Referenced by SCAndECALLinker().

30  {
31  double dist = -1.0;
32  const reco::PFBlockElementCluster* ecalelem(NULL);
33  const reco::PFBlockElementSuperCluster* scelem(NULL);
34  if( elem1->type() < elem2->type() ) {
35  ecalelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
36  scelem = static_cast<const reco::PFBlockElementSuperCluster*>(elem2);
37  } else {
38  ecalelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
39  scelem = static_cast<const reco::PFBlockElementSuperCluster*>(elem1);
40  }
41  const reco::PFClusterRef& clus = ecalelem->clusterRef();
42  const reco::SuperClusterRef& sclus = scelem->superClusterRef();
43  if( sclus.isNull() ) {
44  throw cms::Exception("BadRef")
45  << "SuperClusterRef is invalid!";
46  }
47 
49  if( sclus == ecalelem->superClusterRef() ) dist = 0.001;
50  } else {
51  if( ClusterClusterMapping::overlap(*sclus,*clus) ) {
52  dist = LinkByRecHit::computeDist( sclus->position().eta(),
53  sclus->position().phi(),
54  clus->positionREP().Eta(),
55  clus->positionREP().Phi() );
56  }
57  }
58  return dist;
59 }
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)
Type type() const
#define NULL
Definition: scimark2.h:8
bool isNull() const
Checks for null.
Definition: Ref.h:249

Member Data Documentation

bool SCAndECALLinker::_debug
private
bool SCAndECALLinker::_superClusterMatchByRef
private

Definition at line 21 of file SCAndECALLinker.cc.

Referenced by testLink().

bool SCAndECALLinker::_useKDTree
private

Definition at line 21 of file SCAndECALLinker.cc.