CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
37  namespace maker {
38  template<typename T> class ModuleHolderT;
39  }
40 
41  namespace global {
42 
44  {
45 
46  public:
47  template <typename T> friend class edm::WorkerT;
48  template <typename T> friend class edm::maker::ModuleHolderT;
50 
52  virtual ~EDAnalyzerBase();
53 
54  static void fillDescriptions(ConfigurationDescriptions& descriptions);
55  static void prevalidate(ConfigurationDescriptions& descriptions);
56  static const std::string& baseType();
57 
58  // Warning: the returned moduleDescription will be invalid during construction
60 
61  private:
62  bool doEvent(EventPrincipal& ep, EventSetup const& c,
64  ModuleCallingContext const*);
66  void doBeginJob();
67  void doEndJob();
68 
69  void doBeginStream(StreamID id);
70  void doEndStream(StreamID id);
71  void doStreamBeginRun(StreamID id,
72  RunPrincipal& ep,
73  EventSetup const& c,
74  ModuleCallingContext const*);
75  void doStreamEndRun(StreamID id,
76  RunPrincipal& ep,
77  EventSetup const& c,
78  ModuleCallingContext const*);
81  EventSetup const& c,
82  ModuleCallingContext const*);
85  EventSetup const& c,
86  ModuleCallingContext const*);
87 
88 
89  void doBeginRun(RunPrincipal& rp, EventSetup const& c,
90  ModuleCallingContext const*);
91  void doEndRun(RunPrincipal& rp, EventSetup const& c,
92  ModuleCallingContext const*);
94  ModuleCallingContext const*);
96  ModuleCallingContext const*);
97 
99  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
100 
101  //For now, the following are just dummy implemenations with no ability for users to override
104 
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 preForkReleaseResources() {}
114  virtual void postForkReacquireResources(unsigned int /*iChildIndex*/, unsigned int /*iNumberOfChildren*/) {}
115 
116 
117  virtual void preallocStreams(unsigned int);
118  virtual void doBeginStream_(StreamID id);
119  virtual void doEndStream_(StreamID id);
120  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
121  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
122  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
123  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
124  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
125  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
126 
127  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
128  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
129  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
130  virtual void doEndRun_(Run const& rp, EventSetup const& c);
131  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
132  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
133  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
134  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
135 
138  }
140 
141  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
142  };
143 
144  }
145 }
146 
147 #endif
void doStreamBeginLuminosityBlock(StreamID id, LuminosityBlockPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
virtual void analyze(StreamID, Event const &, EventSetup const &) const =0
void doRespondToCloseInputFile(FileBlock const &fb)
static const std::string & baseType()
void doStreamEndRun(StreamID id, RunPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
void doEndRun(RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *)
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
void doStreamEndLuminosityBlock(StreamID id, LuminosityBlockPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
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_
void registerProductsAndCallbacks(EDAnalyzerBase *module, ProductRegistry *reg)
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
void doBeginRun(RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *)
bool doEvent(EventPrincipal &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
virtual void postForkReacquireResources(unsigned int, unsigned int)
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)
std::string workerType() const
void doStreamBeginRun(StreamID id, RunPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
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 preallocStreams(unsigned int)
void doRespondToOpenInputFile(FileBlock const &fb)
void doBeginLuminosityBlock(LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *)
void doBeginStream(StreamID id)
void doEndLuminosityBlock(LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *)
Definition: vlib.h:208
virtual void preForkReleaseResources()
virtual void doBeginStream_(StreamID id)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: Run.h:41
ModuleDescription const & moduleDescription() const