CMS 3D CMS Logo

EDAnalyzerBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_limited_EDAnalyzerBase_h
2 #define FWCore_Framework_limited_EDAnalyzerBase_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : EDAnalyzerBase
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Thu, 18 Jul 2013 11:51:14 GMT
19 //
20 
21 // system include files
22 
23 // user include files
30 
31 // forward declarations
32 
33 namespace edm {
34  class ModuleCallingContext;
35  class PreallocationConfiguration;
36  class StreamID;
37  class ActivityRegistry;
38  class ThinnedAssociationsHelper;
39 
40  namespace maker {
41  template <typename T>
42  class ModuleHolderT;
43  }
44 
45  namespace limited {
46 
47  class EDAnalyzerBase : public EDConsumerBase {
48  public:
49  template <typename T>
50  friend class edm::WorkerT;
51  template <typename T>
54 
56  ~EDAnalyzerBase() 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 noexcept = 0;
66  virtual bool wantsInputProcessBlocks() const noexcept = 0;
67  virtual bool wantsGlobalRuns() const noexcept = 0;
68  virtual bool wantsGlobalLuminosityBlocks() const noexcept = 0;
69  virtual bool wantsStreamRuns() const noexcept = 0;
70  virtual bool wantsStreamLuminosityBlocks() const noexcept = 0;
71 
74  }
75 
76  unsigned int concurrencyLimit() const { return queue_.concurrencyLimit(); }
77 
78  LimitedTaskQueue& queue() { return queue_; }
79 
80  private:
82  //For now this is a placeholder
84  ModuleCallingContext const& iModuleCallingContext,
85  Principal const& iPrincipal) const noexcept {}
86 
88  void doBeginJob();
89  void doEndJob();
90 
91  void doBeginStream(StreamID id);
92  void doEndStream(StreamID id);
97 
102  void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
105 
110 
112  std::string workerType() const { return "WorkerT<EDAnalyzer>"; }
113 
114  virtual void analyze(StreamID, Event const&, EventSetup const&) const = 0;
115  virtual void beginJob() {}
116  virtual void endJob() {}
117 
118  virtual void preallocStreams(unsigned int);
119  virtual void preallocRuns(unsigned int);
120  virtual void preallocRunsSummary(unsigned int);
121  virtual void preallocLumis(unsigned int);
122  virtual void preallocLumisSummary(unsigned int);
123  virtual void preallocate(PreallocationConfiguration const&);
124  virtual void doBeginStream_(StreamID id);
125  virtual void doEndStream_(StreamID id);
126  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
127  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
128  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
129  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
130  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
131  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
132 
133  virtual void doBeginProcessBlock_(ProcessBlock const&);
134  virtual void doAccessInputProcessBlock_(ProcessBlock const&);
135  virtual void doEndProcessBlock_(ProcessBlock const&);
136  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
137  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
138  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
139  virtual void doEndRun_(Run const& rp, EventSetup const& c);
140  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
141  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
142  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
143  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
144 
145  virtual void clearInputProcessBlockCaches();
146 
147  bool hasAcquire() const noexcept { return false; }
148  bool hasAccumulator() const noexcept { return false; }
149 
152 
153  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
154 
156  };
157 
158  } // namespace limited
159 } // namespace edm
160 
161 #endif
void doStreamEndLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
virtual bool wantsGlobalRuns() const noexcept=0
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
ModuleDescription moduleDescription_
virtual void analyze(StreamID, Event const &, EventSetup const &) const =0
virtual void preallocLumisSummary(unsigned int)
void doStreamBeginRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
virtual bool wantsStreamLuminosityBlocks() const noexcept=0
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
virtual void preallocStreams(unsigned int)
virtual void doEndStream_(StreamID id)
bool hasAcquire() const noexcept
virtual void doEndProcessBlock_(ProcessBlock const &)
std::string workerType() const
void doRespondToOpenInputFile(FileBlock const &)
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
unsigned int concurrencyLimit() const
static void fillDescriptions(ConfigurationDescriptions &descriptions)
virtual void preallocRunsSummary(unsigned int)
void doRespondToCloseInputFile(FileBlock const &)
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginStream_(StreamID id)
virtual void preallocate(PreallocationConfiguration const &)
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void clearInputProcessBlockCaches()
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
virtual bool wantsProcessBlocks() const noexcept=0
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
void registerProductsAndCallbacks(EDAnalyzerBase *module, ProductRegistry *reg)
virtual bool wantsStreamRuns() const noexcept=0
bool hasAccumulator() const noexcept
virtual void preallocRuns(unsigned int)
void preActionBeforeRunEventAsync(WaitingTaskHolder iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const noexcept
virtual void doEndLuminosityBlockSummary_(LuminosityBlock const &lb, EventSetup const &c)
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
void doStreamEndRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
unsigned int concurrencyLimit() const
virtual bool wantsGlobalLuminosityBlocks() const noexcept=0
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
static void prevalidate(ConfigurationDescriptions &descriptions)
virtual void doEndRun_(Run const &rp, EventSetup const &c)
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
EDAnalyzerBase(ParameterSet const &pset)
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
HLT enums.
void setModuleDescription(ModuleDescription const &md)
virtual void preallocLumis(unsigned int)
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
virtual void doBeginProcessBlock_(ProcessBlock const &)
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
virtual bool wantsInputProcessBlocks() const noexcept=0
void doStreamBeginLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
void doBeginStream(StreamID id)
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
void doPreallocate(PreallocationConfiguration const &)
static const std::string & baseType()
LimitedTaskQueue & queue()
Definition: Run.h:45
ModuleDescription const & moduleDescription() const