Logo ROOT   6.10/09
Reference Guide
stressGoFTest.cxx
Go to the documentation of this file.
1 #include "TBenchmark.h"
2 #include "Math/GoFTest.h"
3 #include "Math/Functor.h"
4 #include "TROOT.h"
5 #include "TSystem.h"
6 #include "TStopwatch.h"
7 
8 #ifdef R__HAS_MATHMORE
9 #include "Math/GSLRndmEngines.h"
10 #include "Math/Random.h"
11 #endif
12 
13 #include "TRandom3.h"
14 
15 #include <iostream>
16 
17 #include <cassert>
18 
19 /*N.B.: The tests' expected values (expectedDn and expectedA2) were computed on Pcphsft54.cern.ch i386 GNU/Linux computer (slc4_ia32_gcc34)
20 
21  LM. (16/9/14) Expected values for AD2 test have been computed with R kSamples package
22 */
23 struct GoFTStress {
24 
25  static enum EDebugLevelTypes {
26  kNoDebug, // no test results printing
27  kBasicDebug, // prints either "OK" or "FAIL" test results
28  kStandardDebug, // prints summarized test results
29  } fgDebugLevel;
30 
31  Int_t RunTests() {
32  Int_t result = 0;
33  result += UnitTest1();
34  result += UnitTest2();
35  result += UnitTest3();
36  result += UnitTest4();
37  result += UnitTest5();
38  result += UnitTest6();
39  result += UnitTest7();
40  return result;
41  }
42 
43  void PrintBenchmark() {
44  if (fgDebugLevel == kNoDebug) {
45  return;
46  }
47 
48  //Print table with results
49  Bool_t UNIX = strcmp(gSystem->GetName(), "Unix") == 0;
50  printf("******************************************************************\n");
51  if (UNIX) {
52  TString sp = gSystem->GetFromPipe("uname -a");
53  sp.Resize(60);
54  printf("* SYS: %s\n",sp.Data());
55  if (strstr(gSystem->GetBuildNode(),"Linux")) {
56  sp = gSystem->GetFromPipe("lsb_release -d -s");
57  printf("* SYS: %s\n",sp.Data());
58  }
59  if (strstr(gSystem->GetBuildNode(),"Darwin")) {
60  sp = gSystem->GetFromPipe("sw_vers -productVersion");
61  sp += " Mac OS X ";
62  printf("* SYS: %s\n",sp.Data());
63  }
64  } else {
65  const Char_t *os = gSystem->Getenv("OS");
66  if (!os) {
67  printf("* SYS: Windows 95\n");
68  } else {
69  printf("* SYS: %s %s \n",os,gSystem->Getenv("PROCESSOR_IDENTIFIER"));
70  }
71  }
72 
73  printf("*****************************************************************************************\n");
74  gBenchmark->Print("GoFTestStress");
75 #ifdef __CINT__
76  Double_t reftime = 0.02 ; // slc4rabacal interpreted (CPU time taken to run complete tests with ACLiC)
77 #else
78  Double_t reftime = 0.04; // slc4rabacal compiled (CPU time taken to run complete tests)
79 #endif
80 
81  Double_t rootmarks = 800. * reftime / gBenchmark->GetCpuTime("GoFTestStress");
82 
83  printf("*****************************************************************************************\n");
84  printf("* ROOTMARKS = %6.1f * Root%-8s %d/%d\n", rootmarks, gROOT->GetVersion(),
85  gROOT->GetVersionDate(),gROOT->GetVersionTime());
86  printf("*****************************************************************************************\n");
87  }
88 
89  private:
90 
91  Int_t UnitTest1() {
92  std::cout << "UNIT TEST 1" << std::endl;
93 
94  UInt_t nsmps = 2;
95  const UInt_t smpSize1 = 71;
96  const UInt_t smpSize2 = 135;
97  /*
98  Data set adapted from the paper (1)
99  "K-Sample Anderson-Darling Tests of Fit for continuous and discrete cases" by Scholz and Stephens
100  values of expected A2 taken by running R kSamples code
101  */
102  const Double_t smp1[smpSize1] = {194, 15, 41, 29, 33, 181, 413, 14, 58, 37, 100, 65, 9, 169, 447, 18, 4, 36, 201, 118, 34, 31, 18, 18, 67, 57, 62, 7, 22, 34, 90, 10, 60, 186, 61, 49, 14, 24, 56, 20, 79, 84, 44, 59, 29, 118, 25, 156, 310, 76, 26, 44, 23, 62, 130, 208, 70, 101, 208, 74, 57, 48, 29, 502, 12, 70, 21, 29, 386, 59, 27};
103 
104  const Double_t smp2[smpSize2] = {55, 320, 56, 104, 220, 239, 47, 246, 176, 182, 33, 23, 261, 87, 7, 120, 14, 62, 47, 225, 71, 246, 21, 42, 20, 5, 12, 120, 11, 3, 14, 71, 11, 14, 11, 16, 90, 1, 16, 52, 95, 97, 51, 11, 4, 141, 18, 142, 68, 77, 80, 1, 16, 106, 206, 82, 54, 31, 216, 46, 111, 39, 63, 18, 191, 18, 163, 24, 50, 44, 102, 72, 22, 39, 3, 15, 197, 188, 79, 88, 46, 5, 5, 36, 22, 139, 210, 97, 30, 23, 13, 14, 359, 9, 12, 270, 603, 3, 104, 2, 438, 50, 254, 5, 283, 35, 12, 487, 18, 100, 7, 98, 5, 85, 91, 43, 230, 3, 130, 102, 209, 14, 57, 54, 32, 67, 59, 134, 152, 27, 14, 230, 66, 61, 34};
105 
106  ROOT::Math::GoFTest* goft = new ROOT::Math::GoFTest( smpSize1, smp1, smpSize2, smp2 );
107 
108  Double_t A2 = goft->AndersonDarling2SamplesTest("t"); // standartized A2_akN
109  // Double_t pvalueAD = goft->AndersonDarling2SamplesTest();
110  Double_t pvalueAD = (*goft)(ROOT::Math::GoFTest::kAD2s);
111 
112  Double_t expectedA2_akN = 1.5686 ; // A2_akN in (1)
113 
114  Double_t sigmaN = 0.754539; // sigmaN in (1)
115 
116  Double_t zScore = 0.75360; // zScore in (1)
117 
118  Int_t result = PrintResultAD2Samples(nsmps, A2, expectedA2_akN, sigmaN, zScore, pvalueAD);
119 
120  // Double_t Dn = goft->KolmogorovSmirnov2SamplesTest("t"); // standartized A2_akN
121  Double_t Dn = (*goft)(ROOT::Math::GoFTest::kKS2s, "t");
122  Double_t pvalueKS = goft->KolmogorovSmirnov2SamplesTest();
123 
124  Double_t expectedDn = 0.139176;
125 
126  result += PrintResultKS(nsmps, Dn, expectedDn, pvalueKS);
127 
128  delete goft;
129  return result;
130  }
131 
132  Int_t UnitTest2() {
133  std::cout << "UNIT TEST 2" << std::endl;
134 
135  const UInt_t nsmps = 2;
136  const UInt_t smpSize = 16;
137  /*
138  Data sets adapted from the paper (1)
139  "K-Sample Anderson-Darling Tests of Fit for continuous and discrete cases" by Scholz and Stephens
140  */
141  const Double_t smp1[smpSize] = {38.7, 41.5, 43.8, 44.5, 45.5, 46.0, 47.7, 58.0, 39.2, 39.3, 39.7, 41.4, 41.8, 42.9, 43.3, 45.8};
142  const Double_t smp2[smpSize] = {34.0, 35.0, 39.0, 40.0, 43.0, 43.0, 44.0, 45.0, 34.0, 34.8, 34.8, 35.4, 37.2, 37.8, 41.2, 42.8};
143 
144  ROOT::Math::GoFTest* goft = new ROOT::Math::GoFTest( smpSize, smp1, smpSize, smp2 );
145 
146  // Double_t A2 = goft->AndersonDarling2SamplesTest("t"); // standartized A2_akN
147  Double_t A2 = (*goft)(ROOT::Math::GoFTest::kAD2s, "t");
148  Double_t pvalueAD = goft->AndersonDarling2SamplesTest();
149 
150  Double_t expectedA2_akN = 4.5516; // unstandardized A2_akN in (1) (values verified and obtained with R kSamples )
151 
152  Double_t sigmaN = 0.71939; // sigmaN in (1)
153 
154  Double_t zScore = 4.9369; // zScore in (1) (version 1)
155 
156  Int_t result = PrintResultAD2Samples(nsmps, A2, expectedA2_akN, sigmaN, zScore, pvalueAD);
157 
158  Double_t Dn = goft->KolmogorovSmirnov2SamplesTest("t"); // standartized A2_akN
159  // Double_t pvalueKS = goft->KolmogorovSmirnov2SamplesTest();
160  Double_t pvalueKS = (*goft)(ROOT::Math::GoFTest::kKS2s);
161 
162  Double_t expectedDn = 0.5;
163 
164  result += PrintResultKS(nsmps, Dn, expectedDn, pvalueKS);
165 
166  delete goft;
167  return result;
168  }
169 
170  Int_t UnitTest3() {
171  std::cout << "UNIT TEST 3" << std::endl;
172 
173 #ifndef R__HAS_MATHMORE
174  std::cout << "SKIPPED (Mathmore is not present) " << std::endl;
175  return 0;
176 #else
177 
178  UInt_t nEvents = 1000;
179  UInt_t nsmps = 1;
180 
182 
183  Double_t* sample = new Double_t[nEvents];
184 
185  for (UInt_t i = 0; i < nEvents; ++i) {
186  Double_t data = r.LogNormal(5.0, 2.0);
187  sample[i] = data;
188  assert(sample[i] == data);
189  }
190 
192 
193  if (GoFTStress::fgDebugLevel == GoFTStress::kStandardDebug)
194  std::cout << "LogNormal fitting" << std::endl;
195 
196  // Double_t A2 = goft->AndersonDarlingTest("t");
197  Double_t A2 = goft->operator()(ROOT::Math::GoFTest::kAD, "t");
198  Double_t pvalueAD = goft->AndersonDarlingTest();
199 
200  Double_t expectedA2 = 0.422771;
201 
202  Int_t result = PrintResultAD1Sample(A2, expectedA2, pvalueAD);
203 
204  Double_t Dn = goft->KolmogorovSmirnovTest("t");
205  // Double_t pvalueKS = goft->KolmogorovSmirnovTest();
206  Double_t pvalueKS = goft->operator()(ROOT::Math::GoFTest::kKS);
207 
208  Double_t expectedDn = 0.0204916;
209 
210  result += PrintResultKS(nsmps, Dn, expectedDn, pvalueKS);
211 
212  delete goft;
213  return result;
214 #endif
215  }
216 
217  Int_t UnitTest4() {
218  std::cout << "UNIT TEST 4" << std::endl;
219 
220  UInt_t nEvents = 1000;
221  UInt_t nsmps = 1;
222 
223  TRandom3 r;
224 
225  Double_t* sample = new Double_t[nEvents];
226 
227  for (UInt_t i = 0; i < nEvents; ++i) {
228  Double_t data = r.Exp(1.54);
229  sample[i] = data;
230  assert(sample[i] == data);
231  }
232 
234 
235  if (GoFTStress::fgDebugLevel == GoFTStress::kStandardDebug)
236  std::cout << "**Exponential fitting**" << std::endl;
237 
238  Double_t A2 = goft->AndersonDarlingTest("t");
239  // Double_t pvalueAD = goft->AndersonDarlingTest();
240  Double_t pvalueAD = goft->operator()();
241 
242  Double_t expectedA2 = 0.521153;
243 
244  Int_t result = PrintResultAD1Sample(A2, expectedA2, pvalueAD);
245 
246  // Double_t Dn = goft->KolmogorovSmirnovTest("t");
247  Double_t Dn = goft->operator()(ROOT::Math::GoFTest::kKS, "t");
248  Double_t pvalueKS = goft->KolmogorovSmirnovTest();
249 
250  Double_t expectedDn = 0.0218148;
251 
252  result += PrintResultKS(nsmps, Dn, expectedDn, pvalueKS);
253 
254  delete goft;
255  return result;
256  }
257 
258  Int_t UnitTest5() {
259  std::cout << "UNIT TEST 5" << std::endl;
260 
261  UInt_t nEvents = 1000;
262  UInt_t nsmps = 1;
263 
264  TRandom3 r;
265 
266  Double_t* sample = new Double_t[nEvents];
267 
268  for (UInt_t i = 0; i < nEvents; ++i) {
269  Double_t data = r.Gaus(300, 50);
270  sample[i] = data;
271  assert(sample[i] == data);
272  }
273 
274  ROOT::Math::GoFTest* goft = new ROOT::Math::GoFTest(nEvents, sample);
276 
277  if (GoFTStress::fgDebugLevel == GoFTStress::kStandardDebug)
278  std::cout << "**Gaussian fitting**" << std::endl;
279 
280  Double_t A2 = goft->AndersonDarlingTest("t");
281  Double_t pvalueAD = goft->AndersonDarlingTest();
282 
283  Double_t expectedA2 = 0.441755;
284 
285  Int_t result = PrintResultAD1Sample(A2, expectedA2, pvalueAD);
286 
287  Double_t Dn = goft->KolmogorovSmirnovTest("t");
288  Double_t pvalueKS = goft->KolmogorovSmirnovTest();
289 
290  Double_t expectedDn = 0.0282508;
291 
292  result += PrintResultKS(nsmps, Dn, expectedDn, pvalueKS);
293 
294  delete goft;
295  return result;
296  }
297 
298  Int_t UnitTest6() {
299  std::cout << "UNIT TEST 6" << std::endl;
300  UInt_t nEvents = 1000;
301  UInt_t nsmps = 1;
302 
303  TRandom3 r;
304 
305  Double_t* sample = new Double_t[nEvents];
306 
307  for (UInt_t i = 0; i < nEvents; ++i) {
308  Double_t data = r.Landau();
309  sample[i] = data;
310  assert(sample[i] == data);
311  }
312 
314  ROOT::Math::GoFTest* goft = new ROOT::Math::GoFTest(nEvents, sample, userCdf, ROOT::Math::GoFTest::kCDF);
315 
316  if (GoFTStress::fgDebugLevel == GoFTStress::kStandardDebug)
317  std::cout << "**Landau fitting**" << std::endl;
318 
319  Double_t A2 = goft->AndersonDarlingTest("t");
320  Double_t pvalueAD = goft->AndersonDarlingTest();
321 
322  Double_t expectedA2 = 0.544658;
323 
324  Int_t result = PrintResultAD1Sample(A2, expectedA2, pvalueAD);
325 
326  Double_t Dn = goft->KolmogorovSmirnovTest("t");
327  Double_t pvalueKS = goft->KolmogorovSmirnovTest();
328 
329  Double_t expectedDn = 0.0203432;
330 
331  result += PrintResultKS(nsmps, Dn, expectedDn, pvalueKS);
332 
333  delete goft;
334  return result;
335  }
336 
337  Int_t UnitTest7() {
338  std::cout << "UNIT TEST 7" << std::endl;
339 
340  UInt_t nEvents = 1000;
341  UInt_t nsmps = 1;
342 
343  TRandom3 r;
344 
345  Double_t* sample = new Double_t[nEvents];
346 
347  for (UInt_t i = 0; i < nEvents; ++i) {
348  Double_t data = r.Landau();
349  sample[i] = data;
350  }
351 
352  // need to specify min and max otherwise pdf does not converge
353  ROOT::Math::GoFTest* goft = new ROOT::Math::GoFTest(nEvents, sample);
354 
355  ROOT::Math::Functor1D userPdf([](double x){ return TMath::Landau(x);});
356  // need to use a reasanble range for the Landau
357  // but must be bigger than xmin and xmax
358  double xmin = 3*TMath::MinElement(nEvents, sample);
359  double xmax = 3*TMath::MaxElement(nEvents, sample);
360 
361  if (GoFTStress::fgDebugLevel == GoFTStress::kStandardDebug)
362  std::cout << "**Landau fitting**" << " in [ " << xmin << " , " << xmax << " ]" << std::endl;
363 
364  goft->SetUserDistribution(userPdf,ROOT::Math::GoFTest::kPDF, xmin, xmax);
365 
366  Double_t A2 = goft->AndersonDarlingTest("t");
367  Double_t pvalueAD = goft->AndersonDarlingTest();
368 
369  Double_t expectedA2 = 0.544658;
370 
371  // use larger tolerance due to truncation error of Landau
372  Int_t result = PrintResultAD1Sample(A2, expectedA2, pvalueAD,0.002);
373 
374  Double_t Dn = goft->KolmogorovSmirnovTest("t");
375  Double_t pvalueKS = goft->KolmogorovSmirnovTest();
376 
377  Double_t expectedDn = 0.0203432;
378 
379  result += PrintResultKS(nsmps, Dn, expectedDn, pvalueKS,0.001);
380 
381  delete goft;
382  return result;
383  }
384 
385  Int_t PrintResultAD2Samples(UInt_t nsmps, Double_t A2, Double_t expectedA2_akN, Double_t sigmaN, Double_t zScore, Double_t pvalue, Double_t limit = 0.0001) {
386 
387  Double_t A2_akN = A2 * sigmaN + (nsmps - 1);
388 
389  if (GoFTStress::fgDebugLevel == GoFTStress::kStandardDebug) {
390  std::cout << "Anderson-Darling 2-Samples Test" << std::endl;
391 
392  std::cout << "pvalue = " << pvalue << std::endl;
393 
394  std::cout << "zScore = " << zScore << std::endl;
395 
396  std::cout << "Expected A2 value = " << A2 << std::endl;
397 
398  std::cout << "A2_akN = " << A2_akN << std::endl;
399 
400  std::cout << "Expected A2_akN value = " << expectedA2_akN << std::endl;
401  }
402  if (TMath::Abs(A2_akN - expectedA2_akN) < limit * expectedA2_akN || TMath::Abs(A2 - zScore) < limit * zScore) {
403  if (GoFTStress::fgDebugLevel >= GoFTStress::kBasicDebug)
404  std::cout << "+++++++ TEST OK +++++++ \n" << std::endl;
405  return EXIT_SUCCESS;
406  } else {
407  if (GoFTStress::fgDebugLevel >= GoFTStress::kBasicDebug)
408  std::cout << "------- TEST FAIL ------- \n" << std::endl;
409  return EXIT_FAILURE;
410  }
411  }
412 
413  Int_t PrintResultAD1Sample(Double_t A2, Double_t expectedA2, Double_t pvalue, Double_t limit = 0.0001) {
414 
415  if (GoFTStress::fgDebugLevel == GoFTStress::kStandardDebug) {
416  std::cout << "Anderson-Darling 1-Sample Test" << std::endl;
417 
418  std::cout << "pvalue = " << pvalue << std::endl;
419 
420  std::cout << "A2 value = " << A2 << std::endl;
421 
422  std::cout << "Expected A2 value = " << expectedA2 << std::endl;
423  }
424  if (TMath::Abs(A2 - expectedA2) < limit * expectedA2) {
425  if (GoFTStress::fgDebugLevel >= GoFTStress::kBasicDebug)
426  std::cout << "+++++++ TEST OK +++++++ \n" << std::endl;
427  return EXIT_SUCCESS;
428  } else {
429  if (GoFTStress::fgDebugLevel >= GoFTStress::kBasicDebug)
430  std::cout << "------- TEST FAIL ------- \n" << std::endl;
431  return EXIT_FAILURE;
432  }
433  }
434 
435  Int_t PrintResultKS(UInt_t nsmps, Double_t Dn, Double_t expectedDn, Double_t pvalue, Double_t limit = 0.0001) {
436 
437  if (GoFTStress::fgDebugLevel == GoFTStress::kStandardDebug) {
438  std::cout << "Kolmogorov-Smirnov "<< nsmps << "-Samples Test" << std::endl;
439 
440  std::cout << "pvalue = " << pvalue << std::endl;
441 
442  std::cout << "Dn value = " << Dn << std::endl;
443 
444  std::cout << "Expected Dn value = " << expectedDn << std::endl;
445  }
446  if (TMath::Abs(Dn - expectedDn) < limit * expectedDn) {
447  if (GoFTStress::fgDebugLevel >= GoFTStress::kBasicDebug)
448  std::cout << "+++++++ TEST OK +++++++ \n" << std::endl;
449  return EXIT_SUCCESS;
450  } else {
451  if (GoFTStress::fgDebugLevel >= GoFTStress::kBasicDebug)
452  std::cout << "------- TEST FAIL ------- \n" << std::endl;
453  return EXIT_FAILURE;
454  }
455  }
456 };
457 
458 #ifdef __MAKECINT__
459 #pragma link C++ class GoFTStress-;
460 #endif
461 
462 GoFTStress::EDebugLevelTypes GoFTStress::fgDebugLevel;
463 
464 Int_t RunTests(Int_t argc, Char_t* argv[]) {
465  Int_t result = 0;
466  Bool_t validOption(kFALSE);
467 
468  if (argc == 1) {
469  GoFTStress::fgDebugLevel = GoFTStress::kBasicDebug;
470  validOption = kTRUE;
471  } else if (argc == 3 && strcmp(argv[1], "--o") == 0) {
472  if (strcmp(argv[2], "0") == 0 || strcmp(argv[2], "no-debug") == 0) {
473  GoFTStress::fgDebugLevel = GoFTStress::kNoDebug;
474  validOption = kTRUE;
475  } else if (strcmp(argv[2], "1") == 0 || strcmp(argv[2], "basic-debug") == 0) {
476  GoFTStress::fgDebugLevel = GoFTStress::kBasicDebug;
477  validOption = kTRUE;
478  std::cout << "Debug level: basic." << std::endl;
479  } else if (strcmp(argv[2], "2") == 0 || strcmp(argv[2], "standard-debug") == 0) {
480  GoFTStress::fgDebugLevel = GoFTStress::kStandardDebug;
481  validOption = kTRUE;
482  std::cout << "Debug level: standard." << std::endl;
483  } else if (strcmp(argv[2], "help") == 0) {
484  std::cout << "Showing help: " << std::endl;
485  }
486  }
487 
488  if (!validOption) {
489  std::cout << "Please type just one of the following debug levels in either formats preceded by \"--o\":" << std::endl;
490  std::cout << "a) no-debug(0) [no test results printing]" << std::endl;
491  std::cout << "b) basic-debug(1) [prints either \"OK\" or \"FAIL\" test results]" << std::endl;
492  std::cout << "c) standard-debug(2) [prints summarized test results]" << std::endl;
493  return 0;
494  }
495 
496  if (GoFTStress::fgDebugLevel >= GoFTStress::kBasicDebug) {
497  std::cout << "*****************************************************************************************" << std::endl;
498  std::cout << "* Goodness of Fit Test STRESS suite *" <<std::endl;
499  std::cout << "*****************************************************************************************" << std::endl;
500 }
501 
502  gBenchmark = new TBenchmark();
503 
505  timer.Start();
506 
507  gBenchmark->Start("GoFTestStress");
508 
509  GoFTStress* goftStressTest = new GoFTStress;
510 
511  result = goftStressTest->RunTests();
512 
513  gBenchmark->Stop("GoFTestStress");
514 
515  goftStressTest->PrintBenchmark();
516 
517  delete goftStressTest;
518 
519  delete gBenchmark;
520 
521  return result;
522 }
523 
524 Int_t stressGoFTest(Int_t argc = 1 , Char_t* argv[] = 0) {
525  return RunTests(argc, argv);
526 }
527 
528 #if not defined(__CINT__) && not defined(__MAKECINT__)
529 Int_t main(Int_t argc, Char_t* argv[]) {
530  return RunTests(argc, argv);
531 }
532 #endif
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
void SetDistribution(EDistribution dist)
Definition: GoFTest.cxx:123
Double_t Landau(Double_t x, Double_t mpv=0, Double_t sigma=1, Bool_t norm=kFALSE)
The LANDAU function.
Definition: TMath.cxx:472
float xmin
Definition: THbookFile.cxx:93
Random number generator class based on M.
Definition: TRandom3.h:27
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
Definition: TStopwatch.cxx:58
double LogNormal(double zeta, double sigma)
Log-normal distribution.
Definition: Random.h:122
virtual Double_t Gaus(Double_t mean=0, Double_t sigma=1)
Samples a random number from the standard Normal (Gaussian) Distribution with the given mean and sigm...
Definition: TRandom.cxx:235
virtual const char * GetBuildNode() const
Return the build node name.
Definition: TSystem.cxx:3739
virtual TString GetFromPipe(const char *command)
Execute command and return output in TString.
Definition: TSystem.cxx:687
void AndersonDarlingTest(Double_t &pvalue, Double_t &testStat) const
Definition: GoFTest.cxx:858
#define gROOT
Definition: TROOT.h:375
Basic string class.
Definition: TString.h:129
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void Stop(const char *name)
Terminates Benchmark with specified name.
Definition: TBenchmark.cxx:203
Short_t Abs(Short_t d)
Definition: TMathBase.h:108
TStopwatch timer
Definition: pirndm.C:37
virtual void Start(const char *name)
Starts Benchmark with the specified name.
Definition: TBenchmark.cxx:174
Double_t x[n]
Definition: legend1.C:17
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1634
Float_t GetCpuTime(const char *name)
Returns Cpu time used by Benchmark name.
Definition: TBenchmark.cxx:119
void KolmogorovSmirnovTest(Double_t &pvalue, Double_t &testStat) const
Definition: GoFTest.cxx:917
virtual void Print(Option_t *name="") const
Prints parameters of Benchmark name.
Definition: TBenchmark.cxx:139
const int nEvents
Definition: testRooFit.cxx:42
TRandom2 r(17)
R__EXTERN TSystem * gSystem
Definition: TSystem.h:539
R__EXTERN TBenchmark * gBenchmark
Definition: TBenchmark.h:59
unsigned int UInt_t
Definition: RtypesCore.h:42
Double_t LandauI(Double_t x)
Returns the value of the Landau distribution function at point x.
Definition: TMath.cxx:2767
float xmax
Definition: THbookFile.cxx:93
This class is a ROOT utility to help benchmarking applications.
Definition: TBenchmark.h:29
const Bool_t kFALSE
Definition: RtypesCore.h:92
double Double_t
Definition: RtypesCore.h:55
T MaxElement(Long64_t n, const T *a)
Definition: TMath.h:837
void KolmogorovSmirnov2SamplesTest(Double_t &pvalue, Double_t &testStat) const
Definition: GoFTest.cxx:892
char Char_t
Definition: RtypesCore.h:29
Int_t RunTests(Int_t argc, Char_t *argv[])
double result[121]
Functor1D class for one-dimensional functions.
Definition: Functor.h:487
Int_t stressGoFTest(Int_t argc=1, Char_t *argv[]=0)
virtual Double_t Landau(Double_t mean=0, Double_t sigma=1)
Generate a random number following a Landau distribution with location parameter mu and scale paramet...
Definition: TRandom.cxx:340
const Bool_t kTRUE
Definition: RtypesCore.h:91
int main(int argc, char **argv)
void SetUserDistribution(Dist &dist, EUserDistribution userDist=kPDF, Double_t xmin=1, Double_t xmax=0)
Definition: GoFTest.h:86
virtual Double_t Exp(Double_t tau)
Returns an exponential deviate.
Definition: TRandom.cxx:212
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
Definition: TString.cxx:1069
Documentation for the Random class.
Definition: Random.h:39
void AndersonDarling2SamplesTest(Double_t &pvalue, Double_t &testStat) const
Definition: GoFTest.cxx:644
T MinElement(Long64_t n, const T *a)
Definition: TMath.h:830
const char * Data() const
Definition: TString.h:347
Stopwatch class.
Definition: TStopwatch.h:28