Main Page | Class List | File List | Class Members | File Members | Related Pages

BipolarFit.h

00001 
00002 // A programme to determine the parameters of 
00003 // a bipolar pulse by chi2 minimization
00004 //
00005 // http://knikolop.home.cern.ch/knikolop/csc/bipolarfit.c
00006 //
00007 // for the function of the bipolar pulse look
00008 // http://positron.ps.uci.edu/~schernau/ROD/SIT/results/cluster1.html
00009 //
00010 // Konstantinos Nikolopoulos
00011 // 23/5/2007
00012 // this version : 27/7/2007
00014 #include<math.h>
00015 //#include"CLHEP/Matrix/Matrix.h"
00016 //#include"CLHEP/Matrix/SymMatrix.h"
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   //void Derivative(HepMatrix&,HepMatrix&,HepMatrix&,bool*usemeas);
00030   void Derivative(double A[][3],double fp[][1], double p0[][1],int imeas, int*meas);
00031   //double dFdz(double,double *);
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 };

Generated on Wed Oct 29 10:35:18 2008 for CSCRead by  doxygen 1.3.9.1