13 #ifndef ROOT_Fit_PoissonLikelihoodFCN 14 #define ROOT_Fit_PoissonLikelihoodFCN 47 template<
class FunType>
63 PoissonLikelihoodFCN (
const std::shared_ptr<BinData> &
data,
const std::shared_ptr<IModelFunction> &
func,
int weight = 0,
bool extended =
true ) :
119 virtual double DataElement(
const double *
x,
unsigned int i,
double * g)
const {
125 virtual void Gradient(
const double *
x,
double *g)
const {
158 virtual double DoEval (
const double *
x)
const {
166 return fGrad[icoord];
virtual void UpdateNCalls() const
update number of calls
Type_t
enumeration specyfing the possible fit method types
virtual unsigned int NFitPoints() const
Namespace for new ROOT classes and functions.
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...
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.
virtual double DataElement(const double *x, unsigned int i, double *g) const
i-th likelihood element and its gradient
virtual BaseObjFunction::Type_t Type() const
get type of fit method function
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
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.
class evaluating the log likelihood for binned Poisson likelihood fits it is template to distinguish ...
virtual ~PoissonLikelihoodFCN()
Destructor (no operations)
virtual const BinData & Data() const
access to const reference to the data
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.
BasicFCN class: base class for the objective functions used in the fits It has a reference to the dat...
std::shared_ptr< IModelFunction > ModelFunctionPtr() const
access to function pointer
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
virtual BaseFunction * Clone() const
clone the function (need to return Base for Windows)
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)
PoissonLikelihoodFCN< ROOT::Math::IMultiGradFunction > PoissonLLGradFunction
IParametricFunctionMultiDim IParamMultiFunction
virtual double DoEval(const double *x) const
Evaluation of the function (required by interface)
BaseObjFunction::BaseFunction BaseFunction
virtual void Gradient(const double *x, double *g) const
evaluate gradient
PoissonLikelihoodFCN & operator=(const PoissonLikelihoodFCN &rhs)
Assignment operator.
BasicFCN< FunType, BinData > BaseFCN
::ROOT::Math::IParamMultiFunction IModelFunction
std::shared_ptr< BinData > DataPtr() const
access to data pointer
::ROOT::Math::BasicFitMethodFunction< FunType > BaseObjFunction
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.