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 ProductRegistry;
38  class ThinnedAssociationsHelper;
39  class WaitingTask;
40 
41  namespace maker {
42  template <typename T>
43  class ModuleHolderT;
44  }
45 
46  namespace one {
47 
48  class EDProducerBase : public ProducerBase, public EDConsumerBase {
49  public:
50  template <typename T>
52  template <typename T>
53  friend class edm::WorkerT;
55 
57  ~EDProducerBase() override;
58 
59  static void fillDescriptions(ConfigurationDescriptions& descriptions);
60  static void prevalidate(ConfigurationDescriptions& descriptions);
61  static const std::string& baseType();
62 
63  // Warning: the returned moduleDescription will be invalid during construction
65 
66  virtual bool wantsGlobalRuns() const = 0;
67  virtual bool wantsGlobalLuminosityBlocks() const = 0;
68  bool wantsStreamRuns() const { return false; }
69  bool wantsStreamLuminosityBlocks() const { return false; };
70 
73 
74  private:
76  //For now this is a placeholder
77  /*virtual*/ void preActionBeforeRunEventAsync(WaitingTask* iTask,
78  ModuleCallingContext const& iModuleCallingContext,
79  Principal const& iPrincipal) const {}
80 
82  virtual void preallocLumis(unsigned int);
83  void doBeginJob();
84  void doEndJob();
85 
86  void doBeginRun(RunPrincipal const& rp, EventSetupImpl const& c, ModuleCallingContext const*);
87  void doEndRun(RunPrincipal const& rp, EventSetupImpl const& c, ModuleCallingContext const*);
89  EventSetupImpl const& c,
90  ModuleCallingContext const*);
92  EventSetupImpl const& c,
93  ModuleCallingContext const*);
94 
95  //For now, the following are just dummy implemenations with no ability for users to override
99 
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 doBeginRun_(Run const& rp, EventSetup const& c);
114  virtual void doEndRun_(Run const& rp, EventSetup const& c);
115  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
116  virtual void doEndLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
117 
118  virtual void doBeginRunProduce_(Run& rp, EventSetup const& c);
119  virtual void doEndRunProduce_(Run& rp, EventSetup const& c);
120  virtual void doBeginLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
121  virtual void doEndLuminosityBlockProduce_(LuminosityBlock& lbp, EventSetup const& c);
122 
123  virtual bool hasAccumulator() const { return false; }
124 
125  bool hasAcquire() const { return false; }
126 
128 
131  std::vector<BranchID> previousParentage_;
133 
135  };
136 
137  } // namespace one
138 } // namespace edm
139 
140 #endif
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::one::EDProducerBase::endJob
virtual void endJob()
Definition: EDProducerBase.h:109
edm::one::EDProducerBase::~EDProducerBase
~EDProducerBase() override
Definition: EDProducerBase.cc:44
edm::one::EDProducerBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDProducerBase.cc:77
edm::one::EDProducerBase::wantsGlobalRuns
virtual bool wantsGlobalRuns() const =0
edm::one::EDProducerBase::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDProducerBase.h:129
edm::one::EDProducerBase::preallocThreads
virtual void preallocThreads(unsigned int)
Definition: EDProducerBase.h:111
ActivityRegistry
edm::EventSetupImpl
Definition: EventSetupImpl.h:44
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:125
edm::one::EDProducerBase::doBeginLuminosityBlock
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDProducerBase.cc:109
edm::one::EDProducerBase::createAcquirer
virtual SharedResourcesAcquirer createAcquirer()
Definition: EDProducerBase.cc:61
edm::LuminosityBlockPrincipal
Definition: LuminosityBlockPrincipal.h:31
edm::one::EDProducerBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDProducerBase.cc:141
edm::Principal
Definition: Principal.h:57
edm::one::EDProducerBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDProducerBase.h:130
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
edm::one::EDProducerBase::produce
virtual void produce(Event &, EventSetup const &)=0
edm::WorkerT
Definition: Frameworkfwd.h:54
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::one::EDProducerBase::previousParentage_
std::vector< BranchID > previousParentage_
Definition: EDProducerBase.h:131
edm::ProductRegistry
Definition: ProductRegistry.h:34
ModuleDescription.h
edm::FileBlock
Definition: FileBlock.h:20
SharedResourcesAcquirer.h
edm::EDConsumerBase
Definition: EDConsumerBase.h:62
edm::one::EDProducerBase::beginJob
virtual void beginJob()
Definition: EDProducerBase.h:108
edm::EventPrincipal
Definition: EventPrincipal.h:46
WaitingTask
edm::ActivityRegistry
Definition: ActivityRegistry.h:132
edm::one::EDProducerBase::EDProducerBase
EDProducerBase()
Definition: EDProducerBase.cc:41
edm::one::EDProducerBase::ModuleType
EDProducerBase ModuleType
Definition: EDProducerBase.h:54
edm::one::EDProducerBase::doEndLuminosityBlock_
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:152
edm::one::EDProducerBase::workerType
std::string workerType() const
Definition: EDProducerBase.h:103
edm::Hash< ParentageType >
edm::one::EDProducerBase::hasAccumulator
virtual bool hasAccumulator() const
Definition: EDProducerBase.h:123
edm::one::EDProducerBase::wantsGlobalLuminosityBlocks
virtual bool wantsGlobalLuminosityBlocks() const =0
edm::maker::ModuleHolderT
Definition: EDAnalyzer.h:26
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:155
edm::one::EDProducerBase::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDProducerBase.h:64
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:35
edm::one::EDProducerBase::doBeginRun_
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:149
EDConsumerBase.h
edm::one::EDProducerBase::globalRunsQueue
virtual SerialTaskQueue * globalRunsQueue()
Definition: EDProducerBase.cc:66
edm::one::EDProducerBase::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDProducerBase.cc:165
edm::one::EDProducerBase::doEndLuminosityBlock
void doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDProducerBase.cc:125
edm::EventSetup
Definition: EventSetup.h:57
edm::one::EDProducerBase::globalLuminosityBlocksQueue
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDProducerBase.cc:67
edm::one::EDProducerBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDProducerBase.cc:83
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
module
Definition: vlib.h:198
edm::one::EDProducerBase::doEndJob
void doEndJob()
Definition: EDProducerBase.cc:75
edm::one::EDProducerBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDProducerBase.cc:145
edm::one::EDProducerBase::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDProducerBase.cc:159
edm::one::EDProducerBase::wantsStreamLuminosityBlocks
bool wantsStreamLuminosityBlocks() const
Definition: EDProducerBase.h:69
edm::one::EDProducerBase::baseType
static const std::string & baseType()
Definition: EDProducerBase.cc:169
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::one::EDProducerBase::doEndRun_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
Definition: EDProducerBase.cc:150
edm::WaitingTask
Definition: WaitingTask.h:36
edm::one::EDProducerBase::doEvent
bool doEvent(EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDProducerBase.cc:46
edm::one::EDProducerBase::sharedResourcesAcquirer
SharedResourcesAcquirer & sharedResourcesAcquirer()
Definition: EDProducerBase.h:105
edm::one::EDProducerBase::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTask *iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const
Definition: EDProducerBase.h:77
edm::one::EDProducerBase::doEndLuminosityBlockProduce_
virtual void doEndLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:157
Frameworkfwd.h
edm::one::EDProducerBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDProducerBase *module, ProductRegistry *reg)
Definition: EDProducerBase.h:100
edm::one::EDProducerBase::doRegisterThinnedAssociations
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDProducerBase.h:98
edm::one::EDProducerBase
Definition: EDProducerBase.h:48
ParameterSetfwd.h
edm::one::EDProducerBase::doBeginLuminosityBlock_
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:151
edm::one::EDProducerBase::wantsStreamRuns
bool wantsStreamRuns() const
Definition: EDProducerBase.h:68
edm::one::EDProducerBase::doBeginRun
void doBeginRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDProducerBase.cc:85
edm::one::EDProducerBase::doBeginJob
void doBeginJob()
Definition: EDProducerBase.cc:69
edm::one::EDProducerBase::doBeginRunProduce_
virtual void doBeginRunProduce_(Run &rp, EventSetup const &c)
Definition: EDProducerBase.cc:154
edm::RunPrincipal
Definition: RunPrincipal.h:34
edm::ProducerBase
Definition: ProducerBase.h:65
edm::ProducerBase::registerProducts
void registerProducts(ProducerBase *, ProductRegistry *, ModuleDescription const &)
Definition: ProducerBase.cc:57
edm::one::EDProducerBase::doEndRun
void doEndRun(RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)
Definition: EDProducerBase.cc:97
edm::Event
Definition: Event.h:73
edm::one::EDProducerBase::resourcesAcquirer_
SharedResourcesAcquirer resourcesAcquirer_
Definition: EDProducerBase.h:134
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
edm::one::EDProducerBase::doBeginLuminosityBlockProduce_
virtual void doBeginLuminosityBlockProduce_(LuminosityBlock &lbp, EventSetup const &c)
Definition: EDProducerBase.cc:156
edm::one::EDProducerBase::previousParentageId_
ParentageID previousParentageId_
Definition: EDProducerBase.h:132
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29