diff --git a/ostap/fitting/pdfbasic.py b/ostap/fitting/pdfbasic.py index 17ddd672..c4473aa4 100644 --- a/ostap/fitting/pdfbasic.py +++ b/ostap/fitting/pdfbasic.py @@ -1296,6 +1296,10 @@ def nll ( self , sf = dataset.sFactor() self.debug ( 'nll: createNLL args: %s'% list ( opts ) ) + + if ( 6 , 32 ) <= root_info : + return Ostap.MoreRooFit.createNLL ( self.pdf , dataset , *opts ), sF + if len ( opts ) < 8 and root_info < ( 6 , 29 ) : return self.pdf.createNLL ( dataset , *opts ) , sf else : diff --git a/source/include/Ostap/MoreRooFit.h b/source/include/Ostap/MoreRooFit.h index 022b33f3..f1b42595 100644 --- a/source/include/Ostap/MoreRooFit.h +++ b/source/include/Ostap/MoreRooFit.h @@ -3158,7 +3158,15 @@ namespace Ostap ( RooAbsPdf& model , RooAbsData& data , const RooLinkedList& opts ) ; + // ======================================================================== + RooAbsReal* + createNLL + ( RooAbsPdf& model , + RooAbsData& data , + const RooLinkedList& opts ) ; + // ======================================================================= #if ROOT_VERSION(6,32,0)<=ROOT_VERSION_CODE + // ======================================================================= template RooFit::OwningPtr fitTo ( RooAbsPdf& model , @@ -3167,6 +3175,16 @@ namespace Ostap { return model.fitTo(data, cmdArgs... ) ; } + // ======================================================================= + template + RooFit::OwningPtr createNLL + ( RooAbsPdf& model , + RooAbsData& data , + CmdArgs_t const&... cmdArgs ) + { + return model.createNLL ( data , cmdArgs... ) ; + } + // ======================================================================== #endif // ======================================================================== } // The end of namespace Ostap::MoreRooFit diff --git a/source/src/MoreRooFit.cpp b/source/src/MoreRooFit.cpp index 8c777853..0376543a 100644 --- a/source/src/MoreRooFit.cpp +++ b/source/src/MoreRooFit.cpp @@ -1652,6 +1652,15 @@ Ostap::MoreRooFit::fitTo const RooLinkedList& opts ) { return model.fitTo ( data , opts ) ; } // ============================================================================ +// helper function to call RooAbsPdf::createNLL( data , options ) +// ============================================================================ +RooAbsReal* +Ostap::MoreRooFit::createNLL +( RooAbsPdf& model , + RooAbsData& data , + const RooLinkedList& opts ) +{ return model.createNLL ( data , opts ) ; } +// ============================================================================ // ============================================================================