PAW |
CINT/ROOT |
|
|
fun/plot sin(x) 100 0. 3.14
histo/plot 12345 |
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"); |
|
|
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 just .ls) |
cd //lun10 | hfile.cd(); |
myfile.cd(); // make sure ROOT's focus is on myfile
TTree * mytree = (TTree*)gDirectory->Get("treeName"); |
|
hrout 10 | hfile->Write(); |
close 10 | hfile->Close(); |
|
|
1-dim: | 1-dim: |
1d/crea 10 'title' nbins xlow xup | TH1F *h10 = new TH1F("h10","title",nbins,xlow,xup); |
histo/plot 10 histo/plot 10(20.:50.) |
h10->Draw(); h10->GetXaxis()->SetRange(20,50) ; h10->Draw(); |
set hcol 5 histo/plot 10 e1,s |
h10.SetLineColor(5) 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 E | TH1F *h12 = new TH1F(*h10);
h12->Sumw2(); h12->Add(h10,h11,a,b); |
histo/op/div 10 11 12 | TH1F *h12 = new TH1F(*h10);
h12->Divide(h10,h11,1,1); |
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(bin1,bin2); |
histo/del 10 | h10->Delete(); |
2-dim: | 2-dim: |
2d/crea 20 'title' ncx xmin xmax ncy ymin ymax | TH2F *h20 = new TH2F("h20","title",ncx,xmin,xmax,ncy,ymin,ymax); |
set hcol 5 histo/plot 20 chopt (chopt=box/col/cont/...) |
h20.SetMarkerColor(5) h20->Draw("opt"); (opt = box/col/cont/...) |
min 20 5
max 20 10 |
h20->SetMinimum(5);
h20->SetMaximum(10); |
histo/proj 20
histo/plot 20.prox |
h20->ProjectionX("Xproj",); |
|
|
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"); // (old)
t100->MakeClass("file.root"); // (old) t100->MakeSelector("file.root"); // (old) |
|
|
(Open HIGZ window) | TCanvas *c1 = new TCanvas("c1","title",sizex,sizey); |
next | c1->Clear(); |
(Refresh changes in window) | c1->Update(); |
zone 1 2
histo/plot 1 histo/plot 2 |
c1->Divide(1,2);
c1_1->Draw(); c1_1->cd(); h1->Draw(); c1_2->Draw(); c1_2->cd(); h2->Draw(); |
zone 2 2
histo/plot 1 histo/plot 2 histo/plot 3 histo/plot 4 |
c1->Divide(2,2);
c1_1->Draw(); c1_1->cd(); h1->Draw(); c1_2->Draw(); c1_2->cd(); h2->Draw(); c1_3->Draw(); c1_3->cd(); h3->Draw(); c1_4->Draw(); c1_4->cd(); h4->Draw(); |
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(); |
opt logy
opt liny |
c1->SetLogy();
c1->SetLogy(0); |
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"); |
c1->Print("graph.C");
c1->Print("graph.root"); |
|
|
|
text 0.5 0.5 "TEXT" 0.35 45 | TText *t1 = new TText(0.5,0.5,"TEXT");
t1->SetTextSize(0.35); t1->SetTextAngle(45); t1->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(); |
|
|
exec macro.kumac | .x macro.C |
shell (command) | .! (command) |
exit | .q |
ldir | .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 | getchar(); |
(PAW++ mode) | TBrowser *b = new TBrowser |
last.kumac | .root_hist |
pawlogon.kumac | rootlogon.C |