Virtual base class for implementation of likelihood calculation strategies.
This class provides the interface necessary for RooMinimizer (through MinuitFcnGrad) to get the likelihood values it needs for fitting the pdf to the data. The strategy by which these values are obtained is up to the implementer of this class. Its intended purpose was mainly to allow for parallel calculation strategies, but serial strategies are possible too, as illustrated in LikelihoodSerial.
Definition at line 61 of file LikelihoodWrapper.h.
Public Member Functions | |
LikelihoodWrapper (const LikelihoodWrapper &)=delete | |
virtual | ~LikelihoodWrapper ()=default |
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. | |
virtual std::string | GetName () const |
virtual ROOT::Math::KahanSum< double > | getResult () const =0 |
Return the latest result of a likelihood evaluation. | |
virtual std::string | GetTitle () const |
virtual bool | isOffsetting () const |
LikelihoodWrapper & | operator= (const LikelihoodWrapper &)=delete |
void | setApplyWeightSquared (bool flag) |
void | setOffsettingMode (OffsettingMode mode) |
virtual void | synchronizeParameterSettings (const std::vector< ROOT::Fit::ParameterSettings > ¶meter_settings) |
virtual void | synchronizeWithMinimizer (const ROOT::Math::MinimizerOptions &options) |
Synchronize minimizer settings with calculators in child classes. | |
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. | |
Static Public Member Functions | |
static std::unique_ptr< LikelihoodWrapper > | create (LikelihoodMode likelihoodMode, std::shared_ptr< RooAbsL > likelihood, std::shared_ptr< WrapperCalculationCleanFlags > calculationIsClean, SharedOffset offset) |
Factory method. | |
Protected Member Functions | |
LikelihoodWrapper (std::shared_ptr< RooAbsL > likelihood, std::shared_ptr< WrapperCalculationCleanFlags > calculation_is_clean, SharedOffset offset) | |
void | calculate_offsets () |
(Re)calculate (on each worker) all component offsets. | |
Protected Attributes | |
std::shared_ptr< WrapperCalculationCleanFlags > | calculation_is_clean_ |
bool | do_offset_ = false |
std::shared_ptr< RooAbsL > | likelihood_ |
LikelihoodType | likelihood_type_ |
OffsettingMode | offsetting_mode_ = OffsettingMode::legacy |
SharedOffset | shared_offset_ |
#include <RooFit/TestStatistics/LikelihoodWrapper.h>
|
protected |
Definition at line 52 of file LikelihoodWrapper.cxx.
|
virtualdefault |
|
delete |
|
protected |
(Re)calculate (on each worker) all component offsets.
Note that these are calculated over the full event range! This will decrease the effectiveness of offsetting proportionally to the number of splits over the event range. The alternative, however, becomes very complex to implement and maintain, so this is a compromise.
Definition at line 123 of file LikelihoodWrapper.cxx.
void RooFit::TestStatistics::LikelihoodWrapper::constOptimizeTestStatistic | ( | RooAbsArg::ConstOpCode | opcode, |
bool | doAlsoTrackingOpt | ||
) |
Definition at line 80 of file LikelihoodWrapper.cxx.
|
static |
Factory method.
Definition at line 212 of file LikelihoodWrapper.cxx.
double RooFit::TestStatistics::LikelihoodWrapper::defaultErrorLevel | ( | ) | const |
Definition at line 85 of file LikelihoodWrapper.cxx.
|
virtual |
Reimplemented in RooFit::TestStatistics::LikelihoodJob.
Definition at line 98 of file LikelihoodWrapper.cxx.
|
pure virtual |
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().
Implemented in RooFit::TestStatistics::LikelihoodJob, and RooFit::TestStatistics::LikelihoodSerial.
|
virtual |
Definition at line 89 of file LikelihoodWrapper.cxx.
|
pure virtual |
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.
Implemented in RooFit::TestStatistics::LikelihoodJob, and RooFit::TestStatistics::LikelihoodSerial.
|
virtual |
Definition at line 93 of file LikelihoodWrapper.cxx.
|
inlinevirtual |
Definition at line 101 of file LikelihoodWrapper.h.
|
delete |
void RooFit::TestStatistics::LikelihoodWrapper::setApplyWeightSquared | ( | bool | flag | ) |
Definition at line 173 of file LikelihoodWrapper.cxx.
void RooFit::TestStatistics::LikelihoodWrapper::setOffsettingMode | ( | OffsettingMode | mode | ) |
Definition at line 107 of file LikelihoodWrapper.cxx.
|
virtual |
Definition at line 75 of file LikelihoodWrapper.cxx.
|
virtual |
Synchronize minimizer settings with calculators in child classes.
Definition at line 73 of file LikelihoodWrapper.cxx.
|
virtual |
Definition at line 208 of file LikelihoodWrapper.cxx.
|
virtual |
Minuit passes in parameter values that may not conform to RooFit internal standards (like applying range clipping), but that the specific calculator does need.
This function can be implemented to receive these Minuit-internal values:
Definition at line 207 of file LikelihoodWrapper.cxx.
|
protected |
Definition at line 109 of file LikelihoodWrapper.h.
|
protected |
Definition at line 111 of file LikelihoodWrapper.h.
|
protected |
Definition at line 107 of file LikelihoodWrapper.h.
|
protected |
Definition at line 108 of file LikelihoodWrapper.h.
|
protected |
Definition at line 114 of file LikelihoodWrapper.h.
|
protected |
Definition at line 112 of file LikelihoodWrapper.h.