|
BrModuleclass description - source file - inheritance tree class BrModule : public TNamedprotected: Data Membersprivate: See also
Class DescriptionBRAHMS Analysis Module Class A standard Physics analysis Module should be derived from this base class. This ensure that the general framework is capable of accessing these in a common and general way. The methods (member functions) consists of a general set for all modules; but the user if free to add specific ones for specific needs. Ideas for this has been taken from the CDF/E802 Analysis Control as well as from the BABAR framework. The initial version is derived from the ROOT base classes, It should be relatively simple to re-write it using non-root container classes etc. Author : Flemming Videbaek Created: 27/12/97 Version: 1.0 The standard methods defined for a module are: ---------------------------------------------- Init() This methods finishes the initialisation of the module, that is after all user parameters for the module has been set. This message is sent once per job. External parameters should be referenced at this time. A method intended to be used for modules that cannot be completely initialized by the constrcutor and needs additional setups. It is the responsibility of the user modules to give out warnings if the init has not been called. Book() Book histograms if defined in the DefineHistograms() method, The booking method ensures that the histograms are added to the list of known histograms. Begin() Send at run initialisation time. That is once per run. This method can for example update references to external parameters, such as database entries and so on. Event(BrEventNode* , BrEventNode*) A module may use both nodes. The normal convention is that the first node is input i.e. module should look for dataobjects in this node, The second node may be empty. Normal use is to add dataobjects to this. The main program/shell will control the vent nodes. All data objects added to the node will be owned by the node. Thus the node will delete at end of event. End() Send at the end of a run. This should flush histograms, etc. specific for this run to disk and so on. Also, one may need to tidy up some stuff before the next Begin. Finish() Send at end of a job. This should do the final write of data to permanent store and so on. Flow in a module: ----------------- +-------------------+ | Set up job things | +-------------------+ | +--------------------+ | Initialize job | | [BrModule::Init()] | +--------------------+ | no o------------------------o +-<---| More runs to process ? |---<----------+ | o------------------------o | | | yes | | +---------------------+ +-------------------+ | | Initialize for run | | Finish run | | | [BrModule::Begin()] | | [BrModule::End()] | | +---------------------+ +-------------------+ | | | | o-------------------------o no | | +--| More events to process? |-->----------+ | | o-------------------------o | ^ | yes | | +---------------------+ | +----| Process event | | | [BrModule::Event()] | | +---------------------+ | | +----------------------+ | Finish job | | [BrModule::Finish()] | +----------------------+ Error handling and state information: ------------------------------------- A few methods are avaliable for communicating the status of the module. Stop(<location>, <format string>, ...) Flag this module as having not being able to fullfil it's requirements. That is, the module pipeline should stop after this module. Note, sending this message in Init() will stop the current job altogether, and in Begin() will stop that run loop altogether. If verbose flag is greater then, or equal to kShowStop, then also output message. If this failure makes the total number of failures for this module exceed the stop limit (as set by BrModule::SetStopLimit), then promote this stop to a Failure (see BrModule::Failure). Failure(<location>, <format string>, ...) Flag this module as having failed. If verbose flag is greater then, or equal to kShowFailure, then also output message. If this failure makes the total number of failures for this module exceed the failure limit (as set by BrModule::SetFailureLimit), then promote this failure to a Abort (see BrModule::Abort). Normally a Failure should not stop the event processing, but should stop the module from doing more work. Abort<location>, <format string>, ...) Flag this module as having failed misaerably, and output message. A BrModuleContainer should always react to this by stoping the module loop, since this flag means that something is very VERY screwy. This should abort the event processing all together. Notice that TObject::Warning, TObject::Error, and TObject::Fatal are reserved for serious errors. ____________________________________________________________________ BrModule() Vanilla constructor; Should not be called within the ROOT environment. BrModule(const Char_t *name, const Char_t *title) : TNamed(name, title) Constructor. This is the default constructor to use. The names of the Modules can be used for navigation and identification. ~BrModule() default destructor Histograms are assumed to have been generated inside the Book method and ownership set to the histogram list void Event() Event method with no Data objects. This method is called once per event. void Event(BrEventNode* inev, BrEventNode* outev) Default Event method with in/out Data objects. In normal application to be called once per event. Method should also be overwritten in the concrete class. This method is called once per event. A dummy routine is supplied in case a module for some strange reason is not called per event. void Book() Booking method for Module class. This method in turns calls the 'user overrrideen method DefineHistograms' and adds all defined histograms to the histogram list for the module. If the user wants to have these in a specific root directory this should be setup in DefineHistogram() method. Following Booking histogramming is enabled. It can be turned on/off using the EnableHistograms() DisableHistogram() Once added to this list the histograms should be considerd owned by Module. void EnableHistograms() Enable use of histograms void DisableHistograms() Disable use of histograms void Print(Option_t* option) Information module. In the final implementation this MUST be overwritten by the derived class. Here a default behaviour is implemented. Options: D show all the details H show list of histograms B DO NOT show basic information This non-const version is only kept for backward compatibility with ROOT pre3. Will soon disappear! void Print(Option_t* option) const Information module. In the final implementation this MUST be overwritten by the derived class. Here a default behaviour is implemented. Options: D show all the details H show list of histograms B show basic information (default) E show event statistics void SetRequiredData(Char_t* name) Set the name of a required DataObject. The name will be stored in a list. The intent is that the calling Event method can check against the names (by calling a basSe Module member function which will search the input Event and return a pointer to the object. CheckDataObjects(); GetDataObject Note none of this is implemented so far. 2/17/98 void EventStatisticsStart() Start the timer for the statistics output void EventStatisticsEnd() Stop the timer for the statistics output void ListEventStatistics() List the event statistics from the timer. Presupposes that EventStatisticsStart() and EventStatisticsEnd() has been called void AddRequiredTable(TObject *tablename) Add a table to the list of requirted tables void Info(Int_t lvl, const char *location, const char *va_(fmt), ...) const Information print out, if the verbosity level is greater than or equal to first argument lvl. Remaining arguments as in TObject::Warning and similar void Debug(Int_t lvl, const char *location, const char *va_(fmt), ...) const Debug print out, if the debug level is greater than or equal to first argument lvl. Remaining arguments as in TObject::Warning and similar. Please note that the line is prefixed with 'Info' and not debug - sorry, but we need our own error handler to handle that properly. void Stop(const char *location, const char *va_(fmt), ...) const Flag this module as having not being able to fullfil it's requirements. That is, the module pipeline should stop after this module. Note, sending this message in Init() will stop the current job altogether, and in Begin() will stop that run loop altogether. If verbose flag is greater then, or equal to kShowStop, then also output message. If this failure makes the total number of failures for this module exceed the stop limit (as set by BrModule::SetStopLimit), then promote this stop to a Failure (see BrModule::Failure). void Failure(const char *location, const char *va_(fmt), ...) const Flag this module as having failed. If verbose flag is greater then, or equal to kShowFailure, then also output message. If this failure makes the total number of failures for this module exceed the failure limit (as set by BrModule::SetFailureLimit), then promote this failure to a Abort (see BrModule::Abort). void Abort(const char *location, const char *va_(fmt), ...) const Flag this module as having failed misaerably, and output message. A BrModuleContainer should always react to this by stoping the module loop, since this flag means that something is very VERY screwy. Inline Functionsvoid SetState(BrModule::EBrModuleState state) void SetStatus(Int_t status) void Init() void Begin() void End() void Finish() Bool_t HistOn() const Bool_t HistBooked() const void SetHistOn() void SetHistOff() void SetHistBooked() void DefineHistograms() TList* HistogramList() const TList* GetRequiredTableList() void SetStopLimit(Int_t limit = 10) void SetFailureLimit(Int_t limit = 10) Int_t GetStopLimit() const Int_t GetFailureLimit() const Int_t GetStopCount() const Int_t GetFailureCount() const void Reset() const BrModule::EBrModuleState GetState() const const Int_t GetStatus() const void SetDebugLevel(const Int_t level) Int_t DebugLevel() void SetVerbose(const Int_t verbose) Int_t Verbose() TClass* Class() TClass* IsA() const void ShowMembers(TMemberInspector& insp, char* parent) void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) BrModule BrModule(BrModule&) |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|