Run benchmarks macros.
2 from __future__
import print_function
6 ROOT.SetSignalPolicy( ROOT.kSignalFast )
10 'framework.py',
'hsimple.py',
'hsum.py',
'formula1.py',
11 'fillrandom.py',
'fit1.py',
'h1draw.py',
'graph.py',
12 'gerrors.py',
'tornado.py',
'surfaces.py',
'zdemo.py',
13 'geometry.py',
'na49view.py',
'file.py',
14 'ntuple1.py',
'rootmarks.py' ]
17 def bexec( dir, macro, bench ):
18 if ROOT.gROOT.IsBatch():
19 print(
'Processing benchmark: %s\n' % macro)
21 summary = bench.GetPrimitive(
'TPave' )
22 tmacro = summary.GetLineWith( macro )
24 tmacro.SetTextColor( 4 )
28 exec(
open(os.path.join( macrodir, macro )).
read(), sys.modules[ __name__ ].__dict__ )
30 summary2 = bench.GetPrimitive(
'TPave' )
31 tmacro2 = summary2.GetLineWith( macro )
33 tmacro2.SetTextColor( 2 )
39 if __name__ ==
'__main__':
41 macrodir = os.path.join(ROOT.gROOT.GetTutorialsDir(),
'pyroot')
44 bench = ROOT.TCanvas(
'bench',
'Benchmarks Summary', -1000, 50, 200, 500 )
45 summary = ROOT.TPaveText( 0, 0, 1, 1 )
46 summary.SetTextAlign( 12 )
47 summary.SetTextSize( 0.1 )
51 summary.AddText(
' ** %s' % m )
55 bexec( macrodir, m, bench )
- Author
- Wim Lavrijsen
Definition in file benchmarks.py.