RecoParticleFlow
PFProducer
plugins
importers
GenericClusterImporter.cc
Go to the documentation of this file.
1
#include "
RecoParticleFlow/PFProducer/interface/BlockElementImporterBase.h
"
2
#include "
DataFormats/ParticleFlowReco/interface/PFCluster.h
"
3
#include "
DataFormats/ParticleFlowReco/interface/PFBlockElementCluster.h
"
4
5
class
GenericClusterImporter
:
public
BlockElementImporterBase
{
6
public
:
7
GenericClusterImporter
(
const
edm::ParameterSet
& conf,
edm::ConsumesCollector
& sumes)
8
:
BlockElementImporterBase
(conf, sumes),
9
_src
(sumes.consumes<
reco
::
PFClusterCollection
>(conf.getParameter<
edm
::
InputTag
>(
"source"
))) {}
10
11
void
importToBlock
(
const
edm::Event
&,
ElementList
&)
const override
;
12
13
private
:
14
edm::EDGetTokenT<reco::PFClusterCollection>
_src
;
15
};
16
17
DEFINE_EDM_PLUGIN
(
BlockElementImporterFactory
,
GenericClusterImporter
,
"GenericClusterImporter"
);
18
19
void
GenericClusterImporter::importToBlock
(
const
edm::Event
&
e
,
BlockElementImporterBase::ElementList
& elems)
const
{
20
auto
clusters
=
e
.getHandle(
_src
);
21
auto
cbegin =
clusters
->cbegin();
22
auto
cend =
clusters
->cend();
23
for
(
auto
clus = cbegin; clus != cend; ++clus) {
24
reco::PFBlockElement::Type
type
=
reco::PFBlockElement::NONE
;
25
reco::PFClusterRef
cref(
clusters
,
std::distance
(cbegin, clus));
26
switch
(clus->layer()) {
27
case
PFLayer::PS1
:
28
type
=
reco::PFBlockElement::PS1
;
29
break
;
30
case
PFLayer::PS2
:
31
type
=
reco::PFBlockElement::PS2
;
32
break
;
33
case
PFLayer::ECAL_BARREL
:
34
case
PFLayer::ECAL_ENDCAP
:
35
type
=
reco::PFBlockElement::ECAL
;
36
break
;
37
case
PFLayer::HCAL_BARREL1
:
38
case
PFLayer::HCAL_ENDCAP
:
39
type
=
reco::PFBlockElement::HCAL
;
40
break
;
41
case
PFLayer::HCAL_BARREL2
:
42
type
=
reco::PFBlockElement::HO
;
43
break
;
44
case
PFLayer::HF_EM
:
45
type
=
reco::PFBlockElement::HFEM
;
46
break
;
47
case
PFLayer::HF_HAD
:
48
type
=
reco::PFBlockElement::HFHAD
;
49
break
;
50
case
PFLayer::HGCAL
:
51
type
=
reco::PFBlockElement::HGCAL
;
52
break
;
53
default
:
54
throw
cms::Exception
(
"InvalidPFLayer"
) <<
"Layer given, "
<< clus->layer() <<
" is not a valid PFLayer!"
;
55
}
56
reco::PFBlockElement
* cptr =
new
reco::PFBlockElementCluster
(cref,
type
);
57
elems.emplace_back(cptr);
58
}
59
}
reco::PFBlockElement::HO
Definition:
PFBlockElement.h:42
PFBlockElementCluster.h
edm::EDGetTokenT< reco::PFClusterCollection >
edm
HLT enums.
Definition:
AlignableModifier.h:19
GenericClusterImporter
Definition:
GenericClusterImporter.cc:5
HLT_FULL_cff.InputTag
InputTag
Definition:
HLT_FULL_cff.py:89353
PFLayer::HCAL_ENDCAP
Definition:
PFLayer.h:37
reco::PFBlockElement::HCAL
Definition:
PFBlockElement.h:36
reco::PFBlockElement::HGCAL
Definition:
PFBlockElement.h:43
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
GenericClusterImporter::GenericClusterImporter
GenericClusterImporter(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
Definition:
GenericClusterImporter.cc:7
edm::Ref< PFClusterCollection >
PFLayer::ECAL_BARREL
Definition:
PFLayer.h:33
reco::PFBlockElement::Type
Type
Definition:
PFBlockElement.h:30
PFLayer::PS1
Definition:
PFLayer.h:31
BlockElementImporterBase.h
PFLayer::HCAL_BARREL2
Definition:
PFLayer.h:36
PFLayer::HF_EM
Definition:
PFLayer.h:38
PFLayer::HCAL_BARREL1
Definition:
PFLayer.h:35
PFCluster.h
PFLayer::HGCAL
Definition:
PFLayer.h:40
reco::PFBlockElement::NONE
Definition:
PFBlockElement.h:31
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition:
PluginFactory.h:124
BlockElementImporterBase::ElementList
std::vector< std::unique_ptr< reco::PFBlockElement > > ElementList
Definition:
BlockElementImporterBase.h:16
bsc_activity_cfg.clusters
clusters
Definition:
bsc_activity_cfg.py:36
PFLayer::HF_HAD
Definition:
PFLayer.h:39
edm::ParameterSet
Definition:
ParameterSet.h:47
reco::PFBlockElement::HFEM
Definition:
PFBlockElement.h:39
GenericClusterImporter::_src
edm::EDGetTokenT< reco::PFClusterCollection > _src
Definition:
GenericClusterImporter.cc:14
type
type
Definition:
SiPixelVCal_PayloadInspector.cc:37
edmplugin::PluginFactory
Definition:
PluginFactory.h:34
reco::PFBlockElement::ECAL
Definition:
PFBlockElement.h:35
reco::PFBlockElement::HFHAD
Definition:
PFBlockElement.h:40
reco::PFBlockElement
Abstract base class for a PFBlock element (track, cluster...)
Definition:
PFBlockElement.h:26
GenericClusterImporter::importToBlock
void importToBlock(const edm::Event &, ElementList &) const override
Definition:
GenericClusterImporter.cc:19
reco::PFBlockElementCluster
Cluster Element.
Definition:
PFBlockElementCluster.h:16
Exception
Definition:
hltDiff.cc:246
reco::PFBlockElement::PS1
Definition:
PFBlockElement.h:33
PFLayer::ECAL_ENDCAP
Definition:
PFLayer.h:32
edm::Event
Definition:
Event.h:73
HLT_FULL_cff.distance
distance
Definition:
HLT_FULL_cff.py:7799
PFLayer::PS2
Definition:
PFLayer.h:30
l1t::PFClusterCollection
std::vector< l1t::PFCluster > PFClusterCollection
Definition:
PFCluster.h:73
edm::ConsumesCollector
Definition:
ConsumesCollector.h:45
reco::PFBlockElement::PS2
Definition:
PFBlockElement.h:34
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
BlockElementImporterBase
Definition:
BlockElementImporterBase.h:14
Generated for CMSSW Reference Manual by
1.8.16