Loading [MathJax]/extensions/tex2jax.js
ROOT  6.06/09
Reference Guide
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
RooUnitTest.cxx
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * @(#)root/roofitcore:$Id$
5  * Authors: *
6  * WV, Wouter Verkerke, NIKHEF, verkerke@nikhef.nl *
7  * *
8  * Copyright (c) 2000-2011, Regents of the University of California *
9  * and Stanford University. All rights reserved. *
10  * *
11  * Redistribution and use in source and binary forms, *
12  * with or without modification, are permitted according to the terms *
13  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
14  *****************************************************************************/
15 
16 //////////////////////////////////////////////////////////////////////////////
17 //
18 // BEGIN_HTML
19 // RooUnit test is an abstract base class for unit regression tests for
20 // RooFit and RooStats tests performed in stressRooFit and stressRooStats
21 //
22 // Implementations of this class must implement abstract method testCode()
23 // which defines the regression test to be performed. Inside testCode()
24 // the regression test can define objects on which the regression is performed.
25 // These are
26 // RooPlot - regPlot() ;
27 // RooFitResult - regFitResult() ;
28 // Double_t - regValue() ;
29 // RooTable - regTable() ;
30 // TH1/2/3 - regTH
31 //
32 // RooWorkspace - regWS() ;
33 //
34 //
35 // END_HTML
36 //
37 //
38 
39 #include "RooFit.h"
40 #include "RooUnitTest.h"
41 #include "TROOT.h"
42 #include "TClass.h"
43 #include "TSystem.h"
44 #include "RooHist.h"
45 #include "RooMsgService.h"
46 #include "RooDouble.h"
47 #include "RooTrace.h"
48 #include "RooRandom.h"
49 #include <math.h>
50 
52 ;
53 
54 using namespace std;
55 
56 TDirectory* RooUnitTest::gMemDir = 0 ;
57 
58 
59 ////////////////////////////////////////////////////////////////////////////////
60 
61 RooUnitTest::RooUnitTest(const char* name, TFile* refFile, Bool_t writeRef, Int_t verbose) : TNamed(name,name),
62  _refFile(refFile), _debug(kFALSE), _write(writeRef), _verb(verbose)
63 {
64 }
65 
66 
67 
68 ////////////////////////////////////////////////////////////////////////////////
69 
71 {
72 }
73 
74 
75 ////////////////////////////////////////////////////////////////////////////////
76 
77 void RooUnitTest::regPlot(RooPlot* frame, const char* refName)
78 {
79  if (_refFile) {
80  string refNameStr(refName) ;
81  frame->SetName(refName) ;
82  _regPlots.push_back(make_pair(frame,refNameStr)) ;
83  } else {
84  delete frame ;
85  }
86 }
87 
88 
89 ////////////////////////////////////////////////////////////////////////////////
90 
91 void RooUnitTest::regResult(RooFitResult* r, const char* refName)
92 {
93  if (_refFile) {
94  string refNameStr(refName) ;
95  _regResults.push_back(make_pair(r,refNameStr)) ;
96  } else {
97  delete r ;
98  }
99 }
100 
101 
102 ////////////////////////////////////////////////////////////////////////////////
103 
104 void RooUnitTest::regValue(Double_t d, const char* refName)
105 {
106  if (_refFile) {
107  string refNameStr(refName) ;
108  _regValues.push_back(make_pair(d,refNameStr)) ;
109  }
110 }
111 
112 
113 ////////////////////////////////////////////////////////////////////////////////
114 
115 void RooUnitTest::regTable(RooTable* t, const char* refName)
116 {
117  if (_refFile) {
118  string refNameStr(refName) ;
119  _regTables.push_back(make_pair(t,refNameStr)) ;
120  } else {
121  delete t ;
122  }
123 }
124 
125 
126 ////////////////////////////////////////////////////////////////////////////////
127 
128 void RooUnitTest::regWS(RooWorkspace* ws, const char* refName)
129 {
130  if (_refFile) {
131  string refNameStr(refName) ;
132  _regWS.push_back(make_pair(ws,refNameStr)) ;
133  } else {
134  delete ws ;
135  }
136 }
137 
138 
139 ////////////////////////////////////////////////////////////////////////////////
140 
141 void RooUnitTest::regTH(TH1* th, const char* refName)
142 {
143  if (_refFile) {
144  string refNameStr(refName) ;
145  _regTH.push_back(make_pair(th,refNameStr)) ;
146  } else {
147  delete th ;
148  }
149 }
150 
151 
152 ////////////////////////////////////////////////////////////////////////////////
153 
154 RooWorkspace* RooUnitTest::getWS(const char* refName)
155 {
156  RooWorkspace* ws = dynamic_cast<RooWorkspace*>(_refFile->Get(refName)) ;
157  if (!ws) {
158  cout << "RooUnitTest ERROR: cannot retrieve RooWorkspace " << refName
159  << " from reference file, skipping " << endl ;
160  return 0 ;
161  }
162 
163  return ws ;
164 }
165 
166 
167 ////////////////////////////////////////////////////////////////////////////////
168 
170 {
171  if (htest->GetDimension() != href->GetDimension()) {
172  return kFALSE ;
173  }
174 
175  // Use Kolmogorov distance as metric rather than probability
176  // because we expect histograms to be identical rather
177  // than drawn from the same parent distribution
178  Double_t kmax = htest->KolmogorovTest(href,"M") ;
179 
180  if (kmax>htol()) {
181 
182  cout << "KS distances = " << kmax << endl ;
183 
184  Int_t ntest = htest->GetNbinsX() +2 ;
185  Int_t nref = href->GetNbinsX() +2 ;
186  if (htest->GetDimension()>1) {
187  ntest *= htest->GetNbinsY() + 2 ;
188  nref *= href->GetNbinsY() + 2 ;
189  }
190  if (htest->GetDimension()>2) {
191  ntest *= htest->GetNbinsZ() + 2 ;
192  nref *= href->GetNbinsZ() + 2 ;
193  }
194 
195  if (ntest != nref) {
196  return kFALSE ;
197  }
198 
199  for (Int_t i=0 ; i<ntest ; i++) {
200  if (fabs(htest->GetBinContent(i)-href->GetBinContent(i))>htol()) {
201  cout << "htest[" << i << "] = " << htest->GetBinContent(i) << " href[" << i << "] = " << href->GetBinContent(i) << endl;
202  }
203  }
204 
205  return kFALSE ;
206  }
207 
208  return kTRUE ;
209 }
210 
211 
212 
213 ////////////////////////////////////////////////////////////////////////////////
214 
216 {
217  Bool_t ret = kTRUE ;
218 
219  list<pair<RooPlot*, string> >::iterator iter = _regPlots.begin() ;
220  while (iter!=_regPlots.end()) {
221 
222  if (!_write) {
223 
224  // Comparison mode
225 
226  // Retrieve benchmark
227  RooPlot* bmark = dynamic_cast<RooPlot*>(_refFile->Get(iter->second.c_str())) ;
228  if (!bmark) {
229  cout << "RooUnitTest ERROR: cannot retrieve RooPlot " << iter->second << " from reference file, skipping " << endl ;
230  ret = kFALSE ;
231  ++iter ;
232  continue ;
233  }
234 
235  if (_verb) {
236  cout << "comparing RooPlot " << iter->first << " to benchmark " << iter->second << " = " << bmark << endl ;
237  cout << "reference: " ; iter->first->Print() ;
238  cout << "benchmark: " ; bmark->Print() ;
239  }
240 
241  RooPlot* compPlot = _debug ? iter->first->emptyClone(Form("%s_comparison",iter->first->GetName())) : 0 ;
242  Bool_t anyFail=kFALSE ;
243 
244  Stat_t nItems = iter->first->numItems() ;
245  for (Stat_t i=0 ; i<nItems ; i++) {
246  // coverity[NULL_RETURNS]
247  TObject* obj = iter->first->getObject((Int_t)i) ;
248 
249  // Retrieve corresponding object from reference frame
250  TObject* objRef = bmark->findObject(obj->GetName()) ;
251 
252  if (!objRef) {
253  cout << "RooUnitTest ERROR: cannot retrieve object " << obj->GetName() << " from reference RooPlot " << iter->second << ", skipping" << endl ;
254  ret = kFALSE ;
255  break ;
256  }
257 
258  // Histogram comparisons
259  if (obj->IsA()==RooHist::Class()) {
260  RooHist* testHist = static_cast<RooHist*>(obj) ;
261  RooHist* refHist = static_cast<RooHist*>(objRef) ;
262  if (!testHist->isIdentical(*refHist,htol())) {
263  cout << "RooUnitTest ERROR: comparison of object " << obj->IsA()->GetName() << "::" << obj->GetName()
264  << " fails comparison with counterpart in reference RooPlot " << bmark->GetName() << endl ;
265 
266  if (compPlot) {
267  compPlot->addPlotable((RooHist*)testHist->Clone(),"P") ;
268  compPlot->getAttLine()->SetLineColor(kRed) ;
269  compPlot->getAttMarker()->SetMarkerColor(kRed) ;
270  compPlot->getAttLine()->SetLineWidth(1) ;
271 
272  compPlot->addPlotable((RooHist*)refHist->Clone(),"P") ;
273  compPlot->getAttLine()->SetLineColor(kBlue) ;
274  compPlot->getAttMarker()->SetMarkerColor(kBlue) ;
275  compPlot->getAttLine()->SetLineWidth(1) ;
276  }
277 
278  anyFail=kTRUE ;
279  ret = kFALSE ;
280  }
281  } else if (obj->IsA()==RooCurve::Class()) {
282  RooCurve* testCurve = static_cast<RooCurve*>(obj) ;
283  RooCurve* refCurve = static_cast<RooCurve*>(objRef) ;
284  if (!testCurve->isIdentical(*refCurve,ctol())) {
285  cout << "RooUnitTest ERROR: comparison of object " << obj->IsA()->GetName() << "::" << obj->GetName()
286  << " fails comparison with counterpart in reference RooPlot " << bmark->GetName() << endl ;
287 
288  if (compPlot) {
289  compPlot->addPlotable((RooCurve*)testCurve->Clone()) ;
290  compPlot->getAttLine()->SetLineColor(kRed) ;
291  compPlot->getAttLine()->SetLineWidth(1) ;
292  compPlot->getAttLine()->SetLineStyle(kSolid) ;
293 
294  compPlot->addPlotable((RooCurve*)refCurve->Clone()) ;
295  compPlot->getAttLine()->SetLineColor(kBlue) ;
296  compPlot->getAttLine()->SetLineWidth(1) ;
297  compPlot->getAttLine()->SetLineStyle(kDashed) ;
298  }
299 
300  anyFail=kTRUE ;
301  ret = kFALSE ;
302  }
303 
304  }
305 
306  }
307 
308  if (anyFail && compPlot) {
309  cout << "RooUnitTest INFO: writing comparison plot " << compPlot->GetName() << " of failed test to RooUnitTest_DEBUG.root" << endl ;
310  TFile fdbg("RooUnitTest_DEBUG.root","UPDATE") ;
311  compPlot->Write() ;
312  fdbg.Close() ;
313  } else {
314  delete compPlot ;
315  }
316 
317  // Delete RooPlot when comparison is finished to avoid noise in leak checking
318  delete iter->first ;
319 
320  } else {
321 
322  // Writing mode
323 
324  cout <<"RooUnitTest: Writing reference RooPlot " << iter->first << " as benchmark " << iter->second << endl ;
325  _refFile->cd() ;
326  iter->first->Write(iter->second.c_str()) ;
327  gMemDir->cd() ;
328  }
329 
330  ++iter ;
331  }
332 
333 
334  list<pair<RooFitResult*, string> >::iterator iter2 = _regResults.begin() ;
335  while (iter2!=_regResults.end()) {
336 
337  if (!_write) {
338 
339  // Comparison mode
340 
341  // Retrieve benchmark
342  RooFitResult* bmark = dynamic_cast<RooFitResult*>(_refFile->Get(iter2->second.c_str())) ;
343  if (!bmark) {
344  cout << "RooUnitTest ERROR: cannot retrieve RooFitResult " << iter2->second << " from reference file, skipping " << endl ;
345  ++iter2 ;
346  ret = kFALSE ;
347  continue ;
348  }
349 
350  if (_verb) {
351  cout << "comparing RooFitResult " << iter2->first << " to benchmark " << iter2->second << " = " << bmark << endl ;
352  }
353 
354  if (!iter2->first->isIdentical(*bmark,fptol(),fctol())) {
355  cout << "RooUnitTest ERROR: comparison of object " << iter2->first->IsA()->GetName() << "::" << iter2->first->GetName()
356  << " fails comparison with counterpart in reference RooFitResult " << bmark->GetName() << endl ;
357  ret = kFALSE ;
358  }
359 
360  // Delete RooFitResult when comparison is finished to avoid noise in leak checking
361  delete iter2->first ;
362 
363 
364  } else {
365 
366  // Writing mode
367 
368  cout <<"RooUnitTest: Writing reference RooFitResult " << iter2->first << " as benchmark " << iter2->second << endl ;
369  _refFile->cd() ;
370  iter2->first->Write(iter2->second.c_str()) ;
371  gMemDir->cd() ;
372  }
373 
374  ++iter2 ;
375  }
376 
377  list<pair<Double_t, string> >::iterator iter3 = _regValues.begin() ;
378  while (iter3!=_regValues.end()) {
379 
380  if (!_write) {
381 
382  // Comparison mode
383 
384  // Retrieve benchmark
385  RooDouble* ref = dynamic_cast<RooDouble*>(_refFile->Get(iter3->second.c_str())) ;
386  if (!ref) {
387  cout << "RooUnitTest ERROR: cannot retrieve RooDouble " << iter3->second << " from reference file, skipping " << endl ;
388  ++iter3 ;
389  ret = kFALSE ;
390  continue ;
391  }
392 
393  if (_verb) {
394  cout << "comparing value " << iter3->first << " to benchmark " << iter3->second << " = " << (Double_t)(*ref) << endl ;
395  }
396 
397  if (fabs(iter3->first - (Double_t)(*ref))>vtol() ) {
398  cout << "RooUnitTest ERROR: comparison of value " << iter3->first << " fails comparison with reference " << ref->GetName() << endl ;
399  ret = kFALSE ;
400  }
401 
402 
403  } else {
404 
405  // Writing mode
406 
407  cout <<"RooUnitTest: Writing reference Double_t " << iter3->first << " as benchmark " << iter3->second << endl ;
408  _refFile->cd() ;
409  RooDouble* rd = new RooDouble(iter3->first) ;
410  rd->Write(iter3->second.c_str()) ;
411  gMemDir->cd() ;
412  }
413 
414  ++iter3 ;
415  }
416 
417 
418  list<pair<RooTable*, string> >::iterator iter4 = _regTables.begin() ;
419  while (iter4!=_regTables.end()) {
420 
421  if (!_write) {
422 
423  // Comparison mode
424 
425  // Retrieve benchmark
426  RooTable* bmark = dynamic_cast<RooTable*>(_refFile->Get(iter4->second.c_str())) ;
427  if (!bmark) {
428  cout << "RooUnitTest ERROR: cannot retrieve RooTable " << iter4->second << " from reference file, skipping " << endl ;
429  ++iter4 ;
430  ret = kFALSE ;
431  continue ;
432  }
433 
434  if (_verb) {
435  cout << "comparing RooTable " << iter4->first << " to benchmark " << iter4->second << " = " << bmark << endl ;
436  }
437 
438  if (!iter4->first->isIdentical(*bmark)) {
439  cout << "RooUnitTest ERROR: comparison of object " << iter4->first->IsA()->GetName() << "::" << iter4->first->GetName()
440  << " fails comparison with counterpart in reference RooTable " << bmark->GetName() << endl ;
441  ret = kFALSE ;
442  }
443 
444  // Delete RooTable when comparison is finished to avoid noise in leak checking
445  delete iter4->first ;
446 
447 
448  } else {
449 
450  // Writing mode
451 
452  cout <<"RooUnitTest: Writing reference RooTable " << iter4->first << " as benchmark " << iter4->second << endl ;
453  _refFile->cd() ;
454  iter4->first->Write(iter4->second.c_str()) ;
455  gMemDir->cd() ;
456  }
457 
458  ++iter4 ;
459  }
460 
461 
462  list<pair<RooWorkspace*, string> >::iterator iter5 = _regWS.begin() ;
463  while (iter5!=_regWS.end()) {
464 
465  if (_write) {
466 
467  // Writing mode
468 
469  cout <<"RooUnitTest: Writing reference RooWorkspace " << iter5->first << " as benchmark " << iter5->second << endl ;
470  _refFile->cd() ;
471  iter5->first->Write(iter5->second.c_str()) ;
472  gMemDir->cd() ;
473  }
474 
475  ++iter5 ;
476  }
477 
478  /////////////////
479  list<pair<TH1*, string> >::iterator iter6 = _regTH.begin() ;
480  while (iter6!=_regTH.end()) {
481 
482  if (!_write) {
483 
484  // Comparison mode
485 
486  // Retrieve benchmark
487  TH1* bmark = dynamic_cast<TH1*>(_refFile->Get(iter6->second.c_str())) ;
488  if (!bmark) {
489  cout << "RooUnitTest ERROR: cannot retrieve TH1 " << iter6->second << " from reference file, skipping " << endl ;
490  ++iter6 ;
491  ret = kFALSE ;
492  continue ;
493  }
494 
495  if (_verb) {
496  cout << "comparing TH1 " << iter6->first << " to benchmark " << iter6->second << " = " << bmark << endl ;
497  }
498 
499  if (!areTHidentical(iter6->first,bmark)) {
500  // coverity[NULL_RETURNS]
501  cout << "RooUnitTest ERROR: comparison of object " << iter6->first->IsA()->GetName() << "::" << iter6->first->GetName()
502  << " fails comparison with counterpart in reference TH1 " << bmark->GetName() << endl ;
503 
504 
505  if (_debug) {
506  cout << "RooUnitTest INFO: writing THx " << iter6->first->GetName() << " and " << bmark->GetName()
507  << " of failed test to RooUnitTest_DEBUG.root" << endl ;
508  TFile fdbg("RooUnitTest_DEBUG.root","UPDATE") ;
509  iter6->first->SetName(Form("%s_test",iter6->first->GetName())) ;
510  iter6->first->Write() ;
511  bmark->SetName(Form("%s_ref",bmark->GetName())) ;
512  bmark->Write() ;
513  fdbg.Close() ;
514  }
515 
516  ret = kFALSE ;
517  }
518 
519  // Delete TH1 when comparison is finished to avoid noise in leak checking
520  delete iter6->first ;
521 
522 
523  } else {
524 
525  // Writing mode
526 
527  cout <<"RooUnitTest: Writing reference TH1 " << iter6->first << " as benchmark " << iter6->second << endl ;
528  _refFile->cd() ;
529  iter6->first->Write(iter6->second.c_str()) ;
530  gMemDir->cd() ;
531  }
532 
533  ++iter6 ;
534  }
535 
536 
537  /////////////////
538 
539  return ret ;
540 }
541 
542 
543 ////////////////////////////////////////////////////////////////////////////////
544 
546 {
548  for (Int_t i=0 ; i<RooMsgService::instance().numStreams() ; i++) {
551  }
552  }
553 }
554 
555 
556 ////////////////////////////////////////////////////////////////////////////////
557 
559 {
561  for (Int_t i=0 ; i<RooMsgService::instance().numStreams() ; i++) {
563  }
564 }
565 
566 
567 
568 ////////////////////////////////////////////////////////////////////////////////
569 
571 {
572  gMemDir->cd() ;
573 
574  if (_verb<2) {
575  setSilentMode() ;
576  } else {
577  cout << "*** Begin of output of Unit Test at normal verbosity *************" << endl ;
578  }
579 
581 
582  // Reset random generator seed to make results independent of test ordering
583  gRandom->SetSeed(12345) ;
585 
587  if (!testCode()) return kFALSE ;
589 
590  if (_verb<2) {
591  clearSilentMode() ;
592  } else {
593  cout << "*** End of output of Unit Test at normal verbosity ***************" << endl ;
594  }
595 
596  if (RooMsgService::instance().errorCount()>0) {
597  cout << "RooUnitTest: ERROR messages were logged, failing test" << endl ;
598  return kFALSE ;
599  }
600 
601  return runCompTests() ;
602 }
603 
604 
605 ////////////////////////////////////////////////////////////////////////////////
606 /// Set gMemDir to memDir
607 
609  gMemDir = memDir ;
610 }
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition: TObject.cxx:823
virtual void SetLineWidth(Width_t lwidth)
Definition: TAttLine.h:57
TObject * findObject(const char *name, const TClass *clas=0) const
Find the named object in our list of items and return a pointer to it.
Definition: RooPlot.cxx:850
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH1.cxx:4629
void SetName(const char *name)
Set the name of the RooPlot to 'name'.
Definition: RooPlot.cxx:1077
virtual Double_t vtol()
Definition: RooUnitTest.h:66
Definition: Rtypes.h:61
void regWS(RooWorkspace *ws, const char *refName)
static void callgrind_zero()
Utility function to trigger zeroing of callgrind counters.
Definition: RooTrace.cxx:297
virtual Int_t GetDimension() const
Definition: TH1.h:283
std::list< std::pair< RooFitResult *, std::string > > _regResults
Definition: RooUnitTest.h:79
std::list< std::pair< RooWorkspace *, std::string > > _regWS
Definition: RooUnitTest.h:82
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", Bool_t invisible=kFALSE, Bool_t refreshNorm=kFALSE)
Add the specified plotable object to our plot.
Definition: RooPlot.cxx:447
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:45
Bool_t areTHidentical(TH1 *htest, TH1 *href)
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
Bool_t isIdentical(const RooHist &other, Double_t tol=1e-6) const
Return kTRUE if contents of this RooHIst is identical within given relative tolerance to that of 'oth...
Definition: RooHist.cxx:613
Bool_t _write
Definition: RooUnitTest.h:76
TFile * _refFile
Definition: RooUnitTest.h:74
Int_t _verb
Definition: RooUnitTest.h:77
int Int_t
Definition: RtypesCore.h:41
StreamConfig & getStream(Int_t id)
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual Double_t htol()
Definition: RooUnitTest.h:58
void clearErrorCount()
virtual Int_t GetNbinsX() const
Definition: TH1.h:296
static RooMsgService & instance()
Return reference to singleton instance.
STL namespace.
virtual void SetSeed(UInt_t seed=0)
Set the random generator seed.
Definition: TRandom.cxx:568
void setStreamStatus(Int_t id, Bool_t active)
(De)Activate stream with given unique ID
void Class()
Definition: Class.C:29
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
ClassImp(RooUnitTest)
std::map< std::string, std::string >::const_iterator iter
Definition: TAlienJob.cxx:54
virtual void SetMarkerColor(Color_t mcolor=1)
Definition: TAttMarker.h:51
if on multiple lines(like in C++).**The" * configuration fragment. * * The "import myobject continue
Parses the configuration file.
Definition: HLFactory.cxx:368
RooUnitTest(const char *name, TFile *refFile, Bool_t writeRef, Int_t verbose)
Definition: RooUnitTest.cxx:61
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
Definition: RooRandom.cxx:53
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Definition: TNamed.cxx:63
static TDirectory * gMemDir
Definition: RooUnitTest.h:72
RooWorkspace * getWS(const char *refName)
static void setMemDir(TDirectory *memDir)
Set gMemDir to memDir.
Int_t numStreams() const
virtual void SetLineColor(Color_t lcolor)
Definition: TAttLine.h:54
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
ROOT::R::TRInterface & r
Definition: Object.C:4
std::list< std::pair< TH1 *, std::string > > _regTH
Definition: RooUnitTest.h:83
TAttLine * getAttLine(const char *name=0) const
Return a pointer to the line attributes of the named object in this plot, or zero if the named object...
Definition: RooPlot.cxx:734
void regValue(Double_t value, const char *refName)
virtual Double_t KolmogorovTest(const TH1 *h2, Option_t *option="") const
Statistical test of compatibility in shape between this histogram and h2, using Kolmogorov test...
Definition: TH1.cxx:7610
bool verbose
char * Form(const char *fmt,...)
virtual Double_t ctol()
Definition: RooUnitTest.h:62
Bool_t _debug
Definition: RooUnitTest.h:75
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
Definition: RooPlot.h:127
virtual Int_t GetNbinsZ() const
Definition: TH1.h:298
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
void clearSilentMode()
void setSilentMode(Bool_t flag)
R__EXTERN TRandom * gRandom
Definition: TRandom.h:62
virtual Bool_t testCode()=0
void regPlot(RooPlot *frame, const char *refName)
Definition: RooUnitTest.cxx:77
std::list< std::pair< RooTable *, std::string > > _regTables
Definition: RooUnitTest.h:81
virtual void SetName(const char *name)
Change the name of this histogram.
Definition: TH1.cxx:8288
void regTable(RooTable *t, const char *refName)
Bool_t isIdentical(const RooCurve &other, Double_t tol=1e-6) const
Return true if curve is identical to other curve allowing for given absolute tolerance on each point ...
Definition: RooCurve.cxx:863
void setSilentMode()
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:415
double Double_t
Definition: RtypesCore.h:55
Describe directory structure in memory.
Definition: TDirectory.h:41
The TH1 histogram class.
Definition: TH1.h:80
std::list< std::pair< Double_t, std::string > > _regValues
Definition: RooUnitTest.h:80
virtual void SetLineStyle(Style_t lstyle)
Definition: TAttLine.h:56
double Stat_t
Definition: RtypesCore.h:73
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
virtual Double_t fctol()
Definition: RooUnitTest.h:65
virtual Int_t GetNbinsY() const
Definition: TH1.h:297
std::list< std::pair< RooPlot *, std::string > > _regPlots
Definition: RooUnitTest.h:78
virtual Bool_t cd(const char *path=0)
Change current directory to "this" directory.
Definition: TDirectory.cxx:433
virtual Double_t fptol()
Definition: RooUnitTest.h:64
Bool_t runTest()
Definition: Rtypes.h:61
static void callgrind_dump()
Utility function to trigger dumping of callgrind counters.
Definition: RooTrace.cxx:309
TAttMarker * getAttMarker(const char *name=0) const
Return a pointer to the marker attributes of the named object in this plot, or zero if the named obje...
Definition: RooPlot.cxx:754
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
void regTH(TH1 *h, const char *refName)
Bool_t runCompTests()
virtual void Close(Option_t *option="")
Close a file.
Definition: TFile.cxx:898
void regResult(RooFitResult *r, const char *refName)
Definition: RooUnitTest.cxx:91