ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
mathcoreCDF.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_math
3 /// Example describing how to use the different cumulative distribution functions in ROOT.
4 /// The macro shows four of them with
5 /// respect to their two variables. In order to run the macro type:
6 ///
7 /// ~~~ {.cpp}
8 /// root [0] .x mathcoreCDF.C
9 /// ~~~
10 ///
11 /// \macro_image
12 /// \macro_code
13 ///
14 /// \author Lorenzo Moneta
15 
16 #include "TSystem.h"
17 #include "TF2.h"
18 #include "TCanvas.h"
19 
20 void mathcoreCDF(){
21 
22  gSystem->Load("libMathCore");
23  TF2 *f1a = new TF2("f1a","ROOT::Math::breitwigner_cdf_c(x, y)",-10,10,0,10);
24  TF2 *f2a = new TF2("f2a","ROOT::Math::cauchy_cdf(x,y)",0,20, 0,20);
25  TF2 *f3a = new TF2("f3a","ROOT::Math::normal_cdf(x,y)",-10,10,0,5);
26  TF2 *f4a = new TF2("f4a","ROOT::Math::exponential_cdf_c(x,y)",0,10,0,5);
27 
28  TCanvas *c1 = new TCanvas("c1","c1",800,650);
29 
30  c1->Divide(2,2);
31  c1->cd(1); f1a->SetLineWidth(1);
32  f1a->Draw("surf1");
33  c1->cd(2); f2a->SetLineWidth(1);
34  f2a->Draw("surf1");
35  c1->cd(3); f3a->SetLineWidth(1);
36  f3a->Draw("surf1");
37  c1->cd(4); f4a->SetLineWidth(1);
38  f4a->Draw("surf1");
39 }
virtual void SetLineWidth(Width_t lwidth)
Definition: TAttLine.h:57
virtual void Draw(Option_t *option="")
Draw this function with its current attributes.
Definition: TF2.cxx:216
TVirtualPad * cd(Int_t subpadnumber=0)
Set current canvas & pad.
Definition: TCanvas.cxx:659
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
Definition: TSystem.cxx:1766
R__EXTERN TSystem * gSystem
Definition: TSystem.h:545
A 2-Dim function with parameters.
Definition: TF2.h:33
The Canvas class.
Definition: TCanvas.h:48
virtual void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0)
Automatic pad generation by division.
Definition: TPad.cxx:1073