Logo ROOT  
Reference Guide
Go to the documentation of this file.
1 /// \file
2 /// \ingroup Tutorials
3 /// This macro shows a control bar to run some of the ROOT tutorials.
4 /// To execute an item, click with the left mouse button.
5 ///
6 /// \macro_code
7 ///
8 /// \author Rene Brun
10 void demos() {
12  //Add the tutorials directory to the macro path
13  //This is necessary in case this macro is executed from another user directory
14  TString dirName = gSystem->UnixPathName(__FILE__);
15  dirName.ReplaceAll("demos.C","");
16  dirName.ReplaceAll("/./","");
17  const char *current = gROOT->GetMacroPath();
18  gROOT->SetMacroPath(Form("%s:%s",current,dirName.Data()));
20  TControlBar *bar = new TControlBar("vertical", "Demos",10,10);
21  bar->AddButton("Help Demos",".x demoshelp.C", "Click Here For Help on Running the Demos");
22  bar->AddButton("browser", "new TBrowser;", "Start the ROOT Browser");
23  bar->AddButton("framework", ".x graphics/framework.C","An Example of Object Oriented User Interface");
24  bar->AddButton("first", ".x graphics/first.C", "An Example of Slide with Root");
25  bar->AddButton("hsimple", ".x hsimple.C", "An Example Creating Histograms/Ntuples on File");
26  bar->AddButton("hsum", ".x hist/hsum.C", "Filling Histograms and Some Graphics Options");
27  bar->AddButton("formula1", ".x graphics/formula1.C","Simple Formula and Functions");
28  bar->AddButton("surfaces", ".x graphs/surfaces.C", "Surface Drawing Options");
29  bar->AddButton("fillrandom",".x hist/fillrandom.C", "Histograms with Random Numbers from a Function");
30  bar->AddButton("fit1", ".x fit/fit1.C", "A Simple Fitting Example");
31  bar->AddButton("multifit", ".x fit/multifit.C", "Fitting in Subranges of Histograms");
32  bar->AddButton("h1draw", ".x hist/h1draw.C", "Drawing Options for 1D Histograms");
33  bar->AddButton("graph", ".x graphs/graph.C", "Example of a Simple Graph");
34  bar->AddButton("gerrors", ".x graphs/gerrors.C", "Example of a Graph with Error Bars");
35  bar->AddButton("tornado", ".x graphics/tornado.C", "Examples of 3-D PolyMarkers");
36  bar->AddButton("shapes", ".x geom/shapes.C", "The Geometry Shapes");
37  bar->AddButton("geometry", ".x geom/geometry.C", "Creation of the NA49 Geometry File");
38  bar->AddButton("na49view", ".x geom/na49view.C", "Two Views of the NA49 Detector Geometry");
39  bar->AddButton("file", ".x io/file.C", "The ROOT File Format");
40  bar->AddButton("fildir", ".x io/fildir.C", "The ROOT File, Directories and Keys");
41  bar->AddButton("tree", ".x tree/tree.C", "The Tree Data Structure");
42  bar->AddButton("ntuple1", ".x tree/ntuple1.C", "Ntuples and Selections");
43  bar->AddButton("rootmarks", ".x rootmarks.C", "Prints an Estimated ROOTMARKS for Your Machine");
44  bar->SetButtonWidth(90);
45  bar->Show();
46  gROOT->SaveContext();
47 }
const char * Data() const
Definition: TString.h:369
char * Form(const char *fmt,...)
Definition: TString.h:136
static constexpr double bar
Definition: TGeant4SystemOfUnits.h:227
Definition: TControlBar.h:26
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Definition: TSystem.cxx:1061
#define gROOT
Definition: TROOT.h:406