File indexing completed on 2025-01-18 10:11:47
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 private:
0059
0060
0061
0062
0063
0064 TFumiliMinimizer(const TFumiliMinimizer &);
0065
0066
0067
0068
0069 TFumiliMinimizer & operator = (const TFumiliMinimizer & rhs);
0070
0071 public:
0072
0073
0074 void SetFunction(const ROOT::Math::IMultiGenFunction & func) override;
0075
0076
0077 bool SetVariable(unsigned int ivar, const std::string & name, double val, double step) override;
0078
0079
0080 bool SetLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double , double ) override;
0081
0082 #ifdef LATER
0083
0084 virtual bool SetLowerLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double lower );
0085
0086 virtual bool SetUpperLimitedVariable(unsigned int ivar , const std::string & name , double val , double step , double upper );
0087 #endif
0088
0089
0090 bool SetFixedVariable(unsigned int , const std::string & , double ) override;
0091
0092
0093 bool SetVariableValue(unsigned int ivar, double val ) override;
0094
0095
0096 bool Minimize() override;
0097
0098
0099 double MinValue() const override { return fMinVal; }
0100
0101
0102 double Edm() const override { return fEdm; }
0103
0104
0105 const double * X() const override { return &fParams.front(); }
0106
0107
0108 const double * MinGradient() const override { return nullptr; }
0109
0110
0111 unsigned int NCalls() const override { return 0; }
0112
0113
0114
0115 unsigned int NDim() const override { return fDim; }
0116
0117
0118
0119 unsigned int NFree() const override { return fNFree; }
0120
0121
0122 bool ProvidesError() const override { return true; }
0123
0124
0125 const double * Errors() const override { return &fErrors.front(); }
0126
0127
0128
0129
0130
0131 double CovMatrix(unsigned int i, unsigned int j) const override {
0132 return fCovar[i + fDim* j];
0133 }
0134
0135
0136
0137
0138 int CovMatrixStatus() const override {
0139 if (fCovar.empty()) return 0;
0140 return (fStatus ==0) ? 3 : 1;
0141 }
0142
0143
0144
0145
0146
0147 protected:
0148
0149
0150 static void Fcn( int &, double * , double & f, double * , int);
0151
0152
0153
0154
0155 static double EvaluateFCN(const double * x, double * g);
0156
0157 private:
0158
0159
0160 unsigned int fDim;
0161 unsigned int fNFree;
0162 double fMinVal;
0163 double fEdm;
0164 std::vector<double> fParams;
0165 std::vector<double> fErrors;
0166 std::vector<double> fCovar;
0167
0168 TFumili * fFumili;
0169
0170
0171
0172 static ROOT::Math::FitMethodFunction * fgFunc;
0173 static ROOT::Math::FitMethodGradFunction * fgGradFunc;
0174
0175 static TFumili * fgFumili;
0176
0177 ClassDef(TFumiliMinimizer,1)
0178
0179 };
0180
0181
0182
0183 #endif