13#ifndef ROOT_Fit_LogLikelihoodFCN
14#define ROOT_Fit_LogLikelihoodFCN
40template<
class DerivFunType,
class ModelFunType = ROOT::Math::IParamMultiFunction>
45 typedef typename ModelFunType::BackendType
T;
63 fGrad ( std::vector<double> ( func->NPar() ) ),
75 fGrad ( std::vector<double> ( func.NPar() ) ),
121 virtual double DataElement(
const double *
x,
unsigned int i,
double *
g)
const {
155 virtual double DoEval (
const double *
x)
const {
163 return fGrad[icoord];
BasicFCN class: base class for the objective functions used in the fits It has a reference to the dat...
void SetData(const std::shared_ptr< UnBinData > &data)
Set the data pointer.
std::shared_ptr< IModelFunction > ModelFunctionPtr() const
access to function pointer
void SetModelFunction(const std::shared_ptr< IModelFunction > &func)
Set the function pointer.
virtual const DataType & Data() const
access to const reference to the data
std::shared_ptr< UnBinData > DataPtr() const
access to data pointer
virtual const IModelFunction & ModelFunction() const
access to const reference to the model function
LogLikelihoodFCN class for likelihood fits.
BaseObjFunction::BaseFunction BaseFunction
virtual BaseObjFunction::Type_t Type() const
get type of fit method function
LogLikelihoodFCN & operator=(const LogLikelihoodFCN &rhs)
Assignment operator.
virtual double DoDerivative(const double *x, unsigned int icoord) const
::ROOT::Math::IParamMultiFunctionTempl< T > IModelFunction
LogLikelihoodFCN(const LogLikelihoodFCN &f)
Copy constructor.
BasicFCN< DerivFunType, ModelFunType, UnBinData > BaseFCN
ModelFunType::BackendType T
virtual double DataElement(const double *x, unsigned int i, double *g) const
i-th likelihood contribution and its gradient
void UseSumOfWeightSquare(bool on=true)
::ROOT::Fit::ExecutionPolicy fExecutionPolicy
virtual void Gradient(const double *x, double *g) const
::ROOT::Math::BasicFitMethodFunction< DerivFunType > BaseObjFunction
virtual BaseFunction * Clone() const
clone the function (need to return Base for Windows)
LogLikelihoodFCN(const UnBinData &data, const IModelFunction &func, int weight=0, bool extended=false, const ::ROOT::Fit::ExecutionPolicy &executionPolicy=::ROOT::Fit::ExecutionPolicy::kSerial)
Constructor from unbin data set and model function (pdf) for object managed by users.
virtual ~LogLikelihoodFCN()
Destructor (no operations)
virtual unsigned int NFitPoints() const
LogLikelihoodFCN(const std::shared_ptr< UnBinData > &data, const std::shared_ptr< IModelFunction > &func, int weight=0, bool extended=false, const ::ROOT::Fit::ExecutionPolicy &executionPolicy=::ROOT::Fit::ExecutionPolicy::kSerial)
Constructor from unbin data set and model function (pdf)
std::vector< double > fGrad
BaseObjFunction::Type_t Type_t
virtual double DoEval(const double *x) const
Evaluation of the function (required by interface)
Class describing the unbinned data sets (just x coordinates values) of any dimensions.
Type_t
enumeration specyfing the possible fit method types
FunctionType::BaseFunc BaseFunction
virtual void UpdateNCalls() const
update number of calls
IParamFunction interface (abstract class) describing multi-dimensional parameteric functions It is a ...
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, ROOT::Math::IParamMultiFunction > LogLikelihoodFunction
LogLikelihoodFCN< ROOT::Math::IMultiGradFunction, ROOT::Math::IParamMultiFunction > LogLikelihoodGradFunction
Namespace for new ROOT classes and functions.
static double EvalLogL(const IModelFunctionTempl< double > &func, const UnBinData &data, const double *p, int iWeight, bool extended, unsigned int &nPoints, ::ROOT::Fit::ExecutionPolicy executionPolicy, unsigned nChunks=0)
static void EvalLogLGradient(const IModelFunctionTempl< double > &func, const UnBinData &data, const double *p, double *g, unsigned int &nPoints, ::ROOT::Fit::ExecutionPolicy executionPolicy=::ROOT::Fit::ExecutionPolicy::kSerial, unsigned nChunks=0)