Logo ROOT   6.14/05
Reference Guide
benchmarks.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup Tutorials
3 /// This macro run several tests and produces an benchmark report.
4 ///
5 /// \macro_image
6 /// \macro_output
7 /// \macro_code
8 ///
9 /// \author Rene Brun
10 
11 TCanvas* bench1 = 0;
12 
13 void bexec(TString &dir,const char *macro)
14 {
15  if (gROOT->IsBatch()) printf("Processing benchmark: %s%s\n",dir.Data(),macro);
16  TPaveText *summary = (TPaveText*)bench1->GetPrimitive("TPave");
17  TText *tmacro = summary->GetLineWith(macro);
18  if (tmacro) tmacro->SetTextColor(4);
19  bench1->Modified(); bench1->Update();
20 
21  gROOT->Macro(Form("%s%s",dir.Data(),macro));
22 
23  TPaveText *summary2 = (TPaveText*)bench1->GetPrimitive("TPave");
24  TText *tmacro2 = summary2->GetLineWith(macro);
25  if (tmacro2) tmacro2->SetTextColor(2);
26  bench1->Modified(); bench1->Update(); gSystem->ProcessEvents();
27 
28 }
29 
30 void benchmarks() {
31  TString dir = gSystem->UnixPathName(__FILE__);
32  dir.ReplaceAll("benchmarks.C","");
33  dir.ReplaceAll("/./","/");
34  bench1 = new TCanvas("bench1","Benchmarks Summary",-1000,50,200,500);
35  TPaveText *summary = new TPaveText(0,0,1,1);
36  summary->SetTextAlign(12);
37  summary->SetTextSize(0.08);
38  summary->Draw();
39  summary->AddText(" graphics/framework.C");
40  summary->AddText(" hsimple.C");
41  summary->AddText(" hist/hsum.C");
42  summary->AddText(" graphics/formula1.C");
43  summary->AddText(" hist/fillrandom.C");
44  summary->AddText(" fit/fit1.C");
45  summary->AddText(" hist/h1draw.C");
46  summary->AddText(" graphs/graph.C");
47  summary->AddText(" graphs/gerrors.C");
48  summary->AddText(" graphics/tornado.C");
49  summary->AddText(" graphs/surfaces.C");
50  summary->AddText(" graphs/zdemo.C");
51  summary->AddText(" geom/geometry.C");
52  summary->AddText(" geom/na49view.C");
53  summary->AddText(" tree/ntuple1.C");
54  summary->AddText(" ");
55  bexec(dir,"graphics/framework.C");
56  bexec(dir,"hsimple.C");
57  bexec(dir,"hist/hsum.C");
58  bexec(dir,"graphics/formula1.C");
59  bexec(dir,"hist/fillrandom.C");
60  bexec(dir,"fit/fit1.C");
61  bexec(dir,"hist/h1draw.C");
62  bexec(dir,"graphs/graph.C");
63  bexec(dir,"graphs/gerrors.C");
64  bexec(dir,"graphics/tornado.C");
65  bexec(dir,"graphs/surfaces.C");
66  bexec(dir,"graphs/zdemo.C");
67  bexec(dir,"geom/geometry.C");
68  bexec(dir,"geom/na49view.C");
69  bexec(dir,"tree/ntuple1.C");
70  bexec(dir,"rootmarks.C");
71 }
virtual Bool_t ProcessEvents()
Process pending events (GUI, timers, sockets).
Definition: TSystem.cxx:424
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
Definition: TPaveText.cxx:233
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:687
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
Definition: TPaveText.cxx:182
#define gROOT
Definition: TROOT.h:410
Basic string class.
Definition: TString.h:131
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
Definition: TSystem.cxx:1044
Base class for several text objects.
Definition: TText.h:23
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition: TAttText.h:41
virtual TText * GetLineWith(const char *text) const
Get Pointer to first containing string text in this pavetext.
Definition: TPaveText.cxx:289
R__EXTERN TSystem * gSystem
Definition: TSystem.h:540
virtual TObject * GetPrimitive(const char *name) const
Get primitive.
Definition: TPad.cxx:2847
char * Form(const char *fmt,...)
The Canvas class.
Definition: TCanvas.h:31
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:21
virtual void SetTextColor(Color_t tcolor=1)
Set the text color.
Definition: TAttText.h:43
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition: TAttText.h:46
virtual void Update()
Update canvas pad buffers.
Definition: TCanvas.cxx:2248
void Modified(Bool_t flag=1)
Definition: TPad.h:414
const char * Data() const
Definition: TString.h:364