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
void GammaFun() {
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);
TCanvas *c1 =
new TCanvas(
"c1",
"Gamma and related functions",800,700);
TH1F * h =
new TH1F(
"htmp",
"",500,-2,5);
}
- Author
- Magdalena Slawinska
Definition in file GammaFun.C.