13 #ifndef ROOT_Fit_PoissonLikelihoodFCN
14 #define ROOT_Fit_PoissonLikelihoodFCN
16 #ifndef ROOT_Fit_BasicFCN
20 #ifndef ROOT_Math_IParamFunction
24 #ifndef ROOT_Fit_BinData
28 #ifndef ROOT_Fit_FitUtil
55 template<
class FunType>
71 PoissonLikelihoodFCN (
const std::shared_ptr<BinData> & data,
const std::shared_ptr<IModelFunction> &
func,
int weight = 0,
bool extended =
true ) :
127 virtual double DataElement(
const double *
x,
unsigned int i,
double *
g)
const {
166 virtual double DoEval (
const double *
x)
const {
174 return fGrad[icoord];
Type_t
enumeration specyfing the possible fit method types
virtual const IModelFunction & ModelFunction() const
access to const reference to the model function
double EvaluatePoissonBinPdf(const IModelFunction &func, const BinData &data, const double *x, unsigned int ipoint, double *g=0)
evaluate the pdf contribution to the Poisson LogL given a model function and the BinPoint data...
void SetModelFunction(const std::shared_ptr< IModelFunction > &func)
Set the function pointer.
virtual BaseObjFunction::Type_t Type() const
get type of fit method function
virtual void Gradient(const double *x, double *g) const
evaluate gradient
virtual BaseFunction * Clone() const
clone the function (need to return Base for Windows)
virtual const BinData & Data() const
access to const reference to the data
PoissonLikelihoodFCN(const std::shared_ptr< BinData > &data, const std::shared_ptr< IModelFunction > &func, int weight=0, bool extended=true)
Constructor from unbin data set and model function (pdf)
PoissonLikelihoodFCN(const PoissonLikelihoodFCN &f)
Copy constructor.
std::vector< double > fGrad
virtual double DoEval(const double *x) const
Evaluation of the function (required by interface)
void EvaluatePoissonLogLGradient(const IModelFunction &func, const BinData &data, const double *x, double *grad)
evaluate the Poisson LogL given a model function and the data at the point x.
virtual double DataElement(const double *x, unsigned int i, double *g) const
i-th likelihood element and its gradient
class evaluating the log likelihood for binned Poisson likelihood fits it is template to distinguish ...
virtual ~PoissonLikelihoodFCN()
Destructor (no operations)
virtual unsigned int NFitPoints() const
void UseSumOfWeightSquare(bool on=true)
virtual double DoDerivative(const double *x, unsigned int icoord) const
void SetData(const std::shared_ptr< BinData > &data)
Set the data pointer.
IParamFunction interface (abstract class) describing multi-dimensional parameteric functions It is a ...
BasicFCN class: base class for the objective functions used in the fits It has a reference to the dat...
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
double EvaluatePoissonLogL(const IModelFunction &func, const BinData &data, const double *x, int iWeight, bool extended, unsigned int &nPoints)
evaluate the Poisson LogL given a model function and the data at the point x.
FunType::BaseFunc BaseFunction
PoissonLikelihoodFCN< ROOT::Math::IMultiGenFunction > PoissonLLFunction
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
double func(double *x, double *p)
std::shared_ptr< IModelFunction > ModelFunctionPtr() const
access to function pointer
PoissonLikelihoodFCN< ROOT::Math::IMultiGradFunction > PoissonLLGradFunction
IParametricFunctionMultiDim IParamMultiFunction
virtual void UpdateNCalls() const
update number of calls
BaseObjFunction::BaseFunction BaseFunction
PoissonLikelihoodFCN & operator=(const PoissonLikelihoodFCN &rhs)
Assignment operator.
BasicFCN< FunType, BinData > BaseFCN
::ROOT::Math::IParamMultiFunction IModelFunction
::ROOT::Math::BasicFitMethodFunction< FunType > BaseObjFunction
std::shared_ptr< BinData > DataPtr() const
access to data pointer
PoissonLikelihoodFCN(const BinData &data, const IModelFunction &func, int weight=0, bool extended=true)
Constructor from unbin data set and model function (pdf) managed by the users.