Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType > Class Template Reference

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
class ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >

class evaluating the log likelihood for binned Poisson likelihood fits it is template to distinguish gradient and non-gradient case

Definition at line 46 of file PoissonLikelihoodFCN.h.

Public Types

typedef BasicFCN< DerivFunType, ModelFunType, BinDataBaseFCN
typedef BaseObjFunction::BaseFunction BaseFunction
typedef ::ROOT::Math::BasicFitMethodFunction< DerivFunType > BaseObjFunction
typedef ::ROOT::Math::IParamMultiFunctionTempl< TIModelFunction
typedef ModelFunType::BackendType T
typedef BaseObjFunction::Type_t Type_t

Public Member Functions

 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.
 PoissonLikelihoodFCN (const PoissonLikelihoodFCN &f)
 Copy constructor.
 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).
virtual ~PoissonLikelihoodFCN ()
 Destructor (no operations).
BaseFunctionClone () const override
 clone the function (need to return Base for Windows)
virtual const BinDataData () const
 access to const reference to the data
double DataElement (const double *x, unsigned int i, double *g, double *h, bool fullHessian) const override
 i-th likelihood element and its gradient
std::shared_ptr< BinDataDataPtr () const
 access to data pointer
virtual bool G2 (const double *, double *) const
 Computes the Second derivatives.
virtual bool G2 (const double *, double *) const
 Computes the Second derivatives.
void Gradient (const double *x, double *g) const override
 evaluate gradient
bool HasHessian () const override
 flag to indicate if can compute Hessian
virtual bool Hessian (const double *x, double *hess) const
 Computes the full Hessian.
virtual bool Hessian (const double *x, double *hess) const
 Computes the full Hessian.
bool IsAGradFCN ()
bool IsAGradFCN ()
bool IsWeighted () const
virtual const IModelFunctionModelFunction () const
 access to const reference to the model function
std::shared_ptr< IModelFunctionModelFunctionPtr () const
 access to function pointer
virtual unsigned int NCalls () const
 return the total number of function calls (override if needed)
virtual unsigned int NCalls () const
 return the total number of function calls (override if needed)
unsigned int NDim () const override
 Number of dimension (parameters) .
unsigned int NDim () const override
 Number of dimension (parameters) .
virtual unsigned int NFitPoints () const
virtual unsigned int NPoints () const
 return the number of data points used in evaluating the function
virtual unsigned int NPoints () const
 return the number of data points used in evaluating the function
PoissonLikelihoodFCNoperator= (const PoissonLikelihoodFCN &rhs)
 Assignment operator.
virtual void ResetNCalls ()
 reset number of function calls
virtual void ResetNCalls ()
 reset number of function calls
BaseObjFunction::Type_t Type () const override
 Computes the full Hessian.
virtual void UpdateNCalls () const
 update number of calls
virtual void UpdateNCalls () const
 update number of calls
void UseSumOfWeights ()
void UseSumOfWeightSquare (bool on=true)

Static Public Member Functions

static bool IsAGradFCN ()
 Static function to indicate if a function is supporting gradient.
static bool IsAGradFCN ()
 Static function to indicate if a function is supporting gradient.

Protected Types

typedef ::ROOT::Math::IParametricGradFunctionMultiDimTempl< TIGradModelFunction

Protected Member Functions

void SetData (const std::shared_ptr< BinData > &data)
 Set the data pointer.
void SetModelFunction (const std::shared_ptr< IModelFunction > &func)
 Set the function pointer.

Protected Attributes

std::shared_ptr< BinDatafData
std::shared_ptr< IModelFunctionfFunc

Private Member Functions

double DoDerivative (const double *x, unsigned int icoord) const override
double DoEval (const double *x) const override
 Evaluation of the function (required by interface).

Private Attributes

::ROOT::EExecutionPolicy fExecutionPolicy
 Execution policy.
std::vector< doublefGrad
 for derivatives
bool fIsExtended
 flag to indicate if is extended (when false is a Multinomial likelihood), default is true
unsigned int fNCalls
unsigned int fNCalls
unsigned int fNDim
unsigned int fNDim
unsigned int fNEffPoints
 number of effective points used in the fit
unsigned int fNPoints
unsigned int fNPoints
int fWeight
 flag to indicate if needs to evaluate using weight or weight squared (default weight = 0)

#include <Fit/PoissonLikelihoodFCN.h>

Inheritance diagram for ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >:
ROOT::Fit::BasicFCN< DerivFunType, ROOT::Math::IParamMultiFunction, BinData > ROOT::Math::BasicFitMethodFunction< DerivFunType >

Member Typedef Documentation

◆ BaseFCN

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
typedef BasicFCN<DerivFunType,ModelFunType,BinData> ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::BaseFCN

Definition at line 50 of file PoissonLikelihoodFCN.h.

◆ BaseFunction

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
typedef BaseObjFunction::BaseFunction ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::BaseFunction

Definition at line 53 of file PoissonLikelihoodFCN.h.

◆ BaseObjFunction

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
typedef ::ROOT::Math::BasicFitMethodFunction<DerivFunType> ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::BaseObjFunction

Definition at line 52 of file PoissonLikelihoodFCN.h.

◆ IGradModelFunction

typedef ::ROOT::Math::IParametricGradFunctionMultiDimTempl<T> ROOT::Fit::BasicFCN< DerivFunType, ROOT::Math::IParamMultiFunction, BinData >::IGradModelFunction
protectedinherited

Definition at line 50 of file BasicFCN.h.

◆ IModelFunction

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
typedef ::ROOT::Math::IParamMultiFunctionTempl<T> ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::IModelFunction

Definition at line 55 of file PoissonLikelihoodFCN.h.

◆ T

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
typedef ModelFunType::BackendType ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::T

Definition at line 49 of file PoissonLikelihoodFCN.h.

◆ Type_t

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
typedef BaseObjFunction::Type_t ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::Type_t

Definition at line 56 of file PoissonLikelihoodFCN.h.

Constructor & Destructor Documentation

◆ PoissonLikelihoodFCN() [1/3]

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::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 )
inline

Constructor from unbin data set and model function (pdf).

Definition at line 61 of file PoissonLikelihoodFCN.h.

◆ PoissonLikelihoodFCN() [2/3]

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::PoissonLikelihoodFCN ( const BinData & data,
const IModelFunction & func,
int weight = 0,
bool extended = true,
const ::ROOT::EExecutionPolicy & executionPolicy = ::ROOT::EExecutionPolicy::kSequential )
inline

Constructor from unbin data set and model function (pdf) managed by the users.

Definition at line 73 of file PoissonLikelihoodFCN.h.

◆ ~PoissonLikelihoodFCN()

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::~PoissonLikelihoodFCN ( )
inlinevirtual

Destructor (no operations).

Definition at line 86 of file PoissonLikelihoodFCN.h.

◆ PoissonLikelihoodFCN() [3/3]

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::PoissonLikelihoodFCN ( const PoissonLikelihoodFCN< DerivFunType, ModelFunType > & f)
inline

Copy constructor.

Definition at line 91 of file PoissonLikelihoodFCN.h.

Member Function Documentation

◆ Clone()

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
BaseFunction * ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::Clone ( ) const
inlineoverride

clone the function (need to return Base for Windows)

Definition at line 115 of file PoissonLikelihoodFCN.h.

◆ Data()

virtual const BinData & ROOT::Fit::BasicFCN< DerivFunType, ROOT::Math::IParamMultiFunction, BinData >::Data ( ) const
inlinevirtualinherited

access to const reference to the data

Definition at line 72 of file BasicFCN.h.

◆ DataElement()

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
double ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::DataElement ( const double * x,
unsigned int i,
double * g,
double * h,
bool fullHessian ) const
inlineoverridevirtual

i-th likelihood element and its gradient

Implements ROOT::Math::BasicFitMethodFunction< DerivFunType >.

Definition at line 121 of file PoissonLikelihoodFCN.h.

◆ DataPtr()

std::shared_ptr< BinData > ROOT::Fit::BasicFCN< DerivFunType, ROOT::Math::IParamMultiFunction, BinData >::DataPtr ( ) const
inlineinherited

access to data pointer

Definition at line 75 of file BasicFCN.h.

◆ DoDerivative()

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
double ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::DoDerivative ( const double * x,
unsigned int icoord ) const
inlineoverrideprivate

Definition at line 195 of file PoissonLikelihoodFCN.h.

◆ DoEval()

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
double ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::DoEval ( const double * x) const
inlineoverrideprivate

Evaluation of the function (required by interface).

Definition at line 188 of file PoissonLikelihoodFCN.h.

◆ G2() [1/2]

virtual bool ROOT::Math::BasicFitMethodFunction< DerivFunType >::G2 ( const double * ,
double *  ) const
inlinevirtualinherited

Computes the Second derivatives.

Return false if this is not supported

Definition at line 104 of file FitMethodFunction.h.

◆ G2() [2/2]

virtual bool ROOT::Math::BasicFitMethodFunction< DerivFunType >::G2 ( const double * ,
double *  ) const
inlinevirtualinherited

Computes the Second derivatives.

Return false if this is not supported

Definition at line 104 of file FitMethodFunction.h.

◆ Gradient()

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
void ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::Gradient ( const double * x,
double * g ) const
inlineoverride

evaluate gradient

Definition at line 127 of file PoissonLikelihoodFCN.h.

◆ HasHessian()

bool ROOT::Fit::BasicFCN< DerivFunType, ROOT::Math::IParamMultiFunction, BinData >::HasHessian ( ) const
inlineoverridevirtualinherited

flag to indicate if can compute Hessian

Reimplemented from ROOT::Math::BasicFitMethodFunction< DerivFunType >.

Definition at line 84 of file BasicFCN.h.

◆ Hessian() [1/2]

virtual bool ROOT::Math::BasicFitMethodFunction< DerivFunType >::Hessian ( const double * x,
double * hess ) const
inlinevirtualinherited

Computes the full Hessian.

Return false if Hessian is not supported

Definition at line 81 of file FitMethodFunction.h.

◆ Hessian() [2/2]

virtual bool ROOT::Math::BasicFitMethodFunction< DerivFunType >::Hessian ( const double * x,
double * hess ) const
inlinevirtualinherited

Computes the full Hessian.

Return false if Hessian is not supported

Definition at line 81 of file FitMethodFunction.h.

◆ IsAGradFCN() [1/4]

Definition at line 149 of file FitMethodFunction.h.

◆ IsAGradFCN() [2/4]

bool ROOT::Math::BasicFitMethodFunction< DerivFunType >::IsAGradFCN ( )
inlinestaticinherited

Static function to indicate if a function is supporting gradient.

Definition at line 135 of file FitMethodFunction.h.

◆ IsAGradFCN() [3/4]

◆ IsAGradFCN() [4/4]

bool ROOT::Math::BasicFitMethodFunction< DerivFunType >::IsAGradFCN ( )
inlinestaticinherited

Static function to indicate if a function is supporting gradient.

Definition at line 135 of file FitMethodFunction.h.

◆ IsWeighted()

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
bool ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::IsWeighted ( ) const
inline

Definition at line 163 of file PoissonLikelihoodFCN.h.

◆ ModelFunction()

virtual const IModelFunction & ROOT::Fit::BasicFCN< DerivFunType, ROOT::Math::IParamMultiFunction, BinData >::ModelFunction ( ) const
inlinevirtualinherited

access to const reference to the model function

Definition at line 78 of file BasicFCN.h.

◆ ModelFunctionPtr()

std::shared_ptr< IModelFunction > ROOT::Fit::BasicFCN< DerivFunType, ROOT::Math::IParamMultiFunction, BinData >::ModelFunctionPtr ( ) const
inlineinherited

access to function pointer

Definition at line 81 of file BasicFCN.h.

◆ NCalls() [1/2]

virtual unsigned int ROOT::Math::BasicFitMethodFunction< DerivFunType >::NCalls ( ) const
inlinevirtualinherited

return the total number of function calls (override if needed)

Definition at line 119 of file FitMethodFunction.h.

◆ NCalls() [2/2]

virtual unsigned int ROOT::Math::BasicFitMethodFunction< DerivFunType >::NCalls ( ) const
inlinevirtualinherited

return the total number of function calls (override if needed)

Definition at line 119 of file FitMethodFunction.h.

◆ NDim() [1/2]

unsigned int ROOT::Math::BasicFitMethodFunction< DerivFunType >::NDim ( ) const
inlineoverrideinherited

Number of dimension (parameters) .

From IGenMultiFunction interface

Definition at line 63 of file FitMethodFunction.h.

◆ NDim() [2/2]

unsigned int ROOT::Math::BasicFitMethodFunction< DerivFunType >::NDim ( ) const
inlineoverrideinherited

Number of dimension (parameters) .

From IGenMultiFunction interface

Definition at line 63 of file FitMethodFunction.h.

◆ NFitPoints()

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual unsigned int ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::NFitPoints ( ) const
inlinevirtual

Definition at line 118 of file PoissonLikelihoodFCN.h.

◆ NPoints() [1/2]

virtual unsigned int ROOT::Math::BasicFitMethodFunction< DerivFunType >::NPoints ( ) const
inlinevirtualinherited

return the number of data points used in evaluating the function

Definition at line 109 of file FitMethodFunction.h.

◆ NPoints() [2/2]

virtual unsigned int ROOT::Math::BasicFitMethodFunction< DerivFunType >::NPoints ( ) const
inlinevirtualinherited

return the number of data points used in evaluating the function

Definition at line 109 of file FitMethodFunction.h.

◆ operator=()

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
PoissonLikelihoodFCN & ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::operator= ( const PoissonLikelihoodFCN< DerivFunType, ModelFunType > & rhs)
inline

Assignment operator.

Definition at line 103 of file PoissonLikelihoodFCN.h.

◆ ResetNCalls() [1/2]

virtual void ROOT::Math::BasicFitMethodFunction< DerivFunType >::ResetNCalls ( )
inlinevirtualinherited

reset number of function calls

Definition at line 129 of file FitMethodFunction.h.

◆ ResetNCalls() [2/2]

virtual void ROOT::Math::BasicFitMethodFunction< DerivFunType >::ResetNCalls ( )
inlinevirtualinherited

reset number of function calls

Definition at line 129 of file FitMethodFunction.h.

◆ SetData()

void ROOT::Fit::BasicFCN< DerivFunType, ROOT::Math::IParamMultiFunction, BinData >::SetData ( const std::shared_ptr< BinData > & data)
inlineprotectedinherited

Set the data pointer.

Definition at line 98 of file BasicFCN.h.

◆ SetModelFunction()

void ROOT::Fit::BasicFCN< DerivFunType, ROOT::Math::IParamMultiFunction, BinData >::SetModelFunction ( const std::shared_ptr< IModelFunction > & func)
inlineprotectedinherited

Set the function pointer.

Definition at line 101 of file BasicFCN.h.

◆ Type()

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
BaseObjFunction::Type_t ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::Type ( ) const
inlineoverridevirtual

Computes the full Hessian.

Return false if Hessian is not supported get type of fit method function

Reimplemented from ROOT::Math::BasicFitMethodFunction< DerivFunType >.

Definition at line 161 of file PoissonLikelihoodFCN.h.

◆ UpdateNCalls() [1/2]

virtual void ROOT::Math::BasicFitMethodFunction< DerivFunType >::UpdateNCalls ( ) const
inlinevirtualinherited

update number of calls

Definition at line 124 of file FitMethodFunction.h.

◆ UpdateNCalls() [2/2]

virtual void ROOT::Math::BasicFitMethodFunction< DerivFunType >::UpdateNCalls ( ) const
inlinevirtualinherited

update number of calls

Definition at line 124 of file FitMethodFunction.h.

◆ UseSumOfWeights()

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
void ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::UseSumOfWeights ( )
inline

Definition at line 166 of file PoissonLikelihoodFCN.h.

◆ UseSumOfWeightSquare()

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
void ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::UseSumOfWeightSquare ( bool on = true)
inline

Definition at line 173 of file PoissonLikelihoodFCN.h.

Member Data Documentation

◆ fData

std::shared_ptr<BinData> ROOT::Fit::BasicFCN< DerivFunType, ROOT::Math::IParamMultiFunction, BinData >::fData
protectedinherited

Definition at line 104 of file BasicFCN.h.

◆ fExecutionPolicy

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
::ROOT::EExecutionPolicy ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::fExecutionPolicy
private

Execution policy.

Definition at line 210 of file PoissonLikelihoodFCN.h.

◆ fFunc

std::shared_ptr<IModelFunction> ROOT::Fit::BasicFCN< DerivFunType, ROOT::Math::IParamMultiFunction, BinData >::fFunc
protectedinherited

Definition at line 105 of file BasicFCN.h.

◆ fGrad

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
std::vector<double> ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::fGrad
mutableprivate

for derivatives

Definition at line 208 of file PoissonLikelihoodFCN.h.

◆ fIsExtended

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
bool ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::fIsExtended
private

flag to indicate if is extended (when false is a Multinomial likelihood), default is true

Definition at line 203 of file PoissonLikelihoodFCN.h.

◆ fNCalls [1/2]

unsigned int ROOT::Math::BasicFitMethodFunction< DerivFunType >::fNCalls
mutableprivateinherited

Definition at line 143 of file FitMethodFunction.h.

◆ fNCalls [2/2]

unsigned int ROOT::Math::BasicFitMethodFunction< DerivFunType >::fNCalls
mutableprivateinherited

Definition at line 143 of file FitMethodFunction.h.

◆ fNDim [1/2]

unsigned int ROOT::Math::BasicFitMethodFunction< DerivFunType >::fNDim
privateinherited

Definition at line 141 of file FitMethodFunction.h.

◆ fNDim [2/2]

unsigned int ROOT::Math::BasicFitMethodFunction< DerivFunType >::fNDim
privateinherited

Definition at line 141 of file FitMethodFunction.h.

◆ fNEffPoints

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
unsigned int ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::fNEffPoints
mutableprivate

number of effective points used in the fit

Definition at line 206 of file PoissonLikelihoodFCN.h.

◆ fNPoints [1/2]

unsigned int ROOT::Math::BasicFitMethodFunction< DerivFunType >::fNPoints
privateinherited

Definition at line 142 of file FitMethodFunction.h.

◆ fNPoints [2/2]

unsigned int ROOT::Math::BasicFitMethodFunction< DerivFunType >::fNPoints
privateinherited

Definition at line 142 of file FitMethodFunction.h.

◆ fWeight

template<class DerivFunType, class ModelFunType = ROOT::Math::IParamMultiFunction>
int ROOT::Fit::PoissonLikelihoodFCN< DerivFunType, ModelFunType >::fWeight
private

flag to indicate if needs to evaluate using weight or weight squared (default weight = 0)

Definition at line 204 of file PoissonLikelihoodFCN.h.


The documentation for this class was generated from the following file: