CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ECALAndHCALCaloJetLinker Class Reference
Inheritance diagram for ECALAndHCALCaloJetLinker:
BlockElementLinkerBase

Public Member Functions

 ECALAndHCALCaloJetLinker (const edm::ParameterSet &conf)
 
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
 
virtual bool linkPrefilter (const reco::PFBlockElement *, const reco::PFBlockElement *) const
 
const std::string & name () const
 
BlockElementLinkerBaseoperator= (const BlockElementLinkerBase &)=delete
 
virtual ~BlockElementLinkerBase ()=default
 

Private Attributes

bool debug_
 
bool useKDTree_
 

Detailed Description

Definition at line 6 of file ECALAndHCALCaloJetLinker.cc.

Constructor & Destructor Documentation

◆ ECALAndHCALCaloJetLinker()

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

Definition at line 8 of file ECALAndHCALCaloJetLinker.cc.

10  useKDTree_(conf.getParameter<bool>("useKDTree")),
11  debug_(conf.getUntrackedParameter<bool>("debug", false)) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T getUntrackedParameter(std::string const &, T const &) const
BlockElementLinkerBase(const edm::ParameterSet &conf)

Member Function Documentation

◆ testLink()

double ECALAndHCALCaloJetLinker::testLink ( const reco::PFBlockElement elem1,
const reco::PFBlockElement elem2 
) const
overridevirtual

Implements BlockElementLinkerBase.

Definition at line 21 of file ECALAndHCALCaloJetLinker.cc.

References reco::PFBlockElementCluster::clusterRef(), LinkByRecHit::computeDist(), Exception, edm::Ref< C, T, F >::isNull(), and reco::PFBlockElement::type().

21  {
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 }
static double computeDist(double eta1, double phi1, double eta2, double phi2, bool etaPhi=true)
computes a chisquare
bool isNull() const
Checks for null.
Definition: Ref.h:235
ROOT::Math::PositionVector3D< ROOT::Math::CylindricalEta3D< double > > REPPoint
Definition: PFCluster.h:48

Member Data Documentation

◆ debug_

bool ECALAndHCALCaloJetLinker::debug_
private

Definition at line 16 of file ECALAndHCALCaloJetLinker.cc.

◆ useKDTree_

bool ECALAndHCALCaloJetLinker::useKDTree_
private

Definition at line 16 of file ECALAndHCALCaloJetLinker.cc.