library: libTreePlayer #include "TFileDrawMap.h"

# TFileDrawMap

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

## class TFileDrawMap : public TNamed

| Inheritance Chart:

`TObject`

<-

`TNamed`

<-

`TFileDrawMap`

        protected:

              virtual void DrawMarker(Int_t marker, Long64_t eseek)
          virtual TObject* GetObject()
            virtual Bool_t GetObjectInfoDir(TDirectory* dir, Int_t px, Int_t py, char* info) const
              virtual void PaintBox(TBox& box, Long64_t bseek, Int_t nbytes)
              virtual void PaintDir(TDirectory* dir, const char* keys)

        public:

                          TFileDrawMap()
                          TFileDrawMap(const TFile* file, const char* keys, Option_t* option)
                          TFileDrawMap(const TFileDrawMap&)
                  virtual ~TFileDrawMap()
             virtual void AnimateTree(const char* branches = "")
           static TClass* Class()
            virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
             virtual void DrawObject()
             virtual void DumpObject()
             virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
            virtual char* GetObjectInfo(Int_t px, Int_t py) const
             virtual void InspectObject()
          virtual TClass* IsA() const
            TFileDrawMap& operator=(const TFileDrawMap&)
             virtual void Paint(Option_t* option)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)

### Data Members

        protected:

           TFile* fFile    pointer to the file
             TH1* fFrame   histogram used to draw the map frame
          TString fKeys    list of keys
          TString fOption  drawing options
            Int_t fXsize   size in bytes of X axis
            Int_t fYsize   size in K/Mbytes of Y axis

## Class Description

     TFileDrawMap

     This class is automatically called by TFile::DrawMap
     It draws a canvas showing the internal structure of a ROOT file.
     Each key or basket in a file is shown with a fill area drawn
     at the byte position of the key/basket in the file.
     The Y axis of the canvas shows the number of Kbytes/Mbytes.
     The X axis shows the bytes between y(i) and y(i+1).
     A color corresponding to the class in the key/basket is automatically
     selected using the class unique identifier.

     When moving the mouse in the canvas, the "Event Status" panels
     shows the object corresponding to the mouse position.
     if the object is a key, it shows the class and object name as well as
        the file directory name if the file has sub-directories.
     if the object is a basket, it shows:
       -the name of the Tree
       -the name of the branch
       -the basket number
       -the entry number in the basket

     Special keys like the StreamerInfo record, the Keys List Record
     and the Free Blocks Record are also shown.

     When clicking the right mouse button, a pop-up menu is shown
     with its title identifying the picked object and with the items:
       -DrawObject: in case of a key, the Draw function of the object is called
                    in case of a basket, the branch is drawn for all entries
       -DumpObject: in case of a key, the Dump function of the object is called
                    in case of a basket, tree->Show(entry) is called
       -InspectObject: the Inspect function is called for the object.

     The normal axis zoom functionality can be used to zoom or unzoom
     One can also use the TCanvas context menu SetCanvasSize to make
     a larger canvas and use the canvas scroll bars.

     When the class is built, it is possible to identify a subset of the
     objects to be shown. For example, to view only the keys with
     names starting with "abc", set the argument keys to "abc*".
     The default is to view all the objects.
     The argument options can also be used (only one option currently)
     When the option "same" is given, the new picture is suprimposed.
     The option "same" is useful, eg:
      to draw all keys with names = "abc" in a first pass
     then all keys with names = "uv*" in a second pass, etc.

/* */

      =============================================================================

TFileDrawMap() :TNamed()

     Default TreeFileMap constructor

TFileDrawMap(const TFile *file, const char *keys, Option_t *option) : TNamed("TFileDrawMap","")

     TFileDrawMap normal constructor
     see descriptions of arguments above

~TFileDrawMap()

    *-*-*-*-*-*-*-*-*-*-*Tree destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
    *-*                  =================

void AnimateTree(const char *branches)

     Show sequence of baskets reads for the list of baskets involved
     in the list of branches (separated by ",")
     if branches="", the branch pointed by the mouse is taken.
     if branches="*", all branches are taken
     Example:
      AnimateTree("x,y,u");

Int_t DistancetoPrimitive(Int_t px, Int_t py)

     Compute distance from point px,py to this TreeFileMap
     Find the closest object to the mouse, save its path in the TFileDrawMap name.

void DrawMarker(Int_t marker, Long64_t eseek)

     Draw marker

void DrawObject()

     Draw object at the mouse position

void DumpObject()

     Dump object at the mouse position

void ExecuteEvent(Int_t event, Int_t px, Int_t py)

     Execute action corresponding to one event

TObject* GetObject()

     Retrieve object at the mouse position in memory

char* GetObjectInfo(Int_t px, Int_t py) const

       Redefines TObject::GetObjectInfo.
       Displays the keys info in the file corresponding to cursor position px,py
       in the canvas status bar info panel

Bool_t GetObjectInfoDir(TDirectory *dir, Int_t px, Int_t py, char *info) const

       Redefines TObject::GetObjectInfo.
       Displays the keys info in the directory
       corresponding to cursor position px,py

void InspectObject()

     Inspect object at the mouse position

void Paint(Option_t *)

      Paint this TFileDrawMap

void PaintBox(TBox &box, Long64_t bseek, Int_t nbytes)

     Paint the object at bseek with nbytes using the box object

void PaintDir(TDirectory *dir, const char *keys)

     Paint keys in a directory

### Inline Functions

                  TClass* Class()
                  TClass* IsA() const
                     void ShowMembers(TMemberInspector& insp, char* parent)
                     void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)
             TFileDrawMap TFileDrawMap(const TFileDrawMap&)
            TFileDrawMap& operator=(const TFileDrawMap&)

Author: Rene Brun 15/01/2003
Last update: root/treeplayer:$Name: $:$Id: TFileDrawMap.cxx,v 1.5 2003/12/30 13:16:51 brun Exp $
Copyright (C) 1995-2003, Rene Brun and Fons Rademakers. *