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
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::StreamID
Definition: StreamID.h:30
edm::global::EDProducerBase::hasAcquire
virtual bool hasAcquire() const
Definition: EDProducerBase.h:156
edm::global::EDProducerBase::hasAccumulator
virtual bool hasAccumulator() const
Definition: EDProducerBase.h:154
edm::global::EDProducerBase::previousParentages_
std::unique_ptr< std::vector< BranchID >[]> previousParentages_
Definition: EDProducerBase.h:162
edm::global::EDProducerBase::doStreamEndRun
void doStreamEndRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:215
ActivityRegistry
edm::global::EDProducerBase::doRespondToCloseOutputFile
void doRespondToCloseOutputFile()
Definition: EDProducerBase.h:104
edm::global::EDProducerBase::doBeginProcessBlock
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:109
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::global::EDProducerBase::wantsStreamLuminosityBlocks
virtual bool wantsStreamLuminosityBlocks() const =0
edm::global::EDProducerBase::wantsProcessBlocks
virtual bool wantsProcessBlocks() const =0
edm::Run
Definition: Run.h:45
WaitingTaskHolder.h
edm::global::EDProducerBase::gotBranchIDsFromAcquire_
std::unique_ptr< std::vector< BranchID >[]> gotBranchIDsFromAcquire_
Definition: EDProducerBase.h:163
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::global::EDProducerBase::preallocLumisSummary
virtual void preallocLumisSummary(unsigned int)
Definition: EDProducerBase.cc:257
edm::global::EDProducerBase::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDProducerBase.h:68
edm::global::EDProducerBase::doBeginLuminosityBlockSummary_
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:280
edm::global::EDProducerBase::doStreamBeginLuminosityBlock
void doStreamBeginLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:224
edm::Principal
Definition: Principal.h:56
edm::global::EDProducerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &)
Definition: EDProducerBase.h:103
edm::global::EDProducerBase::doAccessInputProcessBlock_
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
Definition: EDProducerBase.cc:271
edm::global::EDProducerBase::produce
virtual void produce(StreamID, Event &, EventSetup const &) const =0
edm::WorkerT
Definition: Frameworkfwd.h:63
edm::global::EDProducerBase::doEndJob
void doEndJob()
Definition: EDProducerBase.cc:107
edm::global::EDProducerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDProducerBase.cc:294
edm::global::EDProducerBase::doStreamBeginLuminosityBlock_
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:264
edm::global::EDProducerBase::baseType
static const std::string & baseType()
Definition: EDProducerBase.cc:304
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
edm::global::EDProducerBase::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const
Definition: EDProducerBase.h:114
edm::global::EDProducerBase::doBeginRun
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:136
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::global::EDProducerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDProducerBase.h:161
edm::global::EDProducerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
Definition: EDProducerBase.cc:279
edm::global::EDProducerBase::doEndLuminosityBlockSummary_
virtual void doEndLuminosityBlockSummary_(LuminosityBlock const &lb, EventSetup const &c)
Definition: EDProducerBase.cc:281
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::global::EDProducerBase::doRegisterThinnedAssociations
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDProducerBase.h:105
edm::ProductRegistry
Definition: ProductRegistry.h:37
ModuleDescription.h
edm::FileBlock
Definition: FileBlock.h:22
edm::WaitingTaskWithArenaHolder
Definition: WaitingTaskWithArenaHolder.h:34
edm::EDConsumerBase
Definition: EDConsumerBase.h:71
edm::global::EDProducerBase::beginJob
virtual void beginJob()
Definition: EDProducerBase.h:118
edm::global::EDProducerBase::doEndStream_
virtual void doEndStream_(StreamID id)
Definition: EDProducerBase.cc:260
edm::global::EDProducerBase::doStreamBeginRun_
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:261
edm::global::EDProducerBase::doBeginProcessBlockProduce_
virtual void doBeginProcessBlockProduce_(ProcessBlock &)
Definition: EDProducerBase.cc:283
edm::global::EDProducerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:273
edm::global::EDProducerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:167
edm::global::EDProducerBase::wantsGlobalRuns
virtual bool wantsGlobalRuns() const =0
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
edm::global::EDProducerBase::doBeginJob
void doBeginJob()
Definition: EDProducerBase.cc:105
edm::global::EDProducerBase::doStreamEndRunSummary_
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:263
edm::global::EDProducerBase
Definition: EDProducerBase.h:50
edm::maker::ModuleHolderT
Definition: EDAnalyzer.h:25
edm::GlobalSchedule
Definition: GlobalSchedule.h:81
edm::global::EDProducerBase::doAcquire
void doAcquire(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *, WaitingTaskWithArenaHolder &)
Definition: EDProducerBase.cc:77
edm::global::EDProducerBase::doStreamBeginRun
void doStreamBeginRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:203
edm::global::EDProducerBase::clearInputProcessBlockCaches
virtual void clearInputProcessBlockCaches()
Definition: EDProducerBase.cc:290
ProducerBase.h
edm::global::EDProducerBase::preallocate
virtual void preallocate(PreallocationConfiguration const &)
Definition: EDProducerBase.cc:258
edm::global::EDProducerBase::wantsGlobalLuminosityBlocks
virtual bool wantsGlobalLuminosityBlocks() const =0
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::global::EDProducerBase::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDProducerBase.h:160
edm::global::EDProducerBase::workerType
std::string workerType() const
Definition: EDProducerBase.h:110
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
edm::global::EDProducerBase::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDProducerBase.cc:58
edm::global::EDProducerBase::doBeginStream
void doBeginStream(StreamID)
Definition: EDProducerBase.cc:201
EDConsumerBase.h
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:32
edm::global::EDProducerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:278
edm::global::EDProducerBase::doEndProcessBlockProduce_
virtual void doEndProcessBlockProduce_(ProcessBlock &)
Definition: EDProducerBase.cc:284
edm::global::EDProducerBase::~EDProducerBase
~EDProducerBase() override
Definition: EDProducerBase.cc:56
edm::global::EDProducerBase::endJob
virtual void endJob()
Definition: EDProducerBase.h:119
edm::global::EDProducerBase::doStreamEndLuminosityBlockSummary_
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:266
edm::global::EDProducerBase::doBeginLuminosityBlockProduce_
virtual void doBeginLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:287
edm::global::EDProducerBase::doEndRun
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:153
edm::global::EDProducerBase::previousParentageIds_
std::unique_ptr< ParentageID[]> previousParentageIds_
Definition: EDProducerBase.h:164
edm::global::EDProducerBase::ModuleType
EDProducerBase ModuleType
Definition: EDProducerBase.h:56
edm::EventSetup
Definition: EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::global::EDProducerBase::doEndRunProduce_
virtual void doEndRunProduce_(Run &rp, EventSetup const &c)
Definition: EDProducerBase.cc:286
callgraph.module
module
Definition: callgraph.py:61
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::global::EDProducerBase::doAcquire_
virtual void doAcquire_(StreamID, Event const &, edm::EventSetup const &, WaitingTaskWithArenaHolder &)
Definition: EDProducerBase.cc:292
edm::global::EDProducerBase::doBeginProcessBlock_
virtual void doBeginProcessBlock_(ProcessBlock const &)
Definition: EDProducerBase.cc:270
edm::global::EDProducerBase::doEndStream
void doEndStream(StreamID)
Definition: EDProducerBase.cc:202
edm::global::EDProducerBase::doAccessInputProcessBlock
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:119
edm::global::EDProducerBase::wantsStreamRuns
virtual bool wantsStreamRuns() const =0
Frameworkfwd.h
edm::global::EDProducerBase::doEndRunSummary_
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:276
ParameterSetfwd.h
edm::global::EDProducerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:184
edm::global::EDProducerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDProducerBase.cc:300
edm::global::EDProducerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDProducerBase.cc:256
edm::global::EDProducerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &)
Definition: EDProducerBase.h:102
edm::global::EDProducerBase::doEndLuminosityBlockProduce_
virtual void doEndLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:288
edm::global::EDProducerBase::doBeginStream_
virtual void doBeginStream_(StreamID id)
Definition: EDProducerBase.cc:259
edm::global::EDProducerBase::doEndProcessBlock
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:126
edm::global::EDProducerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:274
edm::global::EDProducerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDProducerBase.cc:92
edm::global::EDProducerBase::doEndProcessBlock_
virtual void doEndProcessBlock_(ProcessBlock const &)
Definition: EDProducerBase.cc:272
edm::global::EDProducerBase::preallocStreams
virtual void preallocStreams(unsigned int)
Definition: EDProducerBase.cc:255
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::ProducerBase
Definition: ProducerBase.h:70
edm::global::EDProducerBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDProducerBase *module, ProductRegistry *reg)
Definition: EDProducerBase.h:107
edm::ProducerBase::registerProducts
void registerProducts(ProducerBase *, ProductRegistry *, ModuleDescription const &)
Definition: ProducerBase.cc:57
edm::Event
Definition: Event.h:73
edm::global::EDProducerBase::doStreamEndLuminosityBlock
void doStreamEndLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:240
edm::global::EDProducerBase::doBeginRunSummary_
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:275
edm::global::EDProducerBase::doBeginRunProduce_
virtual void doBeginRunProduce_(Run &rp, EventSetup const &c)
Definition: EDProducerBase.cc:285
edm::ProcessBlock
Definition: ProcessBlock.h:36
edm::global::EDProducerBase::EDProducerBase
EDProducerBase()
Definition: EDProducerBase.cc:49
edm::global::EDProducerBase::doStreamEndLuminosityBlock_
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:265
edm::global::EDProducerBase::wantsInputProcessBlocks
virtual bool wantsInputProcessBlocks() const =0
edm::global::EDProducerBase::doStreamEndRun_
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:262
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29