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

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

LogLikelihoodFCN class for likelihood fits.

it is template to distinguish gradient and non-gradient case

Definition at line 40 of file LogLikelihoodFCN.h.

Public Types

typedef BasicFCN< DerivFunType, ModelFunType, UnBinDataBaseFCN
 
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 Types inherited from ROOT::Math::BasicFitMethodFunction< DerivFunType >
typedef FunctionType::BaseFunc BaseFunction
 
enum  Type_t
 enumeration specifying the possible fit method types More...
 

Public Member Functions

 LogLikelihoodFCN (const LogLikelihoodFCN &f)
 Copy constructor.
 
 LogLikelihoodFCN (const std::shared_ptr< UnBinData > &data, const std::shared_ptr< IModelFunction > &func, int weight=0, bool extended=false, const ::ROOT::EExecutionPolicy &executionPolicy=::ROOT::EExecutionPolicy::kSequential)
 Constructor from unbin data set and model function (pdf)
 
 LogLikelihoodFCN (const UnBinData &data, const IModelFunction &func, int weight=0, bool extended=false, const ::ROOT::EExecutionPolicy &executionPolicy=::ROOT::EExecutionPolicy::kSequential)
 Constructor from unbin data set and model function (pdf) for object managed by users.
 
virtual ~LogLikelihoodFCN ()
 Destructor (no operations)
 
virtual BaseFunctionClone () const
 clone the function (need to return Base for Windows)
 
virtual double DataElement (const double *x, unsigned int i, double *g, double *h=nullptr, bool fullHessian=false) const
 i-th likelihood contribution and its gradient
 
virtual void Gradient (const double *x, double *g) const
 
virtual unsigned int NFitPoints () const
 
LogLikelihoodFCNoperator= (const LogLikelihoodFCN &rhs)
 Assignment operator.
 
virtual BaseObjFunction::Type_t Type () const
 get type of fit method function
 
void UseSumOfWeightSquare (bool on=true)
 
- Public Member Functions inherited from ROOT::Fit::BasicFCN< DerivFunType, ModelFunType, DataType >
virtual const DataType & Data () const
 access to const reference to the data
 
std::shared_ptr< DataType > DataPtr () const
 access to data pointer
 
virtual bool HasHessian () const
 flag to indicate if can compute Hessian
 
virtual const IModelFunctionModelFunction () const
 access to const reference to the model function
 
std::shared_ptr< IModelFunctionModelFunctionPtr () const
 access to function pointer
 
- Public Member Functions inherited from ROOT::Math::BasicFitMethodFunction< DerivFunType >
 BasicFitMethodFunction (int dim, int npoint)
 
 ~BasicFitMethodFunction () override
 Virtual Destructor (no operations)
 
virtual bool G2 (const double *, double *) const
 Computes the Second derivatives.
 
virtual bool Hessian (const double *x, double *hess) const
 Computes the full Hessian.
 
bool IsAGradFCN ()
 
virtual unsigned int NCalls () const
 return the total number of function calls (override if needed)
 
unsigned int NDim () const override
 Number of dimension (parameters) .
 
virtual unsigned int NPoints () const
 return the number of data points used in evaluating the function
 
virtual void ResetNCalls ()
 reset number of function calls
 
virtual void UpdateNCalls () const
 update number of calls
 

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from ROOT::Math::BasicFitMethodFunction< DerivFunType >
static bool IsAGradFCN ()
 Static function to indicate if a function is supporting gradient.
 
- Protected Types inherited from ROOT::Fit::BasicFCN< DerivFunType, ModelFunType, DataType >
typedef BaseObjFunction::BaseFunction BaseFunction
 
typedef ::ROOT::Math::BasicFitMethodFunction< DerivFunType > BaseObjFunction
 
typedef ::ROOT::Math::IParametricGradFunctionMultiDimTempl< TIGradModelFunction
 
typedef ::ROOT::Math::IParamMultiFunctionTempl< TIModelFunction
 
typedef ModelFunType::BackendType T
 
- Protected Member Functions inherited from ROOT::Fit::BasicFCN< DerivFunType, ModelFunType, DataType >
 BasicFCN (const std::shared_ptr< DataType > &data, const std::shared_ptr< IModelFunction > &func)
 Constructor from data set and model function.
 
virtual ~BasicFCN ()
 Destructor (no operations)
 
void SetData (const std::shared_ptr< DataType > &data)
 Set the data pointer.
 
void SetModelFunction (const std::shared_ptr< IModelFunction > &func)
 Set the function pointer.
 
- Protected Attributes inherited from ROOT::Fit::BasicFCN< DerivFunType, ModelFunType, DataType >
std::shared_ptr< DataType > fData
 
std::shared_ptr< IModelFunctionfFunc
 

#include <Fit/LogLikelihoodFCN.h>

Inheritance diagram for ROOT::Fit::LogLikelihoodFCN< DerivFunType, ModelFunType >:
[legend]

Member Typedef Documentation

◆ BaseFCN

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

Definition at line 45 of file LogLikelihoodFCN.h.

◆ BaseFunction

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

Definition at line 48 of file LogLikelihoodFCN.h.

◆ BaseObjFunction

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

Definition at line 47 of file LogLikelihoodFCN.h.

◆ IModelFunction

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

Definition at line 50 of file LogLikelihoodFCN.h.

◆ T

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

Definition at line 44 of file LogLikelihoodFCN.h.

◆ Type_t

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

Definition at line 51 of file LogLikelihoodFCN.h.

Constructor & Destructor Documentation

◆ LogLikelihoodFCN() [1/3]

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
ROOT::Fit::LogLikelihoodFCN< DerivFunType, ModelFunType >::LogLikelihoodFCN ( const std::shared_ptr< UnBinData > &  data,
const std::shared_ptr< IModelFunction > &  func,
int  weight = 0,
bool  extended = false,
const ::ROOT::EExecutionPolicy executionPolicy = ::ROOT::EExecutionPolicy::kSequential 
)
inline

Constructor from unbin data set and model function (pdf)

Definition at line 57 of file LogLikelihoodFCN.h.

◆ LogLikelihoodFCN() [2/3]

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

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

Definition at line 69 of file LogLikelihoodFCN.h.

◆ ~LogLikelihoodFCN()

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

Destructor (no operations)

Definition at line 81 of file LogLikelihoodFCN.h.

◆ LogLikelihoodFCN() [3/3]

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

Copy constructor.

Definition at line 86 of file LogLikelihoodFCN.h.

Member Function Documentation

◆ Clone()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual BaseFunction * ROOT::Fit::LogLikelihoodFCN< DerivFunType, ModelFunType >::Clone ( ) const
inlinevirtual

clone the function (need to return Base for Windows)

Definition at line 112 of file LogLikelihoodFCN.h.

◆ DataElement()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual double ROOT::Fit::LogLikelihoodFCN< DerivFunType, ModelFunType >::DataElement ( const double x,
unsigned int  i,
double g,
double h = nullptr,
bool  fullHessian = false 
) const
inlinevirtual

i-th likelihood contribution and its gradient

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

Definition at line 121 of file LogLikelihoodFCN.h.

◆ DoDerivative()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual double ROOT::Fit::LogLikelihoodFCN< DerivFunType, ModelFunType >::DoDerivative ( const double x,
unsigned int  icoord 
) const
inlineprivatevirtual

Definition at line 161 of file LogLikelihoodFCN.h.

◆ DoEval()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual double ROOT::Fit::LogLikelihoodFCN< DerivFunType, ModelFunType >::DoEval ( const double x) const
inlineprivatevirtual

Evaluation of the function (required by interface)

Definition at line 155 of file LogLikelihoodFCN.h.

◆ Gradient()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual void ROOT::Fit::LogLikelihoodFCN< DerivFunType, ModelFunType >::Gradient ( const double x,
double g 
) const
inlinevirtual

Definition at line 127 of file LogLikelihoodFCN.h.

◆ NFitPoints()

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

Definition at line 118 of file LogLikelihoodFCN.h.

◆ operator=()

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

Assignment operator.

Definition at line 99 of file LogLikelihoodFCN.h.

◆ Type()

template<class DerivFunType , class ModelFunType = ROOT::Math::IParamMultiFunction>
virtual BaseObjFunction::Type_t ROOT::Fit::LogLikelihoodFCN< DerivFunType, ModelFunType >::Type ( ) const
inlinevirtual

get type of fit method function

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

Definition at line 134 of file LogLikelihoodFCN.h.

◆ UseSumOfWeightSquare()

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

Definition at line 139 of file LogLikelihoodFCN.h.

Member Data Documentation

◆ fExecutionPolicy

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

Execution policy.

Definition at line 176 of file LogLikelihoodFCN.h.

◆ fGrad

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

for derivatives

Definition at line 174 of file LogLikelihoodFCN.h.

◆ fIsExtended

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

flag for indicating if likelihood is extended

Definition at line 168 of file LogLikelihoodFCN.h.

◆ fNEffPoints

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

number of effective points used in the fit

Definition at line 172 of file LogLikelihoodFCN.h.

◆ fWeight

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

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

Definition at line 169 of file LogLikelihoodFCN.h.

  • math/mathcore/inc/Fit/LogLikelihoodFCN.h