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,
double *
h,
bool fullHessian)
const {
188 virtual double DoEval (
const double *
x)
const {
197 return fGrad[icoord];
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
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
::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
Execution policy.
BaseObjFunction::BaseFunction BaseFunction
virtual void Gradient(const double *x, double *g) const
evaluate gradient
BaseObjFunction::Type_t Type_t
bool fIsExtended
flag to indicate if is extended (when false is a Multinomial likelihood), default is true
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)
int fWeight
flag to indicate if needs to evaluate using weight or weight squared (default weight = 0)
ModelFunType::BackendType T
unsigned int fNEffPoints
number of effective points used in the fit
BasicFCN< DerivFunType, ModelFunType, BinData > BaseFCN
std::vector< double > fGrad
for derivatives
virtual double DataElement(const double *x, unsigned int i, double *g, double *h, bool fullHessian) const
i-th likelihood element and its gradient
virtual BaseObjFunction::Type_t Type() const
Computes the full Hessian.
Type_t
enumeration specifying the possible fit method types
static bool IsAGradFCN()
Static function to indicate if a function is supporting gradient.
FunctionType::BaseFunc BaseFunction
virtual void UpdateNCalls() const
update number of calls
IParamFunction interface (abstract class) describing multi-dimensional parametric functions It is a d...
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, double *h, bool hasGrad, bool fullHessian)
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)