Skip to content

Commit

Permalink
fix ?
Browse files Browse the repository at this point in the history
  • Loading branch information
VanyaBelyaev committed Jun 24, 2024
1 parent 12162dc commit 30b2f28
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ostap/fitting/pdfbasic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down
18 changes: 18 additions & 0 deletions source/include/Ostap/MoreRooFit.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename... CmdArgs_t>
RooFit::OwningPtr<RooFitResult> fitTo
( RooAbsPdf& model ,
Expand All @@ -3167,6 +3175,16 @@ namespace Ostap
{
return model.fitTo(data, cmdArgs... ) ;
}
// =======================================================================
template <typename... CmdArgs_t>
RooFit::OwningPtr<RooAbsReal> createNLL
( RooAbsPdf& model ,
RooAbsData& data ,
CmdArgs_t const&... cmdArgs )
{
return model.createNLL ( data , cmdArgs... ) ;
}
// ========================================================================
#endif
// ========================================================================
} // The end of namespace Ostap::MoreRooFit
Expand Down
9 changes: 9 additions & 0 deletions source/src/MoreRooFit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ; }
// ============================================================================


// ============================================================================
Expand Down

0 comments on commit 30b2f28

Please sign in to comment.