Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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) : TNamed(name,name),
62 _refFile(refFile), _debug(false), _write(writeRef), _verb(verbose)
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 // Since ROOT 6.28, the RooPlot doesn't clone the plot variable by default
83 // anymore. This is a problem for registering the RooPlots, because they
84 // need to survive without dangling pointers even after the RooUnitTest is
85 // done. For that reason, we ask the RooPlot to create an internal plot
86 // variable clone for itself.
88 _regPlots.emplace_back(frame,refNameStr);
89 } else {
90 delete frame ;
91 }
92}
93
94
95////////////////////////////////////////////////////////////////////////////////
96
97void RooUnitTest::regResult(std::unique_ptr<RooFitResult> r, const char* refName)
98{
99 if (_refFile) {
100 string refNameStr(refName) ;
101 _regResults.push_back(make_pair(r.release(),refNameStr)) ;
102 }
103}
104
105
106////////////////////////////////////////////////////////////////////////////////
107
108void RooUnitTest::regValue(double d, const char* refName)
109{
110 if (_refFile) {
111 string refNameStr(refName) ;
112 _regValues.push_back(make_pair(d,refNameStr)) ;
113 }
114}
115
116
117////////////////////////////////////////////////////////////////////////////////
118
119void RooUnitTest::regTable(RooTable* t, const char* refName)
120{
121 if (_refFile) {
122 string refNameStr(refName) ;
123 _regTables.push_back(make_pair(t,refNameStr)) ;
124 } else {
125 delete t ;
126 }
127}
128
129
130////////////////////////////////////////////////////////////////////////////////
131
132void RooUnitTest::regWS(RooWorkspace* ws, const char* refName)
133{
134 if (_refFile) {
135 string refNameStr(refName) ;
136 _regWS.push_back(make_pair(ws,refNameStr)) ;
137 } else {
138 delete ws ;
139 }
140}
141
142
143////////////////////////////////////////////////////////////////////////////////
144
145void RooUnitTest::regTH(TH1* th, const char* refName)
146{
147 if (_refFile) {
148 string refNameStr(refName) ;
149 _regTH.push_back(make_pair(th,refNameStr)) ;
150 } else {
151 delete th ;
152 }
153}
154
155
156////////////////////////////////////////////////////////////////////////////////
157
158RooWorkspace* RooUnitTest::getWS(const char* refName)
159{
160 RooWorkspace* ws = dynamic_cast<RooWorkspace*>(_refFile->Get(refName)) ;
161 if (!ws) {
162 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve RooWorkspace " << refName
163 << " from reference file, skipping " << endl ;
164 return 0 ;
165 }
166
167 return ws ;
168}
169
170
171////////////////////////////////////////////////////////////////////////////////
172
174{
175 if (htest->GetDimension() != href->GetDimension()) {
176 return false ;
177 }
178
179 // Use Kolmogorov distance as metric rather than probability
180 // because we expect histograms to be identical rather
181 // than drawn from the same parent distribution
182 double kmax = htest->KolmogorovTest(href,"M") ;
183
184 if (kmax>htol()) {
185
186 if(_verb >= 0) std::cout << "KS distances = " << kmax << std::endl;
187
188 Int_t ntest = htest->GetNbinsX() +2 ;
189 Int_t nref = href->GetNbinsX() +2 ;
190 if (htest->GetDimension()>1) {
191 ntest *= htest->GetNbinsY() + 2 ;
192 nref *= href->GetNbinsY() + 2 ;
193 }
194 if (htest->GetDimension()>2) {
195 ntest *= htest->GetNbinsZ() + 2 ;
196 nref *= href->GetNbinsZ() + 2 ;
197 }
198
199 if (ntest != nref) {
200 return false ;
201 }
202
203 for (Int_t i=0 ; i<ntest ; i++) {
204 if (std::abs(htest->GetBinContent(i)-href->GetBinContent(i))>htol()) {
205 if(_verb >= 0) std::cout << "htest[" << i << "] = " << htest->GetBinContent(i) << " href[" << i << "] = " << href->GetBinContent(i) << endl;
206 }
207 }
208
209 return false ;
210 }
211
212 return true ;
213}
214
215
216
217////////////////////////////////////////////////////////////////////////////////
218
220{
221 bool ret = true ;
222
223 list<pair<RooPlot*, string> >::iterator iter = _regPlots.begin() ;
224 while (iter!=_regPlots.end()) {
225
226 if (!_write) {
227
228 // Comparison mode
229
230 // Retrieve benchmark
231 RooPlot* bmark = dynamic_cast<RooPlot*>(_refFile->Get(iter->second.c_str())) ;
232 if (!bmark) {
233 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve RooPlot " << iter->second
234 << " from reference file, skipping " << std::endl;
235 ret = false ;
236 ++iter ;
237 continue ;
238 }
239
240 if (_verb > 0) {
241 cout << "comparing RooPlot " << iter->first << " to benchmark " << iter->second << " = " << bmark << endl ;
242 cout << "reference: " ; iter->first->Print() ;
243 cout << "benchmark: " ; bmark->Print() ;
244 }
245
246 RooPlot* compPlot = _debug ? iter->first->emptyClone(Form("%s_comparison",iter->first->GetName())) : 0 ;
247 bool anyFail=false ;
248
249 Stat_t nItems = iter->first->numItems() ;
250 for (Stat_t i=0 ; i<nItems ; i++) {
251 // coverity[NULL_RETURNS]
252 TObject* obj = iter->first->getObject((Int_t)i) ;
253
254 // Retrieve corresponding object from reference frame
255 TObject* objRef = bmark->findObject(obj->GetName()) ;
256
257 if (!objRef) {
258 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve reference object " << obj->GetName()
259 << " from benchmark RooPlot " << iter->second << ", skipping" << std::endl;
260 ret = false ;
261 break ;
262 }
263
264 // Histogram comparisons
265 if (obj->IsA()==RooHist::Class()) {
266 RooHist* testHist = static_cast<RooHist*>(obj) ;
267 RooHist* refHist = static_cast<RooHist*>(objRef) ;
268 if (!testHist->isIdentical(*refHist,htol(),_verb >= 0)) {
269 if(_verb >= 0) std::cout << "RooUnitTest ERROR: comparison of object " << obj->ClassName() << "::" << obj->GetName()
270 << " fails comparison with counterpart in reference RooPlot " << bmark->GetName() << std::endl;
271
272 if (compPlot) {
273 compPlot->addPlotable((RooHist*)testHist->Clone(),"P") ;
274 compPlot->getAttLine()->SetLineColor(kRed) ;
275 compPlot->getAttMarker()->SetMarkerColor(kRed) ;
276 compPlot->getAttLine()->SetLineWidth(1) ;
277
278 compPlot->addPlotable((RooHist*)refHist->Clone(),"P") ;
279 compPlot->getAttLine()->SetLineColor(kBlue) ;
280 compPlot->getAttMarker()->SetMarkerColor(kBlue) ;
281 compPlot->getAttLine()->SetLineWidth(1) ;
282 }
283
284 anyFail=true ;
285 ret = false ;
286 }
287 } else if (obj->IsA()==RooCurve::Class()) {
288 RooCurve* testCurve = static_cast<RooCurve*>(obj) ;
289 RooCurve* refCurve = static_cast<RooCurve*>(objRef) ;
290 if (!testCurve->isIdentical(*refCurve,ctol(),_verb >= 0)) {
291 if(_verb >= 0) std::cout << "RooUnitTest ERROR: comparison of object " << obj->ClassName() << "::" << obj->GetName()
292 << " fails comparison with counterpart in reference RooPlot " << bmark->GetName() << std::endl;
293
294 if (compPlot) {
295 compPlot->addPlotable((RooCurve*)testCurve->Clone()) ;
296 compPlot->getAttLine()->SetLineColor(kRed) ;
297 compPlot->getAttLine()->SetLineWidth(1) ;
298 compPlot->getAttLine()->SetLineStyle(kSolid) ;
299
300 compPlot->addPlotable((RooCurve*)refCurve->Clone()) ;
301 compPlot->getAttLine()->SetLineColor(kBlue) ;
302 compPlot->getAttLine()->SetLineWidth(1) ;
303 compPlot->getAttLine()->SetLineStyle(kDashed) ;
304 }
305
306 anyFail=true ;
307 ret = false ;
308 }
309
310 }
311
312 }
313
314 if (anyFail && compPlot) {
315 cout << "RooUnitTest INFO: writing comparison plot " << compPlot->GetName() << " of failed test to RooUnitTest_DEBUG.root" << endl ;
316 TFile fdbg("RooUnitTest_DEBUG.root","UPDATE") ;
317 compPlot->Write() ;
318 fdbg.Close() ;
319 } else {
320 delete compPlot ;
321 }
322
323 // Delete RooPlot when comparison is finished to avoid noise in leak checking
324 delete iter->first ;
325
326 } else {
327
328 // Writing mode
329
330 std::cout <<"RooUnitTest: Writing reference RooPlot " << iter->first << " as benchmark " << iter->second << endl ;
331 _refFile->cd() ;
332 iter->first->Write(iter->second.c_str()) ;
333 gMemDir->cd() ;
334 }
335
336 ++iter ;
337 }
338
339
340 list<pair<RooFitResult*, string> >::iterator iter2 = _regResults.begin() ;
341 while (iter2!=_regResults.end()) {
342
343 if (!_write) {
344
345 // Comparison mode
346
347 // Retrieve benchmark
348 RooFitResult* bmark = dynamic_cast<RooFitResult*>(_refFile->Get(iter2->second.c_str())) ;
349 if (!bmark) {
350 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve RooFitResult "
351 << iter2->second << " from reference file, skipping " << std::endl ;
352 ++iter2 ;
353 ret = false ;
354 continue ;
355 }
356
357 if (_verb > 0) {
358 cout << "comparing RooFitResult " << iter2->first << " to benchmark " << iter2->second << " = " << bmark << endl ;
359 }
360
361 if (!iter2->first->isIdentical(*bmark,fptol(),fctol(),_verb >= 0)) {
362 if(_verb >= 0) cout << "RooUnitTest ERROR: comparison of object " << iter2->first->ClassName() << "::" << iter2->first->GetName()
363 << " from result " << iter2->second
364 << " fails comparison with counterpart in reference RooFitResult " << bmark->GetName() << std::endl;
365 ret = false ;
366 }
367
368 // Delete RooFitResult when comparison is finished to avoid noise in leak checking
369 delete iter2->first ;
370
371
372 } else {
373
374 // Writing mode
375
376 std::cout <<"RooUnitTest: Writing reference RooFitResult " << iter2->first << " as benchmark " << iter2->second << endl ;
377 _refFile->cd() ;
378 iter2->first->Write(iter2->second.c_str()) ;
379 gMemDir->cd() ;
380 }
381
382 ++iter2 ;
383 }
384
385 list<pair<double, string> >::iterator iter3 = _regValues.begin() ;
386 while (iter3!=_regValues.end()) {
387
388 if (!_write) {
389
390 // Comparison mode
391
392 // Retrieve benchmark
393 RooDouble* ref = dynamic_cast<RooDouble*>(_refFile->Get(iter3->second.c_str())) ;
394 if (!ref) {
395 if(_verb >= 0) std::cout << "RooUnitTest ERROR: cannot retrieve RooDouble " << iter3->second << " from reference file, skipping " << std::endl;
396 ++iter3 ;
397 ret = false ;
398 continue ;
399 }
400
401 if (_verb > 0) {
402 cout << "comparing value " << iter3->first << " to benchmark " << iter3->second << " = " << (double)(*ref) << endl ;
403 }
404
405 if (std::abs(iter3->first - (double)(*ref))>vtol() ) {
406 if(_verb >= 0) cout << "RooUnitTest ERROR: comparison of value " << iter3->first << " fails comparison with reference " << ref->GetName() << endl ;
407 ret = false ;
408 }
409
410
411 } else {
412
413 // Writing mode
414
415 std::cout <<"RooUnitTest: Writing reference double " << iter3->first << " as benchmark " << iter3->second << endl ;
416 _refFile->cd() ;
417 RooDouble* rd = new RooDouble(iter3->first) ;
418 rd->Write(iter3->second.c_str()) ;
419 gMemDir->cd() ;
420 }
421
422 ++iter3 ;
423 }
424
425
426 list<pair<RooTable*, string> >::iterator iter4 = _regTables.begin() ;
427 while (iter4!=_regTables.end()) {
428
429 if (!_write) {
430
431 // Comparison mode
432
433 // Retrieve benchmark
434 RooTable* bmark = dynamic_cast<RooTable*>(_refFile->Get(iter4->second.c_str())) ;
435 if (!bmark) {
436 if(_verb >= 0) cout << "RooUnitTest ERROR: cannot retrieve RooTable " << iter4->second << " from reference file, skipping " << endl ;
437 ++iter4 ;
438 ret = false ;
439 continue ;
440 }
441
442 if (_verb > 0) {
443 cout << "comparing RooTable " << iter4->first << " to benchmark " << iter4->second << " = " << bmark << endl ;
444 }
445
446 if (!iter4->first->isIdentical(*bmark, _verb >= 0)) {
447 if(_verb >= 0) std::cout << "RooUnitTest ERROR: comparison of object " << iter4->first->ClassName() << "::" << iter4->first->GetName()
448 << " fails comparison with counterpart in reference RooTable " << bmark->GetName() << endl ;
449 if (_verb > 0) {
450 iter4->first->Print("V");
451 bmark->Print("V");
452 }
453 ret = false;
454 }
455
456 // Delete RooTable when comparison is finished to avoid noise in leak checking
457 delete iter4->first ;
458
459
460 } else {
461
462 // Writing mode
463
464 std::cout <<"RooUnitTest: Writing reference RooTable " << iter4->first << " as benchmark " << iter4->second << endl ;
465 _refFile->cd() ;
466 iter4->first->Write(iter4->second.c_str()) ;
467 gMemDir->cd() ;
468 }
469
470 ++iter4 ;
471 }
472
473
474 list<pair<RooWorkspace*, string> >::iterator iter5 = _regWS.begin() ;
475 while (iter5!=_regWS.end()) {
476
477 if (_write) {
478
479 // Writing mode
480
481 std::cout <<"RooUnitTest: Writing reference RooWorkspace " << iter5->first << " as benchmark " << iter5->second << endl ;
482 _refFile->cd() ;
483 iter5->first->Write(iter5->second.c_str()) ;
484 gMemDir->cd() ;
485 }
486
487 ++iter5 ;
488 }
489
490 /////////////////
491 list<pair<TH1*, string> >::iterator iter6 = _regTH.begin() ;
492 while (iter6!=_regTH.end()) {
493
494 if (!_write) {
495
496 // Comparison mode
497
498 // Retrieve benchmark
499 TH1* bmark = dynamic_cast<TH1*>(_refFile->Get(iter6->second.c_str())) ;
500 if (!bmark) {
501 if(_verb >= 0) cout << "RooUnitTest ERROR: cannot retrieve TH1 " << iter6->second << " from reference file, skipping " << endl ;
502 ++iter6 ;
503 ret = false ;
504 continue ;
505 }
506
507 if (_verb > 0) {
508 cout << "comparing TH1 " << iter6->first << " to benchmark " << iter6->second << " = " << bmark << endl ;
509 }
510
511 if (!areTHidentical(iter6->first,bmark)) {
512 // coverity[NULL_RETURNS]
513 if(_verb >= 0) cout << "RooUnitTest ERROR: comparison of object " << iter6->first->ClassName() << "::" << iter6->first->GetName()
514 << " fails comparison with counterpart in reference TH1 " << bmark->GetName() << endl ;
515
516
517 if (_debug) {
518 cout << "RooUnitTest INFO: writing THx " << iter6->first->GetName() << " and " << bmark->GetName()
519 << " of failed test to RooUnitTest_DEBUG.root" << endl ;
520 TFile fdbg("RooUnitTest_DEBUG.root","UPDATE") ;
521 iter6->first->SetName(Form("%s_test",iter6->first->GetName())) ;
522 iter6->first->Write() ;
523 bmark->SetName(Form("%s_ref",bmark->GetName())) ;
524 bmark->Write() ;
525 fdbg.Close() ;
526 }
527
528 ret = false ;
529 }
530
531 // Delete TH1 when comparison is finished to avoid noise in leak checking
532 delete iter6->first ;
533
534
535 } else {
536
537 // Writing mode
538
539 std::cout <<"RooUnitTest: Writing reference TH1 " << iter6->first << " as benchmark " << iter6->second << endl ;
540 _refFile->cd() ;
541 iter6->first->Write(iter6->second.c_str()) ;
542 gMemDir->cd() ;
543 }
544
545 ++iter6 ;
546 }
547
548
549 /////////////////
550
551 return ret ;
552}
553
554
555////////////////////////////////////////////////////////////////////////////////
556
558{
560 for (Int_t i=0 ; i<RooMsgService::instance().numStreams() ; i++) {
563 }
564 }
565}
566
567
568////////////////////////////////////////////////////////////////////////////////
569
571{
573 for (Int_t i=0 ; i<RooMsgService::instance().numStreams() ; i++) {
575 }
576}
577
578
579
580////////////////////////////////////////////////////////////////////////////////
581
583{
584 gMemDir->cd() ;
585
586 if (_verb<2) {
587 setSilentMode() ;
588 } else {
589 std::cout << "*** Begin of output of Unit Test at normal verbosity *************" << endl ;
590 }
591
593
594 // Reset random generator seed to make results independent of test ordering
595 gRandom->SetSeed(12345) ;
597
599 if (!testCode()) return false ;
601
602 if (_verb<2) {
604 } else {
605 std::cout << "*** End of output of Unit Test at normal verbosity ***************" << endl ;
606 }
607
608 if (RooMsgService::instance().errorCount()>0) {
609 if(_verb >= 0) std::cout << "RooUnitTest: ERROR messages were logged, failing test" << endl ;
610 return false ;
611 }
612
613 return runCompTests() ;
614}
615
616
617////////////////////////////////////////////////////////////////////////////////
618/// Set gMemDir to memDir
619
621 gMemDir = memDir ;
622}
#define d(i)
Definition RSha256.hxx:102
#define ClassImp(name)
Definition Rtypes.h:377
@ 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:2467
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:879
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.
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:610
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
This method must be overridden when a class wants to print itself.
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 createInternalPlotVarClone()
Replaces the pointer to the plot variable with a pointer to a clone of the plot variable that is owne...
Definition RooPlot.cxx:1448
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:354
static void callgrind_dump()
Utility function to trigger dumping of callgrind counters.
Definition RooTrace.cxx:366
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:85
bool runCompTests()
virtual double htol()
histogram test tolerance (KS dist != prob)
Definition RooUnitTest.h:60
~RooUnitTest() override
void regWS(RooWorkspace *ws, const char *refName)
void regTH(TH1 *h, const char *refName)
virtual double fptol()
fit parameter test tolerance
Definition RooUnitTest.h:66
std::list< std::pair< RooWorkspace *, std::string > > _regWS
Definition RooUnitTest.h:84
static void setMemDir(TDirectory *memDir)
Set gMemDir to memDir.
RooWorkspace * getWS(const char *refName)
void regResult(std::unique_ptr< RooFitResult > r, const char *refName)
std::list< std::pair< RooPlot *, std::string > > _regPlots
Definition RooUnitTest.h:80
void regPlot(RooPlot *frame, const char *refName)
void regValue(double value, const char *refName)
void regTable(RooTable *t, const char *refName)
RooUnitTest(const char *name, TFile *refFile, bool writeRef, Int_t verbose)
std::list< std::pair< RooFitResult *, std::string > > _regResults
Definition RooUnitTest.h:81
virtual double ctol()
curve test tolerance
Definition RooUnitTest.h:64
std::list< std::pair< double, std::string > > _regValues
Definition RooUnitTest.h:82
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:83
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.
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() 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()
Change current directory to "this" directory.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition TFile.h:51
void Close(Option_t *option="") override
Close a file.
Definition TFile.cxx:914
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:8826
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:8086
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:439
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:874
virtual TClass * IsA() const
Definition TObject.h:245
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
Definition TRandom.cxx:608