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:245
PFCluster.h
edm::Ref< PFClusterCollection >
funct::false
false
Definition:
Factorize.h:29
reco::PFBlockElementCluster
Cluster Element.
Definition:
PFBlockElementCluster.h:16
BlockElementLinkerBase.h
reco::PFBlockElement::type
Type type() const
Definition:
PFBlockElement.h:69
PFBlockElementCluster.h
edmplugin::PluginFactory
Definition:
PluginFactory.h:35
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition:
Ref.h:235
reco::PFBlockElementCluster::clusterRef
const PFClusterRef & clusterRef() const override
Definition:
PFBlockElementCluster.h:29
BlockElementLinkerBase
Definition:
BlockElementLinkerBase.h:10
electrons_cff.bool
bool
Definition:
electrons_cff.py:319
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:495
HFEMAndHFHADLinker
Definition:
HFEMAndHFHADLinker.cc:6
HFEMAndHFHADLinker::HFEMAndHFHADLinker
HFEMAndHFHADLinker(const edm::ParameterSet &conf)
Definition:
HFEMAndHFHADLinker.cc:8
HFEMAndHFHADLinker::useKDTree_
bool useKDTree_
Definition:
HFEMAndHFHADLinker.cc:16
HFEMAndHFHADLinker::testLink
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
Definition:
HFEMAndHFHADLinker.cc:21
edm::ParameterSet
Definition:
ParameterSet.h:47
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:123
Generated for CMSSW Reference Manual by
1.8.14