TROOT


class description - source file - inheritance tree

class TROOT : public TDirectory


    protected:
void InitSystem() void InitThreads() void* operator new(unsigned int l) public:
virtual ~TROOT() void AddClass(TClass*) virtual void Browse(TBrowser* b) static TClass* Class() Bool_t ClassSaved(TClass* cl) static Int_t DecreaseDirLevel() virtual TObject* FindObject(const char* name) const virtual TObject* FindObject(const TObject* obj) const virtual TObject* FindObjectAny(const char* name) const const char* FindObjectClassName(const char* name) const const char* FindObjectPathName(const TObject* obj) const TObject* FindSpecialObject(const char* name, void*& where) void ForceStyle(Bool_t force = kTRUE) Bool_t FromPopUp() const TApplication* GetApplication() const TClass* GetClass(const char* name, Bool_t load = kTRUE) const TClass* GetClass(const type_info& typeinfo, Bool_t load = kTRUE) const TColor* GetColor(Int_t color) const const char* GetCutClassName() const const char* GetDefCanvasName() const static Int_t GetDirLevel() Bool_t GetEditHistograms() const Int_t GetEditorMode() const virtual TFile* GetFile() const TFile* GetFile(const char* name) const Bool_t GetForceStyle() const TObject* GetFunction(const char* name) const TObject* GetGeometry(const char* name) const TGlobal* GetGlobal(const char* name, Bool_t load = kFALSE) const TGlobal* GetGlobal(const TObject* obj, Bool_t load = kFALSE) const TFunction* GetGlobalFunction(const char* name, const char* params = "0", Bool_t load = kFALSE) TFunction* GetGlobalFunctionWithPrototype(const char* name, const char* proto = "0", Bool_t load = kFALSE) TList* GetListOfBrowsables() const TSeqCollection* GetListOfBrowsers() const TSeqCollection* GetListOfCanvases() const TSeqCollection* GetListOfClasses() const TSeqCollection* GetListOfCleanups() const TSeqCollection* GetListOfColors() const TSeqCollection* GetListOfFiles() const TSeqCollection* GetListOfFunctions() const TSeqCollection* GetListOfGeometries() const TSeqCollection* GetListOfGlobalFunctions(Bool_t load = kFALSE) TSeqCollection* GetListOfGlobals(Bool_t load = kFALSE) TSeqCollection* GetListOfMappedFiles() const TSeqCollection* GetListOfMessageHandlers() const TSeqCollection* GetListOfSockets() const TSeqCollection* GetListOfSpecials() const TSeqCollection* GetListOfStreamerInfo() const TSeqCollection* GetListOfStyles() const TSeqCollection* GetListOfTasks() const TSeqCollection* GetListOfTypes(Bool_t load = kFALSE) static const char* GetMacroPath() const VoidFuncPtr_t GetMakeDefCanvas() const Int_t GetNclasses() const Int_t GetNtypes() const TPluginManager* GetPluginManager() const TFolder* GetRootFolder() const TVirtualPad* GetSelectedPad() const TObject* GetSelectedPrimitive() const TStyle* GetStyle(const char* name) const TDataType* GetType(const char* name, Bool_t load = kFALSE) const TProcessUUID* GetUUIDs() const const char* GetVersion() const Int_t GetVersionDate() const Int_t GetVersionInt() const Int_t GetVersionTime() const void Idle(UInt_t idleTimeInSec, const char* command = "0") Int_t IgnoreInclude(const char* fname, const char* expandedfname) static Int_t IncreaseDirLevel() static void IndentLevel() static Bool_t Initialized() virtual TClass* IsA() const Bool_t IsBatch() const virtual Bool_t IsFolder() const Bool_t IsInterrupted() const Bool_t IsLineProcessing() const Bool_t IsProofServ() const Int_t LoadClass(const char* classname, const char* libname, Bool_t check = kFALSE) Int_t LoadMacro(const char* filename, Int_t* error = 0, Bool_t check = kFALSE) virtual void ls(const Option_t* option) const Int_t Macro(const char* filename, Int_t* error = 0) static Bool_t MemCheck() void Message(Int_t id, const TObject* obj) Bool_t MustClean() const void ProcessLine(const char* line, Int_t* error = 0) Long_t ProcessLineFast(const char* line, Int_t* error = 0) void ProcessLineSync(const char* line, Int_t* error = 0) void Proof(const char* cluster = "proof://localhost") Bool_t ReadingObject() const void RefreshBrowsers() void RemoveClass(TClass*) void Reset(const Option_t* option) void SaveContext() void SetApplication(TApplication* app) void SetBatch(Bool_t batch = kTRUE) void SetCutClassName(const char* name = "TCutG") void SetDefCanvasName(const char* name = "c1") static void SetDirLevel(Int_t level = 0) void SetEditHistograms(Bool_t flag = kTRUE) void SetEditorMode(const char* mode) void SetFromPopUp(Bool_t flag = kTRUE) void SetInterrupt(Bool_t flag = kTRUE) void SetLineHasBeenProcessed() void SetLineIsProcessing() static void SetMacroPath(const char* newpath) static void SetMakeDefCanvas(VoidFuncPtr_t makecanvas) void SetMustClean(Bool_t flag = kTRUE) void SetReadingObject(Bool_t flag = kTRUE) void SetSelectedPad(TVirtualPad* pad) void SetSelectedPrimitive(const TObject* obj) void SetStyle(const char* stylename = "Default") virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) void Time(Int_t casetime = 1) Int_t Timer() const

Data Members

    private:
Int_t fLineIsProcessing To synchronize multi-threads static TString fgMacroPath Macro search path static Int_t fgDirLevel Indentation level for ls() static Bool_t fgRootInit Singleton initialization flag static Bool_t fgMemCheck Turn on memory leak checker protected:
TString fVersion ROOT version (from CMZ VERSQQ) ex 0.05/01 Int_t fVersionInt ROOT version in integer format (501) Int_t fVersionDate Date of ROOT version (ex 951226) Int_t fVersionTime Time of ROOT version (ex 1152) Int_t fTimer Timer flag TApplication* fApplication Pointer to current application TInterpreter* fInterpreter Command interpreter TFile* fCurrentFile Current file TDirectory* fCurrentDirectory Current directory TVirtualPad* fCurrentCanvas Current graphics canvas TVirtualPad* fCurrentPad Current graphics pad TStyle* fCurrentStyle Current graphics style Bool_t fBatch True if session without graphics Bool_t fEditHistograms True if histograms can be edited with the mouse Bool_t fFromPopUp True if command executed from a popup menu Bool_t fMustClean True if object destructor scans canvases Bool_t fReadingObject True while reading an object Bool_t fForceStyle Force setting of current style when reading objects Bool_t fInterrupt True if macro should be interrupted Int_t fEditorMode Current Editor mode TObject* fPrimitive Currently selected primitive TVirtualPad* fSelectPad Currently selected pad TSeqCollection* fClasses List of classes definition ROOT::TMapTypeToTClass* fIdMap Map from typeid to TClass pointer TSeqCollection* fTypes List of data types definition TSeqCollection* fGlobals List of global variables TSeqCollection* fGlobalFunctions List of global functions TSeqCollection* fFiles List of files TSeqCollection* fMappedFiles List of memory mapped files TSeqCollection* fSockets List of network sockets TSeqCollection* fCanvases List of canvases TSeqCollection* fStyles List of styles TSeqCollection* fFunctions List of analytic functions TSeqCollection* fTasks List of tasks TSeqCollection* fColors List of colors TSeqCollection* fGeometries List of geometries TSeqCollection* fBrowsers List of browsers TSeqCollection* fSpecials List of special objects TSeqCollection* fCleanups List of recursiveRemove collections TSeqCollection* fMessageHandlers List of message handlers TSeqCollection* fStreamerInfo List of active StreamerInfo classes TProcessUUID* fUUIDs Pointer to TProcessID managing TUUIDs TFolder* fRootFolder top level folder //root TList* fBrowsables List of browsables TPluginManager* fPluginManager Keeps track of plugin library handlers TString fCutClassName Name of default CutG class in graphics editor TString fDefCanvasName Name of default canvas static VoidFuncPtr_t fgMakeDefCanvas Pointer to default canvas constructor

Class Description

                R O O T top level object description

    The TROOT object is the entry point to the ROOT system.
    The single instance of TROOT is accessible via the global gROOT.
    Using the gROOT pointer one has access to basically every object
    created in a ROOT based program. The TROOT object is essentially a
    container of several lists pointing to the main ROOT objects.

    The following lists are accessible from gROOT object:
       gROOT->GetListOfClasses
       gROOT->GetListOfColors
       gROOT->GetListOfTypes
       gROOT->GetListOfGlobals
       gROOT->GetListOfGlobalFunctions
       gROOT->GetListOfFiles
       gROOT->GetListOfMappedFiles
       gROOT->GetListOfSockets
       gROOT->GetListOfCanvases
       gROOT->GetListOfStyles
       gROOT->GetListOfFunctions
       gROOT->GetListOfSpecials (for example graphical cuts)
       gROOT->GetListOfGeometries
       gROOT->GetListOfBrowsers
       gROOT->GetListOfCleanups
       gROOT->GetListOfMessageHandlers

   The TROOT class provides also many useful services:
     - Get pointer to an object in any of the lists above
     - Time utilities TROOT::Time

   The ROOT object must be created as a static object. An example
   of a main program creating an interactive version is shown below:

---------------------Example of a main program--------------------------------

       #include "TRint.h"

       int main(int argc, char **argv)
       {
          TRint *theApp = new TRint("ROOT example", &argc, argv);

          // Init Intrinsics, build all windows, and enter event loop
          theApp->Run();

          return(0);
       }
-----------------------End of Main program--------------------------------


~TROOT()
 Clean up and free resources used by ROOT (files, network sockets,
 shared memory segments, etc.).

void AddClass(TClass *cl)
 Add a class to the list and map of classes.

void Browse(TBrowser *b)
 Add browsable objects to TBrowser.

Bool_t ClassSaved(TClass *cl)
 return class status bit kClassSaved for class cl
 This function is called by the SavePrimitive functions writing
 the C++ code for an object.

TObject* FindObject(const TObject *) const
 Find an object in one Root folder

TObject* FindObject(const char *name) const
 Returns address of a ROOT object if it exists

 This function looks in the following order in the ROOT lists:
     - List of files
     - List of memory mapped files
     - List of functions
     - List of geometries
     - List of canvases
     - List of styles
     - List of specials
     - List of materials in current geometry
     - List of shapes in current geometry
     - List of matrices in current geometry
     - List of Nodes in current geometry
     - Current Directory in memory
     - Current Directory on file

TObject* FindSpecialObject(const char *name, void *&where)
 Returns address and folder of a ROOT object if it exists

 This function looks in the following order in the ROOT lists:
     - List of files
     - List of memory mapped files
     - List of functions
     - List of geometries
     - List of canvases
     - List of styles
     - List of specials
     - List of materials in current geometry
     - List of shapes in current geometry
     - List of matrices in current geometry
     - List of Nodes in current geometry
     - Current Directory in memory
     - Current Directory on file

TObject* FindObjectAny(const char *name) const
 Return a pointer to the first object with name starting at //root.
 This function scans the list of all folders.
 if no object found in folders, it scans the memory list of all files.

const char* FindObjectClassName(const char *name) const
 Returns class name of a ROOT object including CINT globals.

const char* FindObjectPathName(const TObject *) const
 Return path name of obj somewhere in the //root/... path.
 The function returns the first occurence of the object in the list
 of folders. The returned string points to a static char array in TROOT.
 If this function is called in a loop or recursively, it is the
 user's responsability to copy this string in his area.

TClass* GetClass(const char *name, Bool_t load) const
 Return pointer to class with name.

TClass* GetClass(const type_info& typeinfo, Bool_t load) const
 Return pointer to class with name.

TColor* GetColor(Int_t color) const
 Return address of color with index color.

VoidFuncPtr_t GetMakeDefCanvas() const
 Return default canvas function.

TDataType* GetType(const char *name, Bool_t load) const
 Return pointer to type with name.

TFile* GetFile(const char *name) const
 Return pointer to file with name.

TStyle* GetStyle(const char *name) const
 Return pointer to style with name

TObject* GetFunction(const char *name) const
 Return pointer to function with name.

TGlobal* GetGlobal(const char *name, Bool_t load) const
 Return pointer to global variable by name. If load is true force
 reading of all currently defined globals from CINT (more expensive).

TGlobal* GetGlobal(const TObject *addr, Bool_t load) const
 Return pointer to global variable with address addr. If load is true
 force reading of all currently defined globals from CINT (more
 expensive).

TFunction* GetGlobalFunction(const char *function, const char *params, Bool_t load)
 Return pointer to global function by name. If params != 0
 it will also resolve overloading. If load is true force reading
 of all currently defined global functions from CINT (more expensive).
 The param string must be of the form: "3189,"aap",1.3".

TFunction* GetGlobalFunctionWithPrototype(const char *function, const char *proto, Bool_t load)
 Return pointer to global function by name. If proto != 0
 it will also resolve overloading. If load is true force reading
 of all currently defined global functions from CINT (more expensive).
 The proto string must be of the form: "int, char*, float".

TObject* GetGeometry(const char *name) const
 Return pointer to Geometry with name

TSeqCollection* GetListOfGlobals(Bool_t load)
 Return list containing the TGlobals currently defined.
 Since globals are created and deleted during execution of the
 program, we need to update the list of globals every time we
 execute this method. However, when calling this function in
 a (tight) loop where no interpreter symbols will be created
 you can set load=kFALSE (default).

TSeqCollection* GetListOfGlobalFunctions(Bool_t load)
 Return list containing the TFunctions currently defined.
 Since functions are created and deleted during execution of the
 program, we need to update the list of functions every time we
 execute this method. However, when calling this function in
 a (tight) loop where no interpreter symbols will be created
 you can set load=kFALSE (default).

TSeqCollection* GetListOfTypes(Bool_t load)
 Return list containing all TDataTypes (typedefs) currently defined.
 Since types can be added and removed during execution of the
 program, we need to update the list of types every time we
 execute this method. However, when calling this function in
 a (tight) loop where no new types will be created
 you can set load=kFALSE (default).

void Idle(UInt_t idleTimeInSec, const char *command)
 Execute command when system has been idle for idleTimeInSec seconds.

Int_t IgnoreInclude(const char *fname, const char * /*expandedfname*/)
 Return true if the given include file correspond to a class that has
 been loaded through a compiled dictionnary.

void InitSystem()
 Initialize operating system interface.

void InitThreads()
 Load and initialize thread library.

Int_t LoadClass(const char *classname, const char *libname, Bool_t check)
 Check if class "classname" is known to the interpreter. If
 not it will load library "libname". If the library name does
 not start with "lib", "lib" will be prepended and a search will
 be made in the DynamicPath (see .rootrc). If not found a search
 will be made on libname (without "lib" prepended) and if not found
 a direct try of libname will be made (in case it contained an
 absolute path.
 If check is true it will only check if libname exists and is
 readable.
 Returns 0 on successful loading and -1 in case libname does not
 exist or in case of error.

void ls(Option_t *option) const
 To list all objects of the application.
 Loop on all objects created in the ROOT linked lists.
 Objects may be files and windows or any other object directly
 attached to the ROOT linked list.

Int_t LoadMacro(const char *filename, int *error, Bool_t check)
 Load a macro in the interpreter's memory. Equivalent to the command line
 command ".L filename". If the filename has "+" or "++" appended
 the macro will be compiled by ACLiC. The filename must have the format:
 [path/]macro.C[+|++[g|O]].
 The possible error codes are defined by TInterpreter::EErrorCode.
 If check is true it will only check if filename exists and is
 readable.
 Returns 0 on successful loading and -1 in case filename does not
 exist or in case of error.

Int_t Macro(const char *filename, int *error)
 Execute a macro in the interpreter. Equivalent to the command line
 command ".x filename". If the filename has "+" or "++" appended
 the macro will be compiled by ACLiC. The filename must have the format:
 [path/]macro.C[+|++[g|O]][(args)].
 The possible error codes are defined by TInterpreter::EErrorCode.

void Message(Int_t id, const TObject *obj)
 Process message id called by obj

void ProcessLine(const char *line, Int_t *error)
 Process interpreter command via TApplication::ProcessLine().
 On Win32 the line will be processed a-synchronously by sending
 it to the CINT interpreter thread. For explicit synchrounous processing
 use ProcessLineSync(). On non-Win32 platforms there is not difference
 between ProcessLine() and ProcessLineSync().
 The possible error codes are defined by TInterpreter::EErrorCode.  In
 particular, error will equal to TInterpreter::kProcessing until the
 CINT interpreted thread has finished executing the line.

void ProcessLineSync(const char *line, Int_t *error)
 Process interpreter command via TApplication::ProcessLine().
 On Win32 the line will be processed synchronously (i.e. it will
 only return when the CINT interpreter thread has finished executing
 the line). On non-Win32 platforms there is not difference between
 ProcessLine() and ProcessLineSync().
 The possible error codes are defined by TInterpreter::EErrorCode.

Long_t ProcessLineFast(const char *line, Int_t *error)
 Process interpreter command directly via CINT interpreter.
 Only executable statements are allowed (no variable declarations),
 In all other cases use TROOT::ProcessLine().
 The possible error codes are defined by TInterpreter::EErrorCode.

void Proof(const char *cluster)
 Start PROOF session on a specific cluster (default is
 "proof://localhost"). The TProof object can be accessed via
 the gProof global. Creating a new TProof object will reset
 the gProof global. For more on PROOF see the TProof ctor.

void RefreshBrowsers()
 Refresh all browsers. Call this method when some command line
 command or script has changed the browser contents. Not needed
 for objects that have the kMustCleanup bit set. Most useful to
 update browsers that show the file system or other objects external
 to the running ROOT session.

void RemoveClass(TClass *oldcl)
 Add a class to the list and map of classes

void Reset(Option_t *)
 Delete all global interpreter objects created since the last call to Reset

 If option="a" is set reset to startup context (i.e. unload also
 all loaded files, classes, structs, typedefs, etc.).

 This function is typically used at the beginning (or end) of a macro
 to clean the environment.

void SaveContext()
 Save the current interpreter context.

void SetCutClassName(const char *name)
 Set the default graphical cut class name for the graphics editor
 By default the graphics editor creates an instance of a class TCutG.
 This function may be called to specify a different class that MUST
 derive from TCutG

void SetEditorMode(const char *mode)
 Set editor mode

void SetStyle(const char *stylename)
 Change current style to style with name stylename

Int_t DecreaseDirLevel()

Int_t GetDirLevel()

const char* GetMacroPath()
 Get macro search path. Static utility function.

void SetMacroPath(const char *newpath)
 Set or extend the macro search path. Static utility function.
 If newpath=0 or "" reset to value specified in the rootrc file.

Int_t IncreaseDirLevel()

void IndentLevel()
 Functions used by ls() to indent an object hierarchy.

Bool_t Initialized()

Bool_t MemCheck()

void SetDirLevel(Int_t level)

void SetMakeDefCanvas(VoidFuncPtr_t makecanvas)
 Static function used to set the address of the default make canvas method.
 This address is by default initialized to 0.
 It is set as soon as the library containing the TCanvas class is loaded.



Inline Functions


                  void* operator new(unsigned int l)
                   void ForceStyle(Bool_t force = kTRUE)
                 Bool_t FromPopUp() const
        TPluginManager* GetPluginManager() const
          TApplication* GetApplication() const
            const char* GetCutClassName() const
            const char* GetDefCanvasName() const
                 Bool_t GetEditHistograms() const
                  Int_t GetEditorMode() const
                 Bool_t GetForceStyle() const
                  Int_t GetVersionDate() const
                  Int_t GetVersionTime() const
                  Int_t GetVersionInt() const
            const char* GetVersion() const
        TSeqCollection* GetListOfClasses() const
        TSeqCollection* GetListOfColors() const
        TSeqCollection* GetListOfFiles() const
        TSeqCollection* GetListOfMappedFiles() const
        TSeqCollection* GetListOfSockets() const
        TSeqCollection* GetListOfCanvases() const
        TSeqCollection* GetListOfStyles() const
        TSeqCollection* GetListOfFunctions() const
        TSeqCollection* GetListOfGeometries() const
        TSeqCollection* GetListOfBrowsers() const
        TSeqCollection* GetListOfSpecials() const
        TSeqCollection* GetListOfTasks() const
        TSeqCollection* GetListOfCleanups() const
        TSeqCollection* GetListOfStreamerInfo() const
        TSeqCollection* GetListOfMessageHandlers() const
                 TList* GetListOfBrowsables() const
                 TFile* GetFile(const char* name) const
               TObject* GetSelectedPrimitive() const
           TVirtualPad* GetSelectedPad() const
                  Int_t GetNclasses() const
                  Int_t GetNtypes() const
               TFolder* GetRootFolder() const
          TProcessUUID* GetUUIDs() const
                 Bool_t IsBatch() const
                 Bool_t IsFolder() const
                 Bool_t IsInterrupted() const
                 Bool_t IsLineProcessing() const
                 Bool_t IsProofServ() const
                 Bool_t MustClean() const
                 Bool_t ReadingObject() const
                   void SetApplication(TApplication* app)
                   void SetBatch(Bool_t batch = kTRUE)
                   void SetDefCanvasName(const char* name = "c1")
                   void SetEditHistograms(Bool_t flag = kTRUE)
                   void SetFromPopUp(Bool_t flag = kTRUE)
                   void SetInterrupt(Bool_t flag = kTRUE)
                   void SetLineIsProcessing()
                   void SetLineHasBeenProcessed()
                   void SetReadingObject(Bool_t flag = kTRUE)
                   void SetMustClean(Bool_t flag = kTRUE)
                   void SetSelectedPrimitive(const TObject* obj)
                   void SetSelectedPad(TVirtualPad* pad)
                   void Time(Int_t casetime = 1)
                  Int_t Timer() const
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)


Author: Rene Brun 08/12/94
Last update: root/base:$Name: $:$Id: TROOT.cxx,v 1.91 2003/04/11 11:48:10 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - 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.