BRAT 2.4.5
Class index
Full class index
brahmlib
BRAHMS
ROOT page

BrModule


class description - source file - inheritance tree

class BrModule : public TNamed


    protected:
virtual void SetState(BrModule::EBrModuleState state) virtual void SetStatus(Int_t status) public:
BrModule BrModule() BrModule BrModule(const Char_t* name, const Char_t* title) BrModule BrModule(BrModule&) virtual void ~BrModule() void Abort(const Char_t* location, const char* msgfmt) const virtual void AddRequiredTable(TObject* tablename) virtual void Begin() virtual void Book() static TClass* Class() void Debug(Int_t lvl, const Char_t* location, const char* msgfmt) const Int_t DebugLevel() virtual void DefineHistograms() void DisableHistograms() void EnableHistograms() virtual void End() virtual void Event() virtual void Event(BrEventNode* inev, BrEventNode* outev) virtual void EventStatisticsEnd() virtual void EventStatisticsStart() void Failure(const Char_t* location, const char* msgfmt) const virtual void Finish() virtual Int_t GetFailureCount() const virtual Int_t GetFailureLimit() const virtual TList* GetRequiredTableList() const BrModule::EBrModuleState GetState() const const Int_t GetStatus() const virtual Int_t GetStopCount() const virtual Int_t GetStopLimit() const Bool_t HistBooked() const TList* HistogramList() const Bool_t HistOn() const void Info(Int_t lvl, const Char_t* location, const char* msgfmt) const virtual void Init() virtual TClass* IsA() const virtual void ListEventStatistics() virtual void Print(Option_t* option = "DB") virtual void Print(Option_t* option = "DB") const virtual void Reset() virtual void SetDebugLevel(const Int_t level) virtual void SetFailureLimit(Int_t limit = 10) void SetHistBooked() void SetHistOff() void SetHistOn() void SetRequiredData(Char_t* name) virtual void SetStopLimit(Int_t limit = 10) virtual void SetVerbose(const Int_t verbose) virtual void ShowMembers(TMemberInspector& insp, char* parent) void Stop(const Char_t* location, const char* msgfmt) const virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) Int_t Verbose()

Data Members

    private:
Int_t fDebugLevel ! Debug level Int_t fVerbose ! Option flag TStopwatch fTimer ! Timer for stats Double_t fCpuTime ! Culminative CPU time spend Int_t fEventCalled ! Counter times Event is called. Int_t fStopCount ! Counter for Stop Output Int_t fFailureCount ! Counter for Failure Output Int_t fStopLimit ! Limit for Stop Count Int_t fFailureLimit ! Limit for Failure Count TList* fHistograms ! Histogram list TList* fRequiredTableList ! List of needed tables (not used) protected:
BrModule::EBrModuleState fState ! What state is the module in Int_t fStatus ! How fares the module Bool_t fHistOn ! Histogramming enabled Bool_t fHistBooked ! Histogrammed Booked public:
static const BrModule::EBrModuleState kSetup static const BrModule::EBrModuleState kInit static const BrModule::EBrModuleState kBegin static const BrModule::EBrModuleState kEvent static const BrModule::EBrModuleState kEnd static const BrModule::EBrModuleState kFinish static const BrModule::EBrModuleStatus kOk static const BrModule::EBrModuleStatus kStop static const BrModule::EBrModuleStatus kFailure static const BrModule::EBrModuleStatus kAbort static const enum TObject:: kShowFailures static const enum TObject:: kShowStop


See also

BrBbCalHitsModule, BrBbCalModule, BrBbDumpCalModule, BrBbRdoModule, BrBbVertexModule, BrBfsTofMatchingModule, BrBfsTrackingModule, BrBragHeaderModule, BrC1DigModule, BrC1PidModule, BrCalibrateTof, BrCentFilter, BrChkvCalModule, BrChkvRdoModule, BrCleanupNodesModule, BrCopyModule, BrDC2DTrackFinder, BrDCClusterFinder, BrDCViewCombiner, BrDbCommitModule, BrDbUpdateModule, BrDcCalModule, BrDcRdoModule, BrDigitizeBB, BrDigitizeDC, BrDigitizeTPC, BrDigitizeTof, BrFfsTofMatchingModule, BrFfsTrackingModule, BrFsTrackRegeneratorModule, BrFsTrackingModule, BrGeantToDetectorTracks, BrGeantToMRSTracks, BrGeantToTpcTrackCandidate, BrHeaderModule, BrIOModule, BrInelVertexModule, BrLocalTrackingModule, BrModuleContainer, BrModuleMatchTrack, BrMrsTofMatchingModule, BrMrsTrackingModule, BrMultCentCalModule, BrMultCentModule, BrMultRdoModule, BrMultSdeCentModule, BrRichPidModule, BrScalerHistModule, BrSelectGeantTracks, BrSiDigModule, BrSiPedCalModule, BrTMrsFMatchingModule, BrTMrsFRdoModule, BrTPMClusterVertexModule, BrTPMTrackVertexModule, BrTd1MatchingModule, BrTd1RdoModule, BrTileDigModule, BrTileGapCalModule, BrTilePedCalModule, BrTofCalModule, BrTofPidModule, BrTofRdoModule, BrTpcAddSeqModule, BrTpcCalModule, BrTpcClusterModule, BrTpcDeconvoluteClusterModule, BrTpcHitModule, BrTpcRdoModule, BrTpcSequencePPModule, BrTpcTrackModule, BrTrackProjectionVertexModule, BrTriggerFilter, BrVertexCalModule, BrVertexFilter, BrVertexModule, BrZdcCalModule, BrZdcDigModule, BrZdcRdoModule

Class Description

 BRAHMS 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 Functions


                                  void 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>
Last Update on 2002/03/12 11:50:14 $ by cholm $

Validate HTML
Validate CSS