RecoJets
JetProducers
plugins
FixedGridRhoProducer.cc
Go to the documentation of this file.
1
#include "
RecoJets/JetProducers/plugins/FixedGridRhoProducer.h
"
2
#include "
FWCore/Framework/interface/Event.h
"
3
#include "
FWCore/Framework/interface/MakerMacros.h
"
4
5
using namespace
std
;
6
7
FixedGridRhoProducer::FixedGridRhoProducer
(
const
edm::ParameterSet
& iConfig) {
8
pfCandidatesTag_ = iConfig.
getParameter
<
edm::InputTag
>(
"pfCandidatesTag"
);
9
string
etaRegion
= iConfig.
getParameter
<
string
>(
"EtaRegion"
);
10
if
(
etaRegion
==
"Central"
)
11
myEtaRegion =
FixedGridEnergyDensity::Central
;
12
else
if
(
etaRegion
==
"Forward"
)
13
myEtaRegion =
FixedGridEnergyDensity::Forward
;
14
else
if
(
etaRegion
==
"All"
)
15
myEtaRegion =
FixedGridEnergyDensity::All
;
16
else
{
17
edm::LogWarning
(
"FixedGridRhoProducer"
)
18
<<
"Wrong EtaRegion parameter: "
<<
etaRegion
<<
". Using EtaRegion = Central"
;
19
myEtaRegion =
FixedGridEnergyDensity::Central
;
20
}
21
produces<double>();
22
23
input_pfcoll_token_ = consumes<reco::PFCandidateCollection>(pfCandidatesTag_);
24
}
25
26
FixedGridRhoProducer::~FixedGridRhoProducer
() {}
27
28
void
FixedGridRhoProducer::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
29
edm::Handle<reco::PFCandidateCollection>
pfColl;
30
iEvent
.getByToken(input_pfcoll_token_, pfColl);
31
32
algo
=
new
FixedGridEnergyDensity
(pfColl.
product
());
33
34
double
result
=
algo
->fixedGridRho(myEtaRegion);
35
iEvent
.put(std::make_unique<double>(
result
));
36
37
delete
algo
;
38
}
39
40
DEFINE_FWK_MODULE
(
FixedGridRhoProducer
);
edm::Handle::product
T const * product() const
Definition:
Handle.h:70
FixedGridEnergyDensity::All
Definition:
FixedGridEnergyDensity.h:10
FixedGridEnergyDensity
Definition:
FixedGridEnergyDensity.h:6
FixedGridRhoProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
FixedGridRhoProducer.cc:28
FixedGridRhoProducer::~FixedGridRhoProducer
~FixedGridRhoProducer() override
Definition:
FixedGridRhoProducer.cc:26
edm::Handle
Definition:
AssociativeIterator.h:50
FixedGridRhoProducer
Definition:
FixedGridRhoProducer.h:9
FixedGridEnergyDensity::Forward
Definition:
FixedGridEnergyDensity.h:10
cmsdt::algo
algo
Definition:
constants.h:164
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:16
FixedGridRhoProducer.h
edm::LogWarning
Definition:
MessageLogger.h:141
dyt_utils::etaRegion
etaRegion
Definition:
DynamicTruncation.h:44
edm::ParameterSet
Definition:
ParameterSet.h:36
Event.h
iEvent
int iEvent
Definition:
GenABIO.cc:224
edm::EventSetup
Definition:
EventSetup.h:57
FixedGridEnergyDensity::Central
Definition:
FixedGridEnergyDensity.h:10
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
std
Definition:
JetResolutionObject.h:76
FixedGridRhoProducer::FixedGridRhoProducer
FixedGridRhoProducer(const edm::ParameterSet &iConfig)
Definition:
FixedGridRhoProducer.cc:7
mps_fire.result
result
Definition:
mps_fire.py:303
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
Generated for CMSSW Reference Manual by
1.8.16