L1Trigger
Phase2L1ParticleFlow
plugins
PFClusterProducerFromL1EGClusters.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/Frameworkfwd.h
"
2
#include "
FWCore/Framework/interface/stream/EDProducer.h
"
3
#include "
FWCore/Framework/interface/Event.h
"
4
#include "
FWCore/Framework/interface/MakerMacros.h
"
5
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
6
7
#include "
DataFormats/L1TParticleFlow/interface/PFCluster.h
"
8
#include "
L1Trigger/Phase2L1ParticleFlow/src/corrector.h
"
9
#include "
L1Trigger/Phase2L1ParticleFlow/interface/ParametricResolution.h
"
10
#include "
DataFormats/L1TCalorimeterPhase2/interface/CaloCrystalCluster.h
"
11
12
namespace
l1tpf
{
13
class
PFClusterProducerFromL1EGClusters
:
public
edm::stream::EDProducer
<> {
14
public
:
15
explicit
PFClusterProducerFromL1EGClusters
(
const
edm::ParameterSet
&);
16
~PFClusterProducerFromL1EGClusters
()
override
{}
17
18
private
:
19
edm::EDGetTokenT<l1tp2::CaloCrystalClusterCollection>
src_
;
20
double
etCut_
;
21
l1tpf::corrector
corrector_
;
22
l1tpf::ParametricResolution
resol_
;
23
24
void
produce
(
edm::Event
&,
const
edm::EventSetup
&)
override
;
25
26
};
// class
27
}
// namespace l1tpf
28
29
l1tpf::PFClusterProducerFromL1EGClusters::PFClusterProducerFromL1EGClusters
(
const
edm::ParameterSet
&iConfig)
30
: src_(consumes<
l1tp2
::
CaloCrystalClusterCollection
>(iConfig.getParameter<
edm
::
InputTag
>(
"src"
))),
31
etCut_(iConfig.getParameter<double>(
"etMin"
)),
32
corrector_(iConfig.getParameter<
std
::
string
>(
"corrector"
), -1),
33
resol_(iConfig.getParameter<
edm
::
ParameterSet
>(
"resol"
)) {
34
produces<l1t::PFClusterCollection>();
35
}
36
37
void
l1tpf::PFClusterProducerFromL1EGClusters::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
&) {
38
std::unique_ptr<l1t::PFClusterCollection>
out
(
new
l1t::PFClusterCollection
());
39
edm::Handle<l1tp2::CaloCrystalClusterCollection>
clusters
;
40
iEvent
.getByToken(src_,
clusters
);
41
42
unsigned
int
index
= 0;
43
for
(
auto
it =
clusters
->begin(), ed =
clusters
->end(); it != ed; ++it, ++
index
) {
44
if
(it->pt() <= etCut_)
45
continue
;
46
47
l1t::PFCluster
cluster(
48
it->pt(), it->eta(), it->phi(),
/*hOverE=*/
0.,
/*isEM=*/
true
);
// it->hovere() seems to return random values
49
if
(corrector_.valid())
50
corrector_.correctPt(cluster);
51
cluster.
setPtError
(resol_(cluster.pt(),
std::abs
(cluster.eta())));
52
53
out
->push_back(cluster);
54
out
->back().addConstituent(
edm::Ptr<l1t::L1Candidate>
(
clusters
,
index
));
55
}
56
57
iEvent
.put(
std::move
(
out
));
58
}
59
using
l1tpf::PFClusterProducerFromL1EGClusters
;
60
DEFINE_FWK_MODULE
(
PFClusterProducerFromL1EGClusters
);
ParametricResolution.h
l1tp2::CaloCrystalClusterCollection
std::vector< l1tp2::CaloCrystalCluster > CaloCrystalClusterCollection
Definition:
CaloCrystalCluster.h:150
l1tpf::PFClusterProducerFromL1EGClusters::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
PFClusterProducerFromL1EGClusters.cc:37
l1tpf::PFClusterProducerFromL1EGClusters::~PFClusterProducerFromL1EGClusters
~PFClusterProducerFromL1EGClusters() override
Definition:
PFClusterProducerFromL1EGClusters.cc:16
edm::EDGetTokenT< l1tp2::CaloCrystalClusterCollection >
edm
HLT enums.
Definition:
AlignableModifier.h:19
l1tpf::PFClusterProducerFromL1EGClusters::etCut_
double etCut_
Definition:
PFClusterProducerFromL1EGClusters.cc:20
EDProducer.h
edm::Handle
Definition:
AssociativeIterator.h:50
l1t::PFCluster::setPtError
void setPtError(float ptError)
Definition:
PFCluster.h:57
MakerMacros.h
l1tpf::ParametricResolution
Definition:
ParametricResolution.h:10
l1tpf::corrector
Definition:
corrector.h:15
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
l1tpf::PFClusterProducerFromL1EGClusters::src_
edm::EDGetTokenT< l1tp2::CaloCrystalClusterCollection > src_
Definition:
PFClusterProducerFromL1EGClusters.cc:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
bsc_activity_cfg.clusters
clusters
Definition:
bsc_activity_cfg.py:36
l1tpf::PFClusterProducerFromL1EGClusters::resol_
l1tpf::ParametricResolution resol_
Definition:
PFClusterProducerFromL1EGClusters.cc:22
HLT_2018_cff.InputTag
InputTag
Definition:
HLT_2018_cff.py:79016
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
ParameterSet
Definition:
Functions.h:16
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::stream::EDProducer
Definition:
EDProducer.h:38
edm::EventSetup
Definition:
EventSetup.h:57
l1tpf::PFClusterProducerFromL1EGClusters::corrector_
l1tpf::corrector corrector_
Definition:
PFClusterProducerFromL1EGClusters.cc:21
CaloCrystalCluster.h
edm::Ptr
Definition:
AssociationVector.h:31
PFCluster.h
eostools.move
def move(src, dest)
Definition:
eostools.py:511
std
Definition:
JetResolutionObject.h:76
Frameworkfwd.h
l1t::PFCluster
Definition:
PFCluster.h:10
l1tpf
Definition:
HGC3DClusterEgID.h:20
l1tpf::PFClusterProducerFromL1EGClusters::PFClusterProducerFromL1EGClusters
PFClusterProducerFromL1EGClusters(const edm::ParameterSet &)
Definition:
PFClusterProducerFromL1EGClusters.cc:29
AlignmentPI::index
index
Definition:
AlignmentPayloadInspectorHelper.h:46
MillePedeFileConverter_cfg.out
out
Definition:
MillePedeFileConverter_cfg.py:31
funct::abs
Abs< T >::type abs(const T &t)
Definition:
Abs.h:22
ParameterSet.h
edm::Event
Definition:
Event.h:73
corrector.h
l1tp2
Definition:
CaloCrystalCluster.h:12
l1t::PFClusterCollection
std::vector< l1t::PFCluster > PFClusterCollection
Definition:
PFCluster.h:73
l1tpf::PFClusterProducerFromL1EGClusters
Definition:
PFClusterProducerFromL1EGClusters.cc:13
Generated for CMSSW Reference Manual by
1.8.16