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 
14  const reco::PFBlockElement* ) const override;
15 
16  double testLink( const reco::PFBlockElement*,
17  const reco::PFBlockElement* ) const override;
18 
19 private:
21 };
22 
25  "ECALAndECALLinker");
26 
29  const reco::PFBlockElement* elem2) const {
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 }
37 
40  const reco::PFBlockElement* elem2) const {
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 }
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:253
const PFClusterRef & clusterRef() const override
const SuperClusterRef & superClusterRef() const
bool linkPrefilter(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
ECALAndECALLinker(const edm::ParameterSet &conf)
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
#define DEFINE_EDM_PLUGIN(factory, type, name)