Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

Midnight.h

Go to the documentation of this file.
00001 //  The below code is a modified version of the ROOT/TMinuit class
00002 // in order to have a stand alone C++ version of the Minuit package.
00003 //    G.Barrand
00004 
00005 #ifndef Midnight_h
00006 #define Midnight_h
00007 
00008 #include "CalRecon/MString.h"
00009 
00010 typedef unsigned char MBool;
00011 typedef int MInt;
00012 typedef double MDouble;
00013 typedef void(*MFunction)(MInt&,MDouble*,MDouble&,MDouble*,MInt);
00014 typedef void(*MPrintf)(const char*,...);
00015 
00016 class Midnight {
00017 private:
00018         MInt        fEmpty;            //Initialization flag (1 = Midnight initialized)
00019         MInt        fMaxpar;           //Maximum number of parameters
00020         MString      *fCpnam;           //Array of parameters names
00021         MDouble     *fU;               //External (visible to user in FCN) value of parameters
00022         MDouble     *fAlim;            //Lower limits for parameters. If zero no limits
00023         MDouble     *fBlim;            //Upper limits for parameters
00024         MDouble     *fErp;             //Positive Minos errors if calculated
00025         MDouble     *fErn;             //Negative Minos errors if calculated
00026         MDouble     *fWerr;            //External parameters error (standard deviation, defined by UP)
00027         MDouble     *fGlobcc;          //Global Correlation Coefficients
00028            MInt     *fNvarl;           //parameters flag (-1=undefined, 0=constant..)
00029            MInt     *fNiofex;          //Internal parameters number, or zero if not currently variable
00030            MInt     *fNexofi;          //External parameters number for currently variable parameters
00031         MDouble     *fX;               //Internal parameters values
00032         MDouble     *fXt;              //Internal parameters values X saved as Xt
00033         MDouble     *fDirin;           //(Internal) step sizes for current step
00034         MDouble     *fXs;              //Internal parameters values saved for fixed params
00035         MDouble     *fXts;             //Internal parameters values X saved as Xt for fixed params
00036         MDouble     *fDirins;          //(Internal) step sizes for current step for fixed params
00037         MDouble     *fGrd;             //First derivatives
00038         MDouble     *fG2;              //
00039         MDouble     *fGstep;           //Step sizes
00040         MDouble     *fGin;             //
00041         MDouble     *fDgrd;            //Uncertainties
00042         MDouble     *fGrds;            //
00043         MDouble     *fG2s;             //
00044         MDouble     *fGsteps;          //
00045         MInt        *fIpfix;           //List of fixed parameters
00046         MInt        fNpfix;            //Number of fixed parameters
00047         MDouble     *fVhmat;           //(Internal) error matrix stored as Half MATrix, since it is symmetric
00048         MDouble     *fVthmat;          //VHMAT is sometimes saved in VTHMAT, especially in MNMNOT
00049         MDouble     *fP;               //
00050         MDouble     *fPstar;           //
00051         MDouble     *fPstst;           //
00052         MDouble     *fPbar;            //
00053         MDouble     *fPrho;            //Minimum point of parabola
00054         MInt        fMaxint;           //Maximum number of internal parameters
00055         MInt        fNpar;             //Number of parameters
00056         MInt        fMaxext;           //Maximum number of external parameters
00057         MInt        fNu;               //
00058         MInt        fIsysrd;           //standardInput unit
00059         MInt        fIsyswr;           //standard output unit
00060         MInt        fIsyssa;           //
00061         MInt        fNpagwd;           //Page width
00062         MInt        fNpagln;           //Number of lines per page
00063         MInt        fNewpag;           //
00064         MInt        fIstkrd[10];       //
00065         MInt        fNstkrd;           //
00066         MInt        fIstkwr[10];       //
00067         MInt        fNstkwr;           //
00068         MString      fCfrom;            //
00069         MString      fCstatu;           //
00070         MString      fCtitl;            //
00071         MString      fCword;            //
00072         MString      fCundef;           //
00073         MString      fCvrsn;            //
00074         MString      fCovmes[4];        //
00075         MInt        fISW[7];           //Array of switches
00076         MInt        fIdbg[11];         //Array of internal debug switches
00077         MInt        fNblock;           //Number of Minuit data blocks
00078         MInt        fIcomnd;           //Number of commands
00079         MDouble     fAmin;             //Minimum value found for FCN
00080         MDouble     fUp;               //FCN+-UP defines errors (for chisquare fits UP=1)
00081         MDouble     fEDM;              //Estimated vertical distance to the minimum
00082         MDouble     fFval3;            //
00083         MDouble     fEpsi;             //
00084         MDouble     fApsi;             //
00085         MDouble     fDcovar;           //Relative change in covariance matrix
00086         MInt        fNfcn;             //Number of calls to FCN
00087         MInt        fNfcnmx;           //Maximum number of calls to FCN
00088         MInt        fNfcnlc;           //
00089         MInt        fNfcnfr;           //
00090         MInt        fItaur;            //
00091         MInt        fIstrat;           //
00092         MInt        fNwrmes[2];        //
00093         MDouble     *fWord7;           //
00094         MBool       fLwarn;            //true if warning messges are to be put out (default=true)
00095         MBool       fLrepor;           //true if exceptional conditions are put out (default=false)
00096         MBool       fLimset;           //true if a parameter is up against limits (for MINOS)
00097         MBool       fLnolim;           //true if there are no limits on any parameters (not yet used)
00098         MBool       fLnewmn;           //true if the previous process has unexpectedly improved FCN
00099         MBool       fLphead;           //true if a heading should be put out for the next parameter definition
00100         MDouble     fEpsmac;           //machine precision for floating points:
00101         MDouble     fEpsma2;           //sqrt(fEpsmac)
00102         MDouble     fVlimlo;           //
00103         MDouble     fVlimhi;           //
00104         MDouble     fUndefi;           //Undefined number = -54321
00105         MDouble     fBigedm;           //Big EDM = 123456
00106         MDouble     fUpdflt;           //
00107         MDouble     *fXpt;             //X array of points for contours
00108         MDouble     *fYpt;             //Y array of points for contours
00109         MString      *fChpt;            //Character to be plotted at the X,Y contour positions
00110         MDouble     fXmidcr;           //
00111         MDouble     fYmidcr;           //
00112         MDouble     fXdircr;           //
00113         MDouble     fYdircr;           //
00114         MInt        fKe1cr;            //
00115         MInt        fKe2cr;            //
00116         MString      *fOrigin;          //
00117         MString      *fWarmes;          //
00118         MInt        fNfcwar[20];       //
00119         MInt        fIcirc[2];         //
00120         MFunction fFCN;
00121         MPrintf fPrintf;
00122 
00123 
00124 // methods performed on Midnight class
00125 private:
00126            Midnight(const Midnight &m);
00127  void      BuildArrays(MInt maxpar=15);
00128  void      DeleteArrays();
00129 public:
00130            Midnight();
00131            Midnight(MInt maxpar);
00132  virtual   ~Midnight();
00133  void      SetFCN(MFunction);
00134  void      SetPrintf(MPrintf);
00135  //
00136 
00137  // added R Terrier
00138  int GetParameter(int parNo, double &currentValue, double &currentError ); 
00139 
00140 
00141  void      mnamin();
00142  void      mnbins(MDouble a1, MDouble a2, MInt naa, MDouble &bl, MDouble &bh, MInt &nb, MDouble &bwid);
00143  void      mncalf(MDouble *pvec, MDouble &ycalf);
00144  void      mncler();
00145  void      mncntr(MInt ke1, MInt ke2, MInt &ierrf);
00146  void      mncomd(MString crdbin, MInt &icondn);
00147  void      mncont(MInt ke1, MInt ke2, MInt nptu, MDouble *xptu, MDouble *yptu, MInt &ierrf);
00148  void      mncrck(MString &crdbuf, MInt maxcwd, MString &comand, MInt &lnc
00149                 ,  MInt mxp, MDouble *plist, MInt &llist, MInt &ierr, MInt isyswr);
00150  void      mncros(MDouble &aopt, MInt &iercr);
00151  void      mncuve();
00152  void      mnderi();
00153  void      mndxdi(MDouble pint, MInt ipar, MDouble &dxdi);
00154  void      mneig(MDouble *a, MInt ndima, MInt n, MInt mits, MDouble *work, MDouble precis, MInt &ifault);
00155  void      mnemat(MDouble *emat, MInt ndim);
00156  void      mnerrs(MInt number, MDouble &eplus, MDouble &eminus, MDouble &eparab, MDouble &gcc);
00157  void      mneval(MDouble anext, MDouble &fnext, MInt &ierev);
00158  void      mnexcm(MString comand, MDouble *plist, MInt llist, MInt &ierflg) ;
00159  void      mnexin(MDouble *pint);
00160  void      mnfixp(MInt iint, MInt &ierr);
00161  void      mnfree(MInt k);
00162  void      mngrad();
00163  void      mnhelp(MString comd);
00164  void      mnhess();
00165  void      mnhes1();
00166  void      mnimpr();
00167  void      mninex(MDouble *pint);
00168  void      mninit(MInt i1, MInt i2, MInt i3);
00169  void      mnlims();
00170  void      mnline(MDouble *start, MDouble fstart, MDouble *step, MDouble slope, MDouble toler);
00171  void      mnmatu(MInt kode);
00172  void      mnmigr();
00173  void      mnmnos();
00174  void      mnmnot(MInt ilax, MInt ilax2, MDouble &val2pl, MDouble &val2mi);
00175  void      mnparm(MInt k, MString cnamj, MDouble uk, MDouble wk, MDouble a, MDouble b, MInt &ierflg);
00176  void      mnpars(MString &crdbuf, MInt &icondn);
00177  void      mnpfit(MDouble *parx2p, MDouble *pary2p, MInt npar2p, MDouble *coef2p, MDouble &sdev2p);
00178  void      mnpint(MDouble &pexti, MInt i, MDouble &pinti);
00179  void      mnplot(MDouble *xpt, MDouble *ypt, MString *chpt, MInt nxypt, MInt npagwd, MInt npagln);
00180  void      mnpout(MInt iuext, MString& chnam, MDouble &val, MDouble &err, MDouble &xlolim, MDouble &xuplim, MInt &iuint);
00181  void      mnprin(MInt inkode, MDouble fval);
00182  void      mnpsdf();
00183  void      mnrazz(MDouble ynew, MDouble *pnew, MDouble *y, MInt &jh, MInt &jl);
00184  void      mnrn15(MDouble &val, MInt &inseed);
00185  void      mnrset(MInt iopt);
00186  void      mnsave();
00187  void      mnscan();
00188  void      mnseek();
00189  void      mnset();
00190  void      mnsimp();
00191  void      mnstat(MDouble &fmin, MDouble &fedm, MDouble &errdef, MInt &npari, MInt &nparx, MInt &istat);
00192  void      mntiny(MDouble epsp1, MDouble &epsbak);
00193  MBool    mnunpt(MString &cfname);
00194  void      mnvert(MDouble *a, MInt l, MInt m, MInt n, MInt &ifail);
00195  void      mnwarn(const char *copt, const char *corg, const char *cmes);
00196  void      mnwerr();
00197 };
00198 
00199 #endif
00200 
00201 
00202 
00203 
00204 
00205 
00206 
00207 

Generated on Thu Nov 29 16:38:51 2001 by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001