ROOT
6.14/05
Reference Guide
tutorials
math
mathcoreStatFunc.py
Go to the documentation of this file.
1
## \file
2
## \ingroup tutorial_math
3
## \notebook
4
## Example macro showing some major probability density functions in ROOT.
5
## The macro shows four of them with
6
## respect to their two variables. In order to run the macro type:
7
##
8
## ~~~{.cpp}
9
## root [0] .x mathcoreStatFunc.C
10
## ~~~
11
##
12
## Original tutorial by Andras Zsenei.
13
## \macro_image
14
## \macro_code
15
##
16
## \author Alberto Ferro
17
18
import
ROOT
19
20
21
f1a = ROOT.TF2(
"f1a"
,
"ROOT::Math::cauchy_pdf(x, y)"
,0,10,0,10)
22
f2a = ROOT.TF2(
"f2a"
,
"ROOT::Math::chisquared_pdf(x,y)"
,0,20, 0,20)
23
f3a = ROOT.TF2(
"f3a"
,
"ROOT::Math::gaussian_pdf(x,y)"
,0,10,0,5)
24
f4a = ROOT.TF2(
"f4a"
,
"ROOT::Math::tdistribution_pdf(x,y)"
,0,10,0,5)
25
26
c1 = ROOT.TCanvas(
"c1"
,
"c1"
,800,650)
27
c1.Divide(2,2)
28
c1.cd(1)
29
f1a.SetLineWidth(1)
30
f1a.Draw(
"surf1"
)
31
c1.cd(2)
32
f2a.SetLineWidth(1)
33
f2a.Draw(
"surf1"
)
34
c1.cd(3)
35
f3a.SetLineWidth(1)
36
f3a.Draw(
"surf1"
)
37
c1.cd(4)
38
f4a.SetLineWidth(1)
39
f4a.Draw(
"surf1"
)