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
31 
32 // forward declarations
33 namespace edm {
34 
35  class ModuleCallingContext;
36  class PreallocationConfiguration;
37  class ActivityRegistry;
38  class ThinnedAssociationsHelper;
39  class EventForTransformer;
40  class ServiceWeakToken;
41 
42  namespace maker {
43  template <typename T>
44  class ModuleHolderT;
45  }
46 
47  namespace one {
48 
49  class EDProducerBase : public ProducerBase, public EDConsumerBase {
50  public:
51  template <typename T>
53  template <typename T>
54  friend class edm::WorkerT;
56 
58  ~EDProducerBase() override;
59 
60  static void fillDescriptions(ConfigurationDescriptions& descriptions);
61  static void prevalidate(ConfigurationDescriptions& descriptions);
62  static const std::string& baseType();
63 
64  // Warning: the returned moduleDescription will be invalid during construction
66 
67  virtual bool wantsProcessBlocks() const noexcept = 0;
68  virtual bool wantsInputProcessBlocks() const noexcept = 0;
69  virtual bool wantsGlobalRuns() const noexcept = 0;
70  virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0;
71  bool wantsStreamRuns() const noexcept { return false; }
72  bool wantsStreamLuminosityBlocks() const noexcept { return false; };
73 
76 
77  private:
79  //For now this is a placeholder
81  ModuleCallingContext const&,
82  Principal const&) const noexcept {}
83 
85  size_t iTransformIndex,
86  EventPrincipal const& iEvent,
89  ServiceWeakToken const&) noexcept;
91  virtual void preallocRuns(unsigned int);
92  virtual void preallocLumis(unsigned int);
93  void doBeginJob();
94  void doEndJob();
95 
100  void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
103 
108 
111  }
112  std::string workerType() const { return "WorkerT<EDProducer>"; }
113 
115 
116  virtual void produce(Event&, EventSetup const&) = 0;
117  virtual void beginJob() {}
118  virtual void endJob() {}
119 
120  virtual void preallocThreads(unsigned int) {}
121 
122  virtual void doBeginProcessBlock_(ProcessBlock const&);
123  virtual void doAccessInputProcessBlock_(ProcessBlock const&);
124  virtual void doEndProcessBlock_(ProcessBlock const&);
125  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
126  virtual void doEndRun_(Run const& rp, EventSetup const& c);
127  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
128  virtual void doEndLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
129 
132  virtual void doBeginRunProduce_(Run& rp, EventSetup const& c);
133  virtual void doEndRunProduce_(Run& rp, EventSetup const& c);
134  virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
135  virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
136 
137  virtual size_t transformIndex_(edm::BranchDescription const& iBranch) const noexcept;
138  virtual ProductResolverIndex transformPrefetch_(std::size_t iIndex) const noexcept;
139  virtual void transformAsync_(WaitingTaskHolder iTask,
140  std::size_t iIndex,
142  edm::ActivityRegistry* iAct,
143  ServiceWeakToken const& iToken) const noexcept;
144 
145  virtual void clearInputProcessBlockCaches();
146  virtual bool hasAccumulator() const noexcept { return false; }
147 
148  bool hasAcquire() const noexcept { return false; }
149 
151 
154  std::vector<BranchID> previousParentage_;
156 
158  };
159 
160  } // namespace one
161 } // namespace edm
162 
163 #endif
SharedResourcesAcquirer & sharedResourcesAcquirer()
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
virtual void preallocLumis(unsigned int)
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
virtual void preallocRuns(unsigned int)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
static const std::string & baseType()
unsigned int ProductResolverIndex
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
std::string workerType() const
virtual void transformAsync_(WaitingTaskHolder iTask, std::size_t iIndex, edm::EventForTransformer &iEvent, edm::ActivityRegistry *iAct, ServiceWeakToken const &iToken) const noexcept
virtual void doBeginRunProduce_(Run &rp, EventSetup const &c)
virtual void doEndRunProduce_(Run &rp, EventSetup const &c)
ModuleDescription const & moduleDescription() const
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
virtual SerialTaskQueue * globalRunsQueue()
void registerProducts(ProducerBase *, ProductRegistry *, ModuleDescription const &)
Definition: ProducerBase.cc:57
virtual size_t transformIndex_(edm::BranchDescription const &iBranch) const noexcept
virtual void doBeginProcessBlockProduce_(ProcessBlock &)
virtual bool wantsInputProcessBlocks() const noexcept=0
virtual void doEndProcessBlockProduce_(ProcessBlock &)
virtual bool hasAccumulator() const noexcept
ParentageID previousParentageId_
virtual bool wantsGlobalRuns() const noexcept=0
virtual bool wantsProcessBlocks() const noexcept=0
int iEvent
Definition: GenABIO.cc:224
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 &)
void doRespondToCloseInputFile(FileBlock const &)
virtual void clearInputProcessBlockCaches()
virtual void doEndRun_(Run const &rp, EventSetup const &c)
void doTransformAsync(WaitingTaskHolder iTask, size_t iTransformIndex, EventPrincipal const &iEvent, ActivityRegistry *, ModuleCallingContext, ServiceWeakToken const &) noexcept
bool wantsStreamLuminosityBlocks() const noexcept
virtual bool wantsGlobalLuminosityBlocks() const noexcept=0
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
bool wantsStreamRuns() const noexcept
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
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 ProductResolverIndex transformPrefetch_(std::size_t iIndex) const noexcept
HLT enums.
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
void setModuleDescription(ModuleDescription const &md)
void doRespondToOpenInputFile(FileBlock const &)
static void prevalidate(ConfigurationDescriptions &descriptions)
bool hasAcquire() const noexcept
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
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
void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const &, Principal const &) const noexcept