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 ThinnedAssociationsHelper;
38  class WaitingTask;
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
78  /*virtual*/ void preActionBeforeRunEventAsync(WaitingTask*, ModuleCallingContext const&, Principal const&) const {
79  }
80 
82  virtual void preallocLumis(unsigned int);
83  void doBeginJob();
84  void doEndJob();
85 
90  void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
93 
94  //For now, the following are just dummy implemenations with no ability for users to override
98 
101  }
102  std::string workerType() const { return "WorkerT<EDProducer>"; }
103 
105 
106  virtual void produce(Event&, EventSetup const&) = 0;
107  virtual void beginJob() {}
108  virtual void endJob() {}
109 
110  virtual void preallocThreads(unsigned int) {}
111 
112  virtual void doBeginProcessBlock_(ProcessBlock const&);
113  virtual void doAccessInputProcessBlock_(ProcessBlock const&);
114  virtual void doEndProcessBlock_(ProcessBlock const&);
115  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
116  virtual void doEndRun_(Run const& rp, EventSetup const& c);
117  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
118  virtual void doEndLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
119 
122  virtual void doBeginRunProduce_(Run& rp, EventSetup const& c);
123  virtual void doEndRunProduce_(Run& rp, EventSetup const& c);
124  virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
125  virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
126 
127  virtual bool hasAccumulator() const { return false; }
128 
129  bool hasAcquire() const { return false; }
130 
132 
135  std::vector<BranchID> previousParentage_;
137 
139  };
140 
141  } // namespace one
142 } // namespace edm
143 
144 #endif
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::one::EDProducerBase::wantsInputProcessBlocks
virtual bool wantsInputProcessBlocks() const =0
edm::one::EDProducerBase::endJob
virtual void endJob()
Definition: EDProducerBase.h:108
SiPixelPI::one
Definition: SiPixelPayloadInspectorHelper.h:39
edm::one::EDProducerBase::~EDProducerBase
~EDProducerBase() override
Definition: EDProducerBase.cc:46
edm::one::EDProducerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDProducerBase.cc:79
edm::one::EDProducerBase::wantsGlobalRuns
virtual bool wantsGlobalRuns() const =0
edm::one::EDProducerBase::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDProducerBase.h:133
edm::one::EDProducerBase::preallocThreads
virtual void preallocThreads(unsigned int)
Definition: EDProducerBase.h:110
ActivityRegistry
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::one::EDProducerBase::hasAcquire
bool hasAcquire() const
Definition: EDProducerBase.h:129
edm::one::EDProducerBase::doEndRun
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:126
edm::one::EDProducerBase::createAcquirer
virtual SharedResourcesAcquirer createAcquirer()
Definition: EDProducerBase.cc:63
edm::one::EDProducerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDProducerBase.cc:166
edm::Principal
Definition: Principal.h:57
edm::one::EDProducerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDProducerBase.h:134
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
edm::one::EDProducerBase::produce
virtual void produce(Event &, EventSetup const &)=0
edm::WorkerT
Definition: Frameworkfwd.h:62
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::one::EDProducerBase::doAccessInputProcessBlock_
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
Definition: EDProducerBase.cc:175
edm::one::EDProducerBase::doBeginProcessBlock_
virtual void doBeginProcessBlock_(ProcessBlock const &)
Definition: EDProducerBase.cc:174
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::one::EDProducerBase::previousParentage_
std::vector< BranchID > previousParentage_
Definition: EDProducerBase.h:135
edm::ProductRegistry
Definition: ProductRegistry.h:37
ModuleDescription.h
edm::FileBlock
Definition: FileBlock.h:20
SharedResourcesAcquirer.h
edm::EDConsumerBase
Definition: EDConsumerBase.h:70
edm::one::EDProducerBase::beginJob
virtual void beginJob()
Definition: EDProducerBase.h:107
WaitingTask
edm::one::EDProducerBase::doEndProcessBlock_
virtual void doEndProcessBlock_(ProcessBlock const &)
Definition: EDProducerBase.cc:176
edm::one::EDProducerBase::doEndProcessBlock
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:104
edm::ActivityRegistry
Definition: ActivityRegistry.h:133
edm::one::EDProducerBase::EDProducerBase
EDProducerBase()
Definition: EDProducerBase.cc:43
edm::one::EDProducerBase::ModuleType
EDProducerBase ModuleType
Definition: EDProducerBase.h:53
edm::one::EDProducerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:180
edm::one::EDProducerBase::workerType
std::string workerType() const
Definition: EDProducerBase.h:102
edm::Hash< ParentageType >
edm::one::EDProducerBase::hasAccumulator
virtual bool hasAccumulator() const
Definition: EDProducerBase.h:127
edm::one::EDProducerBase::wantsGlobalLuminosityBlocks
virtual bool wantsGlobalLuminosityBlocks() const =0
edm::maker::ModuleHolderT
Definition: EDAnalyzer.h:25
edm::one::EDProducerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:138
ProducerBase.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::one::EDProducerBase::doEndRunProduce_
virtual void doEndRunProduce_(Run &rp, EventSetup const &c)
Definition: EDProducerBase.cc:185
edm::one::EDProducerBase::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDProducerBase.h:63
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
edm::one::EDProducerBase::doBeginProcessBlockProduce_
virtual void doBeginProcessBlockProduce_(ProcessBlock &)
Definition: EDProducerBase.cc:182
edm::one::EDProducerBase::doAccessInputProcessBlock
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:97
edm::one::EDProducerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:177
EDConsumerBase.h
edm::one::EDProducerBase::globalRunsQueue
virtual SerialTaskQueue * globalRunsQueue()
Definition: EDProducerBase.cc:68
edm::one::EDProducerBase::wantsProcessBlocks
virtual bool wantsProcessBlocks() const =0
edm::one::EDProducerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDProducerBase.cc:195
edm::EventSetup
Definition: EventSetup.h:57
edm::one::EDProducerBase::globalLuminosityBlocksQueue
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDProducerBase.cc:69
edm::one::EDProducerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDProducerBase.cc:85
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::one::EDProducerBase::doEndProcessBlockProduce_
virtual void doEndProcessBlockProduce_(ProcessBlock &)
Definition: EDProducerBase.cc:183
edm::one::EDProducerBase::doEndJob
void doEndJob()
Definition: EDProducerBase.cc:77
edm::one::EDProducerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:152
edm::one::EDProducerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDProducerBase.cc:170
edm::one::EDProducerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDProducerBase.cc:189
edm::one::EDProducerBase::wantsStreamLuminosityBlocks
bool wantsStreamLuminosityBlocks() const
Definition: EDProducerBase.h:70
edm::one::EDProducerBase::baseType
static const std::string & baseType()
Definition: EDProducerBase.cc:199
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::one::EDProducerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:178
edm::WaitingTask
Definition: WaitingTask.h:36
edm::one::EDProducerBase::sharedResourcesAcquirer
SharedResourcesAcquirer & sharedResourcesAcquirer()
Definition: EDProducerBase.h:104
edm::one::EDProducerBase::doEndLuminosityBlockProduce_
virtual void doEndLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:187
Frameworkfwd.h
edm::one::EDProducerBase::doBeginRun
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:114
edm::one::EDProducerBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDProducerBase *module, ProductRegistry *reg)
Definition: EDProducerBase.h:99
edm::one::EDProducerBase::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDProducerBase.cc:48
edm::one::EDProducerBase::doRegisterThinnedAssociations
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDProducerBase.h:97
edm::one::EDProducerBase
Definition: EDProducerBase.h:47
ParameterSetfwd.h
edm::one::EDProducerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:179
edm::one::EDProducerBase::wantsStreamRuns
bool wantsStreamRuns() const
Definition: EDProducerBase.h:69
edm::one::EDProducerBase::doBeginJob
void doBeginJob()
Definition: EDProducerBase.cc:71
edm::one::EDProducerBase::doBeginRunProduce_
virtual void doBeginRunProduce_(Run &rp, EventSetup const &c)
Definition: EDProducerBase.cc:184
edm::WorkerT::module
T & module()
Definition: WorkerT.h:76
edm::ProducerBase
Definition: ProducerBase.h:70
edm::ProducerBase::registerProducts
void registerProducts(ProducerBase *, ProductRegistry *, ModuleDescription const &)
Definition: ProducerBase.cc:57
edm::Event
Definition: Event.h:73
edm::one::EDProducerBase::resourcesAcquirer_
SharedResourcesAcquirer resourcesAcquirer_
Definition: EDProducerBase.h:138
edm::one::EDProducerBase::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTask *, ModuleCallingContext const &, Principal const &) const
Definition: EDProducerBase.h:78
edm::ProcessBlock
Definition: ProcessBlock.h:36
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
edm::one::EDProducerBase::doBeginLuminosityBlockProduce_
virtual void doBeginLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:186
edm::one::EDProducerBase::previousParentageId_
ParentageID previousParentageId_
Definition: EDProducerBase.h:136
edm::one::EDProducerBase::doBeginProcessBlock
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducerBase.cc:87
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29