From 97333bfd01b3651a724278bdd132bde10914f5bf Mon Sep 17 00:00:00 2001 From: Vanya Belyaev Date: Sat, 9 Sep 2023 15:13:33 +0200 Subject: [PATCH] 1. Improve treatment of `silent` for `PDF.chi2FitTo` 1. fix minor typos in `oftap.fitting.pdfbasic.py` --- ReleaseNotes/release_notes.md | 2 ++ ostap/fitting/pdfbasic.py | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ReleaseNotes/release_notes.md b/ReleaseNotes/release_notes.md index d7d96744..aaacb378 100644 --- a/ReleaseNotes/release_notes.md +++ b/ReleaseNotes/release_notes.md @@ -6,10 +6,12 @@ 1. make use for `ROOT::TDirectory::TContext` for `ROOTCWD` 1. imporve functions/pdf for Benini distribution allowing terms upto power 10 1. use 'RoMinimizer' instead of `RooMinuit` for fresh version of ROOT + 1. Improve treatment of `silent` for `PDF.chi2FitTo` ## Backward incompatible: ## Bug fixes: + 1. fix minor typos in `oftap.fitting.pdfbasic.py` # v1.9.9.8 diff --git a/ostap/fitting/pdfbasic.py b/ostap/fitting/pdfbasic.py index 5a8dc2fb..3584d977 100644 --- a/ostap/fitting/pdfbasic.py +++ b/ostap/fitting/pdfbasic.py @@ -1075,15 +1075,22 @@ def chi2fitTo ( self , histo = dataset with roo_silent ( silent ) : - lst1 = self.fit_options + ( ROOT.RooFit.Save () , ) + args lst1 = list ( self.parse_args ( hdataset , *args , **kwargs ) ) lst2 = [] + if silent : + pl = check_arg ('PrintLevel' , *lst1 ) + if not pl : lst1.append ( ROOT.RooFit.PrintLevel ( -1 ) ) + vl = check_arg ('Verbose' , *lst1 ) + if not vl : lst1.append ( ROOT.RooFit.Verbose ( False ) ) + pe = check_arg ('PrintEvalErrors' , *lst1 ) + if not pe : lst1.append ( ROOT.RooFit.PrintEvalErrors ( 0 ) ) + if self.pdf.mustBeExtended () : lst2.append ( ROOT.RooFit.Extended ( True ) ) elif not self.pdf.canBeExtended () : lst2.append ( ROOT.RooFit.Extended ( False ) ) - + if not silent : lst2.append ( ROOT.RooFit.Verbose () ) if histo : if histo.natural() : lst2.append ( ROOT.RooFit.DataError ( ROOT.RooAbsData.Poisson ) ) @@ -1606,7 +1613,7 @@ def wilks2 ( self , with RangeVar( self.xvar , *xminmax ) : density = kwargs.pop ( 'density' , False ) silent = kwargs.pop ( 'silent' , True ) - self.histo_data = H1D_dset ( histo = dataset , xaxis = self.xvar , density = density , silnet = silent ) + self.histo_data = H1D_dset ( histo = dataset , xaxis = self.xvar , density = density , silent = silent ) hdataset = self.histo_data.dset kwargs['ncpu'] = 1 return self.wilks2 ( var = var ,