Example showing the usage of the major special math functions (gamma, beta, erf) in ROOT To execute the macro type in:
It will create one canvas with the representation of the tgamma, lgamma, beta, erf and erfc functions
TF1 *
f1a =
new TF1(
"Gamma(x)",
"ROOT::Math::tgamma(x)",-2,5);
TF1 *
f2a =
new TF1(
"f2a",
"ROOT::Math::lgamma(x)",0,10);
TF2 *
f3a =
new TF2(
"Beta(x)",
"ROOT::Math::beta(x, y)",0,0.1, 0, 0.1);
TF1 *
f4a =
new TF1(
"erf(x)",
"ROOT::Math::erf(x)",0,5);
TF1 *
f4b =
new TF1(
"erfc(x)",
"ROOT::Math::erfc(x)",0,5);
h->GetXaxis()->SetTitleSize(0.06);
h->GetXaxis()->SetTitleOffset(.7);
h->GetXaxis()->SetTitle(
"x");
f2a->GetXaxis()->SetTitle(
"x");
f2a->GetXaxis()->SetTitleSize(0.06);
f2a->GetXaxis()->SetTitleOffset(.7);
f3a->GetXaxis()->SetTitle(
"x");
f3a->GetXaxis()->SetTitleOffset(1.2);
f3a->GetXaxis()->SetTitleSize(0.06);
f3a->GetYaxis()->SetTitle(
"y");
f3a->GetYaxis()->SetTitleSize(0.06);
f3a->GetYaxis()->SetTitleOffset(1.5);
f4a->SetTitle(
"erf(x) and erfc(x)");
f4a->GetXaxis()->SetTitleSize(.06);
f4a->GetXaxis()->SetTitleOffset(.7);
f4a->GetXaxis()->SetTitle(
"x");
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
R__EXTERN TStyle * gStyle
A 2-Dim function with parameters.
1-D histogram with a float per channel (see TH1 documentation)
A Pave (see TPave) with a text centered in the Pave.
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
- Author
- Magdalena Slawinska
Definition in file GammaFun.C.