13 #ifndef ROOT_Fit_PoissonLikelihoodFCN 14 #define ROOT_Fit_PoissonLikelihoodFCN 47 template<
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];
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::Fit::ExecutionPolicy fExecutionPolicy
virtual void UpdateNCalls() const
update number of calls
Type_t
enumeration specyfing the possible fit method types
BaseObjFunction::BaseFunction BaseFunction
virtual const IModelFunction & ModelFunction() const
access to const reference to the model function
void SetData(const std::shared_ptr< BinData > &data)
Set the data pointer.
void SetModelFunction(const std::shared_ptr< IModelFunction > &func)
Set the function pointer.
Namespace for new ROOT classes and functions.
virtual unsigned int NFitPoints() const
std::shared_ptr< BinData > DataPtr() const
access to data pointer
virtual double DoDerivative(const double *x, unsigned int icoord) const
PoissonLikelihoodFCN(const PoissonLikelihoodFCN &f)
Copy constructor.
virtual const BinData & Data() const
access to const reference to the data
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)
virtual double DoEval(const double *x) const
Evaluation of the function (required by interface)
PoissonLikelihoodFCN & operator=(const PoissonLikelihoodFCN &rhs)
Assignment operator.
virtual BaseObjFunction::Type_t Type() const
get type of fit method function
class evaluating the log likelihood for binned Poisson likelihood fits it is template to distinguish ...
virtual ~PoissonLikelihoodFCN()
Destructor (no operations)
::ROOT::Math::BasicFitMethodFunction< DerivFunType > BaseObjFunction
virtual double DataElement(const double *x, unsigned int i, double *g) const
i-th likelihood element and its gradient
BasicFCN class: base class for the objective functions used in the fits It has a reference to the dat...
PoissonLikelihoodFCN< ROOT::Math::IMultiGradFunction, ROOT::Math::IParamMultiFunction > PoissonLLGradFunction
virtual BaseFunction * Clone() const
clone the function (need to return Base for Windows)
Class describing the binned data sets : vectors of x coordinates, y values and optionally error on y ...
std::vector< double > fGrad
PoissonLikelihoodFCN< ROOT::Math::IMultiGenFunction, ROOT::Math::IParamMultiFunction > PoissonLLFunction
DerivFunType ::BaseFunc BaseFunction
::ROOT::Math::IParamMultiFunctionTempl< T > IModelFunction
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)
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)
TFitResultPtr Fit(FitObject *h1, TF1 *f1, Foption_t &option, const ROOT::Math::MinimizerOptions &moption, const char *goption, ROOT::Fit::DataRange &range)
ModelFunType::BackendType T
virtual void Gradient(const double *x, double *g) const
evaluate gradient
BasicFCN< DerivFunType, ModelFunType, BinData > BaseFCN
std::shared_ptr< IModelFunction > ModelFunctionPtr() const
access to function pointer
void UseSumOfWeightSquare(bool on=true)
BaseObjFunction::Type_t Type_t
static constexpr double g