TTreeViewer
class description - source file - inheritance tree
private:
void BuildInterface()
const char* Cut() const
Int_t Dimension()
const char* Ex() const
const char* Ey() const
const char* Ez() const
void MapBranch(TBranch* branch, TGListTreeItem* parent = 0, Bool_t listIt = kTRUE)
void MapOptions(Long_t parm1)
void MapTree(TTree* tree, TGListTreeItem* parent = 0, Bool_t listIt = kTRUE)
const char* ScanList() const
void SetParentTree(TGListTreeItem* item)
void Warning(const char* msg)
public:
TTreeViewer TTreeViewer(const char* treeName = 0)
TTreeViewer TTreeViewer(TTreeViewer&)
virtual void ~TTreeViewer()
static TClass* Class()
virtual void CloseWindow()
virtual void Delete(Option_t* option)
void EditExpression()
void Empty()
void EmptyAll()
void ExecuteCommand(const char* command, Bool_t fast = kFALSE)
void ExecuteDraw()
TTree* GetTree()
virtual Bool_t HandleTimer(TTimer* timer)
virtual TClass* IsA() const
Int_t MakeSelector(const char* selector = 0)
virtual void Message(const char* msg)
void NewExpression()
void PrintEntries()
Int_t Process(const char* filename, Option_t* option, Int_t nentries = 1000000000, Int_t firstentry = 0)
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
void RemoveItem()
void SetTreeName(const char* treeName)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
Bool_t SwitchTree(Int_t index)
private:
TTree* fTree selected tree
TTree* fMappedTree listed tree
TBranch* fMappedBranch listed branch
Int_t fDimension histogram dimension
Bool_t fVarDraw true if an item is double-clicked
TContextMenu* fContextMenu context menu for tree viewer
TGSelectBox* fDialogBox expression editor
TList* fTreeList list of mapped trees
Int_t fTreeIndex index of current tree in list
const TGPicture* fPicX
const TGPicture* fPicY
const TGPicture* fPicZ pictures for X, Y and Z expressions
const TGPicture* fPicDraw
const TGPicture* fPicStop pictures for Draw/Stop buttons
Cursor_t fDefaultCursor default cursor
Cursor_t fWatchCursor watch cursor
TTimer* fTimer tree viewer timer
Bool_t fCounting true if timer is counting
Bool_t fStopMapping true if branch don't need remapping
Bool_t fEnableCut true if cuts are enabled
TGLayoutHints* fMenuBarLayout
TGLayoutHints* fMenuBarItemLayout
TGLayoutHints* fMenuBarHelpLayout
TGMenuBar* fMenuBar
TGPopupMenu* fFileMenu
TGPopupMenu* fEditMenu
TGPopupMenu* fRunMenu
TGPopupMenu* fOptionsMenu
TGPopupMenu* fOptionsGen
TGPopupMenu* fOptions1D
TGPopupMenu* fOptions2D
TGPopupMenu* fHelpMenu
TGToolBar* fToolBar
TGLayoutHints* fBarLayout
TGLabel* fBarLbl1 label of command text entry
TGLabel* fBarLbl2 label of option text entry
TGLabel* fBarLbl3 label of histogram name text entry
TGCheckButton* fBarH checked for drawing current histogram with different graphic option
TGCheckButton* fBarScan checked for tree scan
TGCheckButton* fBarRec command recording toggle
TGTextEntry* fBarCommand user command entry
TGTextEntry* fBarOption histogram drawing option entry
TGTextEntry* fBarHist histogram name entry
TGHorizontalFrame* fHf main horizontal frame
TGDoubleVSlider* fSlider vertical slider to select processed tree entries;
TGVerticalFrame* fV1 list tree mother
TGVerticalFrame* fV2 list view mother
TGCompositeFrame* fTreeHdr header for list tree
TGCompositeFrame* fListHdr header for list view
TGLabel* fLbl1 label for list tree
TGLabel* fLbl2 label for list view
TGHorizontalFrame* fBFrame button frame
TGHorizontalFrame* fHpb progress bar frame
TGHProgressBar* fProgressBar progress bar
TGLabel* fBLbl4 label for input list entry
TGLabel* fBLbl5 label for output list entry
TGTextEntry* fBarListIn tree input event list name entry
TGTextEntry* fBarListOut tree output event list name entry
TGPictureButton* fbDRAW DRAW button
TGPictureButton* fbSTOP interrupt current command (not yet)
TGStatusBar* fStatusBar status bar
TGTextButton* fReset clear expression's entries
TGCanvas* fTreeView ListTree canvas container
TGListTree* fLt ListTree with file and tree items
TGListView* fListView ListView with branches and leaves
TGTreeLVC* fLVContainer container for listview
TList* fWidgets list of widgets to be deleted
public:
static const TTreeViewer::EListItemType kLTNoType
static const TTreeViewer::EListItemType kLTPackType
static const TTreeViewer::EListItemType kLTTreeType
static const TTreeViewer::EListItemType kLTBranchType
static const TTreeViewer::EListItemType kLTLeafType
static const TTreeViewer::EListItemType kLTActionType
static const TTreeViewer::EListItemType kLTDragType
static const TTreeViewer::EListItemType kLTExpressionType
static const TTreeViewer::EListItemType kLTCutType
TTreeViewer is designed to handle ROOT trees and
to take advantage of TTree class features in a graphical manner.
It uses ROOT native GUI widgets and has capability to work with several trees
in the same session. It provides the following functionality :
- browsing all root files in the working directory and mapping trees inside;
- once a tree is mapped, the user can browse branches and work with the
corresponding sub-branches if there is no need for the whole tree;
- fast drawing of branches by double-click;
- easy edit the expressions to be drawn on X, Y and Z axis and/or selection;
- dragging expressions to one axis and aliasing of expression names;
- handle input/output event lists;
- usage of predefined compatible drawing options;
- possibility of executing user commands and macros and echoing of the current
command;
- possibility of interrupting the current command or the event loop (not yet);
- possibility of selecting the tree entries to be processed (not yet);
- take advantage of TTree class features via context menu;
The layout has the following items:
- a menu bar with entries : File, Edit, Run, Options and Help;
- a toolbar in the upper part where you can issue user commands, change
the drawing option and the histogram name, two check buttons Hist and Rec
which toggles histogram drawing mode and command recording respectively;
- a button bar in the lower part with : buttons DRAW/STOP that issue histogram
drawing and stop the current command respectively, two text widgets where
input and output event lists can be specified, a message box and a RESET
button on the right that clear edited expression content (see Editing...)
- a tree-type list on the main left panel where you can browse the root files
from the working directory and load the trees inside by double clicking.
When the first tree is loaded, a new item called "TreeList" will pop-up on
the list menu and will have the selected tree inside with all branches mapped
Mapped trees are provided with context menus, activated by right-clicking;
- a view-type list on the main right panel. The first column contain X, Y and
Z expression items, an optional cut and ten optional editable expressions.
The other items in this list are activated when a mapped item from the
"TreeList" is left-clicked (tree or branch) and will describe the conyent
of the tree (branch). Expressions and leaf-type items can be dragged or
deleted. A right click on the list-box or item activates a general context
menu.
Browsing root files from the working directory:
Just double-click on the directory item on the left and you will see all
root files from this directory. Do it once more on the files with a leading +
and you will see the trees inside. If you want one or more of those to
be loaded, double-click on them and they will be mapped in a new item called
"TreeList".
Browsing trees:
Left-clicking on trees from the TreeList will expand their content on the list
from the right side. Double-clicking them will also open their content on the
left, where you can click on branches to expand them on the right.
Dragging items:
Items that can be dragged from the list in the right : expressions and
leaves. Dragging an item and dropping to another will copy the content of first
to the last (leaf->expression, expression->expression). Items far to the right
side of the list can be easily dragged to the left (where expressions are
placed) by dragging them to the left at least 10 pixels.
Editing expressions
All editable expressions from the right panel has two components : a
true name (that will be used when TTree::Draw() commands are issued) and an
alias (used for labeling axes - not yet). The visible name is the alias if
there is one and the true name otherwise.
The expression editor can be activated by right clicking on an
expression item via the command EditExpression from the context menu.
An alternative is to use the Edit-Expression menu after the desired expression
is selected. The editor will pop-up in the left part, but it can be moved.
The editor usage is the following :
- you can write C expressions made of leaf names by hand or you can insert
any item from the right panel by clicking on it (recommandable);
- you should write the item alias by hand since it not ony make the expression
TTreeViewer(const char* treeName)
:TGMainFrame(gClient->GetRoot(),10,10,kVerticalFrame)
TTreeViewer default constructor
void SetTreeName(const char* treeName)
*-*-*-*-*-*-*-*-*-*-*-*Allow geting the tree from the context menu*-*-*-*-*-*-*-*-*-*-*
*-* ==========================================
void BuildInterface()
*-*-*-*-*-*-*-*-*Create all viewer widgets*-*-*-*-*-*-*-*-*-*-*
*-* =========================
--- timer
~TTreeViewer()
*-*-*-*-*-*-*-*-*-*-*TTreeViewer default destructor*-*-*-*-*-*-*-*-*-*-*-*
*-* ===============================
const char* Cut()
const char* ScanList()
void EmptyAll()
*-*-*-*-*-*-*-*-*Clear the content of all items in the list view*-*-*-*-*-*-*
*-* ================================================
void Empty()
//*-*-*-*-*-*-*-*-*Empty the content of the selected expression*-*-*-*-*-*-*-*-*-*-*
//*-* ============================================
Int_t Dimension()
*-*-*-*-*-*-*-*-*Compute dimension of the histogram*-*-*-*-*-*-*-*-*-*-*
*-* ==================================
void ExecuteDraw()
*-*-*-*-*-*-*-*-*Called when the DRAW button is executed*-*-*-*-*-*-*-*-*-*-*
*-* ========================================
const char* Ex()
*-*-*-*-*-*-*-*-*Get the expression to be drawn on X axis*-*-*-*-*-*-*-*-*-*-*
*-* ========================================
const char* Ey()
*-*-*-*-*-*-*-*-*Get the expression to be drawn on Y axis*-*-*-*-*-*-*-*-*-*-*
*-* ========================================
const char* Ez()
*-*-*-*-*-*-*-*-*Get the expression to be drawn on Z axis*-*-*-*-*-*-*-*-*-*-*
*-* ========================================
void EditExpression()
*-*-*-*-*-*-*-*-*Start the expression editor*-*-*-*-*-*-*-*-*-*-*
*-* ===========================
Int_t MakeSelector(const char* selector)
*-*-*-*-*-*-*-*-*get use of TTree::MakeSelector() via the context menu*-*-*-*-*-*-*-*-*-*-*
*-* =====================================================
Int_t Process(const char* filename, Option_t *option, Int_t nentries, Int_t firstentry)
*-*-*-*-*-*-*-*-*get use of TTree::Process() via the context menu*-*-*-*-*-*
*-* ================================================
void RemoveItem()
*-*-*-*-*-*-*-*-*Remove the selected item from the list*-*-*-*-*-*-*-*-*-*-*
*-* ======================================
Bool_t HandleTimer(TTimer *timer)
This function is called by the fTimer object
Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
*-*-*-*-*-*-*-*-*Handle menu and other commands generated*-*-*-*-*-*-*-*-*-*-*
*-* ========================================
void CloseWindow()
Close the viewer
void ExecuteCommand(const char* command, Bool_t fast)
*-*-*-*-*-*-*-*-*Execute all user commands*-*-*-*-*-*-*-*-*-*-*
*-* =========================
Execute the command, write it to history file and echo it to output
void MapOptions(Long_t parm1)
*-*-*-*-*-*-*-*-*Scan the selected options from option menu*-*-*-*-*-*-*-*-*-*-*
*-* ==========================================
void MapTree(TTree *tree, TGListTreeItem *parent, Bool_t listIt)
*-*-*-*-*-*-*-*-*Map current tree and expand its content in the lists*-*-*-*-*-*-*-*-*-*-*
*-* ====================================================
void MapBranch(TBranch *branch, TGListTreeItem *parent, Bool_t listIt)
*-*-*-*-*-*-*-*-*Map current branch and expand its content in the list view*-*-*-*-*-*-*-*-*-*-*
*-* ==========================================================
void NewExpression()
void SetParentTree(TGListTreeItem *item)
*-*-*-*-*-*-*-*-*Find parent tree of a clicked item*-*-*-*-*-*-*-*-*-*-*
*-* ==================================
void Message(const char* msg)
*-*-*-*-*-*-*-*-*Send a message on the status bar*-*-*-*-*-*-*-*-*-*-*
*-* ================================
void Warning(const char* msg)
*-*-*-*-*-*-*-*-*Pops-up a warning message*-*-*-*-*-*-*-*-*-*-*
*-* =========================
void PrintEntries()
*-*-*-*-*-*-*-*-*Print the number of selected entries on status-bar*-*-*-*-*
*-* ==================================================
Bool_t SwitchTree(Int_t index)
*-*-*-*-*-*-*-*-*Makes current the tree at a given index in the list*-*-*-*-*
*-* ===================================================
Inline Functions
void Delete(Option_t* option)
TTree* GetTree()
TClass* Class()
TClass* IsA() const
void ShowMembers(TMemberInspector& insp, char* parent)
void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
TTreeViewer TTreeViewer(TTreeViewer&)
Last update: root/treeviewer:$Name: $:$Id: TTreeViewer.cxx,v 1.12 2000/12/14 15:23:47 brun 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.