CMS 3D CMS Logo

EDAnalyzerBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_one_EDAnalyzerBase_h
2 #define FWCore_Framework_one_EDAnalyzerBase_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : one::EDAnalyzerBase
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Thu, 01 Aug 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 
39  namespace maker {
40  template <typename T>
41  class ModuleHolderT;
42  }
43 
44  namespace one {
45 
46  class EDAnalyzerBase : public EDConsumerBase {
47  public:
48  template <typename T>
49  friend class edm::WorkerT;
50  template <typename T>
52 
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 = 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 
75 
76  private:
78  //For now this is a placeholder
80  ModuleCallingContext const&,
81  Principal const&) const {}
82 
84  virtual void preallocRuns(unsigned int);
85  virtual void preallocLumis(unsigned int);
86  void doBeginJob();
87  void doEndJob();
88 
93  void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*);
96 
101 
103  std::string workerType() const { return "WorkerT<EDAnalyzer>"; }
104 
106 
107  virtual void analyze(Event const&, EventSetup const&) = 0;
108  virtual void beginJob() {}
109  virtual void endJob() {}
110 
111  virtual void doBeginProcessBlock_(ProcessBlock const&);
112  virtual void doAccessInputProcessBlock_(ProcessBlock const&);
113  virtual void doEndProcessBlock_(ProcessBlock const&);
114  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
115  virtual void doEndRun_(Run const& rp, EventSetup const& c);
116  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
117  virtual void doEndLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
118 
119  virtual void clearInputProcessBlockCaches();
120 
121  bool hasAcquire() const { return false; }
122  bool hasAccumulator() const { return false; }
123 
125 
128  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
129 
131  };
132  } // namespace one
133 } // namespace edm
134 #endif
void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
bool wantsStreamRuns() const
virtual SerialTaskQueue * globalLuminosityBlocksQueue()
std::string workerType() const
void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
virtual void doAccessInputProcessBlock_(ProcessBlock const &)
virtual bool wantsGlobalRuns() const =0
static const std::string & baseType()
virtual void doEndProcessBlock_(ProcessBlock const &)
virtual bool wantsGlobalLuminosityBlocks() const =0
void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
virtual void preallocLumis(unsigned int)
static void prevalidate(ConfigurationDescriptions &descriptions)
void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const &, Principal const &) const
void doPreallocate(PreallocationConfiguration const &)
SharedResourcesAcquirer & sharedResourcesAcquirer()
static void fillDescriptions(ConfigurationDescriptions &descriptions)
virtual void doEndRun_(Run const &rp, EventSetup const &c)
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
void doRespondToOpenInputFile(FileBlock const &)
virtual bool wantsProcessBlocks() const =0
virtual SharedResourcesAcquirer createAcquirer()
virtual void analyze(Event const &, EventSetup const &)=0
void registerProductsAndCallbacks(EDAnalyzerBase const *module, ProductRegistry *reg)
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
virtual void clearInputProcessBlockCaches()
void doRespondToCloseInputFile(FileBlock const &)
virtual void preallocRuns(unsigned int)
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)
EDAnalyzerBase ModuleType
SharedResourcesAcquirer resourcesAcquirer_
virtual void doBeginProcessBlock_(ProcessBlock const &)
ModuleDescription moduleDescription_
virtual SerialTaskQueue * globalRunsQueue()
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
ModuleDescription const & moduleDescription() const
void setModuleDescription(ModuleDescription const &md)
bool wantsStreamLuminosityBlocks() const
HLT enums.
virtual bool wantsInputProcessBlocks() const =0
void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)
void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: Run.h:45