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
21RooUnit test is an abstract base class for unit regression tests for
22RooFit and RooStats tests performed in stressRooFit and stressRooStats
23Implementations of this class must implement abstract method testCode()
24which defines the regression test to be performed. Inside testCode()
25the regression test can define objects on which the regression is performed.
26These are:
27Object | function
28----------------|------------
29 RooPlot | regPlot()
30 RooFitResult | regResult()
31 double | regValue()
32 RooTable | regTable()
33 TH1/2/3 | regTH()
34 RooWorkspace | regWS()
35**/
36
37#include "RooUnitTest.h"
38
39#include "RooCurve.h"
40#include "RooHist.h"
41#include "RooMsgService.h"
42#include "RooDouble.h"
43#include "RooTrace.h"
44#include "RooRandom.h"
45
46#include <TClass.h>
47#include <TDirectory.h>
48#include <TFile.h>
49
50#include <cmath>
51
53
54using namespace std;
55
57
58
59////////////////////////////////////////////////////////////////////////////////
60
61RooUnitTest::RooUnitTest(const char* name, TFile* refFile, bool writeRef, Int_t verbose, std::string const& batchMode) : TNamed(name,name),
62 _refFile(refFile), _debug(false), _write(writeRef), _verb(verbose), _batchMode(batchMode)
63{
64}
65
66
67
68////////////////////////////////////////////////////////////////////////////////
69
71{
72}
73
74
75////////////////////////////////////////////////////////////////////////////////
76
77void 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
91void 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
104void RooUnitTest::regValue(double 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
115void 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
128void 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
141void 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
154RooWorkspace* RooUnitTest::getWS(const char* refName)
155{
156 RooWorkspace* ws = dynamic_cast<RooWorkspace*>(_refFile->Get(refName)) ;
157 if (!ws) {
158 if(_verb >= 0) std::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 false ;
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 kmax = htest->KolmogorovTest(href,"M") ;
179
180 if (kmax>htol()) {
181
182 if(_verb >= 0) std::cout << "KS distances = " << kmax << std::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 false ;
197 }
198
199 for (Int_t i=0 ; i<ntest ; i++) {
200 if (fabs(htest->GetBinContent(i)-href->GetBinContent(i))>htol()) {
201 if(_verb >= 0) std::cout << "htest[" << i << "] = " << htest->GetBinContent(i) << " href[" << i << "] = " << href->GetBinContent(i) << endl;
202 }
203 }
204
205 return false ;
206 }
207
208 return true ;
209}
210
211
212
213////////////////////////////////////////////////////////////////////////////////
214
216{
217 bool ret = true ;
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 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve RooPlot " << iter->second
230 << " from reference file, skipping " << std::endl;
231 ret = false ;
232 ++iter ;
233 continue ;
234 }
235
236 if (_verb > 0) {
237 cout << "comparing RooPlot " << iter->first << " to benchmark " << iter->second << " = " << bmark << endl ;
238 cout << "reference: " ; iter->first->Print() ;
239 cout << "benchmark: " ; bmark->Print() ;
240 }
241
242 RooPlot* compPlot = _debug ? iter->first->emptyClone(Form("%s_comparison",iter->first->GetName())) : 0 ;
243 bool anyFail=false ;
244
245 Stat_t nItems = iter->first->numItems() ;
246 for (Stat_t i=0 ; i<nItems ; i++) {
247 // coverity[NULL_RETURNS]
248 TObject* obj = iter->first->getObject((Int_t)i) ;
249
250 // Retrieve corresponding object from reference frame
251 TObject* objRef = bmark->findObject(obj->GetName()) ;
252
253 if (!objRef) {
254 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve reference object " << obj->GetName()
255 << " from benchmark RooPlot " << iter->second << ", skipping" << std::endl;
256 ret = false ;
257 break ;
258 }
259
260 // Histogram comparisons
261 if (obj->IsA()==RooHist::Class()) {
262 RooHist* testHist = static_cast<RooHist*>(obj) ;
263 RooHist* refHist = static_cast<RooHist*>(objRef) ;
264 if (!testHist->isIdentical(*refHist,htol(),_verb >= 0)) {
265 if(_verb >= 0) std::cout << "RooUnitTest ERROR: comparison of object " << obj->ClassName() << "::" << obj->GetName()
266 << " fails comparison with counterpart in reference RooPlot " << bmark->GetName() << std::endl;
267
268 if (compPlot) {
269 compPlot->addPlotable((RooHist*)testHist->Clone(),"P") ;
270 compPlot->getAttLine()->SetLineColor(kRed) ;
271 compPlot->getAttMarker()->SetMarkerColor(kRed) ;
272 compPlot->getAttLine()->SetLineWidth(1) ;
273
274 compPlot->addPlotable((RooHist*)refHist->Clone(),"P") ;
275 compPlot->getAttLine()->SetLineColor(kBlue) ;
276 compPlot->getAttMarker()->SetMarkerColor(kBlue) ;
277 compPlot->getAttLine()->SetLineWidth(1) ;
278 }
279
280 anyFail=true ;
281 ret = false ;
282 }
283 } else if (obj->IsA()==RooCurve::Class()) {
284 RooCurve* testCurve = static_cast<RooCurve*>(obj) ;
285 RooCurve* refCurve = static_cast<RooCurve*>(objRef) ;
286 if (!testCurve->isIdentical(*refCurve,ctol(),_verb >= 0)) {
287 if(_verb >= 0) std::cout << "RooUnitTest ERROR: comparison of object " << obj->ClassName() << "::" << obj->GetName()
288 << " fails comparison with counterpart in reference RooPlot " << bmark->GetName() << std::endl;
289
290 if (compPlot) {
291 compPlot->addPlotable((RooCurve*)testCurve->Clone()) ;
292 compPlot->getAttLine()->SetLineColor(kRed) ;
293 compPlot->getAttLine()->SetLineWidth(1) ;
294 compPlot->getAttLine()->SetLineStyle(kSolid) ;
295
296 compPlot->addPlotable((RooCurve*)refCurve->Clone()) ;
297 compPlot->getAttLine()->SetLineColor(kBlue) ;
298 compPlot->getAttLine()->SetLineWidth(1) ;
299 compPlot->getAttLine()->SetLineStyle(kDashed) ;
300 }
301
302 anyFail=true ;
303 ret = false ;
304 }
305
306 }
307
308 }
309
310 if (anyFail && compPlot) {
311 cout << "RooUnitTest INFO: writing comparison plot " << compPlot->GetName() << " of failed test to RooUnitTest_DEBUG.root" << endl ;
312 TFile fdbg("RooUnitTest_DEBUG.root","UPDATE") ;
313 compPlot->Write() ;
314 fdbg.Close() ;
315 } else {
316 delete compPlot ;
317 }
318
319 // Delete RooPlot when comparison is finished to avoid noise in leak checking
320 delete iter->first ;
321
322 } else {
323
324 // Writing mode
325
326 std::cout <<"RooUnitTest: Writing reference RooPlot " << iter->first << " as benchmark " << iter->second << endl ;
327 _refFile->cd() ;
328 iter->first->Write(iter->second.c_str()) ;
329 gMemDir->cd() ;
330 }
331
332 ++iter ;
333 }
334
335
336 list<pair<RooFitResult*, string> >::iterator iter2 = _regResults.begin() ;
337 while (iter2!=_regResults.end()) {
338
339 if (!_write) {
340
341 // Comparison mode
342
343 // Retrieve benchmark
344 RooFitResult* bmark = dynamic_cast<RooFitResult*>(_refFile->Get(iter2->second.c_str())) ;
345 if (!bmark) {
346 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve RooFitResult "
347 << iter2->second << " from reference file, skipping " << std::endl ;
348 ++iter2 ;
349 ret = false ;
350 continue ;
351 }
352
353 if (_verb > 0) {
354 cout << "comparing RooFitResult " << iter2->first << " to benchmark " << iter2->second << " = " << bmark << endl ;
355 }
356
357 if (!iter2->first->isIdentical(*bmark,fptol(),fctol(),_verb >= 0)) {
358 if(_verb >= 0) cout << "RooUnitTest ERROR: comparison of object " << iter2->first->ClassName() << "::" << iter2->first->GetName()
359 << " from result " << iter2->second
360 << " fails comparison with counterpart in reference RooFitResult " << bmark->GetName() << std::endl;
361 ret = false ;
362 }
363
364 // Delete RooFitResult when comparison is finished to avoid noise in leak checking
365 delete iter2->first ;
366
367
368 } else {
369
370 // Writing mode
371
372 std::cout <<"RooUnitTest: Writing reference RooFitResult " << iter2->first << " as benchmark " << iter2->second << endl ;
373 _refFile->cd() ;
374 iter2->first->Write(iter2->second.c_str()) ;
375 gMemDir->cd() ;
376 }
377
378 ++iter2 ;
379 }
380
381 list<pair<double, string> >::iterator iter3 = _regValues.begin() ;
382 while (iter3!=_regValues.end()) {
383
384 if (!_write) {
385
386 // Comparison mode
387
388 // Retrieve benchmark
389 RooDouble* ref = dynamic_cast<RooDouble*>(_refFile->Get(iter3->second.c_str())) ;
390 if (!ref) {
391 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve RooDouble " << iter3->second << " from reference file, skipping " << std::endl;
392 ++iter3 ;
393 ret = false ;
394 continue ;
395 }
396
397 if (_verb > 0) {
398 cout << "comparing value " << iter3->first << " to benchmark " << iter3->second << " = " << (double)(*ref) << endl ;
399 }
400
401 if (fabs(iter3->first - (double)(*ref))>vtol() ) {
402 if(_verb >= 0) cout << "RooUnitTest ERROR: comparison of value " << iter3->first << " fails comparison with reference " << ref->GetName() << endl ;
403 ret = false ;
404 }
405
406
407 } else {
408
409 // Writing mode
410
411 std::cout <<"RooUnitTest: Writing reference double " << iter3->first << " as benchmark " << iter3->second << endl ;
412 _refFile->cd() ;
413 RooDouble* rd = new RooDouble(iter3->first) ;
414 rd->Write(iter3->second.c_str()) ;
415 gMemDir->cd() ;
416 }
417
418 ++iter3 ;
419 }
420
421
422 list<pair<RooTable*, string> >::iterator iter4 = _regTables.begin() ;
423 while (iter4!=_regTables.end()) {
424
425 if (!_write) {
426
427 // Comparison mode
428
429 // Retrieve benchmark
430 RooTable* bmark = dynamic_cast<RooTable*>(_refFile->Get(iter4->second.c_str())) ;
431 if (!bmark) {
432 if(_verb >= 0) cout << "RooUnitTest ERROR: cannot retrieve RooTable " << iter4->second << " from reference file, skipping " << endl ;
433 ++iter4 ;
434 ret = false ;
435 continue ;
436 }
437
438 if (_verb > 0) {
439 cout << "comparing RooTable " << iter4->first << " to benchmark " << iter4->second << " = " << bmark << endl ;
440 }
441
442 if (!iter4->first->isIdentical(*bmark, _verb >= 0)) {
443 if(_verb >= 0) std::cout << "RooUnitTest ERROR: comparison of object " << iter4->first->ClassName() << "::" << iter4->first->GetName()
444 << " fails comparison with counterpart in reference RooTable " << bmark->GetName() << endl ;
445 if (_verb > 0) {
446 iter4->first->Print("V");
447 bmark->Print("V");
448 }
449 ret = false;
450 }
451
452 // Delete RooTable when comparison is finished to avoid noise in leak checking
453 delete iter4->first ;
454
455
456 } else {
457
458 // Writing mode
459
460 std::cout <<"RooUnitTest: Writing reference RooTable " << iter4->first << " as benchmark " << iter4->second << endl ;
461 _refFile->cd() ;
462 iter4->first->Write(iter4->second.c_str()) ;
463 gMemDir->cd() ;
464 }
465
466 ++iter4 ;
467 }
468
469
470 list<pair<RooWorkspace*, string> >::iterator iter5 = _regWS.begin() ;
471 while (iter5!=_regWS.end()) {
472
473 if (_write) {
474
475 // Writing mode
476
477 std::cout <<"RooUnitTest: Writing reference RooWorkspace " << iter5->first << " as benchmark " << iter5->second << endl ;
478 _refFile->cd() ;
479 iter5->first->Write(iter5->second.c_str()) ;
480 gMemDir->cd() ;
481 }
482
483 ++iter5 ;
484 }
485
486 /////////////////
487 list<pair<TH1*, string> >::iterator iter6 = _regTH.begin() ;
488 while (iter6!=_regTH.end()) {
489
490 if (!_write) {
491
492 // Comparison mode
493
494 // Retrieve benchmark
495 TH1* bmark = dynamic_cast<TH1*>(_refFile->Get(iter6->second.c_str())) ;
496 if (!bmark) {
497 if(_verb >= 0) cout << "RooUnitTest ERROR: cannot retrieve TH1 " << iter6->second << " from reference file, skipping " << endl ;
498 ++iter6 ;
499 ret = false ;
500 continue ;
501 }
502
503 if (_verb > 0) {
504 cout << "comparing TH1 " << iter6->first << " to benchmark " << iter6->second << " = " << bmark << endl ;
505 }
506
507 if (!areTHidentical(iter6->first,bmark)) {
508 // coverity[NULL_RETURNS]
509 if(_verb >= 0) cout << "RooUnitTest ERROR: comparison of object " << iter6->first->ClassName() << "::" << iter6->first->GetName()
510 << " fails comparison with counterpart in reference TH1 " << bmark->GetName() << endl ;
511
512
513 if (_debug) {
514 cout << "RooUnitTest INFO: writing THx " << iter6->first->GetName() << " and " << bmark->GetName()
515 << " of failed test to RooUnitTest_DEBUG.root" << endl ;
516 TFile fdbg("RooUnitTest_DEBUG.root","UPDATE") ;
517 iter6->first->SetName(Form("%s_test",iter6->first->GetName())) ;
518 iter6->first->Write() ;
519 bmark->SetName(Form("%s_ref",bmark->GetName())) ;
520 bmark->Write() ;
521 fdbg.Close() ;
522 }
523
524 ret = false ;
525 }
526
527 // Delete TH1 when comparison is finished to avoid noise in leak checking
528 delete iter6->first ;
529
530
531 } else {
532
533 // Writing mode
534
535 std::cout <<"RooUnitTest: Writing reference TH1 " << iter6->first << " as benchmark " << iter6->second << endl ;
536 _refFile->cd() ;
537 iter6->first->Write(iter6->second.c_str()) ;
538 gMemDir->cd() ;
539 }
540
541 ++iter6 ;
542 }
543
544
545 /////////////////
546
547 return ret ;
548}
549
550
551////////////////////////////////////////////////////////////////////////////////
552
554{
556 for (Int_t i=0 ; i<RooMsgService::instance().numStreams() ; i++) {
559 }
560 }
561}
562
563
564////////////////////////////////////////////////////////////////////////////////
565
567{
569 for (Int_t i=0 ; i<RooMsgService::instance().numStreams() ; i++) {
571 }
572}
573
574
575
576////////////////////////////////////////////////////////////////////////////////
577
579{
580 gMemDir->cd() ;
581
582 if (_verb<2) {
583 setSilentMode() ;
584 } else {
585 std::cout << "*** Begin of output of Unit Test at normal verbosity *************" << endl ;
586 }
587
589
590 // Reset random generator seed to make results independent of test ordering
591 gRandom->SetSeed(12345) ;
593
595 if (!testCode()) return false ;
597
598 if (_verb<2) {
600 } else {
601 std::cout << "*** End of output of Unit Test at normal verbosity ***************" << endl ;
602 }
603
604 if (RooMsgService::instance().errorCount()>0) {
605 if(_verb >= 0) std::cout << "RooUnitTest: ERROR messages were logged, failing test" << endl ;
606 return false ;
607 }
608
609 return runCompTests() ;
610}
611
612
613////////////////////////////////////////////////////////////////////////////////
614/// Set gMemDir to memDir
615
617 gMemDir = memDir ;
618}
#define d(i)
Definition: RSha256.hxx:102
#define ClassImp(name)
Definition: Rtypes.h:375
@ kRed
Definition: Rtypes.h:66
@ kBlue
Definition: Rtypes.h:66
@ kDashed
Definition: TAttLine.h:48
@ kSolid
Definition: TAttLine.h:48
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
char name[80]
Definition: TGX11.cxx:110
R__EXTERN TRandom * gRandom
Definition: TRandom.h:62
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition: TString.cxx:2456
A RooCurve is a one-dimensional graphical representation of a real-valued function.
Definition: RooCurve.h:32
static TClass * Class()
bool isIdentical(const RooCurve &other, double tol=1e-6, bool verbose=true) const
Return true if curve is identical to other curve allowing for given absolute tolerance on each point ...
Definition: RooCurve.cxx:884
RooDouble is a minimal implementation of a TObject holding a double value.
Definition: RooDouble.h:22
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
Definition: RooFitResult.h:40
A RooHist is a graphical representation of binned data based on the TGraphAsymmErrors class.
Definition: RooHist.h:29
static TClass * Class()
bool isIdentical(const RooHist &other, double tol=1e-6, bool verbose=true) const
Return true if contents of this RooHist is identical within given relative tolerance to that of 'othe...
Definition: RooHist.cxx:657
static RooMsgService & instance()
Return reference to singleton instance.
void clearErrorCount()
StreamConfig & getStream(Int_t id)
Int_t numStreams() const
void setStreamStatus(Int_t id, bool active)
(De)Activate stream with given unique ID
void setSilentMode(bool flag)
A RooPlot is a plot frame and a container for graphics objects within that frame.
Definition: RooPlot.h:43
void SetName(const char *name) override
Set the name of the RooPlot to 'name'.
Definition: RooPlot.cxx:1233
TObject * findObject(const char *name, const TClass *clas=nullptr) const
Find the named object in our list of items and return a pointer to it.
Definition: RooPlot.cxx:954
void Print(Option_t *options=nullptr) const override
Print TNamed name and title.
Definition: RooPlot.h:132
TAttLine * getAttLine(const char *name=nullptr) const
Return a pointer to the line attributes of the named object in this plot, or zero if the named object...
Definition: RooPlot.cxx:819
TAttMarker * getAttMarker(const char *name=nullptr) const
Return a pointer to the marker attributes of the named object in this plot, or zero if the named obje...
Definition: RooPlot.cxx:839
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", bool invisible=false, bool refreshNorm=false)
Add the specified plotable object to our plot.
Definition: RooPlot.cxx:528
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
Definition: RooRandom.cxx:51
RooTable is the abstract interface for table objects.
Definition: RooTable.h:23
static void callgrind_zero()
Utility function to trigger zeroing of callgrind counters.
Definition: RooTrace.cxx:296
static void callgrind_dump()
Utility function to trigger dumping of callgrind counters.
Definition: RooTrace.cxx:308
RooUnit test is an abstract base class for unit regression tests for RooFit and RooStats tests perfor...
Definition: RooUnitTest.h:38
std::list< std::pair< TH1 *, std::string > > _regTH
Definition: RooUnitTest.h:86
bool runCompTests()
virtual double htol()
histogram test tolerance (KS dist != prob)
Definition: RooUnitTest.h:60
~RooUnitTest() override
Definition: RooUnitTest.cxx:70
RooUnitTest(const char *name, TFile *refFile, bool writeRef, Int_t verbose, std::string const &batchMode="off")
Definition: RooUnitTest.cxx:61
void regWS(RooWorkspace *ws, const char *refName)
void regTH(TH1 *h, const char *refName)
void regResult(RooFitResult *r, const char *refName)
Definition: RooUnitTest.cxx:91
virtual double fptol()
fit parameter test tolerance
Definition: RooUnitTest.h:66
std::list< std::pair< RooWorkspace *, std::string > > _regWS
Definition: RooUnitTest.h:85
static void setMemDir(TDirectory *memDir)
Set gMemDir to memDir.
bool runTest()
RooWorkspace * getWS(const char *refName)
std::list< std::pair< RooPlot *, std::string > > _regPlots
Definition: RooUnitTest.h:81
void regPlot(RooPlot *frame, const char *refName)
Definition: RooUnitTest.cxx:77
Int_t _verb
Definition: RooUnitTest.h:79
void regValue(double value, const char *refName)
void regTable(RooTable *t, const char *refName)
std::list< std::pair< RooFitResult *, std::string > > _regResults
Definition: RooUnitTest.h:82
virtual double ctol()
curve test tolerance
Definition: RooUnitTest.h:64
std::list< std::pair< double, std::string > > _regValues
Definition: RooUnitTest.h:83
virtual bool testCode()=0
bool areTHidentical(TH1 *htest, TH1 *href)
virtual double fctol()
fit correlation test tolerance
Definition: RooUnitTest.h:67
std::list< std::pair< RooTable *, std::string > > _regTables
Definition: RooUnitTest.h:84
virtual double vtol()
value test tolerance
Definition: RooUnitTest.h:68
TFile * _refFile
Definition: RooUnitTest.h:76
void setSilentMode()
static TDirectory * gMemDir
Definition: RooUnitTest.h:74
void clearSilentMode()
The RooWorkspace is a persistable container for RooFit projects.
Definition: RooWorkspace.h:43
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
Definition: TAttLine.h:42
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition: TAttLine.h:43
virtual void SetLineColor(Color_t lcolor)
Set the line color.
Definition: TAttLine.h:40
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
Definition: TAttMarker.h:38
Bool_t cd(const char *path=nullptr) override
Change current directory to "this" directory.
TObject * Get(const char *namecycle) override
Return pointer to object identified by namecycle.
Describe directory structure in memory.
Definition: TDirectory.h:45
virtual Bool_t cd(const char *path=nullptr)
Change current directory to "this" directory.
Definition: TDirectory.cxx:504
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:54
void Close(Option_t *option="") override
Close a file.
Definition: TFile.cxx:916
TH1 is the base class of all histogram classes in ROOT.
Definition: TH1.h:58
virtual Int_t GetNbinsY() const
Definition: TH1.h:296
virtual Int_t GetNbinsZ() const
Definition: TH1.h:297
virtual Int_t GetDimension() const
Definition: TH1.h:281
virtual Int_t GetNbinsX() const
Definition: TH1.h:295
void SetName(const char *name) override
Change the name of this histogram.
Definition: TH1.cxx:8827
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Definition: TH1.cxx:5025
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:8087
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
Definition: TNamed.cxx:74
const char * GetName() const override
Returns name of object.
Definition: TNamed.h:47
void Print(Option_t *option="") const override
Print TNamed name and title.
Definition: TNamed.cxx:128
Mother of all ROOT objects.
Definition: TObject.h:41
virtual const char * GetName() const
Returns name of object.
Definition: TObject.cxx:440
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:207
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition: TObject.cxx:875
virtual TClass * IsA() const
Definition: TObject.h:245
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
Definition: TRandom.cxx:608
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)