Logo ROOT  
Reference Guide
mathcoreCDF.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_math
3/// \notebook
4/// Example describing how to use the different cumulative distribution 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 mathcoreCDF.C
10/// ~~~
11///
12/// \macro_image
13/// \macro_code
14///
15/// \author Lorenzo Moneta
16
17#include "TSystem.h"
18#include "TF2.h"
19#include "TCanvas.h"
20
21void mathcoreCDF(){
22
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)
Set the line width.
Definition: TAttLine.h:43
The Canvas class.
Definition: TCanvas.h:23
A 2-Dim function with parameters.
Definition: TF2.h:29
void Draw(Option_t *option="") override
Draw this function with its current attributes.
Definition: TF2.cxx:260
return c1
Definition: legend1.C:41