Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:34:50

0001 #ifndef TFParams_h
0002 #define TFParams_h
0003 #include "TROOT.h"
0004 #include "TObject.h"
0005 #include "TArrayI.h"
0006 #include "TArrayD.h"
0007 #include "TArrayC.h"
0008 #include "TCanvas.h"
0009 #include "TDirectory.h"
0010 #include "TPaveLabel.h"
0011 #include "TF1.h"
0012 #include <ctime>
0013 #include "TGraph.h"
0014 #include <cstdio>
0015 #include <cmath>
0016 #include "TH2.h"
0017 #include "TH1.h"
0018 #include "TStyle.h"
0019 #include "TCanvas.h"
0020 #include "TPaveText.h"
0021 #include "TPaveLabel.h"
0022 #include "TProfile.h"
0023 #include "TVirtualX.h"
0024 #include "TObject.h"
0025 //#include "TMatrixD.h"
0026 
0027 struct matrice {
0028   int nb_lignes;
0029   int nb_colonnes;
0030   double **coeff;
0031 };
0032 typedef struct matrice matrice;
0033 matrice cree_mat(int, int);
0034 matrice cree_mat_prod(matrice, matrice);
0035 void fill_mat(matrice, matrice);
0036 matrice fill_mat_int(matrice, matrice, matrice);
0037 
0038 class TFParams : public TObject {
0039 public:
0040   static constexpr unsigned int dimmat = 30;
0041   static constexpr unsigned int dimout = 10;
0042   static constexpr unsigned int nbmax_cell = 1000;
0043   static constexpr int SDIM2 = 10;
0044   static constexpr int PLSHDIM = 650;
0045 
0046 private:
0047   int ns;        // number of samples
0048   int nsmin;     // beginning of fit
0049   int nsmax;     // end of fit
0050   int nevtmax;   // number of events to fit
0051   double a1ini;  // value of alpha at starting point
0052   double a2ini;  // value of alpha_prim/beta at starting point
0053   double a3ini;  // value of beta/alpha_prim at starting point
0054   double step_shape;
0055   double adclu[26];
0056   double weight_matrix[10][10];
0057   int METHODE;
0058 
0059 public:
0060   /* number of samples for cristal */
0061   /* size of the pulse shape array */
0062   TFParams(int size = SDIM2, int size_sh = PLSHDIM);
0063   ~TFParams() override {}
0064   double fitpj(double **, double *, double **, double noise_val, int debug);
0065   void set_const(int, int, int, double, double, int);
0066   void produit_mat(matrice, matrice, matrice);
0067   void produit_mat_int(matrice, matrice, matrice);
0068   void diff_mat(matrice, matrice, matrice);
0069   void somme_mat_int(matrice, matrice);
0070   void somme_mat_int_scale(matrice, matrice, double);
0071   void print_mat_nk(matrice, int);
0072   void print_mat(matrice);
0073   void transpose_mat(matrice, matrice);
0074   void inverse_mat(matrice, matrice);
0075   void copie_colonne_mat(matrice, matrice, int);
0076   char name_mat[10];
0077   void zero_mat(matrice);
0078   void zero_mat_nk(matrice, int);
0079   double f3deg(int, double parom[dimout], double mask[dimmat], double adcpj[dimmat], double errpj[dimmat][dimmat]);
0080   double parab(double *, Int_t, Int_t, double *);
0081   Double_t polfit(Int_t ns, Int_t imax, Double_t par3d[dimout], Double_t errpj[dimmat][dimmat], double *);
0082   double inverpj(int, double g[dimmat][dimmat], double ginv[dimmat][dimmat]);
0083   double inv3x3(double a[3][3], double b[3][3]);
0084   double pulseShapepj(Double_t *, Double_t *);
0085   double pulseShapepj2(Double_t *, Double_t *);
0086   double lastShape(Double_t *, Double_t *);
0087   double lastShape2(Double_t *, Double_t *);
0088   double mixShape(Double_t *, Double_t *);
0089   double computePulseWidth(int, double, double);
0090 
0091   ClassDefOverride(TFParams, 0)
0092 };
0093 #endif