source: branches/MarsMoreSimulationTruth/manalysis/MMarquardt.h@ 20051

Last change on this file since 20051 was 2475, checked in by wittek, 21 years ago
*** empty log message ***
File size: 1.5 KB
Line 
1#ifndef MARS_MMarquardt
2#define MARS_MMarquardt
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7
8#ifndef ROOT_TVectorD
9#include "TVectorD.h"
10#endif
11
12#ifndef ROOT_TMatrixD
13#include "TMatrixD.h"
14#endif
15
16
17class MMarquardt : public MParContainer
18{
19private:
20
21 Int_t fNumStepMax; // maximum number of steps allowed in the minimization
22 Double_t fLoopChi2; // minimization will stop when the change in chi2
23 // is less than fLoopChi2
24
25 Int_t fNpar; // number of parameters
26 Int_t fNumStep; // number of steps made
27 Double_t fChi2; // final chi2
28 Double_t fdChi2; // change of chi2 in last step
29
30 // working space for Marquardt
31 TVectorD fdParam;
32
33 TVectorD fParam;
34 TMatrixD fCovar;
35 TVectorD fGrad;
36
37 TVectorD fmyParam;
38 TMatrixD fmyCovar;
39 TVectorD fmyGrad;
40
41 Double_t fCHIq;
42 Double_t fLambda;
43 Bool_t (*fFunc)(TVectorD &, TMatrixD &, TVectorD &, Double_t &);
44
45 //working space for GaussJordan
46 TVectorD fIxc, fIxr, fIp;
47
48 Bool_t FirstCall();
49 Bool_t NextStep();
50 Bool_t CovMatrix();
51 Bool_t GaussJordan(Int_t &n, TMatrixD &covar, TVectorD &beta);
52
53
54public:
55 MMarquardt(const char *name=NULL, const char *title=NULL);
56 ~MMarquardt();
57
58 void SetNpar(Int_t npar, Int_t numstepmax, Double_t loopchi2);
59
60 Int_t Loop(Bool_t (*fcn)(TVectorD &, TMatrixD &, TVectorD &, Double_t &),
61 TVectorD &);
62
63 ClassDef(MMarquardt, 0) // Class for Marquardt minimization
64};
65
66#endif
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Note: See TracBrowser for help on using the repository browser.