13#ifndef ROOT_Fit_FitConfig
14#define ROOT_Fit_FitConfig
114 unsigned int npar = func.
NPar();
117 fSettings = std::vector<ParameterSettings>(npar);
123 const double *end = begin + npar;
125 for (
const double *ipar = begin; ipar != end; ++ipar) {
127 double step = 0.3 * fabs(val);
129 if (val == 0) step = 0.3;
133 std::cout <<
"FitConfig: add parameter " << func.
ParameterName(i) <<
" val = " << val << std::endl;
142 void SetParamsSettings(
unsigned int npar,
const double * params,
const double * vstep =
nullptr);
const std::vector< unsigned int > & MinosParams() const
return vector of parameter indices for which the Minos Error will be computed
ParameterSettings & ParSettings(unsigned int i)
get the parameter settings for the i-th parameter (non-const method)
bool UpdateAfterFit() const
Update configuration after a fit using the FitResult.
std::vector< unsigned int > fMinosParams
vector with the parameter indices for running Minos
FitConfig(unsigned int npar=0)
Default constructor.
void SetMinimizer(const char *type, const char *algo=nullptr)
set minimizer type and algorithm
void SetMinosErrors(bool on=true)
set Minos errors computation to be performed after fitting
bool fNormErrors
flag for error normalization
std::vector< double > ParamsValues() const
return a vector of stored parameter values (i.e initial fit parameters)
const std::string & MinimizerAlgoType() const
return type of minimizer algorithms
std::vector< ROOT::Fit::ParameterSettings > & ParamsSettings()
get the vector of parameter settings (non-const method)
void SetNormErrors(bool on=true)
set the option to normalize the error on the result according to chi2/ndf
void SetParamsSettings(const std::vector< ROOT::Fit::ParameterSettings > &pars)
bool NormalizeErrors() const
flag to check if resulting errors are be normalized according to chi2/ndf
void SetMinosErrors(const std::vector< unsigned int > ¶mInd)
set parameter indices for running Minos this can be used for running Minos on a subset of parameters ...
bool ParabErrors() const
do analysis for parabolic errors
void SetMinimizerOptions(const ROOT::Math::MinimizerOptions &minopt)
set all the minimizer options using class ROOT::Math::MinimizerOptions
void SetWeightCorrection(bool on=true)
apply the weight correction for error matrix computation
unsigned int NPar() const
number of parameters settings
void SetUpdateAfterFit(bool on=true)
Update configuration after a fit using the FitResult.
void SetParamsSettings(unsigned int npar, const double *params, const double *vstep=nullptr)
set the parameter settings from number of parameters and a vector of values and optionally step value...
std::vector< ROOT::Fit::ParameterSettings > fSettings
vector with the parameter settings
std::string MinimizerName() const
return Minimizer full name (type / algorithm)
bool UseWeightCorrection() const
Apply Weight correction for error matrix computation.
const std::vector< ROOT::Fit::ParameterSettings > & ParamsSettings() const
get the vector of parameter settings (const method)
bool fParabErrors
get correct parabolic errors estimate (call Hesse after minimizing)
ROOT::Math::MinimizerOptions fMinimizerOpts
minimizer control parameters including name and algo type
ROOT::Math::Minimizer * CreateMinimizer()
create a new minimizer according to chosen configuration
void SetParabErrors(bool on=true)
set parabolic errors
bool fMinosErrors
do full error analysis using Minos
static void SetDefaultMinimizer(const char *type, const char *algo=nullptr)
static function to control default minimizer type and algorithm
void SetFromFitResult(const FitResult &rhs)
void CreateParamsSettings(const ROOT::Math::IParamMultiFunctionTempl< T > &func)
set the parameter settings from a model function.
const std::string & MinimizerType() const
return type of minimizer package
bool fWeightCorr
apply correction to errors for weights fits
const ParameterSettings & ParSettings(unsigned int i) const
get the parameter settings for the i-th parameter (const method)
bool fUpdateAfterFit
update the configuration after a fit using the result
FitConfig & operator=(const FitConfig &rhs)
ROOT::Math::MinimizerOptions & MinimizerOptions()
access to the minimizer control parameter (non const method)
bool MinosErrors() const
do minos errors analysis on the parameters
class containing the result of the fit and all the related information (fitted parameter values,...
Class, describing value, limits and step size of the parameters Provides functionality also to set/re...
virtual const double * Parameters() const =0
Access the parameter values.
virtual std::string ParameterName(unsigned int i) const
Return the name of the i-th parameter (starting from zero) Overwrite if want to avoid the default nam...
virtual unsigned int NPar() const =0
Return the number of Parameters.
Abstract Minimizer class, defining the interface for the various minimizer (like Minuit2,...
Namespace for the fitting classes.
IParametricFunctionMultiDimTempl< T > IParamMultiFunctionTempl