CMS 3D CMS Logo

EDProducerBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_one_EDProducerBase_h
2 #define FWCore_Framework_one_EDProducerBase_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : one::EDProducerBase
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Thu, 02 May 2013 21:21:21 GMT
19 //
20 
21 // system include files
22 
23 // user include files
30 
31 // forward declarations
32 namespace edm {
33 
34  class ModuleCallingContext;
35  class PreallocationConfiguration;
36  class ActivityRegistry;
37  class ProductRegistry;
38  class ThinnedAssociationsHelper;
39  class WaitingTask;
40 
41  namespace maker {
42  template<typename T> class ModuleHolderT;
43  }
44 
45  namespace one {
46 
48  {
49 
50  public:
51  template <typename T> friend class edm::maker::ModuleHolderT;
52  template <typename T> friend class edm::WorkerT;
54 
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
64  ModuleDescription const& moduleDescription() const { return moduleDescription_; }
65 
66  private:
67  bool doEvent(EventPrincipal const& ep, EventSetup const& c,
69  ModuleCallingContext const*);
70  //For now this is a placeholder
71  /*virtual*/ void preActionBeforeRunEventAsync(WaitingTask* iTask, ModuleCallingContext const& iModuleCallingContext, Principal const& iPrincipal) const {}
72 
73  void doPreallocate(PreallocationConfiguration const&);
74  void doBeginJob();
75  void doEndJob();
76 
77  void doBeginRun(RunPrincipal const& rp, EventSetup const& c,
78  ModuleCallingContext const*);
79  void doEndRun(RunPrincipal const& rp, EventSetup const& c,
80  ModuleCallingContext const*);
81  void doBeginLuminosityBlock(LuminosityBlockPrincipal const& lbp, EventSetup const& c,
82  ModuleCallingContext const*);
83  void doEndLuminosityBlock(LuminosityBlockPrincipal const& lbp, EventSetup const& c,
84  ModuleCallingContext const*);
85 
86  void doPreForkReleaseResources();
87  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
88 
89  //For now, the following are just dummy implemenations with no ability for users to override
90  void doRespondToOpenInputFile(FileBlock const& fb);
91  void doRespondToCloseInputFile(FileBlock const& fb);
94 
96  registerProducts(module, reg, moduleDescription_);
97  }
98  std::string workerType() const {return "WorkerT<EDProducer>";}
99 
101  return resourcesAcquirer_;
102  }
103 
104  virtual void produce(Event&, EventSetup const&) = 0;
105  virtual void beginJob() {}
106  virtual void endJob(){}
107 
108  virtual void preForkReleaseResources() {}
109  virtual void postForkReacquireResources(unsigned int /*iChildIndex*/, unsigned int /*iNumberOfChildren*/) {}
110  virtual void preallocThreads(unsigned int) {}
111 
112  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
113  virtual void doEndRun_(Run const& rp, EventSetup const& c);
114  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
115  virtual void doEndLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
116 
117  virtual void doBeginRunProduce_(Run& rp, EventSetup const& c);
118  virtual void doEndRunProduce_(Run& rp, EventSetup const& c);
119  virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
120  virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
121 
122  virtual SharedResourcesAcquirer createAcquirer();
123 
125  moduleDescription_ = md;
126  }
128  std::vector<BranchID> previousParentage_;
130 
132  };
133 
134  }
135 }
136 
137 
138 #endif
SharedResourcesAcquirer & sharedResourcesAcquirer()
void preActionBeforeRunEventAsync(WaitingTask *iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const
std::string workerType() const
virtual void postForkReacquireResources(unsigned int, unsigned int)
ModuleDescription const & moduleDescription() const
ParentageID previousParentageId_
void registerProductsAndCallbacks(EDProducerBase *module, ProductRegistry *reg)
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
SharedResourcesAcquirer resourcesAcquirer_
EDProducerBase ModuleType
virtual void preallocThreads(unsigned int)
HLT enums.
virtual void preForkReleaseResources()
void setModuleDescription(ModuleDescription const &md)
Definition: vlib.h:208
std::vector< BranchID > previousParentage_
ModuleDescription moduleDescription_
Definition: Run.h:42