87void RooUnitTest::regResult(std::unique_ptr<RooFitResult>
r,
const char*
refName)
97void RooUnitTest::regValue(
double d,
const char*
refName)
131void RooUnitTest::regTH(
TH1* th,
const char*
refName)
147 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve RooWorkspace " <<
refName
148 <<
" from reference file, skipping " << std::endl ;
160 if (
htest->GetDimension() !=
href->GetDimension()) {
167 double kmax =
htest->KolmogorovTest(
href,
"M") ;
171 if(
_verb >= 0) std::cout <<
"KS distances = " << kmax << std::endl;
175 if (
htest->GetDimension()>1) {
179 if (
htest->GetDimension()>2) {
189 if (std::abs(
htest->GetBinContent(i)-
href->GetBinContent(i))>
htol()) {
190 if(
_verb >= 0) std::cout <<
"htest[" << i <<
"] = " <<
htest->GetBinContent(i) <<
" href[" << i <<
"] = " <<
href->GetBinContent(i) << std::endl;
204bool RooUnitTest::runCompTests()
218 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve RooPlot " << iter->second
219 <<
" from reference file, skipping " << std::endl;
226 std::cout <<
"comparing RooPlot " << iter->first <<
" to benchmark " << iter->second <<
" = " <<
bmark << std::endl ;
227 std::cout <<
"reference: " ; iter->first->Print() ;
228 std::cout <<
"benchmark: " ;
bmark->Print() ;
231 RooPlot*
compPlot = _debug ? iter->first->emptyClone(
Form(
"%s_comparison",iter->first->GetName())) : nullptr ;
243 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve reference object " << obj->
GetName()
244 <<
" from benchmark RooPlot " << iter->second <<
", skipping" << std::endl;
254 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: comparison of object " << obj->
ClassName() <<
"::" << obj->
GetName()
255 <<
" fails comparison with counterpart in reference RooPlot " <<
bmark->GetName() << std::endl;
261 compPlot->getAttLine()->SetLineWidth(1) ;
266 compPlot->getAttLine()->SetLineWidth(1) ;
276 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: comparison of object " << obj->
ClassName() <<
"::" << obj->
GetName()
277 <<
" fails comparison with counterpart in reference RooPlot " <<
bmark->GetName() << std::endl;
282 compPlot->getAttLine()->SetLineWidth(1) ;
287 compPlot->getAttLine()->SetLineWidth(1) ;
300 std::cout <<
"RooUnitTest INFO: writing comparison plot " <<
compPlot->GetName() <<
" of failed test to RooUnitTest_DEBUG.root" << std::endl ;
301 TFile fdbg(
"RooUnitTest_DEBUG.root",
"UPDATE") ;
315 std::cout <<
"RooUnitTest: Writing reference RooPlot " << iter->first <<
" as benchmark " << iter->second << std::endl ;
317 iter->first->Write(iter->second.c_str()) ;
335 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve RooFitResult "
336 <<
iter2->second <<
" from reference file, skipping " << std::endl ;
343 std::cout <<
"comparing RooFitResult " <<
iter2->first <<
" to benchmark " <<
iter2->second <<
" = " <<
bmark << std::endl ;
348 std::cout <<
"RooUnitTest ERROR: comparison of object " <<
iter2->first->ClassName()
349 <<
"::" <<
iter2->first->GetName() <<
" from result " <<
iter2->second
350 <<
" fails comparison with counterpart in reference RooFitResult " <<
bmark->GetName() << std::endl;
356 delete iter2->first ;
363 std::cout <<
"RooUnitTest: Writing reference RooFitResult " <<
iter2->first <<
" as benchmark " <<
iter2->second << std::endl ;
382 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve RooDouble " <<
iter3->second <<
" from reference file, skipping " << std::endl;
389 std::cout <<
"comparing value " <<
iter3->first <<
" to benchmark " <<
iter3->second <<
" = " << (
double)(*ref) << std::endl ;
392 if (std::abs(
iter3->first - (
double)(*ref))>
vtol() ) {
393 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: comparison of value " <<
iter3->first <<
" fails comparison with reference " << ref->
GetName() << std::endl ;
402 std::cout <<
"RooUnitTest: Writing reference double " <<
iter3->first <<
" as benchmark " <<
iter3->second << std::endl ;
405 rd->Write(
iter3->second.c_str()) ;
423 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve RooTable " <<
iter4->second <<
" from reference file, skipping " << std::endl ;
430 std::cout <<
"comparing RooTable " <<
iter4->first <<
" to benchmark " <<
iter4->second <<
" = " <<
bmark << std::endl ;
434 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: comparison of object " <<
iter4->first->ClassName() <<
"::" <<
iter4->first->GetName()
435 <<
" fails comparison with counterpart in reference RooTable " <<
bmark->GetName() << std::endl ;
437 iter4->first->Print(
"V");
444 delete iter4->first ;
451 std::cout <<
"RooUnitTest: Writing reference RooTable " <<
iter4->first <<
" as benchmark " <<
iter4->second << std::endl ;
468 std::cout <<
"RooUnitTest: Writing reference RooWorkspace " <<
iter5->first <<
" as benchmark " <<
iter5->second << std::endl ;
488 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve TH1 " <<
iter6->second <<
" from reference file, skipping " << std::endl ;
495 std::cout <<
"comparing TH1 " <<
iter6->first <<
" to benchmark " <<
iter6->second <<
" = " <<
bmark << std::endl ;
500 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: comparison of object " <<
iter6->first->ClassName() <<
"::" <<
iter6->first->GetName()
501 <<
" fails comparison with counterpart in reference TH1 " <<
bmark->GetName() << std::endl ;
505 std::cout <<
"RooUnitTest INFO: writing THx " <<
iter6->first->GetName() <<
" and " <<
bmark->GetName()
506 <<
" of failed test to RooUnitTest_DEBUG.root" << std::endl ;
507 TFile fdbg(
"RooUnitTest_DEBUG.root",
"UPDATE") ;
509 iter6->first->Write() ;
519 delete iter6->first ;
526 std::cout <<
"RooUnitTest: Writing reference TH1 " <<
iter6->first <<
" as benchmark " <<
iter6->second << std::endl ;
544void RooUnitTest::setSilentMode()
557void RooUnitTest::clearSilentMode()
569bool RooUnitTest::runTest()
576 std::cout <<
"*** Begin of output of Unit Test at normal verbosity *************" << std::endl ;
592 std::cout <<
"*** End of output of Unit Test at normal verbosity ***************" << std::endl ;
596 if(
_verb >= 0) std::cout <<
"RooUnitTest: ERROR messages were logged, failing test" << std::endl ;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
const_iterator begin() const
const_iterator end() const
One-dimensional graphical representation of a real-valued function.
Minimal implementation of a TObject holding a double value.
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
Graphical representation of binned data based on the TGraphAsymmErrors class.
static RooMsgService & instance()
Return reference to singleton instance.
Plot frame and a container for graphics objects within that frame.
void SetName(const char *name) override
Set the name of the RooPlot to 'name'.
void createInternalPlotVarClone()
Replaces the pointer to the plot variable with a pointer to a clone of the plot variable that is owne...
static TRandom * randomGenerator()
Return a pointer to a singleton random-number generator implementation.
Abstract interface for table objects.
static void callgrind_zero()
Utility function to trigger zeroing of callgrind counters.
static void callgrind_dump()
Utility function to trigger dumping of callgrind counters.
Persistable container for RooFit projects.
Describe directory structure in memory.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
TH1 is the base class of all histogram classes in ROOT.
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual TClass * IsA() const
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.