test
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_global_EDAnalyzerBase_h
2 #define FWCore_Framework_global_EDAnalyzerBase_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : EDAnalyzerBase
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Thu, 18 Jul 2013 11:51:14 GMT
19 //
20 
21 // system include files
22 
23 // user include files
28 
29 // forward declarations
30 
31 namespace edm {
32  class ModuleCallingContext;
33  class PreallocationConfiguration;
34  class StreamID;
35  class ActivityRegistry;
36  class ProductRegistry;
37  class ThinnedAssociationsHelper;
38 
39  namespace maker {
40  template<typename T> class ModuleHolderT;
41  }
42 
43  namespace global {
44 
46  {
47 
48  public:
49  template <typename T> friend class edm::WorkerT;
50  template <typename T> friend class edm::maker::ModuleHolderT;
52 
54  virtual ~EDAnalyzerBase();
55 
56  static void fillDescriptions(ConfigurationDescriptions& descriptions);
57  static void prevalidate(ConfigurationDescriptions& descriptions);
58  static const std::string& baseType();
59 
60  // Warning: the returned moduleDescription will be invalid during construction
62 
63  private:
64  bool doEvent(EventPrincipal const& ep, EventSetup const& c,
66  ModuleCallingContext const*);
68  void doBeginJob();
69  void doEndJob();
70 
71  void doBeginStream(StreamID id);
72  void doEndStream(StreamID id);
73  void doStreamBeginRun(StreamID id,
74  RunPrincipal const& ep,
75  EventSetup const& c,
76  ModuleCallingContext const*);
77  void doStreamEndRun(StreamID id,
78  RunPrincipal const& ep,
79  EventSetup const& c,
80  ModuleCallingContext const*);
82  LuminosityBlockPrincipal const& ep,
83  EventSetup const& c,
84  ModuleCallingContext const*);
86  LuminosityBlockPrincipal const& ep,
87  EventSetup const& c,
88  ModuleCallingContext const*);
89 
90 
91  void doBeginRun(RunPrincipal const& rp, EventSetup const& c,
92  ModuleCallingContext const*);
93  void doEndRun(RunPrincipal const& rp, EventSetup const& c,
94  ModuleCallingContext const*);
96  ModuleCallingContext const*);
98  ModuleCallingContext const*);
99 
101  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
102 
103  //For now, the following are just dummy implemenations with no ability for users to override
108 
110  std::string workerType() const {return "WorkerT<EDAnalyzer>";}
111 
112  virtual void analyze(StreamID, Event const& , EventSetup const&) const= 0;
113  virtual void beginJob() {}
114  virtual void endJob(){}
115 
116  virtual void preForkReleaseResources() {}
117  virtual void postForkReacquireResources(unsigned int /*iChildIndex*/, unsigned int /*iNumberOfChildren*/) {}
118 
119 
120  virtual void preallocStreams(unsigned int);
121  virtual void doBeginStream_(StreamID id);
122  virtual void doEndStream_(StreamID id);
123  virtual void doStreamBeginRun_(StreamID id, Run const& rp, EventSetup const& c);
124  virtual void doStreamEndRun_(StreamID id, Run const& rp, EventSetup const& c);
125  virtual void doStreamEndRunSummary_(StreamID id, Run const& rp, EventSetup const& c);
126  virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
127  virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
128  virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const& lbp, EventSetup const& c);
129 
130  virtual void doBeginRun_(Run const& rp, EventSetup const& c);
131  virtual void doBeginRunSummary_(Run const& rp, EventSetup const& c);
132  virtual void doEndRunSummary_(Run const& rp, EventSetup const& c);
133  virtual void doEndRun_(Run const& rp, EventSetup const& c);
134  virtual void doBeginLuminosityBlock_(LuminosityBlock const& lbp, EventSetup const& c);
135  virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const& rp, EventSetup const& c);
136  virtual void doEndLuminosityBlockSummary_(LuminosityBlock const& lb, EventSetup const& c);
137  virtual void doEndLuminosityBlock_(LuminosityBlock const& lb, EventSetup const& c);
138 
140  moduleDescription_ = md;
141  }
143 
144  std::function<void(BranchDescription const&)> callWhenNewProductsRegistered_;
145  };
146 
147  }
148 }
149 
150 #endif
virtual void doStreamBeginRun_(StreamID id, Run const &rp, EventSetup const &c)
void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
virtual void doEndLuminosityBlock_(LuminosityBlock const &lb, EventSetup const &c)
void doStreamEndLuminosityBlock(StreamID id, LuminosityBlockPrincipal const &ep, EventSetup const &c, ModuleCallingContext const *)
virtual void analyze(StreamID, Event const &, EventSetup const &) const =0
void doRespondToCloseInputFile(FileBlock const &fb)
static const std::string & baseType()
virtual void doStreamBeginLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doStreamEndRun_(StreamID id, Run const &rp, EventSetup const &c)
virtual void doBeginRunSummary_(Run const &rp, EventSetup const &c)
virtual void doBeginLuminosityBlockSummary_(LuminosityBlock const &rp, EventSetup const &c)
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
virtual void doStreamEndRunSummary_(StreamID id, Run const &rp, EventSetup const &c)
std::function< void(BranchDescription const &)> callWhenNewProductsRegistered_
virtual void doEndRun_(Run const &rp, EventSetup const &c)
void doEndRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
bool doEvent(EventPrincipal const &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
virtual void doStreamEndLuminosityBlockSummary_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doBeginLuminosityBlock_(LuminosityBlock const &lbp, EventSetup const &c)
void doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
ModuleDescription moduleDescription_
void doStreamBeginRun(StreamID id, RunPrincipal const &ep, EventSetup const &c, ModuleCallingContext const *)
void registerProductsAndCallbacks(EDAnalyzerBase *module, ProductRegistry *reg)
virtual void doEndRunSummary_(Run const &rp, EventSetup const &c)
virtual void postForkReacquireResources(unsigned int, unsigned int)
void doEndStream(StreamID id)
void doStreamBeginLuminosityBlock(StreamID id, LuminosityBlockPrincipal const &ep, EventSetup const &c, ModuleCallingContext const *)
void doPreallocate(PreallocationConfiguration const &)
void doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, ModuleCallingContext const *)
virtual void doEndLuminosityBlockSummary_(LuminosityBlock const &lb, EventSetup const &c)
virtual void doBeginRun_(Run const &rp, EventSetup const &c)
void doBeginRun(RunPrincipal const &rp, EventSetup const &c, ModuleCallingContext const *)
std::string workerType() const
void setModuleDescription(ModuleDescription const &md)
virtual void doStreamEndLuminosityBlock_(StreamID id, LuminosityBlock const &lbp, EventSetup const &c)
virtual void doEndStream_(StreamID id)
static void prevalidate(ConfigurationDescriptions &descriptions)
virtual void preallocStreams(unsigned int)
void doRespondToOpenInputFile(FileBlock const &fb)
void doStreamEndRun(StreamID id, RunPrincipal const &ep, EventSetup const &c, ModuleCallingContext const *)
void doBeginStream(StreamID id)
Definition: vlib.h:208
virtual void preForkReleaseResources()
virtual void doBeginStream_(StreamID id)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: Run.h:43
ModuleDescription const & moduleDescription() const