CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
10 
11 // Framework
13 
19 
21 
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 
38 
39 //
40 // member functions
41 //
42 
43 // ------------ method called to produce the data ------------
45  // Get the filtered objects
47  iEvent.getByLabel(emObjectProducer_, emObjectHandle);
48 
49  // Get the barrel hcal hits
51  iEvent.getByLabel(towerProducer_, towerHandle);
52  const CaloTowerCollection* towers = towerHandle.product();
53 
54  auto isoMap = std::make_unique<edm::ValueMap<double>>();
56  std::vector<double> retV(emObjectHandle->size(), 0);
57 
58  EgammaTowerIsolation myHadIsolation(
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);
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
void produce(edm::Event &, const edm::EventSetup &) override
EgammaTowerIsolationProducer(const edm::ParameterSet &)
Definition: config.py:1
int iEvent
Definition: GenABIO.cc:224
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:488
T const * product() const
Definition: Handle.h:69
def move(src, dest)
Definition: eostools.py:511