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 #include <mutex>
23 
24 // user include files
30 
31 // forward declarations
32 namespace edm {
33 
34  class ModuleCallingContext;
35  class PreallocationConfiguration;
36  class ActivityRegistry;
37  class ProductRegistry;
38  class ThinnedAssociationsHelper;
39 
40  namespace maker {
41  template<typename T> class ModuleHolderT;
42  }
43 
44  namespace one {
45 
47  {
48 
49  public:
50  template <typename T> friend class edm::WorkerT;
51  template <typename T> friend class edm::maker::ModuleHolderT;
52 
54 
55 
57  virtual ~EDAnalyzerBase();
58 
59  static void fillDescriptions(ConfigurationDescriptions& descriptions);
60  static void prevalidate(ConfigurationDescriptions& descriptions);
61  static const std::string& baseType();
62 
63  // Warning: the returned moduleDescription will be invalid during construction
65 
66  protected:
67 
68  void callWhenNewProductsRegistered(std::function<void(BranchDescription const&)> const& func);
69 
70  private:
71  bool doEvent(EventPrincipal& ep, EventSetup const& c,
73  ModuleCallingContext const*);
75  void doBeginJob();
76  void doEndJob();
77 
78  void doBeginRun(RunPrincipal& rp, EventSetup const& c,
79  ModuleCallingContext const*);
80  void doEndRun(RunPrincipal& rp, EventSetup const& c,
81  ModuleCallingContext const*);
83  ModuleCallingContext const*);
85  ModuleCallingContext const*);
86 
88  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
89 
90  //For now, the following are just dummy implemenations with no ability for users to override
95 
97  std::string workerType() const {return "WorkerT<EDAnalyzer>";}
98 
99  virtual void analyze(Event const&, EventSetup const&) = 0;
100  virtual void beginJob() {}
101  virtual void endJob(){}
102 
103  virtual void preForkReleaseResources() {}
104  virtual void postForkReacquireResources(unsigned int /*iChildIndex*/, unsigned int /*iNumberOfChildren*/) {}
105 
106 
107  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
108  virtual void doEndRun_(Run const& rp, EventSetup const& c);
109  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
110  virtual void doEndLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
111 
113 
116  }
118  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
119 
122  };
123  }
124 }
125 #endif
void doRespondToCloseInputFile(FileBlock const &fb)
static boost::mutex mutex
Definition: LHEProxy.cc:11
static const std::string & baseType()
ModuleDescription const & moduleDescription() const
static void prevalidate(ConfigurationDescriptions &descriptions)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
virtual void postForkReacquireResources(unsigned int, unsigned int)
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 SharedResourcesAcquirer createAcquirer()
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, ActivityRegistry *, ModuleCallingContext const *)
EDAnalyzerBase ModuleType
SharedResourcesAcquirer resourcesAcquirer_
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)
virtual void preForkReleaseResources()
void doEndRun(RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *)
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
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