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  void callWhenNewProductsRegistered(std::function<void(BranchDescription const&)> const& func);
67 
68  private:
69  bool doEvent(EventPrincipal const& ep, EventSetup const& c,
71  ModuleCallingContext const*);
73  void doBeginJob();
74  void doEndJob();
75 
76  void doBeginRun(RunPrincipal const& rp, EventSetup const& c,
77  ModuleCallingContext const*);
78  void doEndRun(RunPrincipal const& rp, EventSetup const& c,
79  ModuleCallingContext const*);
81  ModuleCallingContext const*);
83  ModuleCallingContext const*);
84 
86  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
87 
88  //For now, the following are just dummy implemenations with no ability for users to override
93 
95  std::string workerType() const {return "WorkerT<EDAnalyzer>";}
96 
97  virtual void analyze(Event const&, EventSetup const&) = 0;
98  virtual void beginJob() {}
99  virtual void endJob(){}
100 
101  virtual void preForkReleaseResources() {}
102  virtual void postForkReacquireResources(unsigned int /*iChildIndex*/, unsigned int /*iNumberOfChildren*/) {}
103 
104 
105  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
106  virtual void doEndRun_(Run const& rp, EventSetup const& c);
107  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
108  virtual void doEndLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
109 
111 
114  }
116  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
117 
120  };
121  }
122 }
123 #endif
void doRespondToCloseInputFile(FileBlock const &fb)
static boost::mutex mutex
Definition: LHEProxy.cc:11
void doEndRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
bool doEvent(EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
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)
virtual void doEndRun_(Run const &rp, EventSetup const &c)
virtual void doEndLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
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
void callWhenNewProductsRegistered(std::function< void(BranchDescription const &)> const &func)
void doBeginRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
EDAnalyzerBase ModuleType
SharedResourcesAcquirer resourcesAcquirer_
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
std::string workerType() const
ModuleDescription moduleDescription_
void doRespondToOpenInputFile(FileBlock const &fb)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
void doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
void setModuleDescription(ModuleDescription const &md)
virtual void preForkReleaseResources()
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:43