Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:47

0001 #ifndef TSFit_H
0002 #define TSFit_H
0003 
0004 #include "TObject.h"
0005 
0006 class TSFit : public TObject {
0007 public:
0008   static constexpr unsigned int SDIM = 14;     /* default number of samples for cristal */
0009   static constexpr unsigned int PLSHDIM = 650; /* default size of the pulse shape array */
0010   static constexpr int matdim = 5;             /* parameters fit max matrice size */
0011   static constexpr unsigned int diminpar = 10;
0012   static constexpr unsigned int dimoutpar = 10;
0013   static constexpr unsigned int npar_moni = 4;
0014 
0015 private:
0016   /*
0017     nbs = nb of samples in sample data array[sdim]   nbs<=sdim  
0018     nmxu  number of samples to be used to fit the apd pulse shape
0019     nmxu<=nbs
0020   */
0021   int nbs;
0022   int n_presamples;
0023   int iinf, isup;         //limits indices for max search using pshape
0024   double avtm;            // mean time in clock unit of the maximums
0025   int n_samples_bef_max;  //number of samples before and after sample max
0026   int n_samples_aft_max;  //to be used in pulse fit
0027                           //(  theoritical and experimental )
0028                           //the total number of samples used is
0029                           //n_samples_bef_max+n_samples_aft_max+1
0030   double xki2_max, norme;
0031   //  int *sample_flag;
0032   int nmxu_sto;
0033   double alpha_th, beta_th;
0034   int nbr_iter_fit;
0035   double cov[matdim][matdim], invcov[matdim][matdim];
0036   double al[matdim][matdim], be[matdim][matdim];  //intern to inverms
0037   //double *t, *z, *f, *acc, *adfmx, *maskp3, *adcp, *corel, *nbcor; //[sdim]
0038   //double **ff; //[sdim][4]
0039   //double **der=new double[SDIM];//[sdim][5]
0040   double parfp3[dimoutpar];
0041 
0042   //double  *tb, *fb, *accb;//[plshdim]
0043   //int *sample_flag_call;//[plshdim]
0044   //double **derb; //[plshdim][5]
0045   //double **coeff;//[plshdim][3]
0046 
0047   double errmat[SDIM][SDIM];  //inverse of error matrix
0048   int sample_flag[SDIM];
0049   double t[SDIM];
0050   double z[SDIM];
0051   double f[SDIM];
0052   double acc[SDIM];
0053   double adfmx[SDIM];
0054   double adcp[SDIM];
0055   double maskp3[SDIM];
0056   double corel[SDIM];
0057   double nbcor[SDIM];
0058 
0059   double ff[SDIM][4];
0060   double der[SDIM][5];
0061 
0062 public:
0063   int sdim;
0064   int plshdim;
0065 
0066   TSFit(int size = SDIM, int size_sh = PLSHDIM);
0067 
0068   ~TSFit() override {}
0069 
0070   void set_params(int, int, int, int, int, double, double, int, int);
0071 
0072   void init_errmat(double);
0073 
0074   double fit_third_degree_polynomial(double *, double *);
0075 
0076   double fpol3dg(int, double *, double *, double *);
0077 
0078   double inverms(int, double xx[matdim][matdim], double yy[matdim][matdim]);
0079 
0080   ClassDefOverride(TSFit, 0)
0081 };
0082 
0083 #endif