CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CentralityBinProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CentralityBinProducer
4 // Class: CentralityBinProducer
5 //
13 //
14 // Original Author: Yetkin Yilmaz
15 // Created: Thu Aug 12 05:34:11 EDT 2010
16 //
17 //
18 
19 
20 // system include files
21 #include <memory>
22 #include <string>
23 
24 // user include files
27 
30 
32 
35 
36 
37 //
38 // class declaration
39 //
40 
42  public:
45 
46  private:
47  virtual void beginJob() override ;
48  virtual void produce(edm::Event&, const edm::EventSetup&) override;
49  virtual void endJob() override ;
50 
51  // ----------member data ---------------------------
52 
54 
55 };
56 
57 //
58 // constants, enums and typedefs
59 //
60 
61 
62 //
63 // static data member definitions
64 //
65 
66 //
67 // constructors and destructor
68 //
70  centrality_(0)
71 {
72  produces<int>();
73 }
74 
75 
77 {
78 
79  // do anything here that needs to be done at desctruction time
80  // (e.g. close files, deallocate resources etc.)
81 
82 }
83 
84 
85 //
86 // member functions
87 //
88 
89 // ------------ method called to produce the data ------------
90 void
92 {
93  using namespace edm;
94  if(!centrality_) centrality_ = new CentralityProvider(iSetup);
95  centrality_->newEvent(iEvent,iSetup);
96 
97  int bin = centrality_->getBin();
98  std::auto_ptr<int> binp(new int(bin));
99 
100  iEvent.put(binp);
101 
102 }
103 
104 // ------------ method called once each job just before starting event loop ------------
105 void
107 {
108 }
109 
110 // ------------ method called once each job just after ending the event loop ------------
111 void
113 }
114 
115 //define this as a plug-in
CentralityProvider * centrality_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual void endJob() override
CentralityBinProducer(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
void newEvent(const edm::Event &ev, const edm::EventSetup &iSetup)
virtual void produce(edm::Event &, const edm::EventSetup &) override
virtual void beginJob() override