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 // $Id: CentralityBinProducer.cc,v 1.4 2010/11/02 16:15:59 yilmaz Exp $
17 //
18 //
19 
20 
21 // system include files
22 #include <memory>
23 #include <string>
24 
25 // user include files
28 
31 
33 
36 
37 
38 //
39 // class declaration
40 //
41 
43  public:
46 
47  private:
48  virtual void beginJob() ;
49  virtual void produce(edm::Event&, const edm::EventSetup&);
50  virtual void endJob() ;
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  centrality_(0)
72 {
73  produces<int>();
74 }
75 
76 
78 {
79 
80  // do anything here that needs to be done at desctruction time
81  // (e.g. close files, deallocate resources etc.)
82 
83 }
84 
85 
86 //
87 // member functions
88 //
89 
90 // ------------ method called to produce the data ------------
91 void
93 {
94  using namespace edm;
95  if(!centrality_) centrality_ = new CentralityProvider(iSetup);
96  centrality_->newEvent(iEvent,iSetup);
97 
98  int bin = centrality_->getBin();
99  std::auto_ptr<int> binp(new int(bin));
100 
101  iEvent.put(binp);
102 
103 }
104 
105 // ------------ method called once each job just before starting event loop ------------
106 void
108 {
109 }
110 
111 // ------------ method called once each job just after ending the event loop ------------
112 void
114 }
115 
116 //define this as a plug-in
CentralityProvider * centrality_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
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:94
void newEvent(const edm::Event &ev, const edm::EventSetup &iSetup)
virtual void produce(edm::Event &, const edm::EventSetup &)