CMS 3D CMS Logo

EDProducer.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_EDProducer_h
2 #define FWCore_Framework_EDProducer_h
3 
4 /*----------------------------------------------------------------------
5 
6 EDProducer: The base class of "modules" whose main purpose is to insert new
7 EDProducts into an Event.
8 
9 
10 ----------------------------------------------------------------------*/
11 
19 
20 #include <string>
21 #include <vector>
22 
23 namespace edm {
24 
25  class ModuleCallingContext;
26  class PreallocationConfiguration;
27  class ActivityRegistry;
28  class ThinnedAssociationsHelper;
29 
30  namespace maker {
31  template <typename T>
32  class ModuleHolderT;
33  }
34 
35  class EDProducer : public ProducerBase, public EDConsumerBase {
36  public:
37  template <typename T>
38  friend class maker::ModuleHolderT;
39  template <typename T>
40  friend class WorkerT;
42 
43  EDProducer();
44  ~EDProducer() override;
45 
46  static void fillDescriptions(ConfigurationDescriptions& descriptions);
47  static void prevalidate(ConfigurationDescriptions& descriptions);
48  static const std::string& baseType();
49 
50  // Warning: the returned moduleDescription will be invalid during construction
52 
53  static bool wantsProcessBlocks() { return false; }
54  static bool wantsInputProcessBlocks() { return false; }
55  static bool wantsGlobalRuns() { return true; }
56  static bool wantsGlobalLuminosityBlocks() { return true; }
57  static bool wantsStreamRuns() { return false; }
58  static bool wantsStreamLuminosityBlocks() { return false; };
59 
62 
63  private:
65  //Needed by WorkerT but not supported
67 
69  void doBeginJob();
70  void doEndJob();
75  void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
83  }
84 
85  std::string workerType() const { return "WorkerT<EDProducer>"; }
86 
88 
89  virtual void produce(Event&, EventSetup const&) = 0;
90  virtual void beginJob() {}
91  virtual void endJob() {}
92 
93  virtual void beginRun(Run const& /* iR */, EventSetup const& /* iE */) {}
94  virtual void endRun(Run const& /* iR */, EventSetup const& /* iE */) {}
95  virtual void beginLuminosityBlock(LuminosityBlock const& /* iL */, EventSetup const& /* iE */) {}
96  virtual void endLuminosityBlock(LuminosityBlock const& /* iL */, EventSetup const& /* iE */) {}
97  virtual void respondToOpenInputFile(FileBlock const&) {}
98  virtual void respondToCloseInputFile(FileBlock const&) {}
99 
100  bool hasAcquire() const { return false; }
101  bool hasAccumulator() const { return false; }
102 
105  std::vector<BranchID> previousParentage_;
110  };
111 } // namespace edm
112 
113 #endif
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::EDProducer::globalLuminosityBlocksQueue
SerialTaskQueue * globalLuminosityBlocksQueue()
Definition: EDProducer.h:61
edm::EDProducer::wantsStreamRuns
static bool wantsStreamRuns()
Definition: EDProducer.h:57
edm::EDProducer::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDProducer.h:68
ActivityRegistry
edm::EDProducer::doEndRun
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducer.cc:60
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
WaitingTaskHolder.h
edm::EDProducer::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const &, Principal const &) const
Definition: EDProducer.h:66
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::EDProducer::ModuleType
EDProducer ModuleType
Definition: EDProducer.h:41
edm::Principal
Definition: Principal.h:56
edm::EDProducer::previousParentage_
std::vector< BranchID > previousParentage_
Definition: EDProducer.h:105
edm::EDProducer::doBeginLuminosityBlock
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducer.cc:71
edm::EDProducer::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDProducer.h:103
edm::SerialTaskQueue
Definition: SerialTaskQueue.h:67
edm::EDProducer::wantsStreamLuminosityBlocks
static bool wantsStreamLuminosityBlocks()
Definition: EDProducer.h:58
edm::EDProducer::wantsProcessBlocks
static bool wantsProcessBlocks()
Definition: EDProducer.h:53
edm::WorkerT
Definition: Frameworkfwd.h:62
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::EDProducer::~EDProducer
~EDProducer() override
Definition: EDProducer.cc:25
edm::EDProducer::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDProducer.cc:27
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::EDProducer::hasAccumulator
bool hasAccumulator() const
Definition: EDProducer.h:101
edm::ProductRegistry
Definition: ProductRegistry.h:37
ModuleDescription.h
edm::FileBlock
Definition: FileBlock.h:20
SharedResourcesAcquirer.h
edm::EDProducer::previousParentageId_
ParentageID previousParentageId_
Definition: EDProducer.h:109
edm::EDProducer::wantsGlobalLuminosityBlocks
static bool wantsGlobalLuminosityBlocks()
Definition: EDProducer.h:56
edm::EDProducer::doRegisterThinnedAssociations
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDProducer.h:80
edm::EDConsumerBase
Definition: EDConsumerBase.h:71
edm::EDProducer::baseType
static const std::string & baseType()
Definition: EDProducer.cc:113
edm::EDProducer::luminosityBlockQueue_
SerialTaskQueue luminosityBlockQueue_
Definition: EDProducer.h:108
edm::EDProducer::doEndJob
void doEndJob()
Definition: EDProducer.cc:47
edm::EDProducer::respondToCloseInputFile
virtual void respondToCloseInputFile(FileBlock const &)
Definition: EDProducer.h:98
edm::EDProducer::doBeginJob
void doBeginJob()
Definition: EDProducer.cc:41
edm::EDProducer::hasAcquire
bool hasAcquire() const
Definition: EDProducer.h:100
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
edm::EDProducer::beginJob
virtual void beginJob()
Definition: EDProducer.h:90
edm::Hash< ParentageType >
edm::maker::ModuleHolderT
Definition: EDAnalyzer.h:25
ProducerBase.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::EDProducer::prevalidate
static void prevalidate(ConfigurationDescriptions &descriptions)
Definition: EDProducer.cc:109
edm::EDProducer::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDProducer *module, ProductRegistry *reg)
Definition: EDProducer.h:81
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
edm::EDProducer::doAccessInputProcessBlock
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducer.h:72
EDConsumerBase.h
edm::EDProducer::workerType
std::string workerType() const
Definition: EDProducer.h:85
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:32
edm::EDProducer::runQueue_
SerialTaskQueue runQueue_
Definition: EDProducer.h:107
edm::EDProducer::wantsGlobalRuns
static bool wantsGlobalRuns()
Definition: EDProducer.h:55
edm::EDProducer::doEndProcessBlock
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducer.h:73
edm::EDProducer::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDProducer.cc:103
edm::EDProducer::beginLuminosityBlock
virtual void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Definition: EDProducer.h:95
edm::EventSetup
Definition: EventSetup.h:58
edm::EDProducer::wantsInputProcessBlocks
static bool wantsInputProcessBlocks()
Definition: EDProducer.h:54
edm::EDProducer::endLuminosityBlock
virtual void endLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Definition: EDProducer.h:96
edm::EDProducer::EDProducer
EDProducer()
Definition: EDProducer.cc:21
edm::EDProducer::endRun
virtual void endRun(Run const &, EventSetup const &)
Definition: EDProducer.h:94
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::EDProducer::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDProducer.cc:99
Frameworkfwd.h
edm::EDProducer::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDProducer.h:104
ParameterSetfwd.h
edm::EDProducer::moduleDescription
ModuleDescription const & moduleDescription() const
Definition: EDProducer.h:51
edm::EDProducer
Definition: EDProducer.h:35
edm::EDProducer::sharedResourcesAcquirer
SharedResourcesAcquirer & sharedResourcesAcquirer()
Definition: EDProducer.h:87
edm::EDProducer::doBeginProcessBlock
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
Definition: EDProducer.h:71
edm::EDProducer::respondToOpenInputFile
virtual void respondToOpenInputFile(FileBlock const &)
Definition: EDProducer.h:97
edm::EDProducer::beginRun
virtual void beginRun(Run const &, EventSetup const &)
Definition: EDProducer.h:93
edm::EDProducer::doBeginRun
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducer.cc:49
edm::ProducerBase
Definition: ProducerBase.h:70
edm::ProducerBase::registerProducts
void registerProducts(ProducerBase *, ProductRegistry *, ModuleDescription const &)
Definition: ProducerBase.cc:57
edm::EDProducer::resourceAcquirer_
SharedResourcesAcquirer resourceAcquirer_
Definition: EDProducer.h:106
edm::Event
Definition: Event.h:73
edm::EDProducer::globalRunsQueue
SerialTaskQueue * globalRunsQueue()
Definition: EDProducer.h:60
edm::EDProducer::produce
virtual void produce(Event &, EventSetup const &)=0
edm::EDProducer::doEndLuminosityBlock
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDProducer.cc:85
edm::EDProducer::endJob
virtual void endJob()
Definition: EDProducer.h:91
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29
edm::EDProducer::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDProducer.cc:101