LCG AA Meeting 31 October 2007 The new dynamically and extensively customizable ROOT browser...
-
Upload
sheena-hall -
Category
Documents
-
view
213 -
download
0
description
Transcript of LCG AA Meeting 31 October 2007 The new dynamically and extensively customizable ROOT browser...
LCGLCG LCG AA Meeting 31 October 2007
The new dynamically and The new dynamically and extensively customizable ROOT extensively customizable ROOT
browser browser Bertrand Bellenot
2LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
From this…From this…
3LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
To thisTo this
4LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
OverviewOverview• Features
• New layout• Plug-in management• Available (built-in) plug-ins
• File browser• Canvas• Text editor• Command redirection• HTML browser• …
5LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
New LayoutNew LayoutThe new browser has three main tabs, separated by horizontal and vertical splitters:
Tab 0
(left)
Tab 1 (right)
Tab 2 (bottom)
SplitterSplitter
6LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
Plug-in ManagementPlug-in ManagementEach Tab can be populated with plug-ins. A plug-in can be a macro or a command,as shown below:Example 1 - create a browser and execute a macro as plugin:
Tbrowser b;b.ExecPlugin("MyPlugin", "MyMacro.C");
In this example, the macro “MyMacro.C” creates a TGMainFrame, which will beembedded at the default location (righ tab), creating a new tab element called“MyPlugin”. To be able to use a macro as plug-in, it must create a TGMainFrame, passing“gClient->GetRoot()” as parent window in its constructor, i.e.:
fMain = new TGMainFrame(gClient->GetRoot(), 300, 150);
7LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
Plug-in Management (cont)Plug-in Management (cont)Example of plug-in using the macro Slider3Demo from ROOT tutorials
b.ExecPlugin(0, "gui/Slider3Demo.C");
8LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
Plug-in Management (cont)Plug-in Management (cont)Example 2 - create a browser and execute a command as plug-in:
Tbrowser b;b.ExecPlugin("Canvas", 0, "new TCanvas()");
In this example, the TCanvas will be embedded at the default location (right tab),
creating a new tab element called “Canvas”. This can be achieved with any class creating (or inheriting from) a
TGMainFrame.The only requirement is to pass gClient->GetRoot() as parent in the
constructor,as shown previously.
Plug-in execution is also available from the “Browser” menu:
9LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
Available (built-in) Plug-insAvailable (built-in) Plug-insThere are several plug-ins already available in ROOT. They are:• File browser (TGFileBrowser). This is the core of the new browser,
allowing to browse system directories and ROOT files and execute macros, as in the old browser.
• Text editor (TGTextEditor) allowing to edit, execute and compile macros. Double-clicking on a macro file in the file browser while the active tab contains a text editor will open the macro in the editor.
• Canvas (TCanvas). Double-clicking on a graphic object inside a ROOT file will display the histogram in the canvas.
• Command (I/O) redirection (TGCommandPlugin). This plug-in creates a combo box (populated with root command history) to enter interpreter commands (stdin), and a text view displaying the output (stdout/stderr).
• HTML browser (TGHtmlBrowser), allowing to browse web pages and to open remote ROOT files (via http protocol).
• Proof (TSessionViewer), allowing to manage Proof and local sessions• GL Viewer, ROOT’s OpenGL viewer.
10LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
Available (built-in) Plug-ins Available (built-in) Plug-ins (cont)(cont)
The built-in plug-ins to be loaded by the browser at creation time are specified inthe ROOT configuration file (system.rootrc or .rootrc)In this file, user can also specify which browser has to be used:
Browser.Name: TRootBrowserLite# Browser Options (plugins)# F: File browser E: Text Editor H: HTML browser # C: Canvas I: I/O redirection P: Proof G: GL viewerBrowser.Options: FECI
Browser.Name: specify the browser real implementation, TRootBrowser being the new browser and TRootBrowserLite being the old one
Browser.Options: plug-ins to be included at browser startup time.It is also possible to specify (overwrite) the plug-ins option in the
TBrowser constructor, i.e.
new TBrowser("Browser", "ROOT Browser", 0, "FEHCI");
11LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
ExamplesExamplesFile browser, canvas and command plug-ins:
12LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
Examples (cont)Examples (cont)File browser, editor and command plug-ins:
13LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
Examples (cont)Examples (cont)File browser, HTML and command plug-ins:
14LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
Examples (cont)Examples (cont)File browser, HTML and command plug-ins, browsing ROOT file via
http:
15LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
Real Application ExampleReal Application ExampleAlice Event Viewer(thanks to Matevz Tadel)
16LCGLCGBertrand Bellenot LCG AA Meeting 31 October 2007
ConclusionsConclusions• The new browser provides a fully and dynamically
configurable interface.• It uses a dynamic plug-in mechanism to reduce the code
size and to extend its functionality.• Any kind of user defined plug-in can be added without
too much effort from the user side.• Already available in svn trunk (ROOT v5.17.05)
Users feedback is welcome!