File indexing completed on 2025-09-17 09:16:06
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef ROOT_TLinearMinimizer
0014 #define ROOT_TLinearMinimizer
0015
0016 #include "Math/Minimizer.h"
0017
0018 #include "Rtypes.h"
0019
0020 #include <vector>
0021 #include <string>
0022
0023 class TLinearFitter;
0024
0025
0026
0027
0028
0029
0030
0031 class TLinearMinimizer : public ROOT::Math::Minimizer {
0032
0033 public:
0034
0035
0036
0037
0038 TLinearMinimizer (int type = 0);
0039
0040
0041
0042
0043 TLinearMinimizer ( const char * type );
0044
0045
0046
0047
0048 ~TLinearMinimizer () override;
0049
0050
0051 void SetFunction(const ROOT::Math::IMultiGenFunction & func) override;
0052
0053
0054 bool SetVariable(unsigned int , const std::string & , double , double ) override { return true; }
0055
0056
0057 bool SetFixedVariable(unsigned int , const std::string & , double ) override;
0058
0059
0060 bool Minimize() override;
0061
0062
0063 double MinValue() const override { return fMinVal; }
0064
0065
0066 double Edm() const override { return 0; }
0067
0068
0069 const double * X() const override { return &fParams.front(); }
0070
0071
0072 const double * MinGradient() const override { return nullptr; }
0073
0074
0075 unsigned int NCalls() const override { return 0; }
0076
0077
0078
0079 unsigned int NDim() const override { return fDim; }
0080
0081
0082
0083 unsigned int NFree() const override { return fNFree; }
0084
0085
0086 bool ProvidesError() const override { return true; }
0087
0088
0089 const double * Errors() const override { return fErrors.empty() ? nullptr : &fErrors.front(); }
0090
0091
0092
0093
0094
0095 double CovMatrix(unsigned int i, unsigned int j) const override {
0096 return (fCovar.empty()) ? 0 : fCovar[i + fDim* j];
0097 }
0098
0099
0100 int CovMatrixStatus() const override {
0101 if (fCovar.empty()) return 0;
0102 return (fStatus ==0) ? 3 : 1;
0103 }
0104
0105
0106
0107
0108
0109
0110
0111 protected:
0112
0113 private:
0114
0115 bool fRobust;
0116 unsigned int fDim;
0117 unsigned int fNFree;
0118 double fMinVal;
0119 std::vector<double> fParams;
0120 std::vector<double> fErrors;
0121 std::vector<double> fCovar;
0122
0123 const ROOT::Math::IMultiGradFunction * fObjFunc;
0124 TLinearFitter * fFitter;
0125
0126 ClassDef(TLinearMinimizer,1)
0127
0128 };
0129
0130
0131
0132 #endif