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