CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TSFit.h
Go to the documentation of this file.
1 #ifndef TSFit_H
2 #define TSFit_H
3 
4 #include "TObject.h"
5 
6 class TSFit : public TObject {
7 public:
8  static constexpr unsigned int SDIM = 14; /* default number of samples for cristal */
9  static constexpr unsigned int PLSHDIM = 650; /* default size of the pulse shape array */
10  static constexpr int matdim = 5; /* parameters fit max matrice size */
11  static constexpr unsigned int diminpar = 10;
12  static constexpr unsigned int dimoutpar = 10;
13  static constexpr unsigned int npar_moni = 4;
14 
15 private:
16  /*
17  nbs = nb of samples in sample data array[sdim] nbs<=sdim
18  nmxu number of samples to be used to fit the apd pulse shape
19  nmxu<=nbs
20  */
21  int nbs;
23  int iinf, isup; //limits indices for max search using pshape
24  double avtm; // mean time in clock unit of the maximums
25  int n_samples_bef_max; //number of samples before and after sample max
26  int n_samples_aft_max; //to be used in pulse fit
27  //( theoritical and experimental )
28  //the total number of samples used is
29  //n_samples_bef_max+n_samples_aft_max+1
30  double xki2_max, norme;
31  // int *sample_flag;
32  int nmxu_sto;
33  double alpha_th, beta_th;
36  double al[matdim][matdim], be[matdim][matdim]; //intern to inverms
37  //double *t, *z, *f, *acc, *adfmx, *maskp3, *adcp, *corel, *nbcor; //[sdim]
38  //double **ff; //[sdim][4]
39  //double **der=new double[SDIM];//[sdim][5]
40  double parfp3[dimoutpar];
41 
42  //double *tb, *fb, *accb;//[plshdim]
43  //int *sample_flag_call;//[plshdim]
44  //double **derb; //[plshdim][5]
45  //double **coeff;//[plshdim][3]
46 
47  double errmat[SDIM][SDIM]; //inverse of error matrix
49  double t[SDIM];
50  double z[SDIM];
51  double f[SDIM];
52  double acc[SDIM];
53  double adfmx[SDIM];
54  double adcp[SDIM];
55  double maskp3[SDIM];
56  double corel[SDIM];
57  double nbcor[SDIM];
58 
59  double ff[SDIM][4];
60  double der[SDIM][5];
61 
62 public:
63  int sdim;
64  int plshdim;
65 
66  TSFit(int size = SDIM, int size_sh = PLSHDIM);
67 
68  ~TSFit() override {}
69 
70  void set_params(int, int, int, int, int, double, double, int, int);
71 
72  void init_errmat(double);
73 
74  double fit_third_degree_polynomial(double *, double *);
75 
76  double fpol3dg(int, double *, double *, double *);
77 
78  double inverms(int, double xx[matdim][matdim], double yy[matdim][matdim]);
79 
80  ClassDefOverride(TSFit, 0)
81 };
82 
83 #endif
double avtm
Definition: TSFit.h:24
TSFit(int size=SDIM, int size_sh=PLSHDIM)
Definition: TSFit.cc:19
double invcov[matdim][matdim]
Definition: TSFit.h:35
double f[SDIM]
Definition: TSFit.h:51
int n_samples_bef_max
Definition: TSFit.h:25
double nbcor[SDIM]
Definition: TSFit.h:57
double parfp3[dimoutpar]
Definition: TSFit.h:40
static constexpr unsigned int diminpar
Definition: TSFit.h:11
double alpha_th
Definition: TSFit.h:33
int nbs
Definition: TSFit.h:21
double al[matdim][matdim]
Definition: TSFit.h:36
double t[SDIM]
Definition: TSFit.h:49
double xki2_max
Definition: TSFit.h:30
double fit_third_degree_polynomial(double *, double *)
Definition: TSFit.cc:255
double be[matdim][matdim]
Definition: TSFit.h:36
double cov[matdim][matdim]
Definition: TSFit.h:35
double fpol3dg(int, double *, double *, double *)
Definition: TSFit.cc:105
int plshdim
Definition: TSFit.h:64
int n_presamples
Definition: TSFit.h:22
static constexpr int matdim
Definition: TSFit.h:10
double z[SDIM]
Definition: TSFit.h:50
double inverms(int, double xx[matdim][matdim], double yy[matdim][matdim])
Definition: TSFit.cc:187
double norme
Definition: TSFit.h:30
double adcp[SDIM]
Definition: TSFit.h:54
double beta_th
Definition: TSFit.h:33
void init_errmat(double)
Definition: TSFit.cc:87
static constexpr unsigned int dimoutpar
Definition: TSFit.h:12
static constexpr unsigned int npar_moni
Definition: TSFit.h:13
static constexpr unsigned int PLSHDIM
Definition: TSFit.h:9
static constexpr unsigned int SDIM
Definition: TSFit.h:8
double corel[SDIM]
Definition: TSFit.h:56
int nbr_iter_fit
Definition: TSFit.h:34
int sdim
Definition: TSFit.h:63
double errmat[SDIM][SDIM]
Definition: TSFit.h:47
~TSFit() override
Definition: TSFit.h:68
double maskp3[SDIM]
Definition: TSFit.h:55
double adfmx[SDIM]
Definition: TSFit.h:53
int sample_flag[SDIM]
Definition: TSFit.h:48
int n_samples_aft_max
Definition: TSFit.h:26
int isup
Definition: TSFit.h:23
int iinf
Definition: TSFit.h:23
void set_params(int, int, int, int, int, double, double, int, int)
Definition: TSFit.cc:39
double ff[SDIM][4]
Definition: TSFit.h:59
Definition: TSFit.h:6
int nmxu_sto
Definition: TSFit.h:32
tuple size
Write out results.
double acc[SDIM]
Definition: TSFit.h:52
double der[SDIM][5]
Definition: TSFit.h:60