CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EDAnalyzer.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_EDAnalyzer_h
2 #define FWCore_Framework_EDAnalyzer_h
3 
7 
8 #include <string>
9 
10 // EDAnalyzer is the base class for all analyzer "modules".
11 
12 namespace edm {
13 
14  class EDAnalyzer {
15  public:
16  template <typename T> friend class WorkerT;
19 
21  virtual ~EDAnalyzer();
22 
23  std::string workerType() const {return "WorkerT<EDAnalyzer>";}
24 
25  static void fillDescriptions(ConfigurationDescriptions& descriptions);
26  static const std::string& baseType();
28 
29 
30 
31  protected:
32  // The returned pointer will be null unless the this is currently
33  // executing its event loop function ('analyze').
35 
36  private:
37  bool doEvent(EventPrincipal const& ep, EventSetup const& c,
38  CurrentProcessingContext const* cpc);
39  void doBeginJob();
40  void doEndJob();
41  bool doBeginRun(RunPrincipal const& rp, EventSetup const& c,
42  CurrentProcessingContext const* cpc);
43  bool doEndRun(RunPrincipal const& rp, EventSetup const& c,
44  CurrentProcessingContext const* cpc);
46  CurrentProcessingContext const* cpc);
48  CurrentProcessingContext const* cpc);
54  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
56 
57  virtual void analyze(Event const&, EventSetup const&) = 0;
58  virtual void beginJob(){}
59  virtual void endJob(){}
60  virtual void beginRun(Run const&, EventSetup const&){}
61  virtual void endRun(Run const&, EventSetup const&){}
62  virtual void beginLuminosityBlock(LuminosityBlock const&, EventSetup const&){}
63  virtual void endLuminosityBlock(LuminosityBlock const&, EventSetup const&){}
64  virtual void respondToOpenInputFile(FileBlock const&) {}
65  virtual void respondToCloseInputFile(FileBlock const&) {}
66  virtual void respondToOpenOutputFiles(FileBlock const&) {}
67  virtual void respondToCloseOutputFiles(FileBlock const&) {}
68  virtual void preForkReleaseResources() {}
69  virtual void postForkReacquireResources(unsigned int /*iChildIndex*/, unsigned int /*iNumberOfChildren*/) {}
70 
72  moduleDescription_ = md;
73  }
75 
77  };
78 }
79 
80 #endif
virtual void beginJob()
Definition: EDAnalyzer.h:58
virtual void endLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Definition: EDAnalyzer.h:63
std::string workerType() const
Definition: EDAnalyzer.h:23
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzer.cc:76
virtual void respondToCloseInputFile(FileBlock const &)
Definition: EDAnalyzer.h:65
WorkerT< EDAnalyzer > WorkerType
Definition: EDAnalyzer.h:18
virtual void analyze(Event const &, EventSetup const &)=0
void doPreForkReleaseResources()
Definition: EDAnalyzer.cc:96
bool doEvent(EventPrincipal const &ep, EventSetup const &c, CurrentProcessingContext const *cpc)
Definition: EDAnalyzer.cc:21
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EDAnalyzer.cc:111
virtual void beginRun(Run const &, EventSetup const &)
Definition: EDAnalyzer.h:60
virtual void beginLuminosityBlock(LuminosityBlock const &, EventSetup const &)
Definition: EDAnalyzer.h:62
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzer.cc:81
static const std::string & baseType()
Definition: EDAnalyzer.cc:126
virtual void preForkReleaseResources()
Definition: EDAnalyzer.h:68
static void prevalidate(ConfigurationDescriptions &)
Definition: EDAnalyzer.cc:118
bool doBeginRun(RunPrincipal const &rp, EventSetup const &c, CurrentProcessingContext const *cpc)
Definition: EDAnalyzer.cc:40
bool doEndRun(RunPrincipal const &rp, EventSetup const &c, CurrentProcessingContext const *cpc)
Definition: EDAnalyzer.cc:49
void doBeginJob()
Definition: EDAnalyzer.cc:30
CurrentProcessingContext const * current_context_
Definition: EDAnalyzer.h:76
virtual void endJob()
Definition: EDAnalyzer.h:59
virtual void respondToCloseOutputFiles(FileBlock const &)
Definition: EDAnalyzer.h:67
void registerAnyProducts(EDAnalyzer const *, ProductRegistry const *)
Definition: EDAnalyzer.h:55
ModuleDescription moduleDescription_
Definition: EDAnalyzer.h:74
bool doBeginLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, CurrentProcessingContext const *cpc)
Definition: EDAnalyzer.cc:58
EDAnalyzer ModuleType
Definition: EDAnalyzer.h:17
virtual void respondToOpenOutputFiles(FileBlock const &)
Definition: EDAnalyzer.h:66
virtual void respondToOpenInputFile(FileBlock const &)
Definition: EDAnalyzer.h:64
virtual void endRun(Run const &, EventSetup const &)
Definition: EDAnalyzer.h:61
author Stefano ARGIRO author Bill Tanenbaum
void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
Definition: EDAnalyzer.cc:101
void doRespondToCloseOutputFiles(FileBlock const &fb)
Definition: EDAnalyzer.cc:91
virtual ~EDAnalyzer()
Definition: EDAnalyzer.cc:17
void doRespondToOpenOutputFiles(FileBlock const &fb)
Definition: EDAnalyzer.cc:86
CurrentProcessingContext const * currentContext() const
Definition: EDAnalyzer.cc:106
bool doEndLuminosityBlock(LuminosityBlockPrincipal const &lbp, EventSetup const &c, CurrentProcessingContext const *cpc)
Definition: EDAnalyzer.cc:67
Definition: Run.h:33
virtual void postForkReacquireResources(unsigned int, unsigned int)
Definition: EDAnalyzer.h:69
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzer.h:71