CMS 3D CMS Logo

ECALAndECALLinker.cc
Go to the documentation of this file.
5 
7 public:
10  useKDTree_(conf.getParameter<bool>("useKDTree")),
11  debug_(conf.getUntrackedParameter<bool>("debug", false)) {}
12 
13  bool linkPrefilter(const reco::PFBlockElement*, const reco::PFBlockElement*) const override;
14 
15  double testLink(const reco::PFBlockElement*, const reco::PFBlockElement*) const override;
16 
17 private:
19 };
20 
22 
24  const reco::PFBlockElementCluster* ecal1 = static_cast<const reco::PFBlockElementCluster*>(elem1);
25  const reco::PFBlockElementCluster* ecal2 = static_cast<const reco::PFBlockElementCluster*>(elem2);
26  return (ecal1->superClusterRef().isNonnull() && ecal2->superClusterRef().isNonnull());
27 }
28 
29 double ECALAndECALLinker::testLink(const reco::PFBlockElement* elem1, const reco::PFBlockElement* elem2) const {
30  double dist = -1.0;
31 
32  const reco::PFBlockElementCluster* ecal1 = static_cast<const reco::PFBlockElementCluster*>(elem1);
33  const reco::PFBlockElementCluster* ecal2 = static_cast<const reco::PFBlockElementCluster*>(elem2);
34 
35  const reco::SuperClusterRef& sc1 = ecal1->superClusterRef();
36  const reco::SuperClusterRef& sc2 = ecal2->superClusterRef();
37 
38  const reco::PFClusterRef& clus1 = ecal1->clusterRef();
39  const reco::PFClusterRef& clus2 = ecal2->clusterRef();
40 
41  if (sc1.isNonnull() && sc2.isNonnull() && sc1 == sc2) {
43  clus1->positionREP().Eta(), clus1->positionREP().Phi(), clus2->positionREP().Eta(), clus2->positionREP().Phi());
44  }
45 
46  return dist;
47 }
electrons_cff.bool
bool
Definition: electrons_cff.py:393
funct::false
false
Definition: Factorize.h:29
PFBlockElementCluster.h
BlockElementLinkerBase
Definition: BlockElementLinkerBase.h:10
edm::Ref< SuperClusterCollection >
ECALAndECALLinker::testLink
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
Definition: ECALAndECALLinker.cc:29
PFCluster.h
reco::PFBlockElementCluster::superClusterRef
const SuperClusterRef & superClusterRef() const
Definition: PFBlockElementCluster.h:30
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
edm::ParameterSet
Definition: ParameterSet.h:47
edmplugin::PluginFactory
Definition: PluginFactory.h:34
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
LinkByRecHit.h
ECALAndECALLinker
Definition: ECALAndECALLinker.cc:6
ECALAndECALLinker::debug_
bool debug_
Definition: ECALAndECALLinker.cc:18
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition: PFBlockElement.h:26
ECALAndECALLinker::ECALAndECALLinker
ECALAndECALLinker(const edm::ParameterSet &conf)
Definition: ECALAndECALLinker.cc:8
reco::PFBlockElementCluster
Cluster Element.
Definition: PFBlockElementCluster.h:16
BlockElementLinkerBase.h
reco::PFBlockElementCluster::clusterRef
const PFClusterRef & clusterRef() const override
Definition: PFBlockElementCluster.h:29
ECALAndECALLinker::useKDTree_
bool useKDTree_
Definition: ECALAndECALLinker.cc:18
ECALAndECALLinker::linkPrefilter
bool linkPrefilter(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
Definition: ECALAndECALLinker.cc:23
LinkByRecHit::computeDist
static double computeDist(double eta1, double phi1, double eta2, double phi2, bool etaPhi=true)
computes a chisquare
Definition: LinkByRecHit.cc:519