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
14
(
const
reco::PFBlockElement
*,
15
const
reco::PFBlockElement
* )
const override
;
16
17
private
:
18
bool
_useKDTree
,
_debug
;
19
};
20
21
DEFINE_EDM_PLUGIN
(
BlockElementLinkerFactory
,
22
HFEMAndHFHADLinker
,
23
"HFEMAndHFHADLinker"
);
24
25
double
HFEMAndHFHADLinker::testLink
26
(
const
reco::PFBlockElement
* elem1,
27
const
reco::PFBlockElement
* elem2)
const
{
28
const
reco::PFBlockElementCluster
*hfemelem(
nullptr
), *hfhadelem(
nullptr
);
29
if
( elem1->
type
() < elem2->
type
() ) {
30
hfemelem =
static_cast<
const
reco::PFBlockElementCluster
*
>
(elem1);
31
hfhadelem =
static_cast<
const
reco::PFBlockElementCluster
*
>
(elem2);
32
}
else
{
33
hfemelem =
static_cast<
const
reco::PFBlockElementCluster
*
>
(elem2);
34
hfhadelem =
static_cast<
const
reco::PFBlockElementCluster
*
>
(elem1);
35
}
36
const
reco::PFClusterRef
& hfemref = hfemelem->clusterRef();
37
const
reco::PFClusterRef
& hfhadref = hfhadelem->
clusterRef
();
38
if
( hfemref.
isNull
() || hfhadref.
isNull
() ) {
39
throw
cms::Exception
(
"BadClusterRefs"
)
40
<<
"PFBlockElementCluster's refs are null!"
;
41
}
42
return
LinkByRecHit::testHFEMAndHFHADByRecHit
( *hfemref, *hfhadref,
_debug
);
43
}
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition:
PFBlockElement.h:28
LinkByRecHit.h
HFEMAndHFHADLinker::_debug
bool _debug
Definition:
HFEMAndHFHADLinker.cc:18
Exception
Definition:
hltDiff.cc:292
edm::Ref< PFClusterCollection >
reco::PFBlockElementCluster::clusterRef
const PFClusterRef & clusterRef() const override
Definition:
PFBlockElementCluster.h:32
funct::false
false
Definition:
Factorize.h:35
reco::PFBlockElement::type
Type type() const
Definition:
PFBlockElement.h:86
reco::PFBlockElementCluster
Cluster Element.
Definition:
PFBlockElementCluster.h:16
PFCluster.h
BlockElementLinkerBase.h
PFBlockElementCluster.h
edmplugin::PluginFactory
Definition:
PluginFactory.h:32
HFEMAndHFHADLinker::_useKDTree
bool _useKDTree
Definition:
HFEMAndHFHADLinker.cc:18
edm::Ref::isNull
bool isNull() const
Checks for null.
Definition:
Ref.h:250
BlockElementLinkerBase
Definition:
BlockElementLinkerBase.h:10
electrons_cff.bool
bool
Definition:
electrons_cff.py:334
HFEMAndHFHADLinker::testLink
double testLink(const reco::PFBlockElement *, const reco::PFBlockElement *) const override
Definition:
HFEMAndHFHADLinker.cc:26
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:521
HFEMAndHFHADLinker
Definition:
HFEMAndHFHADLinker.cc:6
HFEMAndHFHADLinker::HFEMAndHFHADLinker
HFEMAndHFHADLinker(const edm::ParameterSet &conf)
Definition:
HFEMAndHFHADLinker.cc:8
edm::ParameterSet
Definition:
ParameterSet.h:36
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:102
Generated for CMSSW Reference Manual by
1.8.11