File indexing completed on 2025-09-16 09:09:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef ROOT_TFumiliMinimizer
0014 #define ROOT_TFumiliMinimizer
0015
0016 #include "Math/Minimizer.h"
0017
0018 #include "Math/FitMethodFunction.h"
0019
0020 #include "Rtypes.h"
0021 #include <vector>
0022 #include <string>
0023
0024 class TFumili;
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 class TFumiliMinimizer : public ROOT::Math::Minimizer {
0044
0045 public:
0046
0047
0048
0049
0050 TFumiliMinimizer (int dummy=0 );
0051
0052
0053
0054
0055
0056 ~TFumiliMinimizer () override;
0057
0058
0059 void SetFunction(const ROOT::Math::IMultiGenFunction & func) override;
0060
0061
0062 bool SetVariable(unsigned int ivar, const std::string & name, double val, double step) override;
0063
0064
0065 bool SetLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double , double ) override;
0066
0067 #ifdef LATER
0068
0069 virtual bool SetLowerLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double lower );
0070
0071 virtual bool SetUpperLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double upper );
0072 #endif
0073
0074
0075 bool SetFixedVariable(unsigned int , const std::string & , double ) override;
0076
0077
0078 bool SetVariableValue(unsigned int ivar, double val ) override;
0079
0080
0081 bool Minimize() override;
0082
0083
0084 double MinValue() const override { return fMinVal; }
0085
0086
0087 double Edm() const override { return fEdm; }
0088
0089
0090 const double * X() const override { return &fParams.front(); }
0091
0092
0093 const double * MinGradient() const override { return nullptr; }
0094
0095
0096 unsigned int NCalls() const override { return 0; }
0097
0098
0099
0100 unsigned int NDim() const override { return fDim; }
0101
0102
0103
0104 unsigned int NFree() const override { return fNFree; }
0105
0106
0107 bool ProvidesError() const override { return true; }
0108
0109
0110 const double * Errors() const override { return &fErrors.front(); }
0111
0112
0113
0114
0115
0116 double CovMatrix(unsigned int i, unsigned int j) const override {
0117 return fCovar[i + fDim* j];
0118 }
0119
0120
0121
0122
0123 int CovMatrixStatus() const override {
0124 if (fCovar.empty()) return 0;
0125 return (fStatus ==0) ? 3 : 1;
0126 }
0127
0128
0129
0130
0131
0132 protected:
0133
0134
0135 static void Fcn( int &, double * , double & f, double * , int);
0136
0137
0138
0139
0140 static double EvaluateFCN(const double * x, double * g);
0141
0142 private:
0143
0144
0145 unsigned int fDim;
0146 unsigned int fNFree;
0147 double fMinVal;
0148 double fEdm;
0149 std::vector<double> fParams;
0150 std::vector<double> fErrors;
0151 std::vector<double> fCovar;
0152
0153 TFumili * fFumili;
0154
0155
0156
0157 static ROOT::Math::FitMethodFunction * fgFunc;
0158 static ROOT::Math::FitMethodGradFunction * fgGradFunc;
0159
0160 static TFumili * fgFumili;
0161
0162 ClassDef(TFumiliMinimizer,1)
0163
0164 };
0165
0166
0167
0168 #endif