30namespace TestStatistics {
33 std::shared_ptr<WrapperCalculationCleanFlags> calculation_is_clean,
45 const std::vector<ROOT::Fit::ParameterSettings> ¶meter_settings)
110 return job_completed;
130 double fValAtX = std::numeric_limits<double>::quiet_NaN();
134 std::move(minuit_internal_x_message), std::move(offsets_message));
139 std::move(minuit_internal_x_message));
169 auto gradient_message =
173 auto gradient_message_end =
175 std::copy(gradient_message_begin, gradient_message_end,
grad_.begin());
177 auto minuit_internal_x_message =
179 auto minuit_internal_x_message_begin = minuit_internal_x_message.
data<
double>();
180 auto minuit_internal_x_message_end =
181 minuit_internal_x_message_begin + minuit_internal_x_message.
size() /
sizeof(
double);
182 std::copy(minuit_internal_x_message_begin, minuit_internal_x_message_end,
minuit_internal_x_.begin());
186 auto offsets_message =
192 auto offsets_message_end = offsets_message_begin + N_offsets;
203 if (!std::isnan(fValAtX)) {
226 i_component,
grad_[i_component]);
231 if (
get_manager()->process_manager().is_master()) {
236 for (std::size_t ix = 0; ix <
N_tasks_; ++ix) {
252 if (
get_manager()->process_manager().is_master()) {
254 fval_at_x_ = std::numeric_limits<double>::quiet_NaN();
260 grad[ix] =
grad_[ix].derivative;
266 double *previous_gstep,
double fValAtX)
268 if (
get_manager()->process_manager().is_master()) {
269 for (std::size_t i_component = 0; i_component <
N_tasks_; ++i_component) {
270 grad_[i_component] = {previous_grad[i_component], previous_g2[i_component], previous_gstep[i_component]};
287 grad[ix] =
grad_[ix].derivative;
288 previous_g2[ix] =
grad_[ix].second_derivative;
289 previous_gstep[ix] =
grad_[ix].step_size;
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
The Kahan summation is a compensated summation algorithm, which significantly reduces numerical error...
int Strategy() const
strategy
double ErrorDef() const
error definition
Minuit2Minimizer class implementing the ROOT::Math::Minimizer interface for Minuit2 minimization algo...
API class for defining four levels of strategies: low (0), medium (1), high (2), very high (>=3); act...
double GradientStepTolerance() const
double GradientTolerance() const
unsigned int GradientNCycles() const
void PreseedFVal(double fval, std::span< const double > cx)
Pre-seed the cache of the function value at the central point, so that a subsequent SetupDifferentiat...
void SetGradTolerance(double value)
void SetInitialGradient(std::span< const ROOT::Fit::ParameterSettings > parameters, std::vector< DerivatorElement > &gradient)
This function was not implemented as in Minuit2.
void SetErrorLevel(double value)
void SetNCycles(unsigned int value)
void SetupDifferentiate(unsigned int nDim, const FCNBase *function, const double *cx, std::span< const ROOT::Fit::ParameterSettings > parameters)
This function sets internal state based on input parameters.
DerivatorElement FastPartialDerivative(const FCNBase *function, std::span< const ROOT::Fit::ParameterSettings > parameters, unsigned int i_component, const DerivatorElement &previous)
void SetStepTolerance(double value)
static bool getTimingAnalysis()
Messenger & messenger() const
JobManager * get_manager()
Get JobManager instance; create and activate if necessary.
void gather_worker_results()
Wait for all tasks to be retrieved for the current Job.
A contiguous byte buffer used as the unit of interprocess communication.
std::size_t size() const
Size of the message in bytes.
value_t receive_from_master_on_worker(bool *more=nullptr)
void send_from_worker_to_master(T &&item)
specialization that sends the final part of a message
void publish_from_master_to_workers(T &&item)
specialization that sends the final part of a message
static void start_timer(std::string section_name)
static void end_timer(std::string section_name)
virtual void add(JobTask job_task)=0
Enqueue a task.
ROOT::Minuit2::NumericalDerivator gradf_
bool usesMinuitInternalValues() override
Implement usesMinuitInternalValues to return true when you want Minuit to send this class Minuit-inte...
void update_state() override
Virtual function to update any necessary state on workers.
void update_workers_state_isCalculating()
std::vector< ROOT::Minuit2::DerivatorElement > grad_
void updateMinuitInternalParameterValues(const std::vector< double > &minuit_internal_x) override
Minuit passes in parameter values that may not conform to RooFit internal standards (like applying ra...
void run_derivator(unsigned int i_component) const
Calculation stuff (mostly duplicates of RooGradMinimizerFcn code):
std::size_t N_tasks_at_workers_
SharedOffset::OffsetVec offsets_previous_
double fval_at_x_
Function value at minuit_internal_x_ as known by the master (NaN when unknown); broadcast to workers ...
void setNCycles(unsigned int ncycles) const
void send_back_task_result_from_worker(std::size_t task) override
void synchronizeWithMinimizer(const ROOT::Math::MinimizerOptions &options) override
Synchronize minimizer settings with calculators in child classes.
void fillGradient(double *grad) override
LikelihoodGradientJob(std::shared_ptr< RooAbsL > likelihood, std::shared_ptr< WrapperCalculationCleanFlags > calculation_is_clean, std::size_t N_dim, RooMinimizer *minimizer, SharedOffset offset)
void setStepTolerance(double step_tolerance) const
void setGradTolerance(double grad_tolerance) const
void setStrategy(int istrat)
bool receive_task_result_on_master(const RooFit::MultiProcess::Message &message) override
void update_workers_state()
void evaluate_task(std::size_t task) override
Job overrides:
void synchronizeParameterSettingsImpl(const std::vector< ROOT::Fit::ParameterSettings > ¶meter_settings) override
std::vector< double > minuit_internal_x_
void setErrorLevel(double error_level) const
void fillGradientWithPrevResult(double *grad, double *previous_grad, double *previous_g2, double *previous_gstep, double fValAtX) override
Virtual base class for implementation of likelihood gradient calculation strategies.
std::shared_ptr< WrapperCalculationCleanFlags > calculation_is_clean_
RooMinimizer * minimizer_
SharedOffset shared_offset_
Wrapper class around ROOT::Math::Minimizer that provides a seamless interface between the minimizer f...
auto fitter()
Return underlying ROOT fitter object.
std::unique_ptr< ROOT::Math::Minimizer > _minimizer
! pointer to used minimizer
double & fcnOffset() const
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
combined job_object, state and task identifier type