Skip to content

Commit

Permalink
Implement right overload of createNLL in RooSimultaneousOpt
Browse files Browse the repository at this point in the history
  • Loading branch information
guitargeek committed Apr 19, 2024
1 parent bcbec56 commit 3becf26
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 5 additions & 1 deletion interface/RooSimultaneousOpt.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class RooSimultaneousOpt : public RooSimultaneous {

~RooSimultaneousOpt() override ;

virtual RooAbsReal* createNLL(RooAbsData& data, const RooLinkedList& cmdList) ;
#if ROOT_VERSION_CODE < ROOT_VERSION(6,30,0)
RooAbsReal* createNLL(RooAbsData& data, const RooLinkedList& cmdList) override;
#else
std::unique_ptr<RooAbsReal> createNLLImpl(RooAbsData& data, const RooLinkedList& cmdList) override;
#endif

const RooArgList & extraConstraints() const { return _extraConstraints; }
const RooArgList & channelMasks() const { return _channelMasks; }
Expand Down
11 changes: 10 additions & 1 deletion src/RooSimultaneousOpt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@
#include "../interface/CachingNLL.h"
#include <RooCmdConfig.h>

#if ROOT_VERSION_CODE < ROOT_VERSION(6,30,0)
RooAbsReal*
RooSimultaneousOpt::createNLL(RooAbsData& data, const RooLinkedList& cmdList)
#else
std::unique_ptr<RooAbsReal>
RooSimultaneousOpt::createNLLImpl(RooAbsData& data, const RooLinkedList& cmdList)
#endif
{
RooCmdConfig pc(Form("RooSimultaneousOpt::createNLL(%s)",GetName())) ;
pc.defineSet("cPars","Constrain",0,0);
RooArgSet *cPars = pc.getSet("cPars");
cacheutils::CachingSimNLL *nll = new cacheutils::CachingSimNLL(this, &data, cPars);
auto nll = std::make_unique<cacheutils::CachingSimNLL>(this, &data, cPars);
nll->setChannelMasks(this->channelMasks());
#if ROOT_VERSION_CODE < ROOT_VERSION(6,30,0)
return nll.release();
#else
return nll;
#endif
}

RooSimultaneousOpt::~RooSimultaneousOpt()
Expand Down

0 comments on commit 3becf26

Please sign in to comment.