CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CalibCalorimetry/EcalLaserAnalyzer/interface/TSFit.h

Go to the documentation of this file.
00001 #ifndef TSFit_H
00002 #define TSFit_H
00003 
00004 #define  SDIM     14 /* default number of samples for cristal */
00005 #define  PLSHDIM 650  /* default size of the pulse shape array */
00006 //these 2 last parameters are overwritten in constructor
00007 
00008 
00009 #define  matdim     5 /* parameters fit max matrice size */    
00010 #define  diminpar  10   
00011 #define  dimoutpar 10   
00012 #define  npar_moni  4
00013 
00014 #include "TObject.h"
00015 
00016 class TSFit : public TObject {
00017 private :
00018   /*
00019     nbs = nb of samples in sample data array[sdim]   nbs<=sdim  
00020     nmxu  number of samples to be used to fit the apd pulse shape
00021     nmxu<=nbs
00022   */
00023   int nbs;
00024   int n_presamples;
00025   int iinf, isup;//limits indices for max search using pshape
00026   double avtm;// mean time in clock unit of the maximums
00027   int n_samples_bef_max;//number of samples before and after sample max
00028   int n_samples_aft_max;//to be used in pulse fit
00029                         //(  theoritical and experimental )
00030                         //the total number of samples used is 
00031                         //n_samples_bef_max+n_samples_aft_max+1
00032   double xki2_max, norme;
00033   //  int *sample_flag;
00034   int nmxu_sto ;
00035   double alpha_th, beta_th;
00036   int nbr_iter_fit;
00037   double cov[matdim][matdim], invcov[matdim][matdim];
00038   double al[matdim][matdim], be[matdim][matdim];//intern to inverms
00039   //double *t, *z, *f, *acc, *adfmx, *maskp3, *adcp, *corel, *nbcor; //[sdim]
00040   //double **ff; //[sdim][4]
00041   //double **der=new double[SDIM];//[sdim][5]
00042   double parfp3[dimoutpar];
00043 
00044   //double  *tb, *fb, *accb;//[plshdim]
00045   //int *sample_flag_call;//[plshdim]
00046   //double **derb; //[plshdim][5]
00047   //double **coeff;//[plshdim][3]
00048 
00049 
00050   double errmat[SDIM][SDIM];//inverse of error matrix
00051   int sample_flag[SDIM];
00052   double t[SDIM];
00053   double z[SDIM];
00054   double f[SDIM];
00055   double acc[SDIM];
00056   double adfmx[SDIM];
00057   double adcp[SDIM];
00058   double maskp3[SDIM];
00059   double corel[SDIM];
00060   double nbcor[SDIM];
00061  
00062   double ff[SDIM][4];
00063   double der[SDIM][5];
00064  
00065 
00066 public :
00067   int sdim;
00068   int plshdim;
00069 
00070   TSFit( int size = SDIM, int size_sh = PLSHDIM );
00071 
00072   virtual ~TSFit() {}
00073 
00074   void set_params( int, int, int, int, int, double, double, int, int );
00075 
00076   void init_errmat(double);
00077 
00078   double fit_third_degree_polynomial( double *,
00079                                       double * );
00080 
00081 
00082   double fpol3dg (  int,
00083                     double *,
00084                     double *,
00085                     double *);
00086 
00087   double inverms  ( int, double xx[matdim][matdim], double yy[matdim][matdim] );
00088 
00089   //  ClassDef( TSFit, 1 )
00090 };
00091 
00092 #endif
00093 
00094