#include "hades.h"

Hades


class description - source file - inheritance tree (.pdf)

class Hades : public TObject

Inheritance Chart:
TObject
<-
Hades

    protected:
void initTaskSetsIDs(Int_t version) void recreateOutput() public:
Hades() Hades(const Hades&) ~Hades() void activateTree(TTree* tree) virtual void Browse(TBrowser* b) static TClass* Class() void closeOutput() void defineTaskSets() Int_t eventLoop(Int_t nEvents = kMaxInt, Int_t firstEvent = 0, Double_t timeQuota = 1.e+20) Bool_t finalizeTasks() HEvent*& getCurrentEvent() HDataSource* getDataSource() const Int_t getEmbeddingMode() Int_t getEmbeddingRealTrackId() Int_t getEventCounter() Bool_t getForceNoSkip() HldFileOutput* getHldOutput() const HMessageMgr* getMsg() Int_t getNumberOfRequestedEvents() TFile* getOutputFile() HRuntimeDb* getRuntimeDb() HDataSource* getSecondDataSource() const HSpectrometer* getSetup() Int_t getSplitLevel() HTask* getTask(Char_t* taskName) HTaskSet* getTask() HTaskSet* getTaskSet(Int_t nEvtId) HTaskSet* getTaskSet(Char_t* evtTypeName) HTree* getTree() Int_t getTreeBufferSize() Bool_t init() Bool_t initTasks() static Hades* instance() virtual TClass* IsA() const Bool_t isCalibration() virtual Bool_t IsFolder() const Bool_t isReal() void makeCounter(Int_t counter = 1000) Bool_t makeTree() Int_t mapId(Int_t id) Hades& operator=(const Hades&) void printDefinedTaskSets() Bool_t reinitTasks() void resetEventCounter() Int_t setAlgorithmLayout(Text_t* fileName) Int_t setConfig(Text_t* fileName) void setDataSource(HDataSource* dataS) void setEmbeddingMode(Int_t mode) void setEnableCloseInput(Bool_t flag = kTRUE) void setEvent(HEvent* ev) Int_t setEventLayout(Text_t* fileName) void setForceNoSkip(Bool_t noskip = kTRUE) Bool_t setHldOutput(Text_t*, Text_t* fileSuffix = "f_", Option_t* option = "NEW") Bool_t setOutputFile(Text_t* name, Option_t* opt, Text_t* title, Int_t comp) void setOutputSizeLimit(Size_t l) void setQuietMode(UChar_t mode = 1) void setSecondDataSource(HDataSource* dataS) void setSplitLevel(Int_t splitLevel) void setTreeBufferSize(Int_t size) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members


    protected:
Size_t fOutputSizeLimit Int_t fCycleNumber Number of current output file TString fOutputFileName Bool_t fFirstEventLoop Int_t fSplitLevel Indicates the split level (0,1,2) HDataSource* fDataSource ! Data source where data are taken from HDataSource* fSecondDataSource ! 2nd data source where data are taken from HldFileOutput* fHldOutput ! Hld file output HEvent* fCurrentEvent Event under reconstruction HTaskSet* fTask Task for each event. TFile* fOutputFile !File used to store the output tree HSpectrometer* setup ! Spectrometer s setup. HTree* fTree Output tree HRuntimeDb* rtdb ! Runtime database of reconstruction parameters. TObjArray* fTaskList List of Task for each type of events. UChar_t quiet 1 - quiet mode, 2 - silence mode Int_t fCounter Counter display for event loop ErrorHandlerFunc_t oldHdlr ! Original ROOT error handler HMessageMgr* msgHandler ! Message handler with three different outputs Int_t reqEvents ! number of requested events from eventloop Bool_t enableCloseInput ! Enable closing oracle input TStopwatch fTimer ! Timer for event loop stoping by time quota static Int_t EventCounter ! Event counter, can be retrieved via gHades->getEventCounter() static Int_t doEmbedding ! embedding mode flag 0=No embedding, static Bool_t forceNoSkip ! kTRUE = don't skip events in unpackers when trigger tag mismatch is detected Int_t evIdMap[16] ! look-up table for event id mapping Int_t treeBufferSize ! size of the buffer of a branch (default 4000)

Class Description

  Hades 
(UML Diagram)

  Hades is the main control class for the reconstruction program.

  There must be one and only one object of this class in the program. This
  object will be accesible anywhere in the reconstruction program or the
  external macros through the global pointer gHades.

  See the initialization section in the HYDRA manual for more information..


Hades(void)
Default constructor for Hades. It sets the global pointer gHades.
This constructor also creates one HDebug object if none exists.

~Hades(void)
Closes the reconstruction program. If there are unsaved data, it saves them
When using Hades within a macro don't forget to call the destructor,
or data won't be saved.

void defineTaskSets()

Int_t mapId(Int_t id)

Int_t setAlgorithmLayout(Text_t *fileName)
This method is used to build the reconstructor's graph. For that purpose
the macro in the file "fileName" is executed.

Returns 0 if successfull.

Int_t setEventLayout(Text_t *fileName)
This method is intended to build the event's structure. For that purpose
the macro in the file "fileName" is executed.

Returns 0 if succesfull.

Int_t setConfig(Text_t *fileName)
 This method is used to interpret a "configuration macro". Within this
 macro all the information to run the analisys is given. This is an
 alternative way of initialization without using setEventLayout(),
 setAlgorithmLayout()...

 For more information on initialization see the initialization section in
 the HYDRA manual.

 Within this macro the user is responsible of calling the Hades::init()
 function before the call to Hades::makeTree();

Bool_t init(void)
 This function initializes Hades. This includes initialization of the
 reconstructors, the data source and the detectors.

Bool_t isCalibration()

Bool_t isReal()
 The event with the sequence number == 0 is a very special event
 which needs special treatment (does not contain any data, it is
 header only, should be skipped from the analysis!!!). It is only
 in the real data and has ID == 2 and Version == 0 (between jan04
 and may06) which points to a calibration event...

Bool_t initTasks()

Bool_t reinitTasks()

Bool_t finalizeTasks()

HTaskSet* getTask()

HTask* getTask(Char_t *name)

HTaskSet* getTaskSet(Int_t nEvtId)

HTaskSet* getTaskSet(Char_t *evtTypeName)

HEvent*& getCurrentEvent(void)
Returns a pointer to the event in reconstruction

void setEvent(HEvent *ev)
 This function sets the event layout to that given by "ev". The user first
 builds the event layout by creating an HEvent object and then call this
 function; which sets the data member fCurrentEvent.

 This function is typically called from the macro invoked in
 setEventLayout()

void setDataSource(HDataSource *dataS)
 Method used to establish the data source where data are taken from. For
 that purpose an object of a class derived from HDataSource is created and
 the setDataSource() method is called to pass a pointer to this object

  This function should be called typically from the macro invoked with
  setConfig()

void setSecondDataSource(HDataSource *dataS)
 Set second data source (needed e.g. for event merging).
 Must be a Root source!

Bool_t setHldOutput(Text_t* filedir,Text_t* fileSuffix,Option_t* option)
 Creates an HLD file output

void setSplitLevel(Int_t splitLevel)
Method used to control the shape of the output Root tree for the events..
Three split levels are supported:

  splitLevel=0 ---> An only branch is created for the event, which is
                    stored as a whole (i.e. the whole HEvent is stored as
                    one piece).

  splitLevel=1 ---> The partial events are stored as a whole, meanwhile the
                    top of the event class (tracks, header ...) is stored
			creating one TBranch per data member

  splitLevel=2 ---> One branch per data member is created (with little
			exceptions, see Root automatic split rules). However
			the categories (see HCategory) still can decide how the
			split is done (by creating their own branches). This
                    is the default value set by the Hades constructor


Int_t getSplitLevel(void)
Returns the current splitLevel (see setSplitLevel() )

Bool_t setOutputFile(Text_t *name, Option_t *opt, Text_t *title, Int_t comp)
Sets the output file, giving its name, compresion level...
For more information on the parameters see the constructor of TFile

  This method allocates the file indicated taking care of saving the
current file if any. If the file does not exist or the user wants it to be
overwritten, then opt="RECREATE"; if the file already exists and is to be
updated then opt="UPDATE"...


HTree* getTree(void)
Returns a pointer to the current output Root tree of events

void activateTree(TTree *tree)
 Sets the right branch address and branch status (=1) for all the branches
 in tree which correspond to the branches which would eventually be
 generated for the output Root tree of events if the function makeTree() is
 called.

 This mechanism allows to only read those branches in "tree" which are
 neccesary to fill an event as defined in setEventLayout()

Bool_t makeTree(void)
 Creates an output tree from the information in the event structure
 and according to the splitLevel (see setSplitLevel() )

Int_t eventLoop(Int_t nEvents, Int_t firstEvent, Double_t timeQuota)
  Executes the event loop;

  For each new event:
  First, the current event is cleared.
  Second, a new event is read from the data source (see HDataSource)
  Third, the reconstruction of this event is launched (see HReconstructor)
  Fourth, if a tree was created (see makeTree() ) then it is filled.

  This function returns the number of events processed. A negative value
  corresponds to an error

  timeQuota - time limit for tasks in minutes.
  timeQuota <= 0. - no limit
  Event loop end condition: evN==nEvents or runing tasks time > timeQuota

Bool_t IsFolder(void) const
 Returns true. This tells the Root browser to show Hades as a folder
 holding other objects

void Browse(TBrowser *b)
 Used to browse the reconstructor's tree, a particular event or the
 reconstructor's histograms...

 This function is called by Root when browsing gHades with the Root browser


void closeOutput(void)

void recreateOutput(void)

void Streamer(TBuffer &R__b)

void printDefinedTaskSets()

void initTaskSetsIDs(Int_t version)
 Mapping of event ids into HTaskSet numbers for DAQ type old (version=0),
 i.e prior to Sep03, and new (version=1).

 This table will go in due time into an rtdb container.  (R.H.)




Inline Functions


                Hades* instance()
          HDataSource* getDataSource() const
                  void setEnableCloseInput(Bool_t flag = kTRUE)
          HDataSource* getSecondDataSource() const
        HldFileOutput* getHldOutput() const
                 Int_t getNumberOfRequestedEvents()
                 Int_t getTreeBufferSize()
                  void setTreeBufferSize(Int_t size)
           HRuntimeDb* getRuntimeDb()
        HSpectrometer* getSetup()
                TFile* getOutputFile()
                  void makeCounter(Int_t counter = 1000)
                  void setOutputSizeLimit(Size_t l)
                  void setQuietMode(UChar_t mode = 1)
          HMessageMgr* getMsg()
                 Int_t getEventCounter()
                 Int_t getEmbeddingMode()
                  void setEmbeddingMode(Int_t mode)
                 Int_t getEmbeddingRealTrackId()
                Bool_t getForceNoSkip()
                  void setForceNoSkip(Bool_t noskip = kTRUE)
                  void resetEventCounter()
               TClass* Class()
               TClass* IsA() const
                  void ShowMembers(TMemberInspector& insp, char* parent)
                  void StreamerNVirtual(TBuffer& b)
                 Hades Hades(const Hades&)
                Hades& operator=(const Hades&)


Author: Manuel Sanchez
Last update: 23/07/2004 bj J.Wuestenfeld
Copyright GENP (Univ. Santiago de Comp.)


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.