CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 

Private Attributes

bool _debug
 
bool _useKDTree
 

Detailed Description

Definition at line 6 of file ECALAndECALLinker.cc.

Constructor & Destructor Documentation

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

Definition at line 8 of file ECALAndECALLinker.cc.

8  :
10  _useKDTree(conf.getParameter<bool>("useKDTree")),
11  _debug(conf.getUntrackedParameter<bool>("debug",false)) {}
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
BlockElementLinkerBase(const edm::ParameterSet &conf)

Member Function Documentation

bool ECALAndECALLinker::linkPrefilter ( const reco::PFBlockElement elem1,
const reco::PFBlockElement elem2 
) const
overridevirtual

Reimplemented from BlockElementLinkerBase.

Definition at line 28 of file ECALAndECALLinker.cc.

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

29  {
30  const reco::PFBlockElementCluster* ecal1 =
31  static_cast<const reco::PFBlockElementCluster*>(elem1);
32  const reco::PFBlockElementCluster* ecal2 =
33  static_cast<const reco::PFBlockElementCluster*>(elem2);
34  return ( ecal1->superClusterRef().isNonnull() &&
35  ecal2->superClusterRef().isNonnull() );
36 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
const SuperClusterRef & superClusterRef() const
double ECALAndECALLinker::testLink ( const reco::PFBlockElement elem1,
const reco::PFBlockElement elem2 
) const
overridevirtual

Implements BlockElementLinkerBase.

Definition at line 39 of file ECALAndECALLinker.cc.

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

40  {
41  double dist = -1.0;
42 
43  const reco::PFBlockElementCluster* ecal1 =
44  static_cast<const reco::PFBlockElementCluster*>(elem1);
45  const reco::PFBlockElementCluster* ecal2 =
46  static_cast<const reco::PFBlockElementCluster*>(elem2);
47 
48  const reco::SuperClusterRef sc1 = ecal1->superClusterRef();
49  const reco::SuperClusterRef sc2 = ecal2->superClusterRef();
50 
51  const reco::PFClusterRef& clus1 = ecal1->clusterRef();
52  const reco::PFClusterRef& clus2 = ecal2->clusterRef();
53 
54  if( sc1.isNonnull() && sc2.isNonnull() && sc1 == sc2 ) {
55  dist=LinkByRecHit::computeDist( clus1->positionREP().Eta(),
56  clus1->positionREP().Phi(),
57  clus2->positionREP().Eta(),
58  clus2->positionREP().Phi() );
59  }
60 
61  return dist;
62 }
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:250
const PFClusterRef & clusterRef() const
const SuperClusterRef & superClusterRef() const

Member Data Documentation

bool ECALAndECALLinker::_debug
private
bool ECALAndECALLinker::_useKDTree
private

Definition at line 20 of file ECALAndECALLinker.cc.