CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
31 
32 // forward declarations
33 namespace edm {
34 
35  class ModuleCallingContext;
36  class PreallocationConfiguration;
37  class ActivityRegistry;
38  class ThinnedAssociationsHelper;
39 
40  namespace maker {
41  template <typename T>
42  class ModuleHolderT;
43  }
44 
45  namespace one {
46 
47  class EDProducerBase : public ProducerBase, public EDConsumerBase {
48  public:
49  template <typename T>
51  template <typename T>
52  friend class edm::WorkerT;
54 
56  ~EDProducerBase() override;
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  virtual bool wantsProcessBlocks() const = 0;
66  virtual bool wantsInputProcessBlocks() const = 0;
67  virtual bool wantsGlobalRuns() const = 0;
68  virtual bool wantsGlobalLuminosityBlocks() const = 0;
69  bool wantsStreamRuns() const { return false; }
70  bool wantsStreamLuminosityBlocks() const { return false; };
71 
74 
75  private:
77  //For now this is a placeholder
79  ModuleCallingContext const&,
80  Principal const&) const {}
81 
83  virtual void preallocLumis(unsigned int);
84  void doBeginJob();
85  void doEndJob();
86 
91  void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
94 
99 
101  registerProducts(module, reg, moduleDescription_);
102  }
103  std::string workerType() const { return "WorkerT<EDProducer>"; }
104 
106 
107  virtual void produce(Event&, EventSetup const&) = 0;
108  virtual void beginJob() {}
109  virtual void endJob() {}
110 
111  virtual void preallocThreads(unsigned int) {}
112 
113  virtual void doBeginProcessBlock_(ProcessBlock const&);
114  virtual void doAccessInputProcessBlock_(ProcessBlock const&);
115  virtual void doEndProcessBlock_(ProcessBlock const&);
116  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
117  virtual void doEndRun_(Run const& rp, EventSetup const& c);
118  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
119  virtual void doEndLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
120 
123  virtual void doBeginRunProduce_(Run& rp, EventSetup const& c);
124  virtual void doEndRunProduce_(Run& rp, EventSetup const& c);
125  virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
126  virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
127 
128  virtual void clearInputProcessBlockCaches();
129  virtual bool hasAccumulator() const { return false; }
130 
131  bool hasAcquire() const { return false; }
132 
134 
137  std::vector<BranchID> previousParentage_;
139 
141  };
142 
143  } // namespace one
144 } // namespace edm
145 
146 #endif
SharedResourcesAcquirer & sharedResourcesAcquirer()
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
virtual void preallocLumis(unsigned int)
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
std::string workerType() const
const edm::EventSetup & c
static const std::string & baseType()
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
bool wantsStreamLuminosityBlocks() const
virtual void doBeginRunProduce_(Run &rp, EventSetup const &c)
virtual void doEndRunProduce_(Run &rp, EventSetup const &c)
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
virtual bool wantsGlobalLuminosityBlocks() const =0
virtual SerialTaskQueue * globalRunsQueue()
void registerProducts(ProducerBase *, ProductRegistry *, ModuleDescription const &)
Definition: ProducerBase.cc:57
virtual bool wantsProcessBlocks() const =0
virtual void doBeginProcessBlockProduce_(ProcessBlock &)
ModuleDescription const & moduleDescription() const
virtual void doEndProcessBlockProduce_(ProcessBlock &)
ParentageID previousParentageId_
void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const &, Principal const &) const
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
virtual void doEndLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
void registerProductsAndCallbacks(EDProducerBase *module, ProductRegistry *reg)
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
virtual bool wantsGlobalRuns() const =0
void doRespondToCloseInputFile(FileBlock const &)
virtual void clearInputProcessBlockCaches()
virtual void doEndRun_(Run const &rp, EventSetup const &c)
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
bool wantsStreamRuns() const
virtual void doBeginLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
virtual void doEndProcessBlock_(ProcessBlock const &)
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
SharedResourcesAcquirer resourcesAcquirer_
EDProducerBase ModuleType
void doPreallocate(PreallocationConfiguration const &)
virtual void preallocThreads(unsigned int)
virtual bool wantsInputProcessBlocks() const =0
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
void setModuleDescription(ModuleDescription const &md)
void doRespondToOpenInputFile(FileBlock const &)
static void prevalidate(ConfigurationDescriptions &descriptions)
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
virtual bool hasAccumulator() const
virtual SharedResourcesAcquirer createAcquirer()
virtual void doBeginProcessBlock_(ProcessBlock const &)
std::vector< BranchID > previousParentage_
ModuleDescription moduleDescription_
virtual void produce(Event &, EventSetup const &)=0
Definition: Run.h:45
tuple module
Definition: callgraph.py:69