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 }
Abstract base class for a PFBlock element (track, cluster...)
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:238
const SuperClusterRef & superClusterRef() const
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
const PFClusterRef & clusterRef() const override
ECALAndECALLinker(const edm::ParameterSet &conf)
bool linkPrefilter(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
#define DEFINE_EDM_PLUGIN(factory, type, name)