86void RooUnitTest::regResult(std::unique_ptr<RooFitResult>
r,
const char*
refName)
96void RooUnitTest::regValue(
double d,
const char*
refName)
146 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve RooWorkspace " <<
refName
147 <<
" from reference file, skipping " << std::endl ;
159 if (
htest->GetDimension() !=
href->GetDimension()) {
166 double kmax =
htest->KolmogorovTest(
href,
"M") ;
170 if(
_verb >= 0) std::cout <<
"KS distances = " << kmax << std::endl;
174 if (
htest->GetDimension()>1) {
178 if (
htest->GetDimension()>2) {
188 if (std::abs(
htest->GetBinContent(i)-
href->GetBinContent(i))>
htol()) {
189 if(
_verb >= 0) std::cout <<
"htest[" << i <<
"] = " <<
htest->GetBinContent(i) <<
" href[" << i <<
"] = " <<
href->GetBinContent(i) << std::endl;
203bool RooUnitTest::runCompTests()
217 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve RooPlot " << iter->second
218 <<
" from reference file, skipping " << std::endl;
225 std::cout <<
"comparing RooPlot " << iter->first <<
" to benchmark " << iter->second <<
" = " <<
bmark << std::endl ;
226 std::cout <<
"reference: " ; iter->first->Print() ;
227 std::cout <<
"benchmark: " ;
bmark->Print() ;
230 RooPlot*
compPlot = _debug ? iter->first->emptyClone(
Form(
"%s_comparison",iter->first->GetName())) : nullptr ;
242 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve reference object " << obj->
GetName()
243 <<
" from benchmark RooPlot " << iter->second <<
", skipping" << std::endl;
253 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: comparison of object " << obj->
ClassName() <<
"::" << obj->
GetName()
254 <<
" fails comparison with counterpart in reference RooPlot " <<
bmark->GetName() << std::endl;
260 compPlot->getAttLine()->SetLineWidth(1) ;
265 compPlot->getAttLine()->SetLineWidth(1) ;
275 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: comparison of object " << obj->
ClassName() <<
"::" << obj->
GetName()
276 <<
" fails comparison with counterpart in reference RooPlot " <<
bmark->GetName() << std::endl;
281 compPlot->getAttLine()->SetLineWidth(1) ;
286 compPlot->getAttLine()->SetLineWidth(1) ;
299 std::cout <<
"RooUnitTest INFO: writing comparison plot " <<
compPlot->GetName() <<
" of failed test to RooUnitTest_DEBUG.root" << std::endl ;
300 TFile fdbg(
"RooUnitTest_DEBUG.root",
"UPDATE") ;
314 std::cout <<
"RooUnitTest: Writing reference RooPlot " << iter->first <<
" as benchmark " << iter->second << std::endl ;
316 iter->first->Write(iter->second.c_str()) ;
334 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve RooFitResult "
335 <<
iter2->second <<
" from reference file, skipping " << std::endl ;
342 std::cout <<
"comparing RooFitResult " <<
iter2->first <<
" to benchmark " <<
iter2->second <<
" = " <<
bmark << std::endl ;
347 std::cout <<
"RooUnitTest ERROR: comparison of object " <<
iter2->first->ClassName()
348 <<
"::" <<
iter2->first->GetName() <<
" from result " <<
iter2->second
349 <<
" fails comparison with counterpart in reference RooFitResult " <<
bmark->GetName() << std::endl;
355 delete iter2->first ;
362 std::cout <<
"RooUnitTest: Writing reference RooFitResult " <<
iter2->first <<
" as benchmark " <<
iter2->second << std::endl ;
381 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve RooDouble " <<
iter3->second <<
" from reference file, skipping " << std::endl;
388 std::cout <<
"comparing value " <<
iter3->first <<
" to benchmark " <<
iter3->second <<
" = " << (
double)(*
ref) << std::endl ;
391 if (std::abs(
iter3->first - (
double)(*ref))>
vtol() ) {
392 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: comparison of value " <<
iter3->first <<
" fails comparison with reference " <<
ref->GetName() << std::endl ;
401 std::cout <<
"RooUnitTest: Writing reference double " <<
iter3->first <<
" as benchmark " <<
iter3->second << std::endl ;
404 rd->Write(
iter3->second.c_str()) ;
422 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve RooTable " <<
iter4->second <<
" from reference file, skipping " << std::endl ;
429 std::cout <<
"comparing RooTable " <<
iter4->first <<
" to benchmark " <<
iter4->second <<
" = " <<
bmark << std::endl ;
433 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: comparison of object " <<
iter4->first->ClassName() <<
"::" <<
iter4->first->GetName()
434 <<
" fails comparison with counterpart in reference RooTable " <<
bmark->GetName() << std::endl ;
436 iter4->first->Print(
"V");
443 delete iter4->first ;
450 std::cout <<
"RooUnitTest: Writing reference RooTable " <<
iter4->first <<
" as benchmark " <<
iter4->second << std::endl ;
467 std::cout <<
"RooUnitTest: Writing reference RooWorkspace " <<
iter5->first <<
" as benchmark " <<
iter5->second << std::endl ;
487 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: cannot retrieve TH1 " <<
iter6->second <<
" from reference file, skipping " << std::endl ;
494 std::cout <<
"comparing TH1 " <<
iter6->first <<
" to benchmark " <<
iter6->second <<
" = " <<
bmark << std::endl ;
499 if(
_verb >= 0) std::cout <<
"RooUnitTest ERROR: comparison of object " <<
iter6->first->ClassName() <<
"::" <<
iter6->first->GetName()
500 <<
" fails comparison with counterpart in reference TH1 " <<
bmark->GetName() << std::endl ;
504 std::cout <<
"RooUnitTest INFO: writing THx " <<
iter6->first->GetName() <<
" and " <<
bmark->GetName()
505 <<
" of failed test to RooUnitTest_DEBUG.root" << std::endl ;
506 TFile fdbg(
"RooUnitTest_DEBUG.root",
"UPDATE") ;
508 iter6->first->Write() ;
518 delete iter6->first ;
525 std::cout <<
"RooUnitTest: Writing reference TH1 " <<
iter6->first <<
" as benchmark " <<
iter6->second << std::endl ;
543void RooUnitTest::setSilentMode()
556void RooUnitTest::clearSilentMode()
568bool RooUnitTest::runTest()
575 std::cout <<
"*** Begin of output of Unit Test at normal verbosity *************" << std::endl ;
589 std::cout <<
"*** End of output of Unit Test at normal verbosity ***************" << std::endl ;
593 if(
_verb >= 0) std::cout <<
"RooUnitTest: ERROR messages were logged, failing test" << std::endl ;
int Int_t
Signed integer 4 bytes (int)
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.
Persistable container for RooFit projects.
Describe directory structure in memory.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
TH1 is the base class of all histogram classes in ROOT.
The TNamed class is the base class for all named ROOT classes.
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.