00001 #ifndef FWCore_Framework_EDAnalyzer_h
00002 #define FWCore_Framework_EDAnalyzer_h
00003
00004 #include "FWCore/Framework/interface/Frameworkfwd.h"
00005 #include "FWCore/Framework/src/WorkerT.h"
00006 #include "DataFormats/Provenance/interface/ModuleDescription.h"
00007 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
00008
00009
00010 namespace edm {
00011
00012 class EDAnalyzer {
00013 public:
00014 template <typename T> friend class WorkerT;
00015 typedef EDAnalyzer ModuleType;
00016 typedef WorkerT<EDAnalyzer> WorkerType;
00017
00018 EDAnalyzer() : moduleDescription_(), current_context_(0) {}
00019 virtual ~EDAnalyzer();
00020
00021 std::string workerType() const {return "WorkerT<EDAnalyzer>";}
00022
00023 static void fillDescription(edm::ParameterSetDescription&);
00024
00025 protected:
00026
00027
00028 CurrentProcessingContext const* currentContext() const;
00029
00030 private:
00031 bool doEvent(EventPrincipal const& ep, EventSetup const& c,
00032 CurrentProcessingContext const* cpc);
00033 void doBeginJob(EventSetup const&);
00034 void doEndJob();
00035 bool doBeginRun(RunPrincipal const& rp, EventSetup const& c,
00036 CurrentProcessingContext const* cpc);
00037 bool doEndRun(RunPrincipal const& rp, EventSetup const& c,
00038 CurrentProcessingContext const* cpc);
00039 bool doBeginLuminosityBlock(LuminosityBlockPrincipal const& lbp, EventSetup const& c,
00040 CurrentProcessingContext const* cpc);
00041 bool doEndLuminosityBlock(LuminosityBlockPrincipal const& lbp, EventSetup const& c,
00042 CurrentProcessingContext const* cpc);
00043 void doRespondToOpenInputFile(FileBlock const& fb);
00044 void doRespondToCloseInputFile(FileBlock const& fb);
00045 void doRespondToOpenOutputFiles(FileBlock const& fb);
00046 void doRespondToCloseOutputFiles(FileBlock const& fb);
00047 void registerAnyProducts(boost::shared_ptr<EDAnalyzer>const&, ProductRegistry const*) {}
00048
00049 virtual void analyze(Event const&, EventSetup const&) = 0;
00050 virtual void beginJob(EventSetup const&){}
00051 virtual void endJob(){}
00052 virtual void beginRun(Run const&, EventSetup const&){}
00053 virtual void endRun(Run const&, EventSetup const&){}
00054 virtual void beginLuminosityBlock(LuminosityBlock const&, EventSetup const&){}
00055 virtual void endLuminosityBlock(LuminosityBlock const&, EventSetup const&){}
00056 virtual void respondToOpenInputFile(FileBlock const& fb) {}
00057 virtual void respondToCloseInputFile(FileBlock const& fb) {}
00058 virtual void respondToOpenOutputFiles(FileBlock const& fb) {}
00059 virtual void respondToCloseOutputFiles(FileBlock const& fb) {}
00060
00061 void setModuleDescription(ModuleDescription const& md) {
00062 moduleDescription_ = md;
00063 }
00064 ModuleDescription moduleDescription_;
00065
00066 CurrentProcessingContext const* current_context_;
00067 };
00068 }
00069
00070 #endif