CMS 3D CMS Logo

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
31 
32 // forward declarations
33 
34 namespace edm {
35  class ModuleCallingContext;
36  class PreallocationConfiguration;
37  class StreamID;
38  class GlobalSchedule;
39  class ActivityRegistry;
40  class ThinnedAssociationsHelper;
41  class WaitingTaskWithArenaHolder;
42 
43  namespace maker {
44  template <typename T>
45  class ModuleHolderT;
46  }
47 
48  namespace global {
49 
50  class EDProducerBase : public ProducerBase, public EDConsumerBase {
51  public:
52  template <typename T>
54  template <typename T>
55  friend class edm::WorkerT;
57 
58  friend class edm::GlobalSchedule;
59 
61  ~EDProducerBase() override;
62 
63  static void fillDescriptions(ConfigurationDescriptions& descriptions);
64  static void prevalidate(ConfigurationDescriptions& descriptions);
65  static const std::string& baseType();
66 
67  // Warning: the returned moduleDescription will be invalid during construction
69 
70  virtual bool wantsProcessBlocks() const = 0;
71  virtual bool wantsInputProcessBlocks() const = 0;
72  virtual bool wantsGlobalRuns() const = 0;
73  virtual bool wantsGlobalLuminosityBlocks() const = 0;
74  virtual bool wantsStreamRuns() const = 0;
75  virtual bool wantsStreamLuminosityBlocks() const = 0;
76 
77  private:
79  void doAcquire(EventTransitionInfo const&,
81  ModuleCallingContext const*,
84  void doBeginJob();
85  void doEndJob();
86 
87  void doBeginStream(StreamID);
88  void doEndStream(StreamID);
93 
98  void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
101 
106 
109  }
110  std::string workerType() const { return "WorkerT<EDProducer>"; }
111 
112  virtual void produce(StreamID, Event&, EventSetup const&) const = 0;
113  //For now this is a placeholder
115  ModuleCallingContext const& iModuleCallingContext,
116  Principal const& iPrincipal) const {}
117 
118  virtual void beginJob() {}
119  virtual void endJob() {}
120 
121  virtual void preallocStreams(unsigned int);
122  virtual void preallocLumis(unsigned int);
123  virtual void preallocLumisSummary(unsigned int);
124  virtual void preallocate(PreallocationConfiguration const&);
125  virtual void doBeginStream_(StreamID id);
126  virtual void doEndStream_(StreamID id);
127  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
128  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
129  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
130  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
131  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
132  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
133 
134  virtual void doBeginProcessBlock_(ProcessBlock const&);
135  virtual void doAccessInputProcessBlock_(ProcessBlock const&);
136  virtual void doEndProcessBlock_(ProcessBlock const&);
137  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
138  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
139  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
140  virtual void doEndRun_(Run const& rp, EventSetup const& c);
141  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
142  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
143  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
144  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
145 
148  virtual void doBeginRunProduce_(Run& rp, EventSetup const& c);
149  virtual void doEndRunProduce_(Run& rp, EventSetup const& c);
150  virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
151  virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
152 
153  virtual void clearInputProcessBlockCaches();
154  virtual bool hasAccumulator() const { return false; }
155 
156  virtual bool hasAcquire() const { return false; }
157 
158  virtual void doAcquire_(StreamID, Event const&, edm::EventSetup const&, WaitingTaskWithArenaHolder&);
159 
162  std::unique_ptr<std::vector<BranchID>[]> previousParentages_;
163  std::unique_ptr<std::vector<BranchID>[]> gotBranchIDsFromAcquire_;
164  std::unique_ptr<ParentageID[]> previousParentageIds_;
165  };
166 
167  } // namespace global
168 } // namespace edm
169 
170 #endif
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
ModuleDescription moduleDescription_
void setModuleDescription(ModuleDescription const &md)
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
virtual void doBeginProcessBlockProduce_(ProcessBlock &)
std::string workerType() const
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 doStreamBeginLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
virtual void preallocate(PreallocationConfiguration const &)
virtual void doEndRun_(Run const &rp, EventSetup const &c)
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
std::unique_ptr< ParentageID[]> previousParentageIds_
void doAcquire(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)
virtual void doBeginProcessBlock_(ProcessBlock const &)
void registerProducts(ProducerBase *, ProductRegistry *, ModuleDescription const &)
Definition: ProducerBase.cc:57
void doStreamBeginRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
void doPreallocate(PreallocationConfiguration const &)
virtual void doAcquire_(StreamID, Event const &, edm::EventSetup const &, WaitingTaskWithArenaHolder &)
void doRespondToCloseInputFile(FileBlock const &)
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
virtual void doBeginStream_(StreamID id)
virtual void doEndLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
virtual bool wantsGlobalRuns() const =0
void registerProductsAndCallbacks(EDProducerBase *module, ProductRegistry *reg)
void doRespondToOpenInputFile(FileBlock const &)
static void prevalidate(ConfigurationDescriptions &descriptions)
virtual void preallocLumisSummary(unsigned int)
virtual void preallocStreams(unsigned int)
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
void doStreamEndLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
ModuleDescription const & moduleDescription() const
std::unique_ptr< std::vector< BranchID >[]> previousParentages_
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const
virtual bool hasAcquire() const
virtual bool wantsGlobalLuminosityBlocks() const =0
void doStreamEndRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
virtual void doEndLuminosityBlockSummary_(LuminosityBlock const &lb, EventSetup const &c)
virtual void preallocLumis(unsigned int)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
static const std::string & baseType()
std::unique_ptr< std::vector< BranchID >[]> gotBranchIDsFromAcquire_
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
virtual void doBeginRunProduce_(Run &rp, EventSetup const &c)
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
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)
virtual bool wantsInputProcessBlocks() const =0
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
virtual bool hasAccumulator() const
HLT enums.
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
virtual void doEndProcessBlockProduce_(ProcessBlock &)
virtual void doEndProcessBlock_(ProcessBlock const &)
virtual bool wantsStreamLuminosityBlocks() const =0
virtual bool wantsStreamRuns() const =0
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual bool wantsProcessBlocks() const =0
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
virtual void clearInputProcessBlockCaches()
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
virtual void doEndRunProduce_(Run &rp, EventSetup const &c)
Definition: Run.h:45