CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuPFIsoEmbedder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: MuPFIsoEmbedder
4 // Class: MuPFIsoEmbedder
5 //
13 //
14 // Original Author: Michail Bachtis,32 3-B16,+41227675567,
15 // Created: Thu Jun 9 01:36:17 CEST 2011
16 // $Id: MuPFIsoEmbedder.cc,v 1.1 2011/06/15 00:33:01 bachtis Exp $
17 //
18 //
19 
20 
21 // system include files
22 #include <memory>
23 
24 // user include files
27 
30 
35 
36 //
37 // class declaration
38 //
39 
41  public:
42  explicit MuPFIsoEmbedder(const edm::ParameterSet&);
44 
45  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
46 
47  private:
48  virtual void beginJob() ;
49  virtual void produce(edm::Event&, const edm::EventSetup&);
50  virtual void endJob() ;
51 
52  virtual void beginRun(edm::Run&, edm::EventSetup const&);
53  virtual void endRun(edm::Run&, edm::EventSetup const&);
56 
57 
58  // ----------member data ---------------------------
60 
62 
63 };
64 
65 
66 
67 
68 //
70  muons_(iConfig.getParameter<edm::InputTag>("src"))
71 {
72 
73  helper_ = new MuPFIsoHelper(iConfig);
74  produces<reco::MuonCollection>();
75 }
76 
77 
79 {
80 
81  // do anything here that needs to be done at desctruction time
82  // (e.g. close files, deallocate resources etc.)
83 
84 }
85 
86 
87 //
88 // member functions
89 //
90 
91 // ------------ method called to produce the data ------------
92 void
94 {
95  using namespace edm;
96  using namespace reco;
97 
98 
99  helper_->beginEvent(iEvent);
100 
102  iEvent.getByLabel(muons_,muons);
103 
104 
105  std::auto_ptr<MuonCollection> out(new MuonCollection);
106 
107  for(unsigned int i=0;i<muons->size();++i) {
108  MuonRef muonRef(muons,i);
109  Muon muon = muons->at(i);
110  helper_->embedPFIsolation(muon,muonRef);
111  out->push_back(muon);
112  }
113 
114  iEvent.put(out);
115 }
116 
117 // ------------ method called once each job just before starting event loop ------------
118 void
120 {
121 }
122 
123 // ------------ method called once each job just after ending the event loop ------------
124 void
126 }
127 
128 // ------------ method called when starting to processes a run ------------
129 void
131 {
132 }
133 
134 // ------------ method called when ending the processing of a run ------------
135 void
137 {
138 }
139 
140 // ------------ method called when starting to processes a luminosity block ------------
141 void
143 {
144 }
145 
146 // ------------ method called when ending the processing of a luminosity block ------------
147 void
149 {
150 }
151 
152 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
153 void
155  //The following says we do not know what parameters are allowed so do no validation
156  // Please change this to state exactly what you do use, even if it is no parameters
158  desc.setUnknown();
159  descriptions.addDefault(desc);
160 }
161 
162 //define this as a plug-in
int i
Definition: DBlmapReader.cc:9
virtual void beginJob()
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
int iEvent
Definition: GenABIO.cc:243
virtual void endLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
void addDefault(ParameterSetDescription const &psetDescription)
MuPFIsoEmbedder(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
virtual void beginLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
virtual void beginRun(edm::Run &, edm::EventSetup const &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple out
Definition: dbtoconf.py:99
MuPFIsoHelper * helper_
int embedPFIsolation(reco::Muon &, reco::MuonRef &)
virtual void endJob()
virtual void produce(edm::Event &, const edm::EventSetup &)
virtual void endRun(edm::Run &, edm::EventSetup const &)
void beginEvent(const edm::Event &iEvent)
tuple muons
Definition: patZpeak.py:38
edm::InputTag muons_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: Run.h:33