18 const double MIN = -2.5;
19 const double MAX = +2.5;
23 bool showGraphics =
false;
40 vector<Double_t>
x( ARRAYSIZE );
41 vector<Double_t> yb( ARRAYSIZE );
42 vector<Double_t> ymb( ARRAYSIZE );
47 TGraph *gb =
nullptr, *gmb =
nullptr;
51 hpx =
new TH2F(
"hpx",
"BetaFunction(p,b)", ARRAYSIZE, MIN, MAX, ARRAYSIZE, 0, 5);
56 for (
double b = 0.9; b < 2; b+=0.4)
58 cout <<
"** b = " << b <<
" **" << endl;
59 unsigned int index = 0;
63 cout <<
"i:"; cout.width(5); cout << i
64 <<
" index: "; cout.width(5); cout << index
65 <<
" TMath::Beta(p,b): "; cout.width(10); cout <<
TMath::Beta(i,b)
72 if (
std::fabs( yb[index] - ymb[index] ) > ERRORLIMIT )
76 <<
" yb[index] " << yb[index]
77 <<
" ymb[index] " << ymb[index]
78 <<
" " <<
std::fabs( yb[index] - ymb[index] )
92 legend->
AddEntry(gb,
"TMath::Beta()");
93 legend->
AddEntry(gmb,
"ROOT::Math::beta()");
99 cout <<
"Test Done!" << endl;
104 int main(
int argc,
char **argv)
107 for (
Int_t i=1 ; i<argc ; i++) {
108 std::string arg = argv[i] ;
117 cerr <<
"Usage: " << argv[0] <<
" [-g] [-v]\n";
119 cerr <<
" -g : graphics mode\n";
120 cerr <<
" -v : verbose mode";
virtual void SetLineWidth(Width_t lwidth)
This class displays a legend box (TPaveText) containing several legend entries.
virtual void Draw(Option_t *option="")
Draw this legend with its current attributes.
int main(int argc, char **argv)
virtual void Draw(Option_t *chopt="")
Draw this graph with its current attributes.
double beta(double x, double y)
Calculates the beta function.
virtual void Run(Bool_t retrn=kFALSE)
Main application eventloop. Calls system dependent eventloop via gSystem.
TGraph * drawPoints(Double_t x[], Double_t y[], int color, int style=1)
virtual void SetLineColor(Color_t lcolor)
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
2-D histogram with a float per channel (see TH1 documentation)}
Double_t Beta(Double_t p, Double_t q)
Calculates Beta-function Gamma(p)*Gamma(q)/Gamma(p+q).
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
virtual void SetLineStyle(Style_t lstyle)
A Graph is a graphics object made of two arrays X and Y with npoints each.
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.