CMS 3D CMS Logo

ECALAndHCALCaloJetLinker.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  double testLink(const reco::PFBlockElement*, const reco::PFBlockElement*) const override;
14 
15 private:
17 };
18 
20 
22  const reco::PFBlockElementCluster *hcalelem(nullptr), *ecalelem(nullptr);
23  double dist(-1.0);
24  if (elem1->type() < elem2->type()) {
25  ecalelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
26  hcalelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
27  } else {
28  ecalelem = static_cast<const reco::PFBlockElementCluster*>(elem2);
29  hcalelem = static_cast<const reco::PFBlockElementCluster*>(elem1);
30  }
31  const reco::PFClusterRef& ecalref = ecalelem->clusterRef();
32  const reco::PFClusterRef& hcalref = hcalelem->clusterRef();
33  const reco::PFCluster::REPPoint& ecalreppos = ecalref->positionREP();
34  if (hcalref.isNull() || ecalref.isNull()) {
35  throw cms::Exception("BadClusterRefs") << "PFBlockElementCluster's refs are null!";
36  }
37  //dist = ( std::abs(ecalreppos.Eta()) > 2.5 ?
38  // LinkByRecHit::computeDist( ecalreppos.Eta(),
39  // ecalreppos.Phi(),
40  // hcalref->positionREP().Eta(),
41  // hcalref->positionREP().Phi() )
42  // : -1.0 );
43  // return (dist < 0.2 ? dist : -1.0);
45  ecalreppos.Eta(), ecalreppos.Phi(), hcalref->positionREP().Eta(), hcalref->positionREP().Phi());
46 
47  return (dist < 0.2 ? dist : -1.0);
48 }
ECALAndHCALCaloJetLinker::ECALAndHCALCaloJetLinker
ECALAndHCALCaloJetLinker(const edm::ParameterSet &conf)
Definition: ECALAndHCALCaloJetLinker.cc:8
ECALAndHCALCaloJetLinker
Definition: ECALAndHCALCaloJetLinker.cc:6
electrons_cff.bool
bool
Definition: electrons_cff.py:372
funct::false
false
Definition: Factorize.h:34
PFBlockElementCluster.h
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition: Ref.h:235
BlockElementLinkerBase
Definition: BlockElementLinkerBase.h:10
edm::Ref< PFClusterCollection >
ECALAndHCALCaloJetLinker::useKDTree_
bool useKDTree_
Definition: ECALAndHCALCaloJetLinker.cc:16
PFCluster.h
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
edm::ParameterSet
Definition: ParameterSet.h:36
edmplugin::PluginFactory
Definition: PluginFactory.h:34
LinkByRecHit.h
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition: PFBlockElement.h:26
ECALAndHCALCaloJetLinker::testLink
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
Definition: ECALAndHCALCaloJetLinker.cc:21
reco::PFBlockElementCluster
Cluster Element.
Definition: PFBlockElementCluster.h:16
Exception
Definition: hltDiff.cc:246
ECALAndHCALCaloJetLinker::debug_
bool debug_
Definition: ECALAndHCALCaloJetLinker.cc:16
BlockElementLinkerBase.h
reco::PFBlockElementCluster::clusterRef
const PFClusterRef & clusterRef() const override
Definition: PFBlockElementCluster.h:29
reco::PFBlockElement::type
Type type() const
Definition: PFBlockElement.h:69
reco::PFCluster::REPPoint
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< double > > REPPoint
Definition: PFCluster.h:52
LinkByRecHit::computeDist
static double computeDist(double eta1, double phi1, double eta2, double phi2, bool etaPhi=true)
computes a chisquare
Definition: LinkByRecHit.cc:517