CMS 3D CMS Logo

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
29 
30 // forward declarations
31 namespace edm {
32 
33  class ModuleCallingContext;
34  class PreallocationConfiguration;
35  class ActivityRegistry;
36  class ProductRegistry;
37  class ThinnedAssociationsHelper;
38  class WaitingTask;
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
64  ModuleDescription const& moduleDescription() const { return moduleDescription_; }
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*);
72  //For now this is a placeholder
73  /*virtual*/ void preActionBeforeRunEventAsync(WaitingTask* iTask, ModuleCallingContext const& iModuleCallingContext, Principal const& iPrincipal) const {}
74 
76  void doBeginJob();
77  void doEndJob();
78 
79  void doBeginRun(RunPrincipal const& rp, EventSetup const& c,
80  ModuleCallingContext const*);
81  void doEndRun(RunPrincipal const& rp, EventSetup const& c,
82  ModuleCallingContext const*);
83  void doBeginLuminosityBlock(LuminosityBlockPrincipal const& lbp, EventSetup const& c,
84  ModuleCallingContext const*);
85  void doEndLuminosityBlock(LuminosityBlockPrincipal const& lbp, EventSetup const& c,
86  ModuleCallingContext const*);
87 
88  void doPreForkReleaseResources();
89  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
90 
91  //For now, the following are just dummy implemenations with no ability for users to override
92  void doRespondToOpenInputFile(FileBlock const& fb);
93  void doRespondToCloseInputFile(FileBlock const& fb);
96 
98  std::string workerType() const {return "WorkerT<EDAnalyzer>";}
99 
101  return resourcesAcquirer_;
102  }
103 
104  virtual void analyze(Event const&, EventSetup const&) = 0;
105  virtual void beginJob() {}
106  virtual void endJob(){}
107 
108  virtual void preForkReleaseResources() {}
109  virtual void postForkReacquireResources(unsigned int /*iChildIndex*/, unsigned int /*iNumberOfChildren*/) {}
110 
111 
112  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
113  virtual void doEndRun_(Run const& rp, EventSetup const& c);
114  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
115  virtual void doEndLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
116 
117  virtual SharedResourcesAcquirer createAcquirer();
118 
120  moduleDescription_ = md;
121  }
123  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
124 
126  };
127  }
128 }
129 #endif
void registerProductsAndCallbacks(ProductRegistry *iReg) override
Definition: ModuleHolder.h:76
def analyze(function, filename, filter=None)
Definition: Profiling.py:11
ModuleDescription const & moduleDescription() const
SharedResourcesAcquirer & sharedResourcesAcquirer()
virtual void postForkReacquireResources(unsigned int, unsigned int)
void preActionBeforeRunEventAsync(WaitingTask *iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const
void doPreallocate(PreallocationConfiguration const &)
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
EDAnalyzerBase ModuleType
SharedResourcesAcquirer resourcesAcquirer_
std::string workerType() const
ModuleDescription moduleDescription_
void setModuleDescription(ModuleDescription const &md)
virtual void preForkReleaseResources()
HLT enums.
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: vlib.h:208
Definition: Run.h:42