BRAT 2.4.5
Class index
Full class index
brahmlib
BRAHMS
ROOT page

BrMainModule


class description - source file - inheritance tree

class BrMainModule : public BrModuleContainer


    public:
BrMainModule BrMainModule() BrMainModule BrMainModule(Char_t* name, Char_t* title, Char_t* author, Int_t major, Int_t minor, Int_t revision) BrMainModule BrMainModule(BrMainModule&) virtual void ~BrMainModule() virtual void Begin() static TClass* Class() virtual void Event() virtual void Event(BrEventNode* in, BrEventNode* out = 0) virtual Int_t GetNumberEvent() const virtual Int_t GetNumberRun() const virtual Int_t IncNumberEvent(const Int_t inum = 1) virtual void Init() static BrMainModule* Instance() virtual TClass* IsA() const virtual Int_t Main() static Bool_t NextEvent() static Bool_t NextRun() virtual void Print(Option_t* option = "BDR") virtual void Print(Option_t* option = "BDR") const virtual void SetMaxEvents(Int_t max) virtual void SetMaxRuns(Int_t max) virtual void ShowMembers(TMemberInspector& insp, char* parent) static void StopJob() static void StopRun() virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) virtual void TagFile()

Data Members

    private:
static BrMainModule* fgInstance Pointer to singleton object static Bool_t fgMoreRuns Flag for run-level loop static Bool_t fgMoreEvents Flag for event-level loop Int_t fMajorVersion major version for this analysis module Int_t fMinorVersion minor version for this analysis module Int_t fRevision revision number for this analysis module TString fAuthor Author of this analysis module Int_t fNumberRun Counter of current number of run Int_t fNumberEvent Counter of current number of event Int_t fMaxRuns Max number of runs to consider Int_t fMaxEvents Max number of events/run to consider

Class Description

 A 'main 'module container to manage a full job, be it digitization
 of GEANT data, analysis of raw data, or some later step in the
 analysis chain, such as user analysis.

 It basically works like a module container (BrModuleContainer) but
 is a singleton i.e., only one instance can exist.

 This class is used in the bratmain program to communicate the user
 defined setup of a job.  This is possible because the class is a
 singleton, and that the static pointer to that singleton is
 accesible from both the interpretor and the program (it is both
 name spaces)

 An example of a setup could be:

    BrMainModule* mainModule =
      new BrMainModule("GlbRdoConfig", "Global Reconstruction",
                       "Christian Holm Christensen", 0, 1, 0);
    mainModule->SetMaxEvents(eventsOption->GetValue());
    mainModule->SetMaxRuns(maxrunsOption->GetValue());

    BrIOModule* inputModule =
      new BrRawDataInput("rawInput", "Raw Data Input");
    inputModule->SetIOMode(BrIOModule::kBrJobFile|
                           BrRawDataInput::kBrRawDiskFile);
    inputModule->AddFile(inputOption->GetValue());
    mainModule->AddModule(inputModule);

    BrHistIOModule* histModule =
        new BrHistIOModule("histograms", "Some histograms");
    histModule->AddFile(histogramOption->GetValue());
    mainModule->AddModule(histModule);
    mainModule->SetHistOn();

    BrTriggerFilter* triggerFilter =
      new BrTriggerFilter("trigFilter", "Trigger filter");
    mainModule->AddModule(triggerFilter);
    triggerFilter->AddTrigger(1);
    triggerFilter->AddTrigger(4);
    triggerFilter->AddTrigger(5);
    triggerFilter->AddTrigger(6);

    BrHeaderModule* headerModule =
      new BrHeaderModule("header", "Copy the event header");
    mainModule->AddModule(headerModule);

    BrGlbPackage* glbPackage =
      new BrGlbPackage("glbPackage", "Global detector reconstrucction");
    mainModule->AddModule(glbPackage);

    BrIOModule* outputModule =
      new BrEventIO("ouputModule", "Output module");
    outputModule->SetIOMode(BrIOModule::kBrJobFile|
                            BrIOModule::kBrRecreateFile);
    outputModule->AddFile(outputOption->GetValue());
    mainModule->AddModule(outputModule);

    mainModule->SetVerbose(verboseOption->GetValue());
    mainModule->SetDebugLevel(debugOption->GetValue());

 Here

      eventsOption
      maxrunsOption
      inputOption
      histogramOption
      outputOption

 are assumed to be pointers to BrAppOption objects.  Alternatively
 one can use variables.

 For more on Job-levels, please refer to BrModule class description.

 Below 'analysis module' is taken to mean program/derived class,
 etc.



BrMainModule() : BrModuleContainer()
 Default CTOR - DO NOT USE - required for ROOT I/O

BrMainModule(Char_t* name, Char_t* title, Char_t* author, Int_t major, Int_t minor, Int_t revision) : BrModuleContainer(name,title)
 Named CTOR - The arguments are:

   name              name of this job.  Set this to be the
                     basename of your configuration script.
   title             title of ths job (be descriptive)
   author            name of the person that started this job
   major             major version number for this job
                     it's recommended that this starts at zero
                     (0), and as the job is well tested, bumped to
                     one (1).  If major changes are made to the
                     job, this should be bumped again.
   minor             Minor version number.  Should start at one
                     (1), and be incremented for each change, such
                     as new option, a new module, and so on.  At
                     major changes, zero it.
   revision          revision number. Should start at zero,
                     increment for each, like spelling, value of
                     default arguments, and so on.  Should be
                     zeroed at minor bumps.

 The version number <major>.<minor>.<revision> is a good way to
 identify the history of a configuration script.  Please use it.


~BrMainModule()
 Default DTOR.  Does nothing

BrMainModule* Instance(void)
 Get a pointer to the singleton object. If no BrMainModule is
 initialized a fatal error is produced.

Int_t Main()
 Do a full job

void Init()
 Initialize all modules and module containers this job
 Sends message BrModule::Init recursively

void Begin()
 Initialize all modules and module containers for this run
 Sends message BrModule::Begin recursively

void Event()
 Process this event by all modules and module containers
 Sends message Calls BrModule::Event recursively

void Event(BrEventNode* in, BrEventNode* out)
 Process this event by all modules and module containers
 Sends message Calls BrModule::Event recursively

void Print(Option_t* option)
 Print information to terminal

 Options: See BrModuleContainer::Print()

 This non-const version is only kept for backward compatibility
 with ROOT pre3. Will soon disappear!

void Print(Option_t* option) const
 Print information to terminal

 Options: See BrModuleContainer::Print()


Bool_t NextEvent()
 Test if we have more events to do. Can be used in BrModules to
 react on previous module settting this flag

Bool_t NextRun()
 Test if we have more runs to do. Can be used in BrModules to
 react on previous module settting this flag

void StopJob()
 Stop the current run level. This is a static method, so that
 BrModules may send this message with:

    BrMainModule::StopJob()

 The effect is to stop the current run loop i.e., the loop over
 runs that trigger the call of BrModule::Begin(), event loop
 (see BrMainModule::StopRun()) and BrModule::End(). After this
 BrModule::Finish() is called on all modules, and the job
 terminates

void StopRun()
 Stop the current event level. This is a static method, so that
 BrModules may send this message with:

    BrMainModule::StopRun()

 The effect is to stop the current event loop i.e., the loop over
 events that trigger the call of BrModule::Event(). After this
 message is send, BrModule::End() on all modules is called, and
 the run level loop is resumed. To stop both the job from the
 event loop, the message BrMainModule::StopJob() should be called
 as well.

void TagFile(void)
 Tag a ROOT file with the information from this job. That includes
 all sub modules, etc.
 I'm not quite sure how to do this yet, but I'll think of
 something soon



Inline Functions


               Int_t GetNumberEvent() const
               Int_t GetNumberRun() const
               Int_t IncNumberEvent(const Int_t inum = 1)
                void SetMaxRuns(Int_t max)
                void SetMaxEvents(Int_t max)
             TClass* Class()
             TClass* IsA() const
                void ShowMembers(TMemberInspector& insp, char* parent)
                void Streamer(TBuffer& b)
                void StreamerNVirtual(TBuffer& b)
        BrMainModule BrMainModule(BrMainModule&)

This page automatically generated by script docBrat by Christian Holm

Copyright ; 2002 BRAHMS Collaboration <brahmlib@rcf.rhic.bnl.gov>
Last Update on 2002/04/22 17:00:14 $ by cholm $

Validate HTML
Validate CSS