13 #ifndef ROOT_Fit_LogLikelihoodFCN
14 #define ROOT_Fit_LogLikelihoodFCN
16 #ifndef ROOT_Fit_BasicFCN
20 #ifndef ROOT_Math_IParamFunction
24 #ifndef ROOT_Fit_UnBinData
28 #ifndef ROOT_Fit_FitUtil
32 #ifdef ROOT_FIT_PARALLEL
33 #ifndef ROOT_Fit_FitUtilParallel
54 template<
class FunType>
70 LogLikelihoodFCN (
const std::shared_ptr<UnBinData> & data,
const std::shared_ptr<IModelFunction> &
func,
int weight = 0,
bool extended =
false) :
129 virtual double DataElement(
const double *
x,
unsigned int i,
double *
g)
const {
163 virtual double DoEval (
const double *
x)
const {
166 #ifdef ROOT_FIT_PARALLEL
176 return fGrad[icoord];
LogLikelihoodFCN(const UnBinData &data, const IModelFunction &func, int weight=0, bool extended=false)
Constructor from unbin data set and model function (pdf) for object managed by users.
Namespace for new ROOT classes and functions.
LogLikelihoodFCN(const LogLikelihoodFCN &f)
Copy constructor.
virtual const IModelFunction & ModelFunction() const
access to const reference to the model function
virtual double DataElement(const double *x, unsigned int i, double *g) const
i-th likelihood contribution and its gradient
void SetModelFunction(const std::shared_ptr< IModelFunction > &func)
Set the function pointer.
LogLikelihoodFCN class for likelihood fits.
::ROOT::Math::IParamMultiFunction IModelFunction
LogLikelihoodFCN & operator=(const LogLikelihoodFCN &rhs)
Assignment operator.
Class describing the unbinned data sets (just x coordinates values) of any dimensions.
virtual const UnBinData & Data() const
access to const reference to the data
virtual BaseFunction * Clone() const
clone the function (need to return Base for Windows)
virtual BaseObjFunction::Type_t Type() const
get type of fit method function
void EvaluateLogLGradient(const IModelFunction &func, const UnBinData &data, const double *x, double *grad, unsigned int &nPoints)
evaluate the LogL gradient given a model function and the data at the point x.
virtual ~LogLikelihoodFCN()
Destructor (no operations)
virtual double DoDerivative(const double *x, unsigned int icoord) const
void SetData(const std::shared_ptr< UnBinData > &data)
Set the data pointer.
BasicFCN class: base class for the objective functions used in the fits It has a reference to the dat...
BaseObjFunction::BaseFunction BaseFunction
double EvaluateLogL(const IModelFunction &func, const UnBinData &data, const double *x, int iWeight, bool extended, unsigned int &nPoints)
evaluate the LogL given a model function and the data at the point x.
void UseSumOfWeightSquare(bool on=true)
FunType::BaseFunc BaseFunction
LogLikelihoodFCN< ROOT::Math::IMultiGradFunction > LogLikelihoodGradFunction
std::vector< double > fGrad
virtual double DoEval(const double *x) const
Evaluation of the function (required by interface)
LogLikelihoodFCN(const std::shared_ptr< UnBinData > &data, const std::shared_ptr< IModelFunction > &func, int weight=0, bool extended=false)
Constructor from unbin data set and model function (pdf)
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
double EvaluatePdf(const IModelFunction &func, const UnBinData &data, const double *x, unsigned int ipoint, double *g=0)
evaluate the pdf contribution to the LogL given a model function and the BinPoint data...
LogLikelihoodFCN< ROOT::Math::IMultiGenFunction > LogLikelihoodFunction
double func(double *x, double *p)
virtual unsigned int NFitPoints() const
std::shared_ptr< IModelFunction > ModelFunctionPtr() const
access to function pointer
BasicFCN< FunType, UnBinData > BaseFCN
IParametricFunctionMultiDim IParamMultiFunction
virtual void UpdateNCalls() const
update number of calls
virtual void Gradient(const double *x, double *g) const
Type_t
enumeration specyfing the possible fit method types
::ROOT::Math::BasicFitMethodFunction< FunType > BaseObjFunction
std::shared_ptr< UnBinData > DataPtr() const
access to data pointer