13 #ifndef ROOT_Fit_LogLikelihoodFCN 14 #define ROOT_Fit_LogLikelihoodFCN 24 #ifdef ROOT_FIT_PARALLEL 44 template<
class FunType>
60 LogLikelihoodFCN (
const std::shared_ptr<UnBinData> &
data,
const std::shared_ptr<IModelFunction> &
func,
int weight = 0,
bool extended =
false) :
119 virtual double DataElement(
const double *
x,
unsigned int i,
double * g)
const {
126 virtual void Gradient(
const double *
x,
double *g)
const {
153 virtual double DoEval (
const double *
x)
const {
156 #ifdef ROOT_FIT_PARALLEL 166 return fGrad[icoord];
virtual double DataElement(const double *x, unsigned int i, double *g) const
i-th likelihood contribution and its gradient
virtual void UpdateNCalls() const
update number of calls
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.
Type_t
enumeration specyfing the possible fit method types
Namespace for new ROOT classes and functions.
LogLikelihoodFCN(const LogLikelihoodFCN &f)
Copy constructor.
virtual double DoDerivative(const double *x, unsigned int icoord) const
virtual const IModelFunction & ModelFunction() const
access to const reference to the model function
void SetModelFunction(const std::shared_ptr< IModelFunction > &func)
Set the function pointer.
LogLikelihoodFCN class for likelihood fits.
virtual void Gradient(const double *x, double *g) const
::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 unsigned int NFitPoints() const
virtual const UnBinData & Data() const
access to const reference to the data
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)
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.
virtual BaseObjFunction::Type_t Type() const
get type of fit method function
std::shared_ptr< IModelFunction > ModelFunctionPtr() const
access to function pointer
void UseSumOfWeightSquare(bool on=true)
FunType ::BaseFunc BaseFunction
LogLikelihoodFCN< ROOT::Math::IMultiGradFunction > LogLikelihoodGradFunction
std::vector< double > fGrad
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 BaseFunction * Clone() const
clone the function (need to return Base for Windows)
BasicFCN< FunType, UnBinData > BaseFCN
IParametricFunctionMultiDim IParamMultiFunction
virtual double DoEval(const double *x) const
Evaluation of the function (required by interface)
std::shared_ptr< UnBinData > DataPtr() const
access to data pointer
::ROOT::Math::BasicFitMethodFunction< FunType > BaseObjFunction