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
28 
29 // forward declarations
30 
31 namespace edm {
32  class ModuleCallingContext;
33  class PreallocationConfiguration;
34  class StreamID;
35  class ActivityRegistry;
36  class ProductRegistry;
37  class ThinnedAssociationsHelper;
38  class WaitingTask;
39 
40  namespace maker {
41  template<typename T> class ModuleHolderT;
42  }
43 
44  namespace global {
45 
47  {
48 
49  public:
50  template <typename T> friend class edm::WorkerT;
51  template <typename T> friend class edm::maker::ModuleHolderT;
53 
55  virtual ~EDAnalyzerBase();
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
62  ModuleDescription const& moduleDescription() const { return moduleDescription_; }
63 
64  private:
65  bool doEvent(EventPrincipal const& ep, EventSetup const& c,
67  ModuleCallingContext const*);
68  //For now this is a placeholder
69  /*virtual*/ void preActionBeforeRunEventAsync(WaitingTask* iTask, ModuleCallingContext const& iModuleCallingContext, Principal const& iPrincipal) const {}
70 
71  void doPreallocate(PreallocationConfiguration const&);
72  void doBeginJob();
73  void doEndJob();
74 
75  void doBeginStream(StreamID id);
76  void doEndStream(StreamID id);
77  void doStreamBeginRun(StreamID id,
78  RunPrincipal const& ep,
79  EventSetup const& c,
80  ModuleCallingContext const*);
81  void doStreamEndRun(StreamID id,
82  RunPrincipal const& ep,
83  EventSetup const& c,
84  ModuleCallingContext const*);
85  void doStreamBeginLuminosityBlock(StreamID id,
86  LuminosityBlockPrincipal const& ep,
87  EventSetup const& c,
88  ModuleCallingContext const*);
89  void doStreamEndLuminosityBlock(StreamID id,
90  LuminosityBlockPrincipal const& ep,
91  EventSetup const& c,
92  ModuleCallingContext const*);
93 
94 
95  void doBeginRun(RunPrincipal const& rp, EventSetup const& c,
96  ModuleCallingContext const*);
97  void doEndRun(RunPrincipal const& rp, EventSetup const& c,
98  ModuleCallingContext const*);
99  void doBeginLuminosityBlock(LuminosityBlockPrincipal const& lbp, EventSetup const& c,
100  ModuleCallingContext const*);
101  void doEndLuminosityBlock(LuminosityBlockPrincipal const& lbp, EventSetup const& c,
102  ModuleCallingContext const*);
103 
104  //For now, the following are just dummy implemenations with no ability for users to override
105  void doRespondToOpenInputFile(FileBlock const& fb);
106  void doRespondToCloseInputFile(FileBlock const& fb);
109 
111  std::string workerType() const {return "WorkerT<EDAnalyzer>";}
112 
113  virtual void analyze(StreamID, Event const& , EventSetup const&) const= 0;
114  virtual void beginJob() {}
115  virtual void endJob(){}
116 
117 
118  virtual void preallocStreams(unsigned int);
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 doBeginRun_(Run const& rp, EventSetup const& c);
129  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
130  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
131  virtual void doEndRun_(Run const& rp, EventSetup const& c);
132  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
133  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
134  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
135  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
136 
138  moduleDescription_ = md;
139  }
141 
142  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
143  };
144 
145  }
146 }
147 
148 #endif
void registerProductsAndCallbacks(ProductRegistry *iReg) override
Definition: ModuleHolder.h:76
def analyze(function, filename, filter=None)
Definition: Profiling.py:11
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
ModuleDescription moduleDescription_
std::string workerType() const
void preActionBeforeRunEventAsync(WaitingTask *iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const
void setModuleDescription(ModuleDescription const &md)
HLT enums.
Definition: vlib.h:208
Definition: Run.h:42
ModuleDescription const & moduleDescription() const