// ---------------------------------- minuit.h //+SEQ,CopyRight,T=NOINCLUDE. ////////////////////////////////////////////////////////////////////////// // // // TMinuit // // // // The MINUIT minimisation package (base class) // // // ////////////////////////////////////////////////////////////////////////// #ifndef ROOT_TMinuit #define ROOT_TMinuit #ifndef ROOT_TNamed //*KEEP,TNamed. #include "TNamed.h" //*KEND. #endif #ifndef ROOT_TMethodCall //*KEEP,TMethodCall,T=C++. #include "TMethodCall.h" //*KEND. #endif class TGraph; class TMinuit : public TNamed { private: TMinuit(const TMinuit &m); // should become private.... public: Int_t fEmpty; //Initialization flag (1 = Minuit initialized) Int_t fMaxpar; //Maximum number of parameters TString *fCpnam; //Array of parameters names Double_t *fU; //External (visible to user in FCN) value of parameters Double_t *fAlim; //Lower limits for parameters. If zero no limits Double_t *fBlim; //Upper limits for parameters Double_t *fErp; //Positive Minos errors if calculated Double_t *fErn; //Negative Minos errors if calculated Double_t *fWerr; //External parameters error (standard deviation, defined by UP) Double_t *fGlobcc; //Global Correlation Coefficients Int_t *fNvarl; //parameters flag (-1=undefined, 0=constant..) Int_t *fNiofex; //Internal parameters number, or zero if not currently variable Int_t *fNexofi; //External parameters number for currently variable parameters Double_t *fX; //Internal parameters values Double_t *fXt; //Internal parameters values X saved as Xt Double_t *fDirin; //(Internal) step sizes for current step Double_t *fXs; //Internal parameters values saved for fixed params Double_t *fXts; //Internal parameters values X saved as Xt for fixed params Double_t *fDirins; //(Internal) step sizes for current step for fixed params Double_t *fGrd; //First derivatives Double_t *fG2; // Double_t *fGstep; //Step sizes Double_t *fGin; // Double_t *fDgrd; //Uncertainties Double_t *fGrds; // Double_t *fG2s; // Double_t *fGsteps; // Int_t *fIpfix; //List of fixed parameters Int_t fNpfix; //Number of fixed parameters Double_t *fVhmat; //(Internal) error matrix stored as Half MATrix, since it is symmetric Double_t *fVthmat; //VHMAT is sometimes saved in VTHMAT, especially in MNMNOT Double_t *fP; // Double_t *fPstar; // Double_t *fPstst; // Double_t *fPbar; // Double_t *fPrho; //Minimum point of parabola Int_t fMaxint; //Maximum number of internal parameters Int_t fNpar; //Number of parameters Int_t fMaxext; //Maximum number of external parameters Int_t fMaxIterations; //Maximum number of iterations Int_t fNu; // Int_t fIsysrd; //standardInput unit Int_t fIsyswr; //standard output unit Int_t fIsyssa; // Int_t fNpagwd; //Page width Int_t fNpagln; //Number of lines per page Int_t fNewpag; // Int_t fIstkrd[10]; // Int_t fNstkrd; // Int_t fIstkwr[10]; // Int_t fNstkwr; // TString fCfrom; // TString fCstatu; // TString fCtitl; // TString fCword; // TString fCundef; // TString fCvrsn; // TString fCovmes[4]; // Int_t fISW[7]; //Array of switches Int_t fIdbg[11]; //Array of internal debug switches Int_t fNblock; //Number of Minuit data blocks Int_t fIcomnd; //Number of commands Double_t fAmin; //Minimum value found for FCN Double_t fUp; //FCN+-UP defines errors (for chisquare fits UP=1) Double_t fEDM; //Estimated vertical distance to the minimum Double_t fFval3; // Double_t fEpsi; // Double_t fApsi; // Double_t fDcovar; //Relative change in covariance matrix Int_t fNfcn; //Number of calls to FCN Int_t fNfcnmx; //Maximum number of calls to FCN Int_t fNfcnlc; // Int_t fNfcnfr; // Int_t fItaur; // Int_t fIstrat; // Int_t fNwrmes[2]; // Double_t *fWord7; // Bool_t fLwarn; //true if warning messges are to be put out (default=true) Bool_t fLrepor; //true if exceptional conditions are put out (default=false) Bool_t fLimset; //true if a parameter is up against limits (for MINOS) Bool_t fLnolim; //true if there are no limits on any parameters (not yet used) Bool_t fLnewmn; //true if the previous process has unexpectedly improved FCN Bool_t fLphead; //true if a heading should be put out for the next parameter definition Double_t fEpsmac; //machine precision for floating points: Double_t fEpsma2; //sqrt(fEpsmac) Double_t fVlimlo; // Double_t fVlimhi; // Double_t fUndefi; //Undefined number = -54321 Double_t fBigedm; //Big EDM = 123456 Double_t fUpdflt; // Double_t *fXpt; //X array of points for contours Double_t *fYpt; //Y array of points for contours TString *fChpt; //Character to be plotted at the X,Y contour positions Double_t fXmidcr; // Double_t fYmidcr; // Double_t fXdircr; // Double_t fYdircr; // Int_t fKe1cr; // Int_t fKe2cr; // TString *fOrigin; // TString *fWarmes; // Int_t fNfcwar[20]; // Int_t fIcirc[2]; // Int_t fStatus; //Status flag for the last called Minuit function TObject *fObjectFit; //Pointer to object being fitted TMethodCall *fMethodCall; //Pointer to MethodCall in case of interpreted function void (*fFCN)(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag); // methods performed on TMinuit class public: TMinuit(); TMinuit(Int_t maxpar); virtual ~TMinuit(); void BuildArrays(Int_t maxpar=15); TGraph *Contour(const char *graphname, Int_t npoints=10, Int_t pa1=1, Int_t pa2=2); void DeleteArrays(); TMethodCall *GetMethodCall() {return fMethodCall;} TObject *GetObjectFit() {return fObjectFit;} Int_t GetMaxIterations() {return fMaxIterations;} Int_t GetStatus() {return fStatus;} void SetObjectFit(TObject *obj) {fObjectFit=obj;} void SetFCN(void *fcn); void SetFCN(void (*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t)); void mnamin(); void mnbins(Double_t a1, Double_t a2, Int_t naa, Double_t &bl, Double_t &bh, Int_t &nb, Double_t &bwid); void mncalf(Double_t *pvec, Double_t &ycalf); void mncler(); void mncntr(Int_t ke1, Int_t ke2, Int_t &ierrf); void mncomd(TString crdbin, Int_t &icondn); void mncont(Int_t ke1, Int_t ke2, Int_t nptu, Double_t *xptu, Double_t *yptu, Int_t &ierrf); void mncrck(TString &crdbuf, Int_t maxcwd, TString &comand, Int_t &lnc , Int_t mxp, Double_t *plist, Int_t &llist, Int_t &ierr, Int_t isyswr); void mncros(Double_t &aopt, Int_t &iercr); void mncuve(); void mnderi(); void mndxdi(Double_t pint, Int_t ipar, Double_t &dxdi); void mneig(Double_t *a, Int_t ndima, Int_t n, Int_t mits, Double_t *work, Double_t precis, Int_t &ifault); void mnemat(Double_t *emat, Int_t ndim); void mnerrs(Int_t number, Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &gcc); void mneval(Double_t anext, Double_t &fnext, Int_t &ierev); void mnexcm(TString comand, Double_t *plist, Int_t llist, Int_t &ierflg) ; void mnexin(Double_t *pint); void mnfixp(Int_t iint, Int_t &ierr); void mnfree(Int_t k); void mngrad(); void mnhelp(TString comd); void mnhess(); void mnhes1(); void mnimpr(); void mninex(Double_t *pint); void mninit(Int_t i1, Int_t i2, Int_t i3); void mnlims(); void mnline(Double_t *start, Double_t fstart, Double_t *step, Double_t slope, Double_t toler); void mnmatu(Int_t kode); void mnmigr(); void mnmnos(); void mnmnot(Int_t ilax, Int_t ilax2, Double_t &val2pl, Double_t &val2mi); void mnparm(Int_t k, TString cnamj, Double_t uk, Double_t wk, Double_t a, Double_t b, Int_t &ierflg); void mnpars(TString &crdbuf, Int_t &icondn); void mnpfit(Double_t *parx2p, Double_t *pary2p, Int_t npar2p, Double_t *coef2p, Double_t &sdev2p); void mnpint(Double_t &pexti, Int_t i, Double_t &pinti); void mnplot(Double_t *xpt, Double_t *ypt, TString *chpt, Int_t nxypt, Int_t npagwd, Int_t npagln); void mnpout(Int_t iuext, TString chnam, Double_t &val, Double_t &err, Double_t &xlolim, Double_t &xuplim, Int_t &iuint); void mnprin(Int_t inkode, Double_t fval); void mnpsdf(); void mnrazz(Double_t ynew, Double_t *pnew, Double_t *y, Int_t &jh, Int_t &jl); void mnrn15(Double_t &val, Int_t &inseed); void mnrset(Int_t iopt); void mnsave(); void mnscan(); void mnseek(); void mnset(); void mnsimp(); void mnstat(Double_t &fmin, Double_t &fedm, Double_t &errdef, Int_t &npari, Int_t &nparx, Int_t &istat); void mntiny(Double_t epsp1, Double_t &epsbak); Bool_t mnunpt(TString &cfname); void mnvert(Double_t *a, Int_t l, Int_t m, Int_t n, Int_t &ifail); void mnwarn(const char *copt, const char *corg, const char *cmes); void mnwerr(); void SetMaxIterations(Int_t maxiter=500) {fMaxIterations = maxiter;} ClassDef(TMinuit,0) //The MINUIT minimisation package }; R__EXTERN TMinuit *gMinuit; #endif