Logo ROOT  
Reference Guide
RooFit::TestStatistics::LikelihoodSerial Class Reference

Serial likelihood calculation strategy implementation.

This class serves as a baseline reference implementation of the LikelihoodWrapper. It reimplements the previous RooNLLVar "BulkPartition" single CPU strategy in the new RooFit::TestStatistics framework.

Note
The class is not intended for use by end-users. We recommend to either use RooMinimizer with a RooAbsL derived likelihood object, or to use a higher level entry point like RooAbsPdf::fitTo() or RooAbsPdf::createNLL().

Definition at line 26 of file LikelihoodSerial.h.

Public Member Functions

 LikelihoodSerial (std::shared_ptr< RooAbsL > likelihood, std::shared_ptr< WrapperCalculationCleanFlags > calculation_is_clean)
 
LikelihoodSerialclone () const override
 
void evaluate () override
 Triggers (possibly asynchronous) evaluation of the likelihood. More...
 
ROOT::Math::KahanSum< doublegetResult () const override
 Return the latest result of a likelihood evaluation. More...
 
void initVars ()
 Helper function for the constuctor. More...
 
- Public Member Functions inherited from RooFit::TestStatistics::LikelihoodWrapper
 LikelihoodWrapper (std::shared_ptr< RooAbsL > likelihood, std::shared_ptr< WrapperCalculationCleanFlags > calculation_is_clean)
 
virtual ~LikelihoodWrapper ()=default
 
virtual LikelihoodWrapperclone () const =0
 
void constOptimizeTestStatistic (RooAbsArg::ConstOpCode opcode, bool doAlsoTrackingOpt)
 
double defaultErrorLevel () const
 
virtual void enableOffsetting (bool flag)
 
virtual void evaluate ()=0
 Triggers (possibly asynchronous) evaluation of the likelihood. More...
 
virtual std::string GetName () const
 
virtual ROOT::Math::KahanSum< doublegetResult () const =0
 Return the latest result of a likelihood evaluation. More...
 
virtual std::string GetTitle () const
 
virtual bool isOffsetting () const
 
ROOT::Math::KahanSum< doubleoffset () const
 
void setApplyWeightSquared (bool flag)
 
void setOffsettingMode (OffsettingMode mode)
 
virtual void synchronizeParameterSettings (const std::vector< ROOT::Fit::ParameterSettings > &parameter_settings)
 
virtual void synchronizeWithMinimizer (const ROOT::Math::MinimizerOptions &options)
 Synchronize minimizer settings with calculators in child classes. More...
 
virtual void updateMinuitExternalParameterValues (const std::vector< double > &minuit_external_x)
 
virtual void updateMinuitInternalParameterValues (const std::vector< double > &minuit_internal_x)
 Minuit passes in parameter values that may not conform to RooFit internal standards (like applying range clipping), but that the specific calculator does need. More...
 

Private Attributes

RooArgList _saveVars
 Copy of variables. More...
 
RooArgList _vars
 Variables. More...
 
LikelihoodType likelihood_type
 
ROOT::Math::KahanSum< doubleresult
 

Additional Inherited Members

- Static Public Member Functions inherited from RooFit::TestStatistics::LikelihoodWrapper
static std::unique_ptr< LikelihoodWrappercreate (LikelihoodMode likelihoodMode, std::shared_ptr< RooAbsL > likelihood, std::shared_ptr< WrapperCalculationCleanFlags > calculationIsClean)
 Factory method. More...
 
- Protected Member Functions inherited from RooFit::TestStatistics::LikelihoodWrapper
ROOT::Math::KahanSum< doubleapplyOffsetting (ROOT::Math::KahanSum< double > current_value)
 
void swapOffsets ()
 When calculating an unbinned likelihood with square weights applied, a different offset is necessary. More...
 
- Protected Attributes inherited from RooFit::TestStatistics::LikelihoodWrapper
std::shared_ptr< WrapperCalculationCleanFlagscalculation_is_clean_
 
bool do_offset_ = false
 
std::shared_ptr< RooAbsLlikelihood_
 
ROOT::Math::KahanSum< doubleoffset_
 
ROOT::Math::KahanSum< doubleoffset_save_ = 0
 ! More...
 
OffsettingMode offsetting_mode_ = OffsettingMode::legacy
 

#include </home/sftnight/build/workspace/root-makedoc-master/rootspi/rdoc/src/master/roofit/roofitcore/src/TestStatistics/LikelihoodSerial.h>

Inheritance diagram for RooFit::TestStatistics::LikelihoodSerial:
[legend]

Constructor & Destructor Documentation

◆ LikelihoodSerial()

RooFit::TestStatistics::LikelihoodSerial::LikelihoodSerial ( std::shared_ptr< RooAbsL likelihood,
std::shared_ptr< WrapperCalculationCleanFlags calculation_is_clean 
)

Definition at line 35 of file LikelihoodSerial.cxx.

Member Function Documentation

◆ clone()

LikelihoodSerial * RooFit::TestStatistics::LikelihoodSerial::clone ( ) const
inlineoverridevirtual

Implements RooFit::TestStatistics::LikelihoodWrapper.

Definition at line 30 of file LikelihoodSerial.h.

◆ evaluate()

void RooFit::TestStatistics::LikelihoodSerial::evaluate ( )
overridevirtual

Triggers (possibly asynchronous) evaluation of the likelihood.

In parallel strategies, it may be advantageous to allow a calling process to continue on with other tasks while the calculation is offloaded to another process or device, like a GPU. For this reason, evaluate() does not return the result, this is done in getResult().

Implements RooFit::TestStatistics::LikelihoodWrapper.

Definition at line 79 of file LikelihoodSerial.cxx.

◆ getResult()

ROOT::Math::KahanSum< double > RooFit::TestStatistics::LikelihoodSerial::getResult ( ) const
inlineoverridevirtual

Return the latest result of a likelihood evaluation.

Returns the result that was stored after calling evaluate(). It is up to the implementer to make sure the stored value represents the most recent evaluation call, e.g. by using a mutex.

Implements RooFit::TestStatistics::LikelihoodWrapper.

Definition at line 35 of file LikelihoodSerial.h.

◆ initVars()

void RooFit::TestStatistics::LikelihoodSerial::initVars ( )

Helper function for the constuctor.

This is a separate function (instead of just in ctor) for historical reasons. Its predecessor RooRealMPFE::initVars() was used from multiple ctors, but also from RooRealMPFE::constOptimizeTestStatistic at the end, which makes sense, because it might change the set of variables. We may at some point want to do this here as well.

Definition at line 63 of file LikelihoodSerial.cxx.

Member Data Documentation

◆ _saveVars

RooArgList RooFit::TestStatistics::LikelihoodSerial::_saveVars
private

Copy of variables.

Definition at line 41 of file LikelihoodSerial.h.

◆ _vars

RooArgList RooFit::TestStatistics::LikelihoodSerial::_vars
private

Variables.

Definition at line 40 of file LikelihoodSerial.h.

◆ likelihood_type

LikelihoodType RooFit::TestStatistics::LikelihoodSerial::likelihood_type
private

Definition at line 43 of file LikelihoodSerial.h.

◆ result

ROOT::Math::KahanSum<double> RooFit::TestStatistics::LikelihoodSerial::result
private

Definition at line 38 of file LikelihoodSerial.h.


The documentation for this class was generated from the following files: