1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
2 | // Classe d ajustement pour piapp
|
---|
3 | // cmv 98-99
|
---|
4 | // CEA-DAPNIA LAL-IN2P3/CNRS
|
---|
5 |
|
---|
6 | #ifndef PIAFITTING_H_SEEN
|
---|
7 | #define PIAFITTING_H_SEEN
|
---|
8 |
|
---|
9 | #include "machdefs.h"
|
---|
10 | #include <string>
|
---|
11 | #include <vector>
|
---|
12 | #if defined(__KCC__)
|
---|
13 | using std::string ;
|
---|
14 | #include <vector.h>
|
---|
15 | #endif
|
---|
16 |
|
---|
17 | #include "anydataobj.h"
|
---|
18 |
|
---|
19 | #include "pdlmgr.h"
|
---|
20 | #include "dlftypes.h"
|
---|
21 | #include "piacmd.h"
|
---|
22 | #include "cvector.h"
|
---|
23 |
|
---|
24 | class PIStdImgApp;
|
---|
25 | class PIAFitterWind;
|
---|
26 | class GeneralFunction;
|
---|
27 | class GeneralFitData;
|
---|
28 | class GeneralFit;
|
---|
29 | class Histo;
|
---|
30 | class Matrix; class Histo2D; class RzImage;
|
---|
31 |
|
---|
32 | class PIAFitter : public CmdExecutor {
|
---|
33 | public :
|
---|
34 | PIAFitter(PIACmd* piac, PIStdImgApp* app);
|
---|
35 | virtual ~PIAFitter();
|
---|
36 | virtual int Execute(string& keyw, vector<string>& args);
|
---|
37 | virtual void LinkFitFunc(string const & fname, string const & funcname, int nvar, int npar);
|
---|
38 | virtual void PrepareFitFuncCFile(string const & fname, string const & funcname, int nvar, int npar);
|
---|
39 |
|
---|
40 | friend class PIAFitterWind;
|
---|
41 |
|
---|
42 | protected :
|
---|
43 |
|
---|
44 | typedef struct DFOptions {
|
---|
45 | bool okres, okfun;
|
---|
46 | int polcx,polcy; double xc,yc;
|
---|
47 | double err_e, err_E;
|
---|
48 | double stc2;
|
---|
49 | int nstep;
|
---|
50 | int lp,lpg;
|
---|
51 | int i1,i2,j1,j2;
|
---|
52 | bool fromlastfit;
|
---|
53 | } DFOPTIONS ;
|
---|
54 |
|
---|
55 | void ResetDPointer(void);
|
---|
56 | void ResetOptions(void);
|
---|
57 | void DecodeOptions(string opt);
|
---|
58 | void DecodeObject(string obj);
|
---|
59 | void CheckOptions(void);
|
---|
60 | void PrintOptions(void);
|
---|
61 | void FillGData(void);
|
---|
62 | void DecodeFunction(string func);
|
---|
63 | void ReSetParam(void);
|
---|
64 | void InitParFromLastFit(void);
|
---|
65 | void DecodeParam(string par,string step,string min,string max,string fix);
|
---|
66 | int DoFit(void);
|
---|
67 | void FitFunRes(void);
|
---|
68 | void LinFit(void);
|
---|
69 |
|
---|
70 | PIStdImgApp* mApp; // Do not delete
|
---|
71 | PIAFitterWind* FWindFit;
|
---|
72 | string mNObj; AnyDataObj* mObj; // Do not delete
|
---|
73 | GeneralFunction* mFunc; string mFName;
|
---|
74 | GeneralFitData* mGData;
|
---|
75 | int mNPar,mNVar,mNBinX,mNBinY,mNData;
|
---|
76 | Vector mPar; Vector mStep; Vector mMin; Vector mMax; Vector mFix;
|
---|
77 | Vector mParSave; Vector mStepSave; Vector mMinSave; Vector mMaxSave; Vector mFixSave;
|
---|
78 | GeneralFit* mFit;
|
---|
79 | DFOPTIONS mOpt;
|
---|
80 | DFOPTIONS mOptSave;
|
---|
81 | // Objets a fitter
|
---|
82 | Vector* mV; Histo* mH; // Do not delete
|
---|
83 | Matrix* mM; Histo2D* mH2; RzImage* mIm; // Do not delete
|
---|
84 | GeneralFitData* mG; // Do not delete
|
---|
85 |
|
---|
86 | // Gestion de fonction de fit user
|
---|
87 | PDynLinkMgr* mDlUFunc;
|
---|
88 | string mNameFitFunc;
|
---|
89 | DlUserFitFunc mFitFunc;
|
---|
90 | DlUserFitFuncDer mFitFuncDer;
|
---|
91 | int mUFNVar, mUFNPar;
|
---|
92 | };
|
---|
93 |
|
---|
94 | #endif
|
---|