Go to the documentation of this file.00001 #ifndef FWCore_Framework_EDLooperBase_h
00002 #define FWCore_Framework_EDLooperBase_h
00003
00004
00005
00006
00007
00051
00052
00053
00054
00055
00056 #include "FWCore/Framework/interface/Frameworkfwd.h"
00057
00058 #include <set>
00059 #include <memory>
00060
00061 namespace edm {
00062 namespace eventsetup {
00063 class EventSetupRecordKey;
00064 class EventSetupProvider;
00065 }
00066 class ActionTable;
00067 class ScheduleInfo;
00068 class ModuleChanger;
00069 class ProcessingController;
00070 class ActivityRegistry;
00071
00072 class EDLooperBase {
00073 public:
00074 enum Status {kContinue, kStop};
00075
00076 EDLooperBase();
00077 virtual ~EDLooperBase();
00078
00079 EDLooperBase(EDLooperBase const&) = delete;
00080 EDLooperBase& operator=(EDLooperBase const&) = delete;
00081
00082 void doStartingNewLoop();
00083 Status doDuringLoop(EventPrincipal& eventPrincipal, EventSetup const& es, ProcessingController&);
00084 Status doEndOfLoop(EventSetup const& es);
00085 void prepareForNextLoop(eventsetup::EventSetupProvider* esp);
00086 void doBeginRun(RunPrincipal&, EventSetup const&);
00087 void doEndRun(RunPrincipal&, EventSetup const&);
00088 void doBeginLuminosityBlock(LuminosityBlockPrincipal&, EventSetup const&);
00089 void doEndLuminosityBlock(LuminosityBlockPrincipal&, EventSetup const&);
00090
00091
00092 virtual void beginOfJob(EventSetup const&);
00093 virtual void beginOfJob();
00094
00095 virtual void endOfJob();
00096
00098 virtual void attachTo(ActivityRegistry&);
00099
00100 void setActionTable(ActionTable const* actionTable) { act_table_ = actionTable; }
00101
00102 virtual std::set<eventsetup::EventSetupRecordKey> modifyingRecords() const;
00103
00104 void copyInfo(ScheduleInfo const&);
00105 void setModuleChanger(ModuleChanger const*);
00106
00107 protected:
00109 ModuleChanger const* moduleChanger() const;
00111 ScheduleInfo const* scheduleInfo() const;
00112 private:
00113
00118 virtual void startingNewLoop(unsigned int ) = 0;
00119
00122 virtual Status duringLoop(Event const&, EventSetup const&, ProcessingController&) = 0;
00123
00128 virtual Status endOfLoop(EventSetup const&, unsigned int iCounter) = 0;
00129
00131 virtual void beginRun(Run const&, EventSetup const&);
00132
00134 virtual void endRun(Run const&, EventSetup const&);
00135
00137 virtual void beginLuminosityBlock(LuminosityBlock const&, EventSetup const&);
00138
00140 virtual void endLuminosityBlock(LuminosityBlock const&, EventSetup const&);
00141
00142
00143 unsigned int iCounter_;
00144 ActionTable const* act_table_;
00145
00146 std::auto_ptr<ScheduleInfo> scheduleInfo_;
00147 ModuleChanger const* moduleChanger_;
00148 };
00149 }
00150
00151 #endif