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 }
void produce(edm::Event &, const edm::EventSetup &) override
EgammaTowerIsolationProducer(const edm::ParameterSet &)
Definition: config.py:1
int iEvent
Definition: GenABIO.cc:224
const edm::EDGetTokenT< edm::View< reco::Candidate > > emObjectProducer_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const edm::EDPutTokenT< edm::ValueMap< double > > putToken_
const edm::EDGetTokenT< CaloTowerCollection > towerProducer_
def move(src, dest)
Definition: eostools.py:511