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.
Definition at line 24 of file LikelihoodSerial.h.
Public Member Functions | |
LikelihoodSerial (std::shared_ptr< RooAbsL > _likelihood, std::shared_ptr< WrapperCalculationCleanFlags > calculation_is_clean, SharedOffset offset) | |
void | evaluate () override |
Triggers (possibly asynchronous) evaluation of the likelihood. | |
ROOT::Math::KahanSum< double > | getResult () const override |
Return the latest result of a likelihood evaluation. | |
void | initVars () |
Helper function for the constructor. | |
![]() | |
LikelihoodWrapper (const LikelihoodWrapper &)=delete | |
virtual | ~LikelihoodWrapper ()=default |
void | constOptimizeTestStatistic (RooAbsArg::ConstOpCode opcode, bool doAlsoTrackingOpt) |
double | defaultErrorLevel () const |
virtual void | enableOffsetting (bool flag) |
virtual std::string | GetName () const |
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. | |
Private Attributes | |
RooArgList | _saveVars |
Copy of variables. | |
RooArgList | _vars |
Variables. | |
ROOT::Math::KahanSum< double > | result |
Additional Inherited Members | |
![]() | |
static std::unique_ptr< LikelihoodWrapper > | create (LikelihoodMode likelihoodMode, std::shared_ptr< RooAbsL > likelihood, std::shared_ptr< WrapperCalculationCleanFlags > calculationIsClean, SharedOffset offset) |
Factory method. | |
![]() | |
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. | |
![]() | |
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_ |
RooFit::TestStatistics::LikelihoodSerial::LikelihoodSerial | ( | std::shared_ptr< RooAbsL > | _likelihood, |
std::shared_ptr< WrapperCalculationCleanFlags > | calculation_is_clean, | ||
SharedOffset | offset | ||
) |
Definition at line 34 of file LikelihoodSerial.cxx.
|
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 65 of file LikelihoodSerial.cxx.
|
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 32 of file LikelihoodSerial.h.
void RooFit::TestStatistics::LikelihoodSerial::initVars | ( | ) |
Helper function for the constructor.
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 49 of file LikelihoodSerial.cxx.
|
private |
Copy of variables.
Definition at line 38 of file LikelihoodSerial.h.
|
private |
Variables.
Definition at line 37 of file LikelihoodSerial.h.
|
private |
Definition at line 35 of file LikelihoodSerial.h.