CMS 3D CMS Logo

EDAnalyzerBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_global_EDAnalyzerBase_h
2 #define FWCore_Framework_global_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
29 
30 // forward declarations
31 
32 namespace edm {
33  class ModuleCallingContext;
34  class PreallocationConfiguration;
35  class StreamID;
36  class ActivityRegistry;
37  class ThinnedAssociationsHelper;
38 
39  namespace maker {
40  template <typename T>
42  }
43 
44  namespace global {
45 
46  class EDAnalyzerBase : public EDConsumerBase {
47  public:
48  template <typename T>
49  friend class edm::WorkerT;
50  template <typename T>
53 
55  ~EDAnalyzerBase() override;
56 
57  static void fillDescriptions(ConfigurationDescriptions& descriptions);
58  static void prevalidate(ConfigurationDescriptions& descriptions);
59  static const std::string& baseType();
60 
61  // Warning: the returned moduleDescription will be invalid during construction
63 
64  virtual bool wantsProcessBlocks() const = 0;
65  virtual bool wantsInputProcessBlocks() const = 0;
66  virtual bool wantsGlobalRuns() const = 0;
67  virtual bool wantsGlobalLuminosityBlocks() const = 0;
68  virtual bool wantsStreamRuns() const = 0;
69  virtual bool wantsStreamLuminosityBlocks() const = 0;
70 
73  }
74 
75  private:
77  //For now this is a placeholder
79  ModuleCallingContext const&,
80  Principal const&) const {}
81 
83  void doBeginJob();
84  void doEndJob();
85 
86  void doBeginStream(StreamID id);
87  void doEndStream(StreamID id);
92 
97  void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
100 
105 
107  std::string workerType() const { return "WorkerT<EDAnalyzer>"; }
108 
109  virtual void analyze(StreamID, Event const&, EventSetup const&) const = 0;
110  virtual void beginJob() {}
111  virtual void endJob() {}
112 
113  virtual void preallocStreams(unsigned int);
114  virtual void preallocRuns(unsigned int);
115  virtual void preallocRunsSummary(unsigned int);
116  virtual void preallocLumis(unsigned int);
117  virtual void preallocLumisSummary(unsigned int);
118  virtual void preallocate(PreallocationConfiguration const&);
119  virtual void doBeginStream_(StreamID id);
120  virtual void doEndStream_(StreamID id);
121  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
122  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
123  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
124  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
125  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
126  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
127 
128  virtual void doBeginProcessBlock_(ProcessBlock const&);
129  virtual void doAccessInputProcessBlock_(ProcessBlock const&);
130  virtual void doEndProcessBlock_(ProcessBlock const&);
131  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
132  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
133  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
134  virtual void doEndRun_(Run const& rp, EventSetup const& c);
135  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
136  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
137  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
138  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
139 
140  virtual void clearInputProcessBlockCaches();
141 
142  bool hasAcquire() const { return false; }
143  bool hasAccumulator() const { return false; }
144 
147 
148  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
149  };
150 
151  } // namespace global
152 } // namespace edm
153 
154 #endif
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
virtual void analyze(StreamID, Event const &, EventSetup const &) const =0
static const std::string & baseType()
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
void doStreamBeginLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
void doStreamBeginRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
virtual void doEndProcessBlock_(ProcessBlock const &)
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
virtual void preallocLumis(unsigned int)
virtual void preallocLumisSummary(unsigned int)
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
virtual bool wantsStreamLuminosityBlocks() const =0
void doStreamEndLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
virtual bool wantsProcessBlocks() const =0
virtual void doEndRun_(Run const &rp, EventSetup const &c)
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
ModuleDescription moduleDescription_
virtual void preallocate(PreallocationConfiguration const &)
void registerProductsAndCallbacks(EDAnalyzerBase *module, ProductRegistry *reg)
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
virtual bool wantsInputProcessBlocks() const =0
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
void doEndStream(StreamID id)
void doPreallocate(PreallocationConfiguration const &)
virtual void doEndLuminosityBlockSummary_(LuminosityBlock const &lb, EventSetup const &c)
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
virtual void preallocRunsSummary(unsigned int)
void setModuleDescription(ModuleDescription const &md)
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doEndStream_(StreamID id)
static void prevalidate(ConfigurationDescriptions &descriptions)
virtual void preallocRuns(unsigned int)
virtual void preallocStreams(unsigned int)
virtual bool wantsGlobalRuns() const =0
virtual bool wantsStreamRuns() const =0
HLT enums.
virtual bool wantsGlobalLuminosityBlocks() const =0
ModuleDescription const & moduleDescription() const
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const &, Principal const &) const
void doRespondToOpenInputFile(FileBlock const &)
virtual void clearInputProcessBlockCaches()
void doBeginStream(StreamID id)
virtual void doBeginProcessBlock_(ProcessBlock const &)
void doRespondToCloseInputFile(FileBlock const &)
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
virtual void doBeginStream_(StreamID id)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: Run.h:45
std::string workerType() const
void doStreamEndRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)