00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00014 #include<math.h>
00015
00016
00017 class BipolarFit
00018 {
00019 public:
00020 BipolarFit();
00021 ~BipolarFit();
00022 int Fit(double *x,const double ex,const double pedestal, const double predefinedwidth,double *result,double *errors,double *chi2);
00023
00024 private:
00025 void InvertMatrix(double matrix[][3],const int dim,int*);
00026 void InvertSymmetric4x4(double W[][4]);
00027 double FindInitValues(double*x,double *initValues,int *maxsample);
00028 int TheFitter(double*x,const double ex,double *initValues, int imeas, int *meas, int ipar, int *par,double *chi2,double *result);
00029
00030 void Derivative(double A[][3],double fp[][1], double p0[][1],int imeas, int*meas);
00031
00032 double bipolar(double*, double*);
00033 double FindPow(double z);
00034
00035 double n;
00036 double powcachez;
00037 double powcachezn;
00038 double zmax;
00039 double bipolarNormalization;
00040 double tsampling;
00041 };