Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

JobCModule.h

Go to the documentation of this file.
00001 
00002 // $Id: JobCModule.h,v 1.21 2005/06/03 22:53:41 rhatcher Exp $
00003 //
00004 // This defines the interface analysis modules. A module has several
00005 // possible entry points which can get called at various points during
00006 // a job. Several of these entry points can act as filters to control
00007 // what files, runs, and events get processed
00008 //
00009 // A module should provide an implementation for at least one of the
00010 // following methods. Default "dummy" methods are provided for any
00011 // methods not required by your module. The possible user entry
00012 // points for a job modules are listed by category.
00013 //
00014 // Analysis/Reconstruction:
00015 //  Ana            - read-only analysis of data records
00016 //  Reco           - read-write access to data records
00017 //
00018 // Status changes:
00019 //  BeginJob  - Notice of begin job
00020 //  EndJob    - Notice of end job
00021 //  BeginFile - Notice of begin of file
00022 //  EndFile   - Notice of end of file
00023 //  BeginRun  - Notice of begin of run
00024 //  EndRun    - Notice of end of run
00025 //
00026 // Interactive entry points:
00027 //  HandleCommand - parse module commands
00028 //  Help          - print help for the module
00029 //  Report        - print module status and information
00030 //  Reset         - return the module to its initial state
00031 //
00032 // I/O Methods (in general provided by framework):
00033 //  Get - get a header/event
00034 //  Put - write a header/event
00035 //
00036 // messier@huhepl.harvard.edu
00038 #ifndef JOBCMODULE_H
00039 #define JOBCMODULE_H
00040 #ifndef STRING
00041 #include <string>
00042 #define STRING
00043 #endif
00044 #ifndef REGISTRY_H
00045 #include "Registry/Registry.h"
00046 #define REGISTRY_H
00047 #endif
00048 #ifndef JOBCRESULT_H
00049 #include "JobControl/JobCResult.h"
00050 #endif
00051 #ifndef JOBCDIALOG_H
00052 #include "JobControl/JobCDialog.h"
00053 #endif
00054 
00055 class MomNavigator;
00056 class JobCEnv;
00057 class JobCommand;
00058 class JobCPath;
00059 class JobCInputModule;
00060 
00061 //......................................................................
00062 
00063 class JobCModule
00064 {
00065 public:
00066     JobCModule();
00067     virtual ~JobCModule();
00068   
00069   
00072     const char* GetName() const;
00073   
00076     virtual JobCResult Ana(const MomNavigator *mom);
00077 
00080     virtual JobCResult Reco(MomNavigator *mom);
00081   
00084     virtual void BeginJob();
00087     virtual void EndJob();
00091     virtual void BeginFile();
00095     virtual void EndFile();
00099     virtual void BeginRun();
00103     virtual void EndRun();
00104 
00108     Int_t GetCurrentRun() const;
00112     Int_t GetLastRun() const;
00113 
00117     const char* GetCurrentFile(const char* streamname="*") const;
00121     const char* GetLastFile(const char* streamname="*") const;
00122 
00135     virtual const Registry& DefaultConfig() const;
00136 
00142     virtual void            Config(const Registry& r);
00143   
00147     virtual JobCResult Get(MomNavigator *mom);
00148 
00152     virtual JobCResult Put(const MomNavigator *mom);
00153 
00155     virtual void Cmd(const char* command);
00157     virtual void HandleCommand(JobCommand *command);
00159     virtual void Help();
00161     virtual void Report();
00163     virtual void Reset();
00164 
00165     // Not normally needed
00166     void              Init(const char* name);
00167     void              Set(const char* paramlist);
00168     void              Set(JobCDialog* d=0);
00169     virtual Registry& GetConfig();
00170 
00171     bool SetUniqueName(const char* name);
00172     const char* GetUniqueName() const;
00173 
00174     JobCPath* GetPath() { return fPath; }
00175     void SetPath(JobCPath* path) { fPath = path; }
00176 
00177 private:
00178 
00179     JobCInputModule* GetJobCInputModule() const;
00180 
00181     std::string fName;   // The name of this module
00182     Registry    fConfig; // The configuration parameters for the module
00183     JobCPath*   fPath;   // The associated job path, if any.
00184 };
00185 
00186 #endif // JOBCMODULE_H
00187 

Generated on Mon Feb 15 11:06:49 2010 for loon by  doxygen 1.3.9.1