13#ifndef ROOT_Fit_PoissonLikelihoodFCN
14#define ROOT_Fit_PoissonLikelihoodFCN
47template<
class DerivFunType,
class ModelFunType = ROOT::Math::IParamMultiFunction>
51 typedef typename ModelFunType::BackendType
T;
68 fGrad ( std::vector<double> ( func->NPar() ) ),
80 fGrad ( std::vector<double> ( func.NPar() ) ),
123 virtual double DataElement(
const double *
x,
unsigned int i,
double *
g)
const {
164 virtual double DoEval (
const double *
x)
const {
173 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< BinData > &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< BinData > 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
PoissonLikelihoodFCN(const BinData &data, const IModelFunction &func, int weight=0, bool extended=true, const ::ROOT::Fit::ExecutionPolicy &executionPolicy=::ROOT::Fit::ExecutionPolicy::kSerial)
Constructor from unbin data set and model function (pdf) managed by the users.
::ROOT::Math::IParamMultiFunctionTempl< T > IModelFunction
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)
PoissonLikelihoodFCN(const std::shared_ptr< BinData > &data, const std::shared_ptr< IModelFunction > &func, int weight=0, bool extended=true, const ::ROOT::Fit::ExecutionPolicy &executionPolicy=::ROOT::Fit::ExecutionPolicy::kSerial)
Constructor from unbin data set and model function (pdf)
BaseObjFunction::BaseFunction BaseFunction
virtual void Gradient(const double *x, double *g) const
evaluate gradient
::ROOT::Fit::ExecutionPolicy fExecutionPolicy
BaseObjFunction::Type_t Type_t
PoissonLikelihoodFCN & operator=(const PoissonLikelihoodFCN &rhs)
Assignment operator.
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
Namespace for new ROOT classes and functions.
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 double EvalPoissonLogL(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, int iWeight, bool extended, unsigned int &nPoints, ::ROOT::Fit::ExecutionPolicy executionPolicy, unsigned nChunks=0)
static void EvalPoissonLogLGradient(const IModelFunctionTempl< double > &func, const BinData &data, const double *p, double *g, unsigned int &nPoints, ::ROOT::Fit::ExecutionPolicy executionPolicy=::ROOT::Fit::ExecutionPolicy::kSerial, unsigned nChunks=0)