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  class ActivityRegistry;
39 
40  namespace maker {
41  template<typename T> class ModuleHolderT;
42  }
43 
44  namespace global {
45 
47  {
48 
49  public:
50  template <typename T> friend class edm::maker::ModuleHolderT;
51  template <typename T> friend class edm::WorkerT;
53 
54  friend class edm::GlobalSchedule;
55 
57  virtual ~EDProducerBase();
58 
59  static void fillDescriptions(ConfigurationDescriptions& descriptions);
60  static void prevalidate(ConfigurationDescriptions& descriptions);
61  static const std::string& baseType();
62 
63  // Warning: the returned moduleDescription will be invalid during construction
65 
66  private:
67  bool doEvent(EventPrincipal& ep, EventSetup const& c,
69  ModuleCallingContext const*);
71  void doBeginJob();
72  void doEndJob();
73 
74  void doBeginStream(StreamID id);
75  void doEndStream(StreamID id);
76  void doStreamBeginRun(StreamID id,
77  RunPrincipal& ep,
78  EventSetup const& c,
79  ModuleCallingContext const*);
80  void doStreamEndRun(StreamID id,
81  RunPrincipal& ep,
82  EventSetup const& c,
83  ModuleCallingContext const*);
86  EventSetup const& c,
87  ModuleCallingContext const*);
90  EventSetup const& c,
91  ModuleCallingContext const*);
92 
93 
94  void doBeginRun(RunPrincipal& rp, EventSetup const& c,
95  ModuleCallingContext const*);
96  void doEndRun(RunPrincipal& rp, EventSetup const& c,
97  ModuleCallingContext const*);
99  ModuleCallingContext const*);
101  ModuleCallingContext const*);
102 
104  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
105 
106  //For now, the following are just dummy implemenations with no ability for users to override
109 
110 
112  registerProducts(module, reg, moduleDescription_);
113  }
114  std::string workerType() const {return "WorkerT<EDProducer>";}
115 
116  virtual void produce(StreamID, Event&, EventSetup const&) const= 0;
117  virtual void beginJob() {}
118  virtual void endJob(){}
119 
120  virtual void preForkReleaseResources() {}
121  virtual void postForkReacquireResources(unsigned int /*iChildIndex*/, unsigned int /*iNumberOfChildren*/) {}
122 
123  virtual void preallocStreams(unsigned int);
124  virtual void doBeginStream_(StreamID id);
125  virtual void doEndStream_(StreamID id);
126  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
127  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
128  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
129  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
130  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
131  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
132 
133  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
134  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
135  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
136  virtual void doEndRun_(Run const& rp, EventSetup const& c);
137  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
138  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
139  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
140  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
141 
142  virtual void doBeginRunProduce_(Run& rp, EventSetup const& c);
143  virtual void doEndRunProduce_(Run& rp, EventSetup const& c);
144  virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
145  virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
146 
147 
150  }
152  std::unique_ptr<std::vector<BranchID>[]> previousParentages_;
153  std::unique_ptr<ParentageID[]> previousParentageIds_;
154  };
155 
156  }
157 }
158 
159 #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)
bool doEvent(EventPrincipal &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
virtual void doEndStream_(StreamID id)
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
void doBeginStream(StreamID id)
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 *)
virtual void preForkReleaseResources()
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 *)
virtual void postForkReacquireResources(unsigned int, unsigned int)
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)