more secure string operations
[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);
40 Double_t GetQnormCorr(Int_t ipad, Int_t itype, Int_t corrType) const;
41 void ResetQnormCorr();
11750d28 42 //
43 // Charge parameterization
44 //
dcf3a564 45 Float_t Qnorm(Int_t ipad, Int_t itype, Float_t dr, Float_t ty, Float_t tz);
8a92e133 46 Float_t QnormHis(Int_t ipad, Int_t itype, Float_t dr, Float_t ty, Float_t tz);
47
b17540e4 48
49 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 50 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);;}
51
52 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);
53 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 54 //
55 // Error parameterization
56 //
798017c7 57 Float_t GetError0(Int_t dim, Int_t type, Float_t z, Float_t angle) const;
58 Float_t GetError0Par(Int_t dim, Int_t type, Float_t z, Float_t angle) const;
59 Float_t GetError1(Int_t dim, Int_t type, Float_t z, Float_t angle) const;
60 Float_t GetErrorQ(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean) const;
61 Float_t GetErrorQPar(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean) const;
62 Float_t GetErrorQParScaled(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean) const;
dcf3a564 63 //
64 // Shape parameterization
65 //
798017c7 66 Float_t GetRMS0(Int_t dim, Int_t type, Float_t z, Float_t angle) const;
67 Float_t GetRMS1(Int_t dim, Int_t type, Float_t z, Float_t angle) const;
68 Float_t GetRMSQ(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean) const;
69 Float_t GetRMSSigma(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean) const;
70 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 71 //
72 //
73 //
12ca5da1 74 void Test(TTree * tree, const char *output="TestClusterParam.root");
75 //
76 // static methods equivalents - use instance of param object - useful for tree draw and TF2 visualization
77 static Float_t SGetError0(Int_t dim, Int_t type, Float_t z, Float_t angle){
78 return fgInstance->GetError0(dim,type,z,angle);
79 }
80 static Float_t SGetError0Par(Int_t dim, Int_t type, Float_t z, Float_t angle){
81 return fgInstance->GetError0Par(dim,type,z,angle);
82 }
83 static Float_t SGetError1(Int_t dim, Int_t type, Float_t z, Float_t angle){
84 return fgInstance->GetError1(dim,type,z,angle);
85 }
86 static Float_t SGetErrorQ(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
87 return fgInstance->GetErrorQ(dim,type,z,angle,Qmean);
88 }
89 static Float_t SGetErrorQPar(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
90 return fgInstance->GetErrorQPar(dim,type,z,angle,Qmean);
91 }
92 static Float_t SGetErrorQParScaled(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
93 return fgInstance->GetErrorQParScaled(dim,type,z,angle,Qmean);
94 }
95
96 static Float_t SGetRMS0(Int_t dim, Int_t type, Float_t z, Float_t angle){
97 return fgInstance->GetRMS0(dim,type,z,angle);
98 }
99 static Float_t SGetRMS1(Int_t dim, Int_t type, Float_t z, Float_t angle){
100 return fgInstance->GetRMS1(dim,type,z,angle);
101 }
102 static Float_t SGetRMSQ(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
103 return fgInstance->GetRMSQ(dim,type,z,angle,Qmean);
104 }
105 static Float_t SGetRMSSigma(Int_t dim, Int_t type, Float_t z, Float_t angle, Float_t Qmean){
106 return fgInstance->GetRMSSigma(dim,type,z,angle,Qmean);
107 }
108 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){
109 return fgInstance->GetShapeFactor(dim,type,z,angle,Qmean, rmsL, rmsM);
110 }
111 //
112 //
0a65832b 113 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 114 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 115
6194ddbd 116 //
117 // Analytical position angular correction
118 //
119 static Double_t GaussConvolution(Double_t x0, Double_t x1, Double_t k0, Double_t k1, Double_t s0, Double_t s1);
120 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);
121 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 122 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);
123 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 124
dcf3a564 125 //
126 //
127 //
12ca5da1 128 void FitResol0(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
129 void FitResol0Par(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
130 void FitResol1(TTree * tree, Int_t dim, Float_t *param0, Float_t *error);
131 void FitResolQ(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
132 void FitResolQPar(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
133 void FitRMS0(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
134 void FitRMS1(TTree * tree, Int_t dim, Float_t *param0, Float_t *error);
135 void FitRMSQ(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
136 void FitRMSSigma(TTree * tree, Int_t dim, Int_t type, Float_t *param0, Float_t *error);
137 //
798017c7 138 TVectorD*& PosYcor(Int_t ind) {return fPosYcor[ind];}
139 TVectorD*& PosZcor(Int_t ind) {return fPosZcor[ind];}
140 Float_t ParamS0Par(Int_t i, Int_t j, Int_t k) const {return fParamS0Par[i][j][k];}
141 TVectorD* QpadTnorm() const {return fQpadTnorm;}
142 TVectorD* QpadMnorm() const {return fQpadMnorm;}
0a65832b 143
798017c7 144protected:
12ca5da1 145 Float_t fRatio; //ratio of values constibution to error
146 Float_t fParamS0[2][3][4]; //error parameterization coeficients
147 Float_t fErrorS0[2][3][4]; //error parameterization coeficients
148 Float_t fParamS0Par[2][3][7]; //error parameterization coeficients
149 Float_t fErrorS0Par[2][3][7]; //error parameterization coeficients
150 Float_t fParamSQ[2][3][6]; //error parameterization coeficients
151 Float_t fErrorSQ[2][3][6]; //error parameterization coeficients
152 Float_t fParamSQPar[2][3][9]; //error parameterization coeficients
153 Float_t fErrorSQPar[2][3][9]; //error parameterization coeficients
154 Float_t fParamS1[2][4]; //error parameterization coeficients
155 Float_t fErrorS1[2][4]; //error parameterization coeficients
156 //
157 Float_t fParamRMS0[2][3][4]; //shape parameterization coeficients
158 Float_t fErrorRMS0[2][3][4]; //shape parameterization coeficients
159 Float_t fParamRMSQ[2][3][6]; //shape parameterization coeficients
160 Float_t fErrorRMSQ[2][3][6]; //shape parameterization coeficients
161 Float_t fParamRMS1[2][5]; //shape parameterization coeficients
162 Float_t fErrorRMS1[2][5]; //shape parameterization coeficients
163 Float_t fErrorRMSSys[2]; // systematic relative error of the parametererization
164 Float_t fRMSSigmaRatio[2][2]; // mean value of the varation of RMS to RMS
165 Float_t fRMSSigmaFit[2][3][2]; // mean value of the varation of RMS to RMS
166 //
b17540e4 167 // charge normalization parametrization
11750d28 168 //
b17540e4 169 TObjArray *fQNorm; // q norm paramters
8a92e133 170 TMatrixD *fQNormCorr; // q norm correction for analytica correction
171 TObjArray *fQNormHis; // q norm correction for analytical correction
2e5bcb67 172 //
173 TVectorD *fPosQTnorm[3]; // q position normalization
174 TVectorD *fPosQMnorm[3]; // q position normalization
175 TVectorD *fQpadTnorm; // q pad normalization - Total charge
176 TVectorD *fQpadMnorm; // q pad normalization - Max charge
177 //
178 // Position corrections
179 //
180 TVectorD *fPosYcor[3]; // position correction parameterization
181 TVectorD *fPosZcor[3]; // position correction parameterization
b17540e4 182 //
12ca5da1 183 static AliTPCClusterParam* fgInstance; //! Instance of this class (singleton implementation)
8a92e133 184 ClassDef(AliTPCClusterParam,6) // TPC Cluster parameter class
12ca5da1 185};
186
187#endif