RecoEgamma
EgammaIsolationAlgos
plugins
EgammaTowerIsolationProducer.cc
Go to the documentation of this file.
1
//*****************************************************************************
2
// File: EgammaTowerIsolationProducer.cc
3
// ----------------------------------------------------------------------------
4
// OrigAuth: Matthias Mozer
5
// Institute: IIHE-VUB
6
//=============================================================================
7
//*****************************************************************************
8
9
#include "
RecoEgamma/EgammaIsolationAlgos/plugins/EgammaTowerIsolationProducer.h
"
10
11
// Framework
12
#include "
DataFormats/Common/interface/Handle.h
"
13
14
#include "
DataFormats/Candidate/interface/Candidate.h
"
15
#include "
DataFormats/Candidate/interface/CandAssociation.h
"
16
#include "
DataFormats/RecoCandidate/interface/RecoCandidate.h
"
17
#include "
DataFormats/EgammaReco/interface/SuperCluster.h
"
18
#include "
DataFormats/EgammaReco/interface/SuperClusterFwd.h
"
19
20
#include "
DataFormats/CaloTowers/interface/CaloTowerCollection.h
"
21
22
EgammaTowerIsolationProducer::EgammaTowerIsolationProducer
(
const
edm::ParameterSet
&
config
) : conf_(
config
) {
23
// use configuration file to setup input/output collection names
24
emObjectProducer_
=
conf_
.
getParameter
<
edm::InputTag
>(
"emObjectProducer"
);
25
26
towerProducer_
=
conf_
.
getParameter
<
edm::InputTag
>(
"towerProducer"
);
27
28
egHcalIsoPtMin_
=
conf_
.
getParameter
<
double
>(
"etMin"
);
29
egHcalIsoConeSizeIn_
=
conf_
.
getParameter
<
double
>(
"intRadius"
);
30
egHcalIsoConeSizeOut_
=
conf_
.
getParameter
<
double
>(
"extRadius"
);
31
egHcalDepth_
=
conf_
.
getParameter
<
int
>(
"Depth"
);
32
33
//register your products
34
produces<edm::ValueMap<double>>();
35
}
36
37
EgammaTowerIsolationProducer::~EgammaTowerIsolationProducer
() {}
38
39
//
40
// member functions
41
//
42
43
// ------------ method called to produce the data ------------
44
void
EgammaTowerIsolationProducer::produce
(
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup) {
45
// Get the filtered objects
46
edm::Handle<edm::View<reco::Candidate>
> emObjectHandle;
47
iEvent
.getByLabel(
emObjectProducer_
, emObjectHandle);
48
49
// Get the barrel hcal hits
50
edm::Handle<CaloTowerCollection>
towerHandle;
51
iEvent
.getByLabel(
towerProducer_
, towerHandle);
52
const
CaloTowerCollection
*
towers
= towerHandle.
product
();
53
54
auto
isoMap = std::make_unique<edm::ValueMap<double>>();
55
edm::ValueMap<double>::Filler
filler
(*isoMap);
56
std::vector<double> retV(emObjectHandle->size(), 0);
57
58
EgammaTowerIsolation
myHadIsolation(
59
egHcalIsoConeSizeOut_
,
egHcalIsoConeSizeIn_
,
egHcalIsoPtMin_
,
egHcalDepth_
,
towers
);
60
61
for
(
size_t
i
= 0;
i
< emObjectHandle->size(); ++
i
) {
62
double
isoValue = myHadIsolation.getTowerEtSum(&(emObjectHandle->at(
i
)));
63
retV[
i
] = isoValue;
64
}
65
66
filler
.insert(emObjectHandle, retV.begin(), retV.end());
67
filler
.fill();
68
iEvent
.put(
std::move
(isoMap));
69
}
70
71
//define this as a plug-in
72
//DEFINE_FWK_MODULE(EgammaTowerIsolationProducer);
EgammaTowerIsolationProducer::towerProducer_
edm::InputTag towerProducer_
Definition:
EgammaTowerIsolationProducer.h:44
HLT_FULL_cff.towers
towers
Definition:
HLT_FULL_cff.py:36362
Handle.h
mps_fire.i
i
Definition:
mps_fire.py:428
EgammaTowerIsolationProducer::egHcalIsoConeSizeOut_
double egHcalIsoConeSizeOut_
Definition:
EgammaTowerIsolationProducer.h:47
edm::Handle::product
T const * product() const
Definition:
Handle.h:70
EgammaTowerIsolationProducer::egHcalIsoPtMin_
double egHcalIsoPtMin_
Definition:
EgammaTowerIsolationProducer.h:46
edm::SortedCollection< CaloTower >
edm::Handle
Definition:
AssociativeIterator.h:50
RecoCandidate.h
EgammaTowerIsolationProducer::~EgammaTowerIsolationProducer
~EgammaTowerIsolationProducer() override
Definition:
EgammaTowerIsolationProducer.cc:37
config
Definition:
config.py:1
EgammaTowerIsolationProducer::egHcalDepth_
signed int egHcalDepth_
Definition:
EgammaTowerIsolationProducer.h:49
EgammaTowerIsolationProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition:
EgammaTowerIsolationProducer.cc:44
edm::ParameterSet
Definition:
ParameterSet.h:47
EgammaTowerIsolationProducer::EgammaTowerIsolationProducer
EgammaTowerIsolationProducer(const edm::ParameterSet &)
Definition:
EgammaTowerIsolationProducer.cc:22
CandAssociation.h
trigObjTnPSource_cfi.filler
filler
Definition:
trigObjTnPSource_cfi.py:21
EgammaTowerIsolation
Definition:
EgammaTowerIsolation.h:197
iEvent
int iEvent
Definition:
GenABIO.cc:224
EgammaTowerIsolationProducer::conf_
edm::ParameterSet conf_
Definition:
EgammaTowerIsolationProducer.h:51
edm::EventSetup
Definition:
EventSetup.h:57
CaloTowerCollection.h
eostools.move
def move(src, dest)
Definition:
eostools.py:511
SuperClusterFwd.h
SuperCluster.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
Candidate.h
edm::helper::Filler
Definition:
ValueMap.h:22
EgammaTowerIsolationProducer::emObjectProducer_
edm::InputTag emObjectProducer_
Definition:
EgammaTowerIsolationProducer.h:43
EgammaTowerIsolationProducer::egHcalIsoConeSizeIn_
double egHcalIsoConeSizeIn_
Definition:
EgammaTowerIsolationProducer.h:48
edm::Event
Definition:
Event.h:73
edm::InputTag
Definition:
InputTag.h:15
EgammaTowerIsolationProducer.h
Generated for CMSSW Reference Manual by
1.8.16