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  //For now, the following are just dummy implemenations with no ability for users to override
89  void doRespondToOpenInputFile(FileBlock const& fb);
90  void doRespondToCloseInputFile(FileBlock const& fb);
93 
95  std::string workerType() const {return "WorkerT<EDAnalyzer>";}
96 
98  return resourcesAcquirer_;
99  }
100 
101  virtual void analyze(Event const&, EventSetup const&) = 0;
102  virtual void beginJob() {}
103  virtual void endJob(){}
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 
110  virtual SharedResourcesAcquirer createAcquirer();
111 
113  moduleDescription_ = md;
114  }
116  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
117 
119  };
120  }
121 }
122 #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()
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)
HLT enums.
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: vlib.h:208
Definition: Run.h:42