Logo ROOT  
Reference Guide
No Matches
Go to the documentation of this file.
1// @(#)root/treeviewer:$Id$
2//Author : Andrei Gheata 16/08/00
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
12#ifndef ROOT_TTreeViewer
13#define ROOT_TTreeViewer
16// //
17// TTreeViewer - A GUI oriented tree viewer //
18// //
21#include "TGFrame.h"
23#include "TTree.h"
25class TTVLVContainer;
26class TTVLVEntry;
27class TTVSession;
28class TGSelectBox;
29class TBranch;
30class TContextMenu;
31class TList;
32class TGPicture;
33class TTimer;
34class TGLayoutHints;
35class TGMenuBar;
36class TGPopupMenu;
37class TGToolBar;
38class TGLabel;
39class TGCheckButton;
40class TGComboBox;
41class TGTextButton;
42class TGTextEntry;
43class TGDoubleVSlider;
44class TGPictureButton;
45class TGStatusBar;
46class TGCanvas;
47class TGListTree;
48class TGListTreeItem;
49class TGListView;
50class TGHProgressBar;
51class TGButton;
54class TTreeViewer : public TGMainFrame {
56friend class TGClient;
57friend class TGButton;
60 //---- item types used as user data
70 kLTCutType = BIT(7)
71 };
74 TTree *fTree; // selected tree
75 TTVSession *fSession; // current tree-viewer session
76 const char *fFilename; // name of the file containing the tree
77 const char *fSourceFile; // name of the C++ source file - default treeviewer.C
78 TString fLastOption; // last graphic option
79 TTree *fMappedTree; // listed tree
80 TBranch *fMappedBranch; // listed branch
81 Int_t fDimension; // histogram dimension
82 Bool_t fVarDraw; // true if an item is double-clicked
83 Bool_t fScanMode; // flag activated when Scan Box is double-clicked
84 TContextMenu *fContextMenu; // context menu for tree viewer
85 TGSelectBox *fDialogBox; // expression editor
86 TList *fTreeList; // list of mapped trees
87 Int_t fTreeIndex; // index of current tree in list
88 const TGPicture *fPicX, *fPicY, *fPicZ; // pictures for X, Y and Z expressions
89 const TGPicture *fPicDraw, *fPicStop; // pictures for Draw/Stop buttons
90 const TGPicture *fPicRefr; // pictures for Refresh buttons //ia
91 Cursor_t fDefaultCursor; // default cursor
92 Cursor_t fWatchCursor; // watch cursor
93 TTimer *fTimer; // tree viewer timer
94 Bool_t fCounting; // true if timer is counting
95 Bool_t fStopMapping; // true if branch don't need remapping
96 Bool_t fEnableCut; // true if cuts are enabled
97 Int_t fNexpressions; // number of expression widgets
98// menu bar, menu bar entries and layouts
111// toolbar and hints
114// widgets on the toolbar
115 TGLabel *fBarLbl1; // label of command text entry
116 TGLabel *fBarLbl2; // label of option text entry
117 TGLabel *fBarLbl3; // label of histogram name text entry
118 TGCheckButton *fBarH; // checked for drawing current histogram with different graphic option
119 TGCheckButton *fBarScan; // checked for tree scan
120 TGCheckButton *fBarRec; // command recording toggle
121 TGTextEntry *fBarCommand; // user command entry
122 TGTextEntry *fBarOption; // histogram drawing option entry
123 TGTextEntry *fBarHist; // histogram name entry
124// frames
125 TGHorizontalFrame *fHf; // main horizontal frame
126 TGDoubleVSlider *fSlider; // vertical slider to select processed tree entries;
127 TGVerticalFrame *fV1; // list tree mother
128 TGVerticalFrame *fV2; // list view mother
129 TGCompositeFrame *fTreeHdr; // header for list tree
130 TGCompositeFrame *fListHdr; // header for list view
131 TGLabel *fLbl1; // label for list tree
132 TGLabel *fLbl2; // label for list view
133 TGHorizontalFrame *fBFrame; // button frame
134 TGHorizontalFrame *fHpb; // progress bar frame
135 TGHProgressBar *fProgressBar; // progress bar
136 TGLabel *fBLbl4; // label for input list entry
137 TGLabel *fBLbl5; // label for output list entry
138 TGTextEntry *fBarListIn; // tree input event list name entry
139 TGTextEntry *fBarListOut; // tree output event list name entry
140 TGPictureButton *fDRAW; // DRAW button
141 TGTextButton *fSPIDER; // SPIDER button
142 TGPictureButton *fSTOP; // interrupt current command (not yet)
143 TGPictureButton *fREFR; // REFRESH button //ia
144 TGStatusBar *fStatusBar; // status bar
145 TGComboBox *fCombo; // combo box with session records
151 TGTextButton *fReset; // clear expression's entries
152// ListTree
153 TGCanvas *fTreeView; // ListTree canvas container
154 TGListTree *fLt; // ListTree with file and tree items
155// ListView
156 TGListView *fListView; // ListView with branches and leaves
157 TTVLVContainer *fLVContainer; // container for listview
159 TList *fWidgets; // list of widgets to be deleted
162// private methods
164 const char *Cut();
166 const char *EmptyBrackets(const char* name);
167 const char *Ex();
168 const char *Ey();
169 const char *Ez();
170 const char *En(Int_t n);
171 void MapBranch(TBranch *branch, const char *prefix="", TGListTreeItem *parent = 0, Bool_t listIt = kTRUE);
172 void MapOptions(Long_t parm1);
173 void MapTree(TTree *tree, TGListTreeItem *parent = 0, Bool_t listIt = kTRUE);
174 void SetFile();
175 const char *ScanList();
177 void DoError(int level, const char *location, const char *fmt, va_list va) const;
180 TTreeViewer(const char* treeName = 0);
182 virtual ~TTreeViewer();
183// public methods
186 Bool_t next , Bool_t last);
187 virtual void CloseWindow();
188 virtual void Delete(Option_t *) { } // *MENU*
189 void DoRefresh();
191 void Empty();
192 void EmptyAll(); // *MENU*
193 void ExecuteCommand(const char* command, Bool_t fast = kFALSE); // *MENU*
198 const char *GetGrOpt();
199 TTree *GetTree() {return fTree;}
203 Int_t MakeSelector(const char* selector = 0); // *MENU*
204 void Message(const char* msg);
205 void NewExpression(); // *MENU*
207 Long64_t Process(const char* filename, Option_t *option="", Long64_t nentries=TTree::kMaxEntries, Long64_t firstentry=0); // *MENU*
210 void RemoveLastRecord(); // *MENU*
211 void SaveSource(const char* filename="", Option_t *option=""); // *MENU*
212 void SetHistogramTitle(const char *title);
213 void SetCutMode(Bool_t enabled = kTRUE) {fEnableCut = enabled;}
215 void SetGrOpt(const char *option);
217 void SetRecordName(const char *name); // *MENU*
218 void SetScanFileName(const char *name=""); // *MENU*
219 void SetScanMode(Bool_t mode=kTRUE) {fScanMode = mode;}
221 void SetSession(TTVSession *session);
222 void SetUserCode(const char *code, Bool_t autoexec=kTRUE); // *MENU*
224 void SetTreeName(const char* treeName); // *MENU*
227 void UpdateRecord(const char *name="new name"); // *MENU*
229 ClassDef(TTreeViewer,0) // A GUI oriented tree viewer
Handle_t Cursor_t
Cursor handle.
Definition GuiTypes.h:34
const Bool_t kFALSE
Definition RtypesCore.h:92
long Long_t
Definition RtypesCore.h:54
long long Long64_t
Definition RtypesCore.h:73
const Bool_t kTRUE
Definition RtypesCore.h:91
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:325
#define BIT(n)
Definition Rtypes.h:85
char name[80]
Definition TGX11.cxx:110
int nentries
A TTree is a list of TBranches.
Definition TBranch.h:89
This class provides an interface to context sensitive popup menus.
This class represent a specialized expression editor for TTVLVEntry 'true name' and 'alias' data memb...
A doubly linked list.
Definition TList.h:44
Basic string class.
Definition TString.h:136
This class represent the list view container for the.
This class represent entries that goes into the TreeViewer listview container.
I/O classes for TreeViewer session handling.
Definition TTVSession.h:70
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
A graphic user interface designed to handle ROOT trees and to take advantage of TTree class features.
Definition TTreeViewer.h:54
TGLabel * fBarLbl2
void SetUserCode(const char *code, Bool_t autoexec=kTRUE)
TGSelectBox * fDialogBox
Definition TTreeViewer.h:85
virtual ~TTreeViewer()
void SetCurrentRecord(Long64_t entry)
TGCheckButton * fBarRec
const TGPicture * fPicZ
Definition TTreeViewer.h:88
TGHProgressBar * fProgressBar
void SetHistogramTitle(const char *title)
const char * Ez()
Bool_t HandleTimer(TTimer *timer)
Execute action in response of a timer timing out.
void UpdateRecord(const char *name="new name")
TGTextEntry * fBarOption
TGLabel * fBLbl4
TGTextEntry * fBarCommand
TGPopupMenu * fOptions2D
TGListView * fListView
TGComboBox * fCombo
void EditExpression()
TGListTree * fLt
TList * fWidgets
void SetNexpressions(Int_t expr)
Bool_t fEnableCut
Definition TTreeViewer.h:96
TGCheckButton * fBarH
TGPictureButton * fBGFirst
Cursor_t fDefaultCursor
Definition TTreeViewer.h:91
void MapOptions(Long_t parm1)
TGLabel * fBLbl5
Bool_t IsScanRedirected()
virtual void CloseWindow()
Close and delete main frame.
TGCanvas * fTreeView
Int_t fTreeIndex
Definition TTreeViewer.h:87
void NewExpression()
TGPictureButton * fSTOP
void SaveSource(const char *filename="", Option_t *option="")
Save the GUI main frame widget in a C++ macro file.
void SetSession(TTVSession *session)
void SetParentTree(TGListTreeItem *item)
const char * EmptyBrackets(const char *name)
TGMenuBar * fMenuBar
TGLabel * fLbl2
TTVLVEntry * ExpressionItem(Int_t index)
Cursor_t fWatchCursor
Definition TTreeViewer.h:92
void AppendTree(TTree *tree)
Bool_t fScanMode
Definition TTreeViewer.h:83
TGPopupMenu * fRunMenu
TGTextEntry * fBarListIn
void SetScanRedirect(Bool_t mode)
TTimer * fTimer
Definition TTreeViewer.h:93
Long64_t Process(const char *filename, Option_t *option="", Long64_t nentries=TTree::kMaxEntries, Long64_t firstentry=0)
Bool_t SwitchTree(Int_t index)
TGCheckButton * fBarScan
void ExecuteDraw()
const TGPicture * fPicRefr
Definition TTreeViewer.h:90
const char * fSourceFile
Definition TTreeViewer.h:77
virtual void Delete(Option_t *)
Delete this object.
TGPopupMenu * fOptions1D
const TGPicture * fPicX
Definition TTreeViewer.h:88
void SetRecordName(const char *name)
TGPictureButton * fDRAW
const char * Cut()
TString fLastOption
Definition TTreeViewer.h:78
TList * fTreeList
Definition TTreeViewer.h:86
const char * fFilename
Definition TTreeViewer.h:76
void RemoveItem()
TGTextEntry * fBarHist
TGLayoutHints * fBarLayout
void SetScanMode(Bool_t mode=kTRUE)
TContextMenu * fContextMenu
Definition TTreeViewer.h:84
void EmptyAll()
TGHorizontalFrame * fHpb
TGPopupMenu * fHelpMenu
TGPictureButton * fBGNext
Int_t fNexpressions
Definition TTreeViewer.h:97
void SetTreeName(const char *treeName)
TGVerticalFrame * fV2
void Empty()
const char * En(Int_t n)
TGLayoutHints * fMenuBarItemLayout
Bool_t fStopMapping
Definition TTreeViewer.h:95
void Message(const char *msg)
void ExecuteCommand(const char *command, Bool_t fast=kFALSE)
void BuildInterface()
void UpdateCombo()
TTree * fTree
Definition TTreeViewer.h:74
const char * GetGrOpt()
TGCompositeFrame * fTreeHdr
TGLabel * fBarLbl3
Int_t Dimension()
Int_t MakeSelector(const char *selector=0)
void SetTree(TTree *tree)
TGDoubleVSlider * fSlider
TTree * fMappedTree
Definition TTreeViewer.h:79
TGVerticalFrame * fV1
const TGPicture * fPicY
Definition TTreeViewer.h:88
void DoRefresh()
const TGPicture * fPicDraw
Definition TTreeViewer.h:89
TGPictureButton * fBGLast
const char * Ex()
TList * ExpressionList()
const TGPicture * fPicStop
Definition TTreeViewer.h:89
void ActivateButtons(Bool_t first, Bool_t previous, Bool_t next, Bool_t last)
void MapTree(TTree *tree, TGListTreeItem *parent=0, Bool_t listIt=kTRUE)
void SetFile()
TGPopupMenu * fOptionsMenu
void RemoveLastRecord()
TGLayoutHints * fMenuBarHelpLayout
Bool_t fVarDraw
Definition TTreeViewer.h:82
TGPictureButton * fBGPrevious
void PrintEntries()
TTVLVContainer * fLVContainer
TGLabel * fLbl1
void SetGrOpt(const char *option)
TGPopupMenu * fOptionsGen
TGLayoutHints * fMenuBarLayout
Definition TTreeViewer.h:99
TGLabel * fBarLbl1
TGPictureButton * fREFR
TGHorizontalFrame * fHf
Bool_t fCounting
Definition TTreeViewer.h:94
TTreeViewer(const TTree *tree)
const char * Ey()
TGToolBar * fToolBar
TGHorizontalFrame * fBFrame
const char * ScanList()
void SetCutMode(Bool_t enabled=kTRUE)
TGPopupMenu * fEditMenu
TBranch * fMappedBranch
Definition TTreeViewer.h:80
Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
TTVSession * fSession
Definition TTreeViewer.h:75
Bool_t IsCutEnabled()
Int_t fDimension
Definition TTreeViewer.h:81
TGCompositeFrame * fListHdr
TGPopupMenu * fFileMenu
TGTextEntry * fBarListOut
TGTextButton * fReset
void ExecuteSpider()
TGPictureButton * fBGRecord
void MapBranch(TBranch *branch, const char *prefix="", TGListTreeItem *parent=0, Bool_t listIt=kTRUE)
void SetScanFileName(const char *name="")
TTree * GetTree()
TGStatusBar * fStatusBar
TGTextButton * fSPIDER
void DoError(int level, const char *location, const char *fmt, va_list va) const
Interface to ErrorHandler (protected).
A TTree represents a columnar dataset.
Definition TTree.h:79
static constexpr Long64_t kMaxEntries
Definition TTree.h:226
const Int_t n
Definition legend1.C:16
Definition first.py:1
Definition tree.py:1