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 
36  namespace maker {
37  template<typename T> class ModuleHolderT;
38  }
39 
40  namespace global {
41 
43  {
44 
45  public:
46  template <typename T> friend class edm::WorkerT;
47  template <typename T> friend class edm::maker::ModuleHolderT;
49 
51  virtual ~EDAnalyzerBase();
52 
53  static void fillDescriptions(ConfigurationDescriptions& descriptions);
54  static void prevalidate(ConfigurationDescriptions& descriptions);
55  static const std::string& baseType();
56 
57  // Warning: the returned moduleDescription will be invalid during construction
59 
60  private:
61  bool doEvent(EventPrincipal& ep, EventSetup const& c,
62  ModuleCallingContext const*);
64  void doBeginJob();
65  void doEndJob();
66 
67  void doBeginStream(StreamID id);
68  void doEndStream(StreamID id);
69  void doStreamBeginRun(StreamID id,
70  RunPrincipal& ep,
71  EventSetup const& c,
72  ModuleCallingContext const*);
73  void doStreamEndRun(StreamID id,
74  RunPrincipal& ep,
75  EventSetup const& c,
76  ModuleCallingContext const*);
79  EventSetup const& c,
80  ModuleCallingContext const*);
83  EventSetup const& c,
84  ModuleCallingContext const*);
85 
86 
87  void doBeginRun(RunPrincipal& rp, EventSetup const& c,
88  ModuleCallingContext const*);
89  void doEndRun(RunPrincipal& rp, EventSetup const& c,
90  ModuleCallingContext const*);
92  ModuleCallingContext const*);
94  ModuleCallingContext const*);
95 
96  //For now, the following are just dummy implemenations with no ability for users to override
100  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
101 
102 
104  std::string workerType() const {return "WorkerT<EDAnalyzer>";}
105 
106  virtual void analyze(StreamID, Event const& , EventSetup const&) const= 0;
107  virtual void beginJob() {}
108  virtual void endJob(){}
109 
110  virtual void preallocStreams(unsigned int);
111  virtual void doBeginStream_(StreamID id);
112  virtual void doEndStream_(StreamID id);
113  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
114  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
115  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
116  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
117  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
118  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
119 
120  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
121  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
122  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
123  virtual void doEndRun_(Run const& rp, EventSetup const& c);
124  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
125  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
126  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
127  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
128 
130  moduleDescription_ = md;
131  }
133 
134  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
135  };
136 
137  }
138 }
139 
140 #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)
bool doEvent(EventPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
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 *)
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 doBeginStream_(StreamID id)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: Run.h:41
ModuleDescription const & moduleDescription() const