13#ifndef ROOT_Fit_PoissonLikelihoodFCN
14#define ROOT_Fit_PoissonLikelihoodFCN
45template<
class DerivFunType,
class ModelFunType = ROOT::Math::IParamMultiFunction>
49 typedef typename ModelFunType::BackendType
T;
121 virtual double DataElement(
const double *
x,
unsigned int i,
double *
g)
const {
162 virtual double DoEval (
const double *
x)
const {
171 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< DataType > &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< DataType > DataPtr() const
access to data pointer
virtual const IModelFunction & ModelFunction() const
access to const reference to the model function
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
class evaluating the log likelihood for binned Poisson likelihood fits it is template to distinguish ...
virtual unsigned int NFitPoints() const
::ROOT::Math::IParamMultiFunctionTempl< T > IModelFunction
PoissonLikelihoodFCN(const BinData &data, const IModelFunction &func, int weight=0, bool extended=true, const ::ROOT::EExecutionPolicy &executionPolicy=::ROOT::EExecutionPolicy::kSequential)
Constructor from unbin data set and model function (pdf) managed by the users.
virtual double DoDerivative(const double *x, unsigned int icoord) const
virtual double DataElement(const double *x, unsigned int i, double *g) const
i-th likelihood element and its gradient
::ROOT::Math::BasicFitMethodFunction< DerivFunType > BaseObjFunction
PoissonLikelihoodFCN(const PoissonLikelihoodFCN &f)
Copy constructor.
virtual BaseFunction * Clone() const
clone the function (need to return Base for Windows)
void UseSumOfWeightSquare(bool on=true)
virtual ~PoissonLikelihoodFCN()
Destructor (no operations)
virtual double DoEval(const double *x) const
Evaluation of the function (required by interface)
::ROOT::EExecutionPolicy fExecutionPolicy
BaseObjFunction::BaseFunction BaseFunction
virtual void Gradient(const double *x, double *g) const
evaluate gradient
BaseObjFunction::Type_t Type_t
PoissonLikelihoodFCN & operator=(const PoissonLikelihoodFCN &rhs)
Assignment operator.
PoissonLikelihoodFCN(const std::shared_ptr< BinData > &data, const std::shared_ptr< IModelFunction > &func, int weight=0, bool extended=true, const ::ROOT::EExecutionPolicy &executionPolicy=::ROOT::EExecutionPolicy::kSequential)
Constructor from unbin data set and model function (pdf)
ModelFunType::BackendType T
BasicFCN< DerivFunType, ModelFunType, BinData > BaseFCN
std::vector< double > fGrad
virtual BaseObjFunction::Type_t Type() const
get type of fit method function
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)
PoissonLikelihoodFCN< ROOT::Math::IMultiGradFunction, ROOT::Math::IParamMultiFunction > PoissonLLGradFunction
PoissonLikelihoodFCN< ROOT::Math::IMultiGenFunction, ROOT::Math::IParamMultiFunction > PoissonLLFunction
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
static double EvalPoissonBinPdf(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, unsigned int i, double *g)
evaluate the pdf (Poisson) contribution to the logl (return actually log of pdf) and its gradient
static void EvalPoissonLogLGradient(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, double *g, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy=::ROOT::EExecutionPolicy::kSequential, unsigned nChunks=0)
static double EvalPoissonLogL(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, int iWeight, bool extended, unsigned int &nPoints, ::ROOT::EExecutionPolicy executionPolicy, unsigned nChunks=0)