Logo ROOT  
Reference Guide
No Matches
RooFit::TestStatistics::LikelihoodJob Class Reference

Definition at line 28 of file LikelihoodJob.h.


struct  task_result_t
struct  update_state_t

Public Types

enum class  update_state_mode : int { parameters , offsetting }

Public Member Functions

 LikelihoodJob (std::shared_ptr< RooAbsL > _likelihood, std::shared_ptr< WrapperCalculationCleanFlags > calculation_is_clean)
LikelihoodJobclone () const override
void enableOffsetting (bool flag) override
void evaluate () override
 Triggers (possibly asynchronous) evaluation of the likelihood.
void evaluate_task (std::size_t task) override
ROOT::Math::KahanSum< doublegetResult () const override
 Return the latest result of a likelihood evaluation.
void init_vars ()
bool receive_task_result_on_master (const zmq::message_t &message) override
void send_back_task_result_from_worker (std::size_t task) override
void update_state () override
 Virtual function to update any necessary state on workers.
void updateWorkersOffsetting ()
void updateWorkersParameters ()
- Public Member Functions inherited from RooFit::MultiProcess::Job
 Job ()
 Job (const Job &other)
 ~Job ()
virtual void evaluate_task (std::size_t task)=0
void gather_worker_results ()
 Wait for all tasks to be retrieved for the current Job.
std::size_t get_state_id ()
 Get the current state identifier.
virtual bool receive_task_result_on_master (const zmq::message_t &message)=0
virtual void send_back_task_result_from_worker (std::size_t task)=0
virtual void update_state ()
 Virtual function to update any necessary state on workers.
- 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.
virtual std::string GetName () const
virtual ROOT::Math::KahanSum< doublegetResult () const =0
 Return the latest result of a likelihood evaluation.
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.
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 Member Functions

std::size_t getNComponentTasks ()
std::size_t getNEventTasks ()

Private Attributes

LikelihoodType likelihood_type_
std::size_t n_component_tasks_
std::size_t n_event_tasks_
std::size_t n_tasks_at_workers_ = 0
ROOT::Math::KahanSum< doubleresult_
std::vector< ROOT::Math::KahanSum< double > > results_
RooArgList save_vars_
RooArgList vars_

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.
- Protected Member Functions inherited from RooFit::MultiProcess::Job
JobManagerget_manager ()
 Get JobManager instance; create and activate if necessary.
- 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.
- Protected Attributes inherited from RooFit::MultiProcess::Job
std::size_t id_
std::size_t state_id_ = 0
- 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.}
OffsettingMode offsetting_mode_ = OffsettingMode::legacy

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

Inheritance diagram for RooFit::TestStatistics::LikelihoodJob:

Member Enumeration Documentation

◆ update_state_mode


Definition at line 51 of file LikelihoodJob.h.

Constructor & Destructor Documentation

◆ LikelihoodJob()

RooFit::TestStatistics::LikelihoodJob::LikelihoodJob ( std::shared_ptr< RooAbsL _likelihood,
std::shared_ptr< WrapperCalculationCleanFlags calculation_is_clean 

Definition at line 31 of file LikelihoodJob.cxx.

Member Function Documentation

◆ clone()

LikelihoodJob * RooFit::TestStatistics::LikelihoodJob::clone ( ) const

Implements RooFit::TestStatistics::LikelihoodWrapper.

Definition at line 56 of file LikelihoodJob.cxx.

◆ enableOffsetting()

void RooFit::TestStatistics::LikelihoodJob::enableOffsetting ( bool  flag)

Reimplemented from RooFit::TestStatistics::LikelihoodWrapper.

Definition at line 277 of file LikelihoodJob.cxx.

◆ evaluate()

void RooFit::TestStatistics::LikelihoodJob::evaluate ( )

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 181 of file LikelihoodJob.cxx.

◆ evaluate_task()

void RooFit::TestStatistics::LikelihoodJob::evaluate_task ( std::size_t  task)

Implements RooFit::MultiProcess::Job.

Definition at line 228 of file LikelihoodJob.cxx.

◆ getNComponentTasks()

std::size_t RooFit::TestStatistics::LikelihoodJob::getNComponentTasks ( )

Definition at line 126 of file LikelihoodJob.cxx.

◆ getNEventTasks()

std::size_t RooFit::TestStatistics::LikelihoodJob::getNEventTasks ( )
In automatic mode, this function can start MultiProcess (forks, starts workers, etc)!

Definition at line 113 of file LikelihoodJob.cxx.

◆ getResult()

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

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 37 of file LikelihoodJob.h.

◆ init_vars()

void RooFit::TestStatistics::LikelihoodJob::init_vars ( )

Definition at line 66 of file LikelihoodJob.cxx.

◆ receive_task_result_on_master()

bool RooFit::TestStatistics::LikelihoodJob::receive_task_result_on_master ( const zmq::message_t &  message)

Implements RooFit::MultiProcess::Job.

Definition at line 217 of file LikelihoodJob.cxx.

◆ send_back_task_result_from_worker()

void RooFit::TestStatistics::LikelihoodJob::send_back_task_result_from_worker ( std::size_t  task)

Implements RooFit::MultiProcess::Job.

Definition at line 209 of file LikelihoodJob.cxx.

◆ update_state()

void RooFit::TestStatistics::LikelihoodJob::update_state ( )

Virtual function to update any necessary state on workers.

This function is called from the worker loop when something is received over the ZeroMQ "SUB" socket. The master process sends messages to workers on its "PUB" socket. Thus, we can update, for instance, parameter values on the worker that were updated since the last call on the master side.

Implementers: make sure to also update the state_id_ member.

Reimplemented from RooFit::MultiProcess::Job.

Definition at line 84 of file LikelihoodJob.cxx.

◆ updateWorkersOffsetting()

void RooFit::TestStatistics::LikelihoodJob::updateWorkersOffsetting ( )

Definition at line 176 of file LikelihoodJob.cxx.

◆ updateWorkersParameters()

void RooFit::TestStatistics::LikelihoodJob::updateWorkersParameters ( )

Definition at line 138 of file LikelihoodJob.cxx.

Member Data Documentation

◆ likelihood_type_

LikelihoodType RooFit::TestStatistics::LikelihoodJob::likelihood_type_

Definition at line 72 of file LikelihoodJob.h.

◆ n_component_tasks_

std::size_t RooFit::TestStatistics::LikelihoodJob::n_component_tasks_

Definition at line 77 of file LikelihoodJob.h.

◆ n_event_tasks_

std::size_t RooFit::TestStatistics::LikelihoodJob::n_event_tasks_

Definition at line 76 of file LikelihoodJob.h.

◆ n_tasks_at_workers_

std::size_t RooFit::TestStatistics::LikelihoodJob::n_tasks_at_workers_ = 0

Definition at line 73 of file LikelihoodJob.h.

◆ result_

ROOT::Math::KahanSum<double> RooFit::TestStatistics::LikelihoodJob::result_

Definition at line 66 of file LikelihoodJob.h.

◆ results_

std::vector<ROOT::Math::KahanSum<double> > RooFit::TestStatistics::LikelihoodJob::results_

Definition at line 67 of file LikelihoodJob.h.

◆ save_vars_

RooArgList RooFit::TestStatistics::LikelihoodJob::save_vars_

Definition at line 70 of file LikelihoodJob.h.

◆ vars_

RooArgList RooFit::TestStatistics::LikelihoodJob::vars_

Definition at line 69 of file LikelihoodJob.h.

  • roofit/roofitcore/src/TestStatistics/LikelihoodJob.h
  • roofit/roofitcore/src/TestStatistics/LikelihoodJob.cxx