Logo ROOT  
Reference Guide
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 \file RooUnitTest.cxx
18 \class RooUnitTest
19 \ingroup Roofitcore
20 
21 RooUnit test is an abstract base class for unit regression tests for
22 RooFit and RooStats tests performed in stressRooFit and stressRooStats
23 Implementations of this class must implement abstract method testCode()
24 which defines the regression test to be performed. Inside testCode()
25 the regression test can define objects on which the regression is performed.
26 These are:
27 Object | function
28 ----------------|------------
29  RooPlot | regPlot()
30  RooFitResult | regResult()
31  Double_t | regValue()
32  RooTable | regTable()
33  TH1/2/3 | regTH()
34  RooWorkspace | regWS()
35 **/
36 
37 #include "RooFit.h"
38 #include "RooUnitTest.h"
39 #include "TDirectory.h"
40 #include "TClass.h"
41 #include "RooHist.h"
42 #include "RooMsgService.h"
43 #include "RooDouble.h"
44 #include "RooTrace.h"
45 #include "RooRandom.h"
46 #include <cmath>
47 
49 
50 using namespace std;
51 
53 
54 
55 ////////////////////////////////////////////////////////////////////////////////
56 
57 RooUnitTest::RooUnitTest(const char* name, TFile* refFile, Bool_t writeRef, Int_t verbose) : TNamed(name,name),
58  _refFile(refFile), _debug(kFALSE), _write(writeRef), _verb(verbose)
59 {
60 }
61 
62 
63 
64 ////////////////////////////////////////////////////////////////////////////////
65 
67 {
68 }
69 
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 
73 void RooUnitTest::regPlot(RooPlot* frame, const char* refName)
74 {
75  if (_refFile) {
76  string refNameStr(refName) ;
77  frame->SetName(refName) ;
78  _regPlots.push_back(make_pair(frame,refNameStr)) ;
79  } else {
80  delete frame ;
81  }
82 }
83 
84 
85 ////////////////////////////////////////////////////////////////////////////////
86 
87 void RooUnitTest::regResult(RooFitResult* r, const char* refName)
88 {
89  if (_refFile) {
90  string refNameStr(refName) ;
91  _regResults.push_back(make_pair(r,refNameStr)) ;
92  } else {
93  delete r ;
94  }
95 }
96 
97 
98 ////////////////////////////////////////////////////////////////////////////////
99 
100 void RooUnitTest::regValue(Double_t d, const char* refName)
101 {
102  if (_refFile) {
103  string refNameStr(refName) ;
104  _regValues.push_back(make_pair(d,refNameStr)) ;
105  }
106 }
107 
108 
109 ////////////////////////////////////////////////////////////////////////////////
110 
111 void RooUnitTest::regTable(RooTable* t, const char* refName)
112 {
113  if (_refFile) {
114  string refNameStr(refName) ;
115  _regTables.push_back(make_pair(t,refNameStr)) ;
116  } else {
117  delete t ;
118  }
119 }
120 
121 
122 ////////////////////////////////////////////////////////////////////////////////
123 
124 void RooUnitTest::regWS(RooWorkspace* ws, const char* refName)
125 {
126  if (_refFile) {
127  string refNameStr(refName) ;
128  _regWS.push_back(make_pair(ws,refNameStr)) ;
129  } else {
130  delete ws ;
131  }
132 }
133 
134 
135 ////////////////////////////////////////////////////////////////////////////////
136 
137 void RooUnitTest::regTH(TH1* th, const char* refName)
138 {
139  if (_refFile) {
140  string refNameStr(refName) ;
141  _regTH.push_back(make_pair(th,refNameStr)) ;
142  } else {
143  delete th ;
144  }
145 }
146 
147 
148 ////////////////////////////////////////////////////////////////////////////////
149 
150 RooWorkspace* RooUnitTest::getWS(const char* refName)
151 {
152  RooWorkspace* ws = dynamic_cast<RooWorkspace*>(_refFile->Get(refName)) ;
153  if (!ws) {
154  cout << "RooUnitTest ERROR: cannot retrieve RooWorkspace " << refName
155  << " from reference file, skipping " << endl ;
156  return 0 ;
157  }
158 
159  return ws ;
160 }
161 
162 
163 ////////////////////////////////////////////////////////////////////////////////
164 
166 {
167  if (htest->GetDimension() != href->GetDimension()) {
168  return kFALSE ;
169  }
170 
171  // Use Kolmogorov distance as metric rather than probability
172  // because we expect histograms to be identical rather
173  // than drawn from the same parent distribution
174  Double_t kmax = htest->KolmogorovTest(href,"M") ;
175 
176  if (kmax>htol()) {
177 
178  cout << "KS distances = " << kmax << endl ;
179 
180  Int_t ntest = htest->GetNbinsX() +2 ;
181  Int_t nref = href->GetNbinsX() +2 ;
182  if (htest->GetDimension()>1) {
183  ntest *= htest->GetNbinsY() + 2 ;
184  nref *= href->GetNbinsY() + 2 ;
185  }
186  if (htest->GetDimension()>2) {
187  ntest *= htest->GetNbinsZ() + 2 ;
188  nref *= href->GetNbinsZ() + 2 ;
189  }
190 
191  if (ntest != nref) {
192  return kFALSE ;
193  }
194 
195  for (Int_t i=0 ; i<ntest ; i++) {
196  if (fabs(htest->GetBinContent(i)-href->GetBinContent(i))>htol()) {
197  cout << "htest[" << i << "] = " << htest->GetBinContent(i) << " href[" << i << "] = " << href->GetBinContent(i) << endl;
198  }
199  }
200 
201  return kFALSE ;
202  }
203 
204  return kTRUE ;
205 }
206 
207 
208 
209 ////////////////////////////////////////////////////////////////////////////////
210 
212 {
213  Bool_t ret = kTRUE ;
214 
215  list<pair<RooPlot*, string> >::iterator iter = _regPlots.begin() ;
216  while (iter!=_regPlots.end()) {
217 
218  if (!_write) {
219 
220  // Comparison mode
221 
222  // Retrieve benchmark
223  RooPlot* bmark = dynamic_cast<RooPlot*>(_refFile->Get(iter->second.c_str())) ;
224  if (!bmark) {
225  cout << "RooUnitTest ERROR: cannot retrieve RooPlot " << iter->second << " from reference file, skipping " << endl ;
226  ret = kFALSE ;
227  ++iter ;
228  continue ;
229  }
230 
231  if (_verb) {
232  cout << "comparing RooPlot " << iter->first << " to benchmark " << iter->second << " = " << bmark << endl ;
233  cout << "reference: " ; iter->first->Print() ;
234  cout << "benchmark: " ; bmark->Print() ;
235  }
236 
237  RooPlot* compPlot = _debug ? iter->first->emptyClone(Form("%s_comparison",iter->first->GetName())) : 0 ;
238  Bool_t anyFail=kFALSE ;
239 
240  Stat_t nItems = iter->first->numItems() ;
241  for (Stat_t i=0 ; i<nItems ; i++) {
242  // coverity[NULL_RETURNS]
243  TObject* obj = iter->first->getObject((Int_t)i) ;
244 
245  // Retrieve corresponding object from reference frame
246  TObject* objRef = bmark->findObject(obj->GetName()) ;
247 
248  if (!objRef) {
249  cout << "RooUnitTest ERROR: cannot retrieve object " << obj->GetName() << " from reference RooPlot " << iter->second << ", skipping" << endl ;
250  ret = kFALSE ;
251  break ;
252  }
253 
254  // Histogram comparisons
255  if (obj->IsA()==RooHist::Class()) {
256  RooHist* testHist = static_cast<RooHist*>(obj) ;
257  RooHist* refHist = static_cast<RooHist*>(objRef) ;
258  if (!testHist->isIdentical(*refHist,htol())) {
259  cout << "RooUnitTest ERROR: comparison of object " << obj->IsA()->GetName() << "::" << obj->GetName()
260  << " fails comparison with counterpart in reference RooPlot " << bmark->GetName() << endl ;
261 
262  if (compPlot) {
263  compPlot->addPlotable((RooHist*)testHist->Clone(),"P") ;
264  compPlot->getAttLine()->SetLineColor(kRed) ;
265  compPlot->getAttMarker()->SetMarkerColor(kRed) ;
266  compPlot->getAttLine()->SetLineWidth(1) ;
267 
268  compPlot->addPlotable((RooHist*)refHist->Clone(),"P") ;
269  compPlot->getAttLine()->SetLineColor(kBlue) ;
270  compPlot->getAttMarker()->SetMarkerColor(kBlue) ;
271  compPlot->getAttLine()->SetLineWidth(1) ;
272  }
273 
274  anyFail=kTRUE ;
275  ret = kFALSE ;
276  }
277  } else if (obj->IsA()==RooCurve::Class()) {
278  RooCurve* testCurve = static_cast<RooCurve*>(obj) ;
279  RooCurve* refCurve = static_cast<RooCurve*>(objRef) ;
280  if (!testCurve->isIdentical(*refCurve,ctol())) {
281  cout << "RooUnitTest ERROR: comparison of object " << obj->IsA()->GetName() << "::" << obj->GetName()
282  << " fails comparison with counterpart in reference RooPlot " << bmark->GetName() << endl ;
283 
284  if (compPlot) {
285  compPlot->addPlotable((RooCurve*)testCurve->Clone()) ;
286  compPlot->getAttLine()->SetLineColor(kRed) ;
287  compPlot->getAttLine()->SetLineWidth(1) ;
288  compPlot->getAttLine()->SetLineStyle(kSolid) ;
289 
290  compPlot->addPlotable((RooCurve*)refCurve->Clone()) ;
291  compPlot->getAttLine()->SetLineColor(kBlue) ;
292  compPlot->getAttLine()->SetLineWidth(1) ;
293  compPlot->getAttLine()->SetLineStyle(kDashed) ;
294  }
295 
296  anyFail=kTRUE ;
297  ret = kFALSE ;
298  }
299 
300  }
301 
302  }
303 
304  if (anyFail && compPlot) {
305  cout << "RooUnitTest INFO: writing comparison plot " << compPlot->GetName() << " of failed test to RooUnitTest_DEBUG.root" << endl ;
306  TFile fdbg("RooUnitTest_DEBUG.root","UPDATE") ;
307  compPlot->Write() ;
308  fdbg.Close() ;
309  } else {
310  delete compPlot ;
311  }
312 
313  // Delete RooPlot when comparison is finished to avoid noise in leak checking
314  delete iter->first ;
315 
316  } else {
317 
318  // Writing mode
319 
320  cout <<"RooUnitTest: Writing reference RooPlot " << iter->first << " as benchmark " << iter->second << endl ;
321  _refFile->cd() ;
322  iter->first->Write(iter->second.c_str()) ;
323  gMemDir->cd() ;
324  }
325 
326  ++iter ;
327  }
328 
329 
330  list<pair<RooFitResult*, string> >::iterator iter2 = _regResults.begin() ;
331  while (iter2!=_regResults.end()) {
332 
333  if (!_write) {
334 
335  // Comparison mode
336 
337  // Retrieve benchmark
338  RooFitResult* bmark = dynamic_cast<RooFitResult*>(_refFile->Get(iter2->second.c_str())) ;
339  if (!bmark) {
340  cout << "RooUnitTest ERROR: cannot retrieve RooFitResult " << iter2->second << " from reference file, skipping " << endl ;
341  ++iter2 ;
342  ret = kFALSE ;
343  continue ;
344  }
345 
346  if (_verb) {
347  cout << "comparing RooFitResult " << iter2->first << " to benchmark " << iter2->second << " = " << bmark << endl ;
348  }
349 
350  if (!iter2->first->isIdentical(*bmark,fptol(),fctol())) {
351  cout << "RooUnitTest ERROR: comparison of object " << iter2->first->IsA()->GetName() << "::" << iter2->first->GetName()
352  << " from result " << iter2->second
353  << " fails comparison with counterpart in reference RooFitResult " << bmark->GetName() << endl ;
354  ret = kFALSE ;
355  }
356 
357  // Delete RooFitResult when comparison is finished to avoid noise in leak checking
358  delete iter2->first ;
359 
360 
361  } else {
362 
363  // Writing mode
364 
365  cout <<"RooUnitTest: Writing reference RooFitResult " << iter2->first << " as benchmark " << iter2->second << endl ;
366  _refFile->cd() ;
367  iter2->first->Write(iter2->second.c_str()) ;
368  gMemDir->cd() ;
369  }
370 
371  ++iter2 ;
372  }
373 
374  list<pair<Double_t, string> >::iterator iter3 = _regValues.begin() ;
375  while (iter3!=_regValues.end()) {
376 
377  if (!_write) {
378 
379  // Comparison mode
380 
381  // Retrieve benchmark
382  RooDouble* ref = dynamic_cast<RooDouble*>(_refFile->Get(iter3->second.c_str())) ;
383  if (!ref) {
384  cout << "RooUnitTest ERROR: cannot retrieve RooDouble " << iter3->second << " from reference file, skipping " << endl ;
385  ++iter3 ;
386  ret = kFALSE ;
387  continue ;
388  }
389 
390  if (_verb) {
391  cout << "comparing value " << iter3->first << " to benchmark " << iter3->second << " = " << (Double_t)(*ref) << endl ;
392  }
393 
394  if (fabs(iter3->first - (Double_t)(*ref))>vtol() ) {
395  cout << "RooUnitTest ERROR: comparison of value " << iter3->first << " fails comparison with reference " << ref->GetName() << endl ;
396  ret = kFALSE ;
397  }
398 
399 
400  } else {
401 
402  // Writing mode
403 
404  cout <<"RooUnitTest: Writing reference Double_t " << iter3->first << " as benchmark " << iter3->second << endl ;
405  _refFile->cd() ;
406  RooDouble* rd = new RooDouble(iter3->first) ;
407  rd->Write(iter3->second.c_str()) ;
408  gMemDir->cd() ;
409  }
410 
411  ++iter3 ;
412  }
413 
414 
415  list<pair<RooTable*, string> >::iterator iter4 = _regTables.begin() ;
416  while (iter4!=_regTables.end()) {
417 
418  if (!_write) {
419 
420  // Comparison mode
421 
422  // Retrieve benchmark
423  RooTable* bmark = dynamic_cast<RooTable*>(_refFile->Get(iter4->second.c_str())) ;
424  if (!bmark) {
425  cout << "RooUnitTest ERROR: cannot retrieve RooTable " << iter4->second << " from reference file, skipping " << endl ;
426  ++iter4 ;
427  ret = kFALSE ;
428  continue ;
429  }
430 
431  if (_verb) {
432  cout << "comparing RooTable " << iter4->first << " to benchmark " << iter4->second << " = " << bmark << endl ;
433  }
434 
435  if (!iter4->first->isIdentical(*bmark)) {
436  cout << "RooUnitTest ERROR: comparison of object " << iter4->first->IsA()->GetName() << "::" << iter4->first->GetName()
437  << " fails comparison with counterpart in reference RooTable " << bmark->GetName() << endl ;
438  if (_verb) {
439  iter4->first->Print("V");
440  bmark->Print("V");
441  }
442  ret = false;
443  }
444 
445  // Delete RooTable when comparison is finished to avoid noise in leak checking
446  delete iter4->first ;
447 
448 
449  } else {
450 
451  // Writing mode
452 
453  cout <<"RooUnitTest: Writing reference RooTable " << iter4->first << " as benchmark " << iter4->second << endl ;
454  _refFile->cd() ;
455  iter4->first->Write(iter4->second.c_str()) ;
456  gMemDir->cd() ;
457  }
458 
459  ++iter4 ;
460  }
461 
462 
463  list<pair<RooWorkspace*, string> >::iterator iter5 = _regWS.begin() ;
464  while (iter5!=_regWS.end()) {
465 
466  if (_write) {
467 
468  // Writing mode
469 
470  cout <<"RooUnitTest: Writing reference RooWorkspace " << iter5->first << " as benchmark " << iter5->second << endl ;
471  _refFile->cd() ;
472  iter5->first->Write(iter5->second.c_str()) ;
473  gMemDir->cd() ;
474  }
475 
476  ++iter5 ;
477  }
478 
479  /////////////////
480  list<pair<TH1*, string> >::iterator iter6 = _regTH.begin() ;
481  while (iter6!=_regTH.end()) {
482 
483  if (!_write) {
484 
485  // Comparison mode
486 
487  // Retrieve benchmark
488  TH1* bmark = dynamic_cast<TH1*>(_refFile->Get(iter6->second.c_str())) ;
489  if (!bmark) {
490  cout << "RooUnitTest ERROR: cannot retrieve TH1 " << iter6->second << " from reference file, skipping " << endl ;
491  ++iter6 ;
492  ret = kFALSE ;
493  continue ;
494  }
495 
496  if (_verb) {
497  cout << "comparing TH1 " << iter6->first << " to benchmark " << iter6->second << " = " << bmark << endl ;
498  }
499 
500  if (!areTHidentical(iter6->first,bmark)) {
501  // coverity[NULL_RETURNS]
502  cout << "RooUnitTest ERROR: comparison of object " << iter6->first->IsA()->GetName() << "::" << iter6->first->GetName()
503  << " fails comparison with counterpart in reference TH1 " << bmark->GetName() << endl ;
504 
505 
506  if (_debug) {
507  cout << "RooUnitTest INFO: writing THx " << iter6->first->GetName() << " and " << bmark->GetName()
508  << " of failed test to RooUnitTest_DEBUG.root" << endl ;
509  TFile fdbg("RooUnitTest_DEBUG.root","UPDATE") ;
510  iter6->first->SetName(Form("%s_test",iter6->first->GetName())) ;
511  iter6->first->Write() ;
512  bmark->SetName(Form("%s_ref",bmark->GetName())) ;
513  bmark->Write() ;
514  fdbg.Close() ;
515  }
516 
517  ret = kFALSE ;
518  }
519 
520  // Delete TH1 when comparison is finished to avoid noise in leak checking
521  delete iter6->first ;
522 
523 
524  } else {
525 
526  // Writing mode
527 
528  cout <<"RooUnitTest: Writing reference TH1 " << iter6->first << " as benchmark " << iter6->second << endl ;
529  _refFile->cd() ;
530  iter6->first->Write(iter6->second.c_str()) ;
531  gMemDir->cd() ;
532  }
533 
534  ++iter6 ;
535  }
536 
537 
538  /////////////////
539 
540  return ret ;
541 }
542 
543 
544 ////////////////////////////////////////////////////////////////////////////////
545 
547 {
549  for (Int_t i=0 ; i<RooMsgService::instance().numStreams() ; i++) {
552  }
553  }
554 }
555 
556 
557 ////////////////////////////////////////////////////////////////////////////////
558 
560 {
562  for (Int_t i=0 ; i<RooMsgService::instance().numStreams() ; i++) {
564  }
565 }
566 
567 
568 
569 ////////////////////////////////////////////////////////////////////////////////
570 
572 {
573  gMemDir->cd() ;
574 
575  if (_verb<2) {
576  setSilentMode() ;
577  } else {
578  cout << "*** Begin of output of Unit Test at normal verbosity *************" << endl ;
579  }
580 
582 
583  // Reset random generator seed to make results independent of test ordering
584  gRandom->SetSeed(12345) ;
586 
588  if (!testCode()) return kFALSE ;
590 
591  if (_verb<2) {
592  clearSilentMode() ;
593  } else {
594  cout << "*** End of output of Unit Test at normal verbosity ***************" << endl ;
595  }
596 
597  if (RooMsgService::instance().errorCount()>0) {
598  cout << "RooUnitTest: ERROR messages were logged, failing test" << endl ;
599  return kFALSE ;
600  }
601 
602  return runCompTests() ;
603 }
604 
605 
606 ////////////////////////////////////////////////////////////////////////////////
607 /// Set gMemDir to memDir
608 
610  gMemDir = memDir ;
611 }
kSolid
@ kSolid
Definition: TAttLine.h:48
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooUnitTest::_refFile
TFile * _refFile
Definition: RooUnitTest.h:86
RooMsgService.h
TDirectory.h
RooPlot::findObject
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:982
RooFit.h
RooUnitTest::areTHidentical
Bool_t areTHidentical(TH1 *htest, TH1 *href)
Definition: RooUnitTest.cxx:165
TH1::GetNbinsZ
virtual Int_t GetNbinsZ() const
Definition: TH1.h:295
RooUnitTest.h
RooMsgService::setSilentMode
void setSilentMode(Bool_t flag)
Definition: RooMsgService.h:178
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
Form
char * Form(const char *fmt,...)
RooUnitTest::_verb
Int_t _verb
Definition: RooUnitTest.h:89
RooMsgService::numStreams
Int_t numStreams() const
Definition: RooMsgService.h:154
RooMsgService::setStreamStatus
void setStreamStatus(Int_t id, Bool_t active)
(De)Activate stream with given unique ID
Definition: RooMsgService.cxx:329
RooUnitTest::vtol
virtual Double_t vtol()
Definition: RooUnitTest.h:78
r
ROOT::R::TRInterface & r
Definition: Object.C:4
RooUnitTest::_regWS
std::list< std::pair< RooWorkspace *, std::string > > _regWS
Definition: RooUnitTest.h:94
TDirectoryFile::cd
Bool_t cd(const char *path=nullptr) override
Change current directory to "this" directory.
Definition: TDirectoryFile.cxx:340
RooMsgService::getStream
StreamConfig & getStream(Int_t id)
Definition: RooMsgService.h:152
RooTrace::callgrind_zero
static void callgrind_zero()
Utility function to trigger zeroing of callgrind counters.
Definition: RooTrace.cxx:298
TClass.h
TDirectory::cd
virtual Bool_t cd(const char *path=nullptr)
Change current directory to "this" directory.
Definition: TDirectory.cxx:498
RooUnitTest::getWS
RooWorkspace * getWS(const char *refName)
Definition: RooUnitTest.cxx:150
RooUnitTest::_regResults
std::list< std::pair< RooFitResult *, std::string > > _regResults
Definition: RooUnitTest.h:91
RooUnitTest::setMemDir
static void setMemDir(TDirectory *memDir)
Set gMemDir to memDir.
Definition: RooUnitTest.cxx:609
TH1::SetName
virtual void SetName(const char *name)
Change the name of this histogram.
Definition: TH1.cxx:8415
RooUnitTest::_write
Bool_t _write
Definition: RooUnitTest.h:88
RooUnitTest::RooUnitTest
RooUnitTest(const char *name, TFile *refFile, Bool_t writeRef, Int_t verbose)
Definition: RooUnitTest.cxx:57
bool
TH1::KolmogorovTest
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:7683
RooFitResult
Definition: RooFitResult.h:40
RooMsgService::clearErrorCount
void clearErrorCount()
Definition: RooMsgService.h:181
RooUnitTest::htol
virtual Double_t htol()
Definition: RooUnitTest.h:70
TH1::GetDimension
virtual Int_t GetDimension() const
Definition: TH1.h:279
RooPlot::Print
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
Definition: RooPlot.h:134
TObject::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:359
RooTrace.h
RooDouble
Definition: RooDouble.h:22
RooUnitTest::_debug
Bool_t _debug
Definition: RooUnitTest.h:87
ROOT::Math::fabs
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
Definition: UnaryOperators.h:131
TDirectoryFile::Get
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
Definition: TDirectoryFile.cxx:909
RooPlot::addPlotable
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:570
RooTable
Definition: RooTable.h:23
RooUnitTest::clearSilentMode
void clearSilentMode()
Definition: RooUnitTest.cxx:559
ws
void ws()
Definition: ws.C:66
TH1::GetBinContent
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH1.cxx:4906
RooPlot::getAttLine
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:866
RooUnitTest::_regTH
std::list< std::pair< TH1 *, std::string > > _regTH
Definition: RooUnitTest.h:95
TNamed::Print
virtual void Print(Option_t *option="") const
Print TNamed name and title.
Definition: TNamed.cxx:128
TNamed
Definition: TNamed.h:29
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooRandom.h
RooUnitTest
Definition: RooUnitTest.h:35
TNamed::Clone
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Definition: TNamed.cxx:74
RooPlot::SetName
void SetName(const char *name)
Set the name of the RooPlot to 'name'.
Definition: RooPlot.cxx:1215
gRandom
R__EXTERN TRandom * gRandom
Definition: TRandom.h:62
RooMsgService::StreamConfig::minLevel
RooFit::MsgLevel minLevel
Definition: RooMsgService.h:131
TRandom::SetSeed
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
Definition: TRandom.cxx:597
RooPlot
Definition: RooPlot.h:44
RooUnitTest::testCode
virtual Bool_t testCode()=0
RooUnitTest::gMemDir
static TDirectory * gMemDir
Definition: RooUnitTest.h:84
RooUnitTest::_regValues
std::list< std::pair< Double_t, std::string > > _regValues
Definition: RooUnitTest.h:92
RooCurve
Definition: RooCurve.h:32
RooUnitTest::regValue
void regValue(Double_t value, const char *refName)
Definition: RooUnitTest.cxx:100
RooHist::isIdentical
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:662
kRed
@ kRed
Definition: Rtypes.h:66
RooHist
Definition: RooHist.h:27
RooUnitTest::setSilentMode
void setSilentMode()
Definition: RooUnitTest.cxx:546
RooUnitTest::ctol
virtual Double_t ctol()
Definition: RooUnitTest.h:74
TFile
Definition: TFile.h:54
RooHist.h
RooUnitTest::runTest
Bool_t runTest()
Definition: RooUnitTest.cxx:571
RooWorkspace
Definition: RooWorkspace.h:43
Double_t
double Double_t
Definition: RtypesCore.h:59
TObject::Write
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:795
TObject
Definition: TObject.h:37
TFile::Close
void Close(Option_t *option="") override
Close a file.
Definition: TFile.cxx:876
TH1
Definition: TH1.h:57
name
char name[80]
Definition: TGX11.cxx:110
RooUnitTest::regPlot
void regPlot(RooPlot *frame, const char *refName)
Definition: RooUnitTest.cxx:73
RooUnitTest::_regTables
std::list< std::pair< RooTable *, std::string > > _regTables
Definition: RooUnitTest.h:93
RooUnitTest::runCompTests
Bool_t runCompTests()
Definition: RooUnitTest.cxx:211
kBlue
@ kBlue
Definition: Rtypes.h:66
d
#define d(i)
Definition: RSha256.hxx:120
TDirectory
Definition: TDirectory.h:40
RooUnitTest::regTable
void regTable(RooTable *t, const char *refName)
Definition: RooUnitTest.cxx:111
kDashed
@ kDashed
Definition: TAttLine.h:48
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooUnitTest::regResult
void regResult(RooFitResult *r, const char *refName)
Definition: RooUnitTest.cxx:87
RooFit::ERROR
@ ERROR
Definition: RooGlobalFunc.h:65
RooDouble.h
RooPlot::getAttMarker
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:886
TH1::GetNbinsY
virtual Int_t GetNbinsY() const
Definition: TH1.h:294
RooRandom::randomGenerator
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
Definition: RooRandom.cxx:53
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:53
RooTrace::callgrind_dump
static void callgrind_dump()
Utility function to trigger dumping of callgrind counters.
Definition: RooTrace.cxx:310
Stat_t
double Stat_t
Definition: RtypesCore.h:77
Class
void Class()
Definition: Class.C:29
RooMsgService::instance
static RooMsgService & instance()
Return reference to singleton instance.
Definition: RooMsgService.cxx:363
RooUnitTest::~RooUnitTest
~RooUnitTest()
Definition: RooUnitTest.cxx:66
RooUnitTest::fctol
virtual Double_t fctol()
Definition: RooUnitTest.h:77
RooUnitTest::regWS
void regWS(RooWorkspace *ws, const char *refName)
Definition: RooUnitTest.cxx:124
RooUnitTest::_regPlots
std::list< std::pair< RooPlot *, std::string > > _regPlots
Definition: RooUnitTest.h:90
TH1::GetNbinsX
virtual Int_t GetNbinsX() const
Definition: TH1.h:293
int
RooUnitTest::regTH
void regTH(TH1 *h, const char *refName)
Definition: RooUnitTest.cxx:137
RooCurve::isIdentical
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:893
RooUnitTest::fptol
virtual Double_t fptol()
Definition: RooUnitTest.h:76