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 
98  //For now, the following are just dummy implemenations with no ability for users to override
102  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
103 
104 
106  std::string workerType() const {return "WorkerT<EDAnalyzer>";}
107 
108  virtual void analyze(StreamID, Event const& , EventSetup const&) const= 0;
109  virtual void beginJob() {}
110  virtual void endJob(){}
111 
112  virtual void preallocStreams(unsigned int);
113  virtual void doBeginStream_(StreamID id);
114  virtual void doEndStream_(StreamID id);
115  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
116  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
117  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
118  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
119  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
120  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
121 
122  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
123  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
124  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
125  virtual void doEndRun_(Run const& rp, EventSetup const& c);
126  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
127  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
128  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
129  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
130 
132  moduleDescription_ = md;
133  }
135 
136  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
137  };
138 
139  }
140 }
141 
142 #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 *)
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