| 35 |
|
|
| 36 |
public: |
public: |
| 37 |
|
|
| 38 |
|
|
| 39 |
typedef typename FunctionType::BaseFunc BaseFunction; |
typedef typename FunctionType::BaseFunc BaseFunction; |
| 40 |
|
|
| 41 |
/// enumeration specyfing the possible fit method types |
/// enumeration specyfing the possible fit method types |
| 42 |
enum Type { kUndefined , kLeastSquare, kLogLikelihood }; |
enum Type { kUndefined , kLeastSquare, kLogLikelihood }; |
| 43 |
|
|
| 44 |
|
|
| 45 |
|
BasicFitMethodFunction(int dim, int npoint) : |
| 46 |
|
fNDim(dim), |
| 47 |
|
fNPoints(npoint), |
| 48 |
|
fNCalls(0) |
| 49 |
|
{} |
| 50 |
|
|
| 51 |
/** |
/** |
| 52 |
Virtual Destructor (no operations) |
Virtual Destructor (no operations) |
| 54 |
virtual ~BasicFitMethodFunction () {} |
virtual ~BasicFitMethodFunction () {} |
| 55 |
|
|
| 56 |
/** |
/** |
| 57 |
|
Number of dimension (parameters) . From IGenMultiFunction interface |
| 58 |
|
*/ |
| 59 |
|
virtual unsigned int NDim() const { return fNDim; } |
| 60 |
|
|
| 61 |
|
/** |
| 62 |
method returning the data i-th contribution to the fit objective function |
method returning the data i-th contribution to the fit objective function |
| 63 |
For example the residual for the least square functions or the pdf element for the |
For example the residual for the least square functions or the pdf element for the |
| 64 |
likelihood functions. |
likelihood functions. |
| 70 |
/** |
/** |
| 71 |
return the number of data points used in evaluating the function |
return the number of data points used in evaluating the function |
| 72 |
*/ |
*/ |
| 73 |
virtual unsigned int NPoints() const = 0; |
virtual unsigned int NPoints() const { return fNPoints; } |
| 74 |
|
|
| 75 |
/** |
/** |
| 76 |
return the type of method, override if needed |
return the type of method, override if needed |
| 80 |
/** |
/** |
| 81 |
return the total number of function calls (overrided if needed) |
return the total number of function calls (overrided if needed) |
| 82 |
*/ |
*/ |
| 83 |
virtual unsigned int NCalls() const { return 0; } |
virtual unsigned int NCalls() const { return fNCalls; } |
| 84 |
|
|
| 85 |
|
/** |
| 86 |
|
update number of calls |
| 87 |
|
*/ |
| 88 |
|
virtual void UpdateNCalls() const { fNCalls++; } |
| 89 |
|
|
| 90 |
|
/** |
| 91 |
|
reset number of function calls |
| 92 |
|
*/ |
| 93 |
|
virtual void ResetNCalls() { fNCalls = 0; } |
| 94 |
|
|
| 95 |
|
|
| 96 |
|
|
| 97 |
public: |
public: |
| 98 |
|
|
| 102 |
|
|
| 103 |
private: |
private: |
| 104 |
|
|
| 105 |
|
unsigned int fNDim; |
| 106 |
|
unsigned int fNPoints; // size of the data |
| 107 |
|
mutable unsigned int fNCalls; |
| 108 |
|
|
| 109 |
|
|
| 110 |
}; |
}; |
| 111 |
|
|