CMS 3D CMS Logo

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 
17 
19 public:
21 
22  void produce(edm::Event&, const edm::EventSetup&) override;
23 
24 private:
25  // ----------member data ---------------------------
26 
29 
31 
32  const double egHcalIsoPtMin_;
33  const double egHcalIsoConeSizeOut_;
34  const double egHcalIsoConeSizeIn_;
35  const signed int egHcalDepth_;
36 };
37 
40 
42  : emObjectProducer_{consumes(config.getParameter<edm::InputTag>("emObjectProducer"))},
43  towerProducer_{consumes(config.getParameter<edm::InputTag>("towerProducer"))},
44  putToken_{produces<edm::ValueMap<double>>()},
45  egHcalIsoPtMin_{config.getParameter<double>("etMin")},
46  egHcalIsoConeSizeOut_{config.getParameter<double>("extRadius")},
47  egHcalIsoConeSizeIn_{config.getParameter<double>("intRadius")},
48  egHcalDepth_{config.getParameter<int>("Depth")} {}
49 
51  // Get the filtered objects
52  auto emObjectHandle = iEvent.getHandle(emObjectProducer_);
53 
54  // Get the barrel hcal hits
55  auto const& towers = iEvent.get(towerProducer_);
56 
57  edm::ValueMap<double> isoMap;
59  std::vector<double> retV(emObjectHandle->size(), 0);
60 
61  EgammaTowerIsolation myHadIsolation(
63 
64  for (size_t i = 0; i < emObjectHandle->size(); ++i) {
65  double isoValue = myHadIsolation.getTowerEtSum(&(emObjectHandle->at(i)));
66  retV[i] = isoValue;
67  }
68 
69  filler.insert(emObjectHandle, retV.begin(), retV.end());
70  filler.fill();
71  iEvent.emplace(putToken_, std::move(isoMap));
72 }
HLT_FULL_cff.towers
towers
Definition: HLT_FULL_cff.py:36362
mps_fire.i
i
Definition: mps_fire.py:428
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm::EDPutTokenT
Definition: EDPutToken.h:33
EgammaTowerIsolationProducer::egHcalIsoConeSizeOut_
const double egHcalIsoConeSizeOut_
Definition: EgammaTowerIsolationProducer.cc:33
EDProducer.h
RecoCandidate.h
config
Definition: config.py:1
MakerMacros.h
EgammaTowerIsolationProducer::putToken_
const edm::EDPutTokenT< edm::ValueMap< double > > putToken_
Definition: EgammaTowerIsolationProducer.cc:30
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
EgammaTowerIsolationProducer::towerProducer_
const edm::EDGetTokenT< CaloTowerCollection > towerProducer_
Definition: EgammaTowerIsolationProducer.cc:28
EgammaTowerIsolation.h
EgammaTowerIsolationProducer::egHcalIsoPtMin_
const double egHcalIsoPtMin_
Definition: EgammaTowerIsolationProducer.cc:32
EgammaTowerIsolationProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: EgammaTowerIsolationProducer.cc:50
edm::ParameterSet
Definition: ParameterSet.h:47
EgammaTowerIsolationProducer::EgammaTowerIsolationProducer
EgammaTowerIsolationProducer(const edm::ParameterSet &)
Definition: EgammaTowerIsolationProducer.cc:41
CandAssociation.h
Event.h
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
EgammaTowerIsolation
Definition: EgammaTowerIsolation.h:197
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:58
CaloTowerCollection.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ValueMap
Definition: ValueMap.h:107
Candidate.h
edm::helper::Filler
Definition: ValueMap.h:22
EgammaTowerIsolationProducer::egHcalIsoConeSizeIn_
const double egHcalIsoConeSizeIn_
Definition: EgammaTowerIsolationProducer.cc:34
ParameterSet.h
EgammaTowerIsolationProducer
Definition: EgammaTowerIsolationProducer.cc:18
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
EgammaTowerIsolationProducer::emObjectProducer_
const edm::EDGetTokenT< edm::View< reco::Candidate > > emObjectProducer_
Definition: EgammaTowerIsolationProducer.cc:27
EgammaTowerIsolationProducer::egHcalDepth_
const signed int egHcalDepth_
Definition: EgammaTowerIsolationProducer.cc:35