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_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
28 
29 // forward declarations
30 namespace edm {
31 
32  class ModuleCallingContext;
33  class PreallocationConfiguration;
34 
35  namespace maker {
36  template<typename T> class ModuleHolderT;
37  }
38 
39  namespace one {
40 
42  {
43 
44  public:
45  template <typename T> friend class edm::WorkerT;
46  template <typename T> friend class edm::maker::ModuleHolderT;
47 
49 
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  protected:
62 
64 
65  private:
66  bool doEvent(EventPrincipal& ep, EventSetup const& c,
67  ModuleCallingContext const*);
69  void doBeginJob();
70  void doEndJob();
71 
72  void doBeginRun(RunPrincipal& rp, EventSetup const& c,
73  ModuleCallingContext const*);
74  void doEndRun(RunPrincipal& rp, EventSetup const& c,
75  ModuleCallingContext const*);
77  ModuleCallingContext const*);
79  ModuleCallingContext const*);
80 
81  //For now, the following are just dummy implemenations with no ability for users to override
85  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
86 
87 
89  std::string workerType() const {return "WorkerT<EDAnalyzer>";}
90 
91  virtual void analyze(Event const&, EventSetup const&) = 0;
92  virtual void beginJob() {}
93  virtual void endJob(){}
94 
95  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
96  virtual void doEndRun_(Run const& rp, EventSetup const& c);
97  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
98  virtual void doEndLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
99 
101  moduleDescription_ = md;
102  }
104  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
105  };
106  }
107 }
108 #endif
void doRespondToCloseInputFile(FileBlock const &fb)
static const std::string & baseType()
ModuleDescription const & moduleDescription() const
static void prevalidate(ConfigurationDescriptions &descriptions)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
virtual void doEndRun_(Run const &rp, EventSetup const &c)
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
void doEndLuminosityBlock(LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *)
virtual void analyze(Event const &, EventSetup const &)=0
void registerProductsAndCallbacks(EDAnalyzerBase const *module, ProductRegistry *reg)
void doPreallocate(PreallocationConfiguration const &)
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
helper::RootFunctionHelper< F, args >::root_function function(F &f)
Definition: rootFunction.h:14
bool doEvent(EventPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
EDAnalyzerBase ModuleType
std::string workerType() const
ModuleDescription moduleDescription_
void doBeginRun(RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *)
void doRespondToOpenInputFile(FileBlock const &fb)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
void doBeginLuminosityBlock(LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *)
void setModuleDescription(ModuleDescription const &md)
string func
Definition: statics.py:48
void doEndRun(RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *)
Definition: vlib.h:208
void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
Definition: Run.h:41