24 const long long NR = 1E7;
32 GoFTest gof(x.size(), x.data(), y.size(), y.data() );
37 std::cout <<
"KS Test failed with p-value " << pvalue << std::endl;
41 std::cout <<
"KS Test : OK - pvalue = " << pvalue << std::endl;
46 pvalue = gof.AndersonDarling2SamplesTest();
48 std::cout <<
"AD Test failed with p-value " << pvalue << std::endl;
52 std::cout <<
"AD Test : OK - pvalue = " << pvalue << std::endl;
57 int nbin =
TMath::Min(x.size(), y.size() )/1000;
60 h1->FillN(x.size(), x.data(),
nullptr );
63 pvalue = h1->Chi2Test(h2);
65 std::cout <<
"Chi2 Test failed with p-value " << pvalue << std::endl;
70 std::cout <<
"Chi2 Test: OK - pvalue = " << pvalue << std::endl;
87 template <
class R1,
class R2>
91 std::vector<double>
x(
NR);
92 std::vector<double>
y(
NR);
95 for (
int i = 0; i <
NR; ++i)
99 std::cout <<
"time for uniform filled for " <<
typeid(
r1).
name();
103 for (
int i = 0; i <
NR; ++i)
107 std::cout <<
"time for uniform filled for " <<
typeid(
r2).
name();
113 template <
class R1,
class R2>
117 std::vector<double>
x(
NR);
118 std::vector<double>
y(
NR);
121 for (
int i = 0; i <
NR; ++i)
125 std::cout <<
"time for GAUS filled for " <<
typeid(
r1).
name();
129 for (
int i = 0; i <
NR; ++i)
133 std::cout <<
"time for GAUS filled for " <<
typeid(
r2).
name();
142 std::cout <<
"\nTesting MT vs MIXMAX " << std::endl;
155 std::cout <<
"\nTesting MIXMAX vs MIXMAX" << std::endl;
172 #ifdef USE_MIXMAX_DECIMATION
173 std::cout <<
"Info:: Remove MIXMAX decimation " << std::endl;
180 std::cout <<
"testing generating " <<
NR <<
" numbers " << std::endl;
185 if (!ret)
Error(
"testMathRandom",
"Test Failed");
187 std::cout <<
"\nTestMathRandom: OK \n";
193 return (ret) ? 0 : -1;
static void SetSkipNumber(int nskip)
set the number we want to use to skip generation higher value means higher luxury but slower ...
void Print(Option_t *option="") const
Print the real and cpu time passed between the start and stop events.
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
Short_t Min(Short_t a, Short_t b)
static void SetFirstReturnElement(int index)
set initial number to be used in the vector.
void Stop()
Stop the stopwatch.
double normal_cdf(double x, double sigma=1, double x0=0)
Cumulative distribution function of the normal (Gaussian) distribution (lower tail).
virtual void SetLineColor(Color_t lcolor)
virtual void Draw(Option_t *option="")
Draw this histogram with options.
unsigned int r1[N_CITIES]
1-D histogram with a double per channel (see TH1 documentation)}
bool testGauss(R1 &r1, R2 &r2)
bool testCompatibility(const std::vector< double > &x, const std::vector< double > &y, double xmin=0, double xmax=1)
virtual void FillN(Int_t ntimes, const Double_t *x, const Double_t *w, Int_t stride=1)
Fill this histogram with an array x and weights w.
bool testUniform(R1 &r1, R2 &r2)
unsigned int r2[N_CITIES]
void KolmogorovSmirnov2SamplesTest(Double_t &pvalue, Double_t &testStat) const
void Error(ErrorHandler_t func, int code, const char *va_(fmt),...)
Write error message and call a handler, if required.
Documentation for the Random class.