CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EDProducerBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_global_EDProducerBase_h
2 #define FWCore_Framework_global_EDProducerBase_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : EDProducerBase
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Thu, 18 Jul 2013 11:51:14 GMT
19 //
20 
21 // system include files
22 #include <memory>
23 
24 // user include files
30 
31 // forward declarations
32 
33 namespace edm {
34  class ModuleCallingContext;
35  class PreallocationConfiguration;
36  class StreamID;
37  class GlobalSchedule;
38 
39  namespace maker {
40  template<typename T> class ModuleHolderT;
41  }
42 
43  namespace global {
44 
46  {
47 
48  public:
49  template <typename T> friend class edm::maker::ModuleHolderT;
50  template <typename T> friend class edm::WorkerT;
52 
53  friend class edm::GlobalSchedule;
54 
56  virtual ~EDProducerBase();
57 
58  static void fillDescriptions(ConfigurationDescriptions& descriptions);
59  static void prevalidate(ConfigurationDescriptions& descriptions);
60  static const std::string& baseType();
61 
62  // Warning: the returned moduleDescription will be invalid during construction
64 
65  private:
66  bool doEvent(EventPrincipal& ep, EventSetup const& c,
67  ModuleCallingContext const*);
69  void doBeginJob();
70  void doEndJob();
71 
72  void doBeginStream(StreamID id);
73  void doEndStream(StreamID id);
74  void doStreamBeginRun(StreamID id,
75  RunPrincipal& ep,
76  EventSetup const& c,
77  ModuleCallingContext const*);
78  void doStreamEndRun(StreamID id,
79  RunPrincipal& ep,
80  EventSetup const& c,
81  ModuleCallingContext const*);
84  EventSetup const& c,
85  ModuleCallingContext const*);
88  EventSetup const& c,
89  ModuleCallingContext const*);
90 
91 
92  void doBeginRun(RunPrincipal& rp, EventSetup const& c,
93  ModuleCallingContext const*);
94  void doEndRun(RunPrincipal& rp, EventSetup const& c,
95  ModuleCallingContext const*);
97  ModuleCallingContext const*);
99  ModuleCallingContext const*);
100 
101  //For now, the following are just dummy implemenations with no ability for users to override
105  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
106 
107 
109  registerProducts(module, reg, moduleDescription_);
110  }
111  std::string workerType() const {return "WorkerT<EDProducer>";}
112 
113  virtual void produce(StreamID, Event&, EventSetup const&) const= 0;
114  virtual void beginJob() {}
115  virtual void endJob(){}
116 
117  virtual void preallocStreams(unsigned int);
118  virtual void doBeginStream_(StreamID id);
119  virtual void doEndStream_(StreamID id);
120  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
121  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
122  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
123  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
124  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
125  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
126 
127  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
128  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
129  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
130  virtual void doEndRun_(Run const& rp, EventSetup const& c);
131  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
132  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
133  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
134  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
135 
136  virtual void doBeginRunProduce_(Run& rp, EventSetup const& c);
137  virtual void doEndRunProduce_(Run& rp, EventSetup const& c);
138  virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
139  virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
140 
141 
143  moduleDescription_ = md;
144  }
146  std::unique_ptr<std::vector<BranchID>[]> previousParentages_;
147  std::unique_ptr<ParentageID[]> previousParentageIds_;
148  };
149 
150  }
151 }
152 
153 #endif
ModuleDescription moduleDescription_
void setModuleDescription(ModuleDescription const &md)
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
virtual void doBeginLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
virtual void doEndStream_(StreamID id)
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
void doBeginStream(StreamID id)
bool doEvent(EventPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
virtual void doEndRun_(Run const &rp, EventSetup const &c)
std::unique_ptr< ParentageID[]> previousParentageIds_
void registerProducts(ProducerBase *, ProductRegistry *, ModuleDescription const &)
Definition: ProducerBase.cc:60
void doPreallocate(PreallocationConfiguration const &)
void doEndRun(RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *)
void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
virtual void doBeginStream_(StreamID id)
virtual void doEndLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
void doStreamEndRun(StreamID id, RunPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
void registerProductsAndCallbacks(EDProducerBase *module, ProductRegistry *reg)
static void prevalidate(ConfigurationDescriptions &descriptions)
virtual void preallocStreams(unsigned int)
void doStreamBeginRun(StreamID id, RunPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
void doRespondToOpenInputFile(FileBlock const &fb)
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
void doStreamEndLuminosityBlock(StreamID id, LuminosityBlockPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
std::unique_ptr< std::vector< BranchID >[]> previousParentages_
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doEndLuminosityBlockSummary_(LuminosityBlock const &lb, EventSetup const &c)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
static const std::string & baseType()
virtual void doBeginRunProduce_(Run &rp, EventSetup const &c)
void doStreamBeginLuminosityBlock(StreamID id, LuminosityBlockPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
ModuleDescription const & moduleDescription() const
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
virtual void produce(StreamID, Event &, EventSetup const &) const =0
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
void doEndLuminosityBlock(LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *)
void doBeginRun(RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *)
std::string workerType() const
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: vlib.h:208
void doBeginLuminosityBlock(LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *)
virtual void doEndRunProduce_(Run &rp, EventSetup const &c)
Definition: Run.h:41
void doEndStream(StreamID id)