Skip to content

Commit

Permalink
[RF] Use local message level changes in stressRooFit to silence tests
Browse files Browse the repository at this point in the history
This is to avoid output that doesn't indicate any problem and only makes
the test output harder to interpret.

That's how the output of test 27 was before this commit:
```
[#1] INFO:NumericIntegration -- RooRealIntegral::init(pxyz_Int[z|R]_Norm[x,y,z]_Int[y|R]) using numeric integrator RooIntegrator1D to calculate Int(y)
Test 27 : Integration over non-rectangular regions...............OK
```
  • Loading branch information
guitargeek committed Jul 12, 2021
1 parent 4fff188 commit 066ce41
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions test/stressRooFit_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "TCanvas.h"
#include "RooPlot.h"
#include "RooUnitTest.h"
#include "RooHelpers.h"

using namespace RooFit ;

Expand Down Expand Up @@ -2903,17 +2904,23 @@ class TestBasic313 : public RooUnitTest
// C a l c u l a t e i n t e g r a l o f n o r m a l i z e d p d f i n R
// ----------------------------------------------------------------------------------

// Create integral over normalized pdf model over x,y,z in "R" region
RooAbsReal* intPdf = pxyz.createIntegral(RooArgSet(x,y,z),RooArgSet(x,y,z),"R") ;
{
// To remove the INFO:NumericIntegration ouput from the stressRooFit output,
// change the message level locally.
RooHelpers::LocalChangeMsgLevel chmsglvl{RooFit::INFO, 0u, RooFit::NumIntegration, false};

// Create integral over normalized pdf model over x,y,z in "R" region
RooAbsReal* intPdf = pxyz.createIntegral(RooArgSet(x,y,z),RooArgSet(x,y,z),"R") ;

// Plot value of integral as function of pdf parameter z0
RooPlot* frame = z0.frame(Title("Integral of pxyz over x,y,z in region R")) ;
intPdf->plotOn(frame) ;
// Plot value of integral as function of pdf parameter z0
RooPlot* frame = z0.frame(Title("Integral of pxyz over x,y,z in region R")) ;
intPdf->plotOn(frame) ;


regPlot(frame,"rf313_plot1") ;
regPlot(frame,"rf313_plot1") ;

delete intPdf ;
delete intPdf ;
}

return kTRUE;
}
Expand Down

0 comments on commit 066ce41

Please sign in to comment.