10from ROOT
import TCanvas, TPad, TFile, TPaveText
11from ROOT
import gBenchmark, gStyle, gROOT
13c1 =
TCanvas(
'c1',
'The Ntuple canvas',200,10,700,780)
15gBenchmark.Start(
'ntuple1')
20f1 =
TFile(
'py-hsimple.root')
24pad1 =
TPad(
'pad1',
'This is pad1',0.02,0.52,0.48,0.98,21)
25pad2 =
TPad(
'pad2',
'This is pad2',0.52,0.52,0.98,0.98,21)
26pad3 =
TPad(
'pad3',
'This is pad3',0.02,0.02,0.48,0.48,21)
27pad4 =
TPad(
'pad4',
'This is pad4',0.52,0.02,0.98,0.48,1)
37gStyle.SetStatColor(42)
46ntuple = gROOT.FindObject(
'ntuple')
47ntuple.SetLineColor(
"black")
48ntuple.SetFillStyle(1001)
49ntuple.SetFillColor(45)
50ntuple.Draw(
'3*px+2',
'px**2+py**2>1')
51ntuple.SetFillColor(38)
52ntuple.Draw(
'2*px+2',
'pz>2',
'same')
54ntuple.Draw(
'1.3*px+2',
'(px^2+py^2>4) && py>0',
'same')
64ntuple.Draw(
'pz:px>>hprofs',
'',
'goffprofs')
65hprofs = gROOT.FindObject(
'hprofs')
66hprofs.SetMarkerColor(5)
67hprofs.SetMarkerSize(0.7)
68hprofs.SetMarkerStyle(21)
73fpol2 = hprofs.GetFunction(
'pol2')
84ntuple.SetMarkerColor(1)
85ntuple.Draw(
'py:px',
'pz>1')
86ntuple.SetMarkerColor(2)
87ntuple.Draw(
'py:px',
'pz<1',
'same')
93ntuple.Draw(
'pz:py:px',
'(pz<10 && pz>6)+(pz<4 && pz>3)')
94ntuple.SetMarkerColor(4)
95ntuple.Draw(
'pz:py:px',
'pz<6 && pz>4',
'same')
96ntuple.SetMarkerColor(5)
97ntuple.Draw(
'pz:py:px',
'pz<4 && pz>3',
'same')
101l4.AddText(
'You can interactively rotate this view in 2 ways:')
102l4.AddText(
' - With the RotateCube in clicking in this pad')
103l4.AddText(
' - Selecting View with x3d in the View menu')
110gStyle.SetStatColor(19)
111gBenchmark.Show(
'ntuple1')
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
The most important graphics class in the ROOT system.