Logo ROOT   6.12/06
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Namespaces
mathcoreStatFunc.py File Reference

Namespaces

 mathcoreStatFunc
 

Detailed Description

Example macro showing some major probability density functions in ROOT.

The macro shows four of them with respect to their two variables. In order to run the macro type:

root [0] .x mathcoreStatFunc.C

Original tutorial by Andras Zsenei.

pict1_mathcoreStatFunc.py.png
1 
2 import ROOT
3 
4 
5 f1a = ROOT.TF2("f1a","ROOT::Math::cauchy_pdf(x, y)",0,10,0,10)
6 f2a = ROOT.TF2("f2a","ROOT::Math::chisquared_pdf(x,y)",0,20, 0,20)
7 f3a = ROOT.TF2("f3a","ROOT::Math::gaussian_pdf(x,y)",0,10,0,5)
8 f4a = ROOT.TF2("f4a","ROOT::Math::tdistribution_pdf(x,y)",0,10,0,5)
9 
10 c1 = ROOT.TCanvas("c1","c1",800,650)
11 c1.Divide(2,2)
12 c1.cd(1)
13 f1a.SetLineWidth(1)
14 f1a.Draw("surf1")
15 c1.cd(2)
16 f2a.SetLineWidth(1)
17 f2a.Draw("surf1")
18 c1.cd(3)
19 f3a.SetLineWidth(1)
20 f3a.Draw("surf1")
21 c1.cd(4)
22 f4a.SetLineWidth(1)
23 f4a.Draw("surf1")
Author
Alberto Ferro

Definition in file mathcoreStatFunc.py.