Some of the coding violations corrected
[u/mrichter/AliRoot.git] / TPC / AliTPCClusterParam.h
CommitLineData
12ca5da1 1#ifndef ALITPCCLUSTERPARAM_H
2#define ALITPCCLUSTERPARAM_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id: AliTPCClusterParam.h,v */
7
8////////////////////////////////////////////////////
9// //
10// TPC cluster error and shape parameterization //
11// //
12////////////////////////////////////////////////////
13
14
15#include <TObject.h>
798017c7 16#include <TVectorDfwd.h>
17#include <TMatrixDfwd.h>
12ca5da1 18
0a65832b 19class TTree;
20class TObjArray;
8a92e133 21class TH1;
12ca5da1 22//_____________________________________________________________________________
23class AliTPCClusterParam : public TObject {
24 public:
25 static AliTPCClusterParam* Instance();
f1c2a4a3 26 AliTPCClusterParam();
38caa778 27 AliTPCClusterParam(const AliTPCClusterParam& param);
798017c7 28 AliTPCClusterParam & operator=(const AliTPCClusterParam& param);
f1c2a4a3 29 virtual ~AliTPCClusterParam();
12ca5da1 30 virtual void Print(Option_t* option = "") const;
798017c7 31 void SetInstance(AliTPCClusterParam *const param){fgInstance = param;}
dcf3a564 32 //
33 // Seting functions
34 //
12ca5da1 35 void FitData(TTree * tree);
dcf3a564 36 void FitResol(TTree * tree);
37 void FitRMS(TTree * tree);
798017c7 38 void SetQnorm(Int_t ipad, Int_t itype, const TVectorD *const norm);
8a92e133 39 void SetQnormCorr(Int_t ipad, Int_t itype, Int_t corrType, Float_t val);
56b51ad9 40 Double_t GetQnormCorr(Int_t ipad, Int_t itype, Int_t corrType) const;
41 TMatrixD *GetQnormCorrMatrix(){return fQNormCorr;};
8a92e133 42 void ResetQnormCorr();
11750d28 43 //
44 // Charge parameterization
45 //
dcf3a564 46 Float_t Qnorm(Int_t ipad, Int_t itype, Float_t dr, Float_t ty, Float_t tz);
8a92e133 47 Float_t QnormHis(Int_t ipad, Int_t itype, Float_t dr, Float_t ty, Float_t tz);
48
b17540e4 49
50 Float_t QnormPos(Int_t ipad, Bool_t isMax, Float_t pad, Float_t time, Float_t z, Float_t sy2, Float_t sz2, Float_t qm, Float_t qt);
2e5bcb67 51 static Float_t SQnormPos(Int_t ipad, Bool_t isMax, Float_t pad, Float_t time, Float_t z, Float_t sy2, Float_t sz2, Float_t qm, Float_t qt){ return fgInstance->QnormPos(ipad,isMax,pad,time,z,sy2,sz2,qm,qt);;}
52
53 Float_t PosCorrection(Int_t type, Int_t ipad, Float_t pad, Float_t time, Float_t z, Float_t sy2, Float_t sz2, Float_t qm);
54 static Float_t SPosCorrection(Int_t type, Int_t ipad, Float_t pad, Float_t time, Float_t z, Float_t sy2, Float_t sz2, Float_t qm){ return fgInstance->PosCorrection(type,ipad,pad,time,z,sy2,sz2,qm);}
dcf3a564 55 //
56 // Error parameterization
57 //
798017c7 58 Float_t GetError0(Int_t dim, Int_t type, Float_t z, Float_t angle) const;
59 Float_t GetError0Par(Int_t dim, Int_t type, Float_t z, Float_t angle) const;
60 Float_t GetError1(Int_t dim, Int_t type, Float_t z, Float_t angle) const;
61 Float_t GetErrorQ(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean) const;
62 Float_t GetErrorQPar(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean) const;
63 Float_t GetErrorQParScaled(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean) const;
dcf3a564 64 //
65 // Shape parameterization
66 //
798017c7 67 Float_t GetRMS0(Int_t dim, Int_t type, Float_t z, Float_t angle) const;
68 Float_t GetRMS1(Int_t dim, Int_t type, Float_t z, Float_t angle) const;
69 Float_t GetRMSQ(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean) const;
70 Float_t GetRMSSigma(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean) const;
71 Float_t GetShapeFactor(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean, Float_t rmsL, Float_t rmsM) const;
dcf3a564 72 //
73 //
74 //
12ca5da1 75 void Test(TTree * tree, const char *output="TestClusterParam.root");
76 //
77 // static methods equivalents - use instance of param object - useful for tree draw and TF2 visualization
78 static Float_t SGetError0(Int_t dim, Int_t type, Float_t z, Float_t angle){
79 return fgInstance->GetError0(dim,type,z,angle);
80 }
81 static Float_t SGetError0Par(Int_t dim, Int_t type, Float_t z, Float_t angle){
82 return fgInstance->GetError0Par(dim,type,z,angle);
83 }
84 static Float_t SGetError1(Int_t dim, Int_t type, Float_t z, Float_t angle){
85 return fgInstance->GetError1(dim,type,z,angle);
86 }
87 static Float_t SGetErrorQ(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
88 return fgInstance->GetErrorQ(dim,type,z,angle,Qmean);
89 }
90 static Float_t SGetErrorQPar(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
91 return fgInstance->GetErrorQPar(dim,type,z,angle,Qmean);
92 }
93 static Float_t SGetErrorQParScaled(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
94 return fgInstance->GetErrorQParScaled(dim,type,z,angle,Qmean);
95 }
96
97 static Float_t SGetRMS0(Int_t dim, Int_t type, Float_t z, Float_t angle){
98 return fgInstance->GetRMS0(dim,type,z,angle);
99 }
100 static Float_t SGetRMS1(Int_t dim, Int_t type, Float_t z, Float_t angle){
101 return fgInstance->GetRMS1(dim,type,z,angle);
102 }
103 static Float_t SGetRMSQ(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
104 return fgInstance->GetRMSQ(dim,type,z,angle,Qmean);
105 }
106 static Float_t SGetRMSSigma(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
107 return fgInstance->GetRMSSigma(dim,type,z,angle,Qmean);
108 }
109 static Float_t SGetShapeFactor(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean, Float_t rmsL, Float_t rmsM){
110 return fgInstance->GetShapeFactor(dim,type,z,angle,Qmean, rmsL, rmsM);
111 }
112 //
113 //
0a65832b 114 static Float_t SQnorm(Int_t ipad, Int_t itype,Float_t dr, Float_t ty, Float_t tz) {return fgInstance->Qnorm(ipad, itype, dr,ty,tz);}
8a92e133 115 static Float_t SQnormHis(Int_t ipad, Int_t itype,Float_t dr, Float_t ty, Float_t tz) {return fgInstance->QnormHis(ipad, itype, dr,ty,tz);}
0a65832b 116
6194ddbd 117 //
118 // Analytical position angular correction
119 //
120 static Double_t GaussConvolution(Double_t x0, Double_t x1, Double_t k0, Double_t k1, Double_t s0, Double_t s1);
121 static Double_t GaussConvolutionTail(Double_t x0, Double_t x1, Double_t k0, Double_t k1, Double_t s0, Double_t s1, Double_t tau);
122 static Double_t GaussConvolutionGamma4(Double_t x0, Double_t x1, Double_t k0, Double_t k1, Double_t s0, Double_t s1, Double_t tau);
8a92e133 123 static Double_t QmaxCorrection(Int_t sector, Int_t row, Float_t cpad, Float_t ctime, Float_t ky, Float_t kz, Float_t rmsy0, Float_t rmsz0, Float_t effLength=0, Float_t effDiff=1);
124 static Double_t QtotCorrection(Int_t sector, Int_t row, Float_t cpad, Float_t ctime, Float_t ky, Float_t kz, Float_t rmsy0, Float_t rmsz0, Float_t qtot, Float_t thr, Float_t effLength=0, Float_t effDiff=1);
6194ddbd 125
dcf3a564 126 //
127 //
128 //
12ca5da1 129 void FitResol0(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
130 void FitResol0Par(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
131 void FitResol1(TTree * tree, Int_t dim, Float_t *param0, Float_t *error);
132 void FitResolQ(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
133 void FitResolQPar(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
134 void FitRMS0(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
135 void FitRMS1(TTree * tree, Int_t dim, Float_t *param0, Float_t *error);
136 void FitRMSQ(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
137 void FitRMSSigma(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
138 //
798017c7 139 TVectorD*& PosYcor(Int_t ind) {return fPosYcor[ind];}
140 TVectorD*& PosZcor(Int_t ind) {return fPosZcor[ind];}
141 Float_t ParamS0Par(Int_t i, Int_t j, Int_t k) const {return fParamS0Par[i][j][k];}
142 TVectorD* QpadTnorm() const {return fQpadTnorm;}
143 TVectorD* QpadMnorm() const {return fQpadMnorm;}
0a65832b 144
798017c7 145protected:
12ca5da1 146 Float_t fRatio; //ratio of values constibution to error
147 Float_t fParamS0[2][3][4]; //error parameterization coeficients
148 Float_t fErrorS0[2][3][4]; //error parameterization coeficients
149 Float_t fParamS0Par[2][3][7]; //error parameterization coeficients
150 Float_t fErrorS0Par[2][3][7]; //error parameterization coeficients
151 Float_t fParamSQ[2][3][6]; //error parameterization coeficients
152 Float_t fErrorSQ[2][3][6]; //error parameterization coeficients
153 Float_t fParamSQPar[2][3][9]; //error parameterization coeficients
154 Float_t fErrorSQPar[2][3][9]; //error parameterization coeficients
155 Float_t fParamS1[2][4]; //error parameterization coeficients
156 Float_t fErrorS1[2][4]; //error parameterization coeficients
157 //
158 Float_t fParamRMS0[2][3][4]; //shape parameterization coeficients
159 Float_t fErrorRMS0[2][3][4]; //shape parameterization coeficients
160 Float_t fParamRMSQ[2][3][6]; //shape parameterization coeficients
161 Float_t fErrorRMSQ[2][3][6]; //shape parameterization coeficients
162 Float_t fParamRMS1[2][5]; //shape parameterization coeficients
163 Float_t fErrorRMS1[2][5]; //shape parameterization coeficients
164 Float_t fErrorRMSSys[2]; // systematic relative error of the parametererization
165 Float_t fRMSSigmaRatio[2][2]; // mean value of the varation of RMS to RMS
166 Float_t fRMSSigmaFit[2][3][2]; // mean value of the varation of RMS to RMS
167 //
b17540e4 168 // charge normalization parametrization
11750d28 169 //
b17540e4 170 TObjArray *fQNorm; // q norm paramters
8a92e133 171 TMatrixD *fQNormCorr; // q norm correction for analytica correction
172 TObjArray *fQNormHis; // q norm correction for analytical correction
2e5bcb67 173 //
174 TVectorD *fPosQTnorm[3]; // q position normalization
175 TVectorD *fPosQMnorm[3]; // q position normalization
176 TVectorD *fQpadTnorm; // q pad normalization - Total charge
177 TVectorD *fQpadMnorm; // q pad normalization - Max charge
178 //
179 // Position corrections
180 //
181 TVectorD *fPosYcor[3]; // position correction parameterization
182 TVectorD *fPosZcor[3]; // position correction parameterization
b17540e4 183 //
12ca5da1 184 static AliTPCClusterParam* fgInstance; //! Instance of this class (singleton implementation)
8a92e133 185 ClassDef(AliTPCClusterParam,6) // TPC Cluster parameter class
12ca5da1 186};
187
188#endif