Main Page
Namespaces
Classes
Package Documentation
RecoParticleFlow
PFProducer
plugins
linkers
HFEMAndHFHADLinker.cc
Go to the documentation of this file.
1
#include "
RecoParticleFlow/PFProducer/interface/BlockElementLinkerBase.h
"
2
#include "
DataFormats/ParticleFlowReco/interface/PFCluster.h
"
3
#include "
DataFormats/ParticleFlowReco/interface/PFBlockElementCluster.h
"
4
#include "
RecoParticleFlow/PFClusterTools/interface/LinkByRecHit.h
"
5
6
class
HFEMAndHFHADLinker
:
public
BlockElementLinkerBase
{
7
public
:
8
HFEMAndHFHADLinker
(
const
edm::ParameterSet
& conf)
9
:
BlockElementLinkerBase
(conf),
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
:
16
bool
useKDTree_
,
debug_
;
17
};
18
19
DEFINE_EDM_PLUGIN
(
BlockElementLinkerFactory
,
HFEMAndHFHADLinker
,
"HFEMAndHFHADLinker"
);
20
21
double
HFEMAndHFHADLinker::testLink
(
const
reco::PFBlockElement
* elem1,
const
reco::PFBlockElement
* elem2)
const
{
22
const
reco::PFBlockElementCluster
*hfemelem(
nullptr
), *hfhadelem(
nullptr
);
23
if
(elem1->
type
() < elem2->
type
()) {
24
hfemelem =
static_cast<
const
reco::PFBlockElementCluster
*
>
(elem1);
25
hfhadelem =
static_cast<
const
reco::PFBlockElementCluster
*
>
(elem2);
26
}
else
{
27
hfemelem =
static_cast<
const
reco::PFBlockElementCluster
*
>
(elem2);
28
hfhadelem =
static_cast<
const
reco::PFBlockElementCluster
*
>
(elem1);
29
}
30
const
reco::PFClusterRef
& hfemref = hfemelem->clusterRef();
31
const
reco::PFClusterRef
& hfhadref = hfhadelem->
clusterRef
();
32
if
(hfemref.
isNull
() || hfhadref.
isNull
()) {
33
throw
cms::Exception
(
"BadClusterRefs"
) <<
"PFBlockElementCluster's refs are null!"
;
34
}
35
return
LinkByRecHit::testHFEMAndHFHADByRecHit
(*hfemref, *hfhadref,
debug_
);
36
}
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition:
PFBlockElement.h:26
HFEMAndHFHADLinker::debug_
bool debug_
Definition:
HFEMAndHFHADLinker.cc:16
LinkByRecHit.h
Exception
Definition:
hltDiff.cc:246
edm::Ref< PFClusterCollection >
reco::PFBlockElementCluster::clusterRef
const PFClusterRef & clusterRef() const override
Definition:
PFBlockElementCluster.h:29
funct::false
false
Definition:
Factorize.h:34
reco::PFBlockElement::type
Type type() const
Definition:
PFBlockElement.h:69
reco::PFBlockElementCluster
Cluster Element.
Definition:
PFBlockElementCluster.h:16
PFCluster.h
BlockElementLinkerBase.h
PFBlockElementCluster.h
edmplugin::PluginFactory
Definition:
PluginFactory.h:34
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition:
Ref.h:235
BlockElementLinkerBase
Definition:
BlockElementLinkerBase.h:10
electrons_cff.bool
bool
Definition:
electrons_cff.py:371
HFEMAndHFHADLinker::testLink
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
Definition:
HFEMAndHFHADLinker.cc:21
LinkByRecHit::testHFEMAndHFHADByRecHit
static double testHFEMAndHFHADByRecHit(const reco::PFCluster &clusterHFEM, const reco::PFCluster &clusterHFHAD, bool debug=false)
test association between HFEM and HFHAD, by rechit
Definition:
LinkByRecHit.cc:493
HFEMAndHFHADLinker
Definition:
HFEMAndHFHADLinker.cc:6
HFEMAndHFHADLinker::HFEMAndHFHADLinker
HFEMAndHFHADLinker(const edm::ParameterSet &conf)
Definition:
HFEMAndHFHADLinker.cc:8
HFEMAndHFHADLinker::useKDTree_
bool useKDTree_
Definition:
HFEMAndHFHADLinker.cc:16
edm::ParameterSet
Definition:
ParameterSet.h:36
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:124
Generated for CMSSW Reference Manual by
1.8.11