PAW to ROOT




PAW to ROOT conversion table

The primarily version of this table was created on 10-May-1998 by David d'Enterria.

PAW

ROOT

Functions
fun/plot sin(x) 100 0. 3.14
fun1 1 sin(x) 100 0. 3.14
TF1 *f1 = new TF1("f1","sin(x)",0,10);
f1->Draw();
(f1->GetHistogram())->Draw();
fun2 10 sin(x)*sin(y) 100 0. 3.14 100 0. 3.14
histo/plot 10 surf4
TF2 *fun2 = new TF2("fun2","sin(x)*sin(y)",0.,3.14,0.,3.14);
fun2->Draw("surf4");
Files
histo/file 10 histos.hbook
histo/file 10 histos.hbook ! N
histo/file 10 histos.hbook ! U
TFile *hfile = new TFile("histos.root");
TFile *hfile = new TFile("histos.root","new");
TFile *hfile = new TFile("histos.root","update");
histo/list 10 hfile.ls(); (or:.ls)
cd //lun10 hfile.cd();
hrout 10 hfile->Write();
close 10 hfile->Close();
Histograms
1-dim
1d/crea 10 'title' nbins xlow xup TH1F *h10 = new TH1F("h10","title",nbins,xlow,xup);
histo/plot 10 h10->Draw();
histo/plot 10 e1,s h10->Draw("e1same");
null xmin xmax ymin ymax
histo/plot 10 s
TH2F *frame = new TH2F("frame","",ncx,xmin,xmax,ncy,ymin,ymax);
frame->Draw();
h10->Draw("same")
histo/op/add 10 11 12 a b TH1F *h12 = new TH1F(*h10);
h12->Add(h10,h11,a,b);
histo/fit 10 chopt (chopt=G/pN/func/myfit.for/...) h10->Fit("opt"); (opt=gaus/pN/myfunc/myfit.C/...)
histo/fit 10(15.:25.) chopt (chopt=G/pN/func/myfit.for/...) h10->Fit("opt","R","",15,25); (opt=gaus/pN/myfunc/myfit.C/...)
loca -i h10->Integral();
histo/del 10 h10->Delete();
2-dim
2d/crea 20 'title' ncx xmin xmax ncy ymin ymax TH2F *h20 = new TH2F("h20","title",ncx,xmin,xmax,ncy,ymin,ymax);
histo/plot 20 chopt (chopt=box/col/cont/...) h20->Draw("opt"); (opt = box/col/cont/...)
min 20 5
max 20 10
h20->SetMinimum(5);
h20->SetMaximum(10);
prox 20
histo/proj 20
histo/plot 20.prox
h20->ProjectionX("Xproj",);
Ntuples - Trees
ntuple/create 100 ' ' 3 ' ' 1024 x y z TTree *t100 = new TTree("t100","Tree 100","z:y:x");
ntuple/print 100 t100->Print();
ntuple/scan 100 t100->Scan();
ntuple/plot 100.x t100->Draw("x");
ntuple/plot 100.x x>0 t100->Draw("x","x>0");
ntuple/plot 100.x ! ! ! ! s t100->Draw("x","","same");
ntuple/plot 100.y%x t100->Draw("y:x");
ntuple/plot 100.z%y%x t100->Draw("z:y:x");
ntuple/plot 100.x*x+y*y t100->Draw("x*x+y*y");
ntuple/proj 10 100.x t100->Draw("x>>h10");
ntuple/uwfnc 100 file.for t100->MakeCode("file.root");
Windows/Graphics - Canvas
(Open HIGZ window) TCanvas *c1 = new TCanvas("c1","title",sizex,sizey);
next c1->Clear();
(Refresh changes in window) c1->Update();
zone 2 2
histo/plot 1
histo/plot 2
histo/plot 3
histo/plot 4
c1 = new TCanvas("c1"," ",200,10,600,480);

TPad pad1("pad1"," ",0.1,0.6,0.6,0.9);
TPad pad2("pad2"," ",0.6,0.9,0.6,0.9);
TPad pad3("pad3"," ",0.1,0.6,0.1,0.4);
TPad pad4("pad4"," ",0.6,0.9,0.1,0.4);

pad1.Draw();
pad1.cd();
h1.Draw();

pad2.Draw();
pad2.cd();
h2.Draw();

pad3.Draw();
pad3.cd();
h3.Draw();

pad4.Draw();
pad4.cd();
h4.Draw();
zone 1 2
histo/plot 1
histo/plot 2
c1->Divide(1,2); // Automatic pad generation by division
c1_1->cd();
h1->Draw();
c1_2->Draw();
c1_2->cd();
h2->Draw();
opt logy
opt liny
c1->SetLogy();
c1->SetLogy(0);
set csiz 0.5 gStyle->SetStatFontSize(0.5);
fortran/file 66 graph.ps (or: graph.eps)
meta -66 -111 (or: -113)
picture/plot
fortran/close 66
c1->Draw();
c1->Print("graph.ps");
or: c1->Print("graph.eps");
(Create "last.kumac") c1->Print("graph.C");
c1->Print("graph.root");
Primitives
text 0.5 0.5 "TEXT" 0.35 45
or:
itx 0.5 0.5 "TEXT"
TText *t1 = new TText(0.5,0.5,"TEXT");
t1->SetTextSize(0.35);
t1->SetTextAngle(45);
t1->Draw();
or:
TText *latex = new TLatex(0.5,0.5,"LaTex")
latex->Draw();
line 0.05 0.05 0.95 0.95 TLine *line1 = new TLine(0.05,0.05,0.95,0.95);
line1->Draw();
arrow 5. 5. 10. 10. 0.3 TArrow *arrow1 = new TArrow(5.,5.,10.,10.,0.03,">");
arrow1->Draw();
Other useful commands
exe macro.kumac .x macro.C
shell (OS command) .! (OS command)
exit .q
ld .ls
cd .pwd()
mdir subdir dir.mkdir("subdir") (dir=gROOT,hfile, ...)
cd dir dir.cd() or:.cd("hfile.root");
cd //PAWC gROOT.cd()
lcdir .which
mess "Welcome" printf("Welcome\n");
(Load a file) .L myfit.C
trace on .s
wait c1.WaitPrimitive();
(PAW++ mode) TBrowser *b = new TBrowser
last.kumac .root_hist
pawlogon.kumac .rootlogon.Ci

PAW/SET to ROOT

Move the mouse over the picture to get the corresponding ROOT command.

P->SetLeftMargin(value); gStyle->SetTitleOffset(value, "y"); gStyle->SetLabelSize(value, "xy"); gStyle->SetLabelOffset(value, "x"); P->SetTopMargin(value); gStyle->SetTitleSize(value, "c"); gStyle->SetTitleY(value) gStyle->SetBarWidth(value); gStyle->SetBarOffset(value); P->SetLeftMargin(value); gStyle->SetHistTopMargin(value); P->SetRightMargin(value); gStyle->SetTickLength(value, "y"); gStyle->SetLabelOffset(value, "y"); P->SetBottomMargin(value); gStyle->SetErrorX(value) gStyle->SetTickLength(value, "x");  gStyle->SetTitleSize(value) gStyle->SetStatY(value) P->SetBottomMargin(value); gStyle->SetPaperSize(x, y) gStyle->SetPaperSize(x, y) gStyle->SetStatFontSize(value) gStyle->SetTitleOffset gStyle->SetTitleSize(value, "xy"); gStyle->SetTitleOffset(value, "x"); gStyle->SetStatX(value)