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:
46 
47  private:
48  virtual void beginJob() override ;
49  virtual void produce(edm::Event&, const edm::EventSetup&) override;
50  virtual void endJob() override ;
51 
52  // ----------member data ---------------------------
53 
55 
56 };
57 
58 //
59 // constants, enums and typedefs
60 //
61 
62 
63 //
64 // static data member definitions
65 //
66 
67 //
68 // constructors and destructor
69 //
71 
73  centrality_(0)
74 {
75  using namespace edm;
76  if(!centrality_) centrality_ = new CentralityProvider(iSetup, std::move(iC));
77 
78  produces<int>();
79 }
80 
81 
83 {
84 
85  // do anything here that needs to be done at desctruction time
86  // (e.g. close files, deallocate resources etc.)
87 
88 }
89 
90 
91 //
92 // member functions
93 //
94 
95 // ------------ method called to produce the data ------------
96 void
98 {
99  centrality_->newEvent(iEvent,iSetup);
100 
101  int bin = centrality_->getBin();
102  std::auto_ptr<int> binp(new int(bin));
103 
104  iEvent.put(binp);
105 
106 }
107 
108 // ------------ method called once each job just before starting event loop ------------
109 void
111 {
112 }
113 
114 // ------------ method called once each job just after ending the event loop ------------
115 void
117 }
118 
119 //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:230
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
void newEvent(const edm::Event &ev, const edm::EventSetup &iSetup)
virtual void produce(edm::Event &, const edm::EventSetup &) override
virtual void beginJob() override