9 from __future__
import print_function
13 ROOT.SetSignalPolicy( ROOT.kSignalFast )
17 'framework.py',
'hsimple.py',
'hsum.py',
'formula1.py',
18 'fillrandom.py',
'fit1.py',
'h1draw.py',
'graph.py',
19 'gerrors.py',
'tornado.py',
'surfaces.py',
'zdemo.py',
20 'geometry.py',
'na49view.py',
'file.py',
21 'ntuple1.py',
'rootmarks.py' ]
24 def bexec( dir, macro, bench ):
25 if ROOT.gROOT.IsBatch():
26 print(
'Processing benchmark: %s\n' % macro)
28 summary = bench.GetPrimitive(
'TPave' )
29 tmacro = summary.GetLineWith( macro )
31 tmacro.SetTextColor( 4 )
35 exec(
open(os.path.join( macrodir, macro )).read(), sys.modules[ __name__ ].__dict__ )
37 summary2 = bench.GetPrimitive(
'TPave' )
38 tmacro2 = summary2.GetLineWith( macro )
40 tmacro2.SetTextColor( 2 )
46 if __name__ ==
'__main__':
48 macrodir = os.path.join(str(ROOT.gROOT.GetTutorialDir()),
'pyroot')
51 bench = ROOT.TCanvas(
'bench',
'Benchmarks Summary', -1000, 50, 200, 500 )
52 summary = ROOT.TPaveText( 0, 0, 1, 1 )
53 summary.SetTextAlign( 12 )
54 summary.SetTextSize( 0.1 )
58 summary.AddText(
' ** %s' % m )
62 bexec( macrodir, m, bench )