1 #ifndef ALITPCSPACECHARGE3D_H
2 #define ALITPCSPACECHARGE3D_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 ////////////////////////////////////////////////////////////////////////////
8 // AliTPCSpaceCharge3D class //
9 // Authors: Stefan Rossegger //
10 ////////////////////////////////////////////////////////////////////////////
12 #include "AliTPCCorrection.h"
15 class AliTPCSpaceCharge3D : public AliTPCCorrection {
17 AliTPCSpaceCharge3D();
18 virtual ~AliTPCSpaceCharge3D();
20 // initialization and update functions
22 virtual void Update(const TTimeStamp &timeStamp);
24 // common setters and getters for tangled ExB effect
25 virtual void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2) {
27 const Double_t wt0=t2*omegaTau; fC0=1./(1.+wt0*wt0);
28 const Double_t wt1=t1*omegaTau; fC1=wt1/(1.+wt1*wt1);
30 void SetC0C1(Float_t c0,Float_t c1) {fC0=c0;fC1=c1;} // CAUTION: USE WITH CARE
31 Float_t GetC0() const {return fC0;}
32 Float_t GetC1() const {return fC1;}
34 // setters and getters
35 void SetCorrectionFactor(Float_t correctionFactor) {fCorrectionFactor=correctionFactor;}
36 Float_t GetCorrectionFactor() const {return fCorrectionFactor;}
38 void SetSCDataFileName(TString fname);
39 const char* GetSCDataFileName() { return fSCDataFileName.Data(); }
41 void InitSpaceCharge3DDistortion(); // faster model and more accurate ;-)
42 void InitSpaceCharge3DDistortionCourse(); // real 3D but not accurate enough
44 Float_t GetSpaceChargeDensity(Float_t r, Float_t phi, Float_t z, Int_t mode=0);
45 TH2F* CreateHistoSCinXY(Float_t z, Int_t nx=100, Int_t ny=100, Int_t mode=0);
46 TH2F* CreateHistoSCinZR(Float_t phi, Int_t nz=100, Int_t nr=100, Int_t mode=0);
49 void WriteChargeDistributionToFile(const char* fname = "SC-Alice.root");
51 virtual void Print(const Option_t* option="") const;
54 virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]);
58 // maximum sizes of lookup tables
59 enum {kNRows= 90 }; // the maximum on row-slices so far ~ 2cm slicing
60 enum {kNPhiSlices= 144 }; // the maximum of phi-slices so far = (8 per sector)
61 enum {kNColumns= 130 }; // the maximum on column-slices so ~ 2cm slicing
63 AliTPCSpaceCharge3D(const AliTPCSpaceCharge3D &); // not implemented
64 AliTPCSpaceCharge3D &operator=(const AliTPCSpaceCharge3D &); // not implemented
66 Float_t fC0; // coefficient C0 (compare Jim Thomas's notes for definitions)
67 Float_t fC1; // coefficient C1 (compare Jim Thomas's notes for definitions)
68 Float_t fCorrectionFactor; // Space Charge Correction factor in comparison to initialized
69 // look up table which was created for M_mb = 900 and IR = 3000
70 // compare Internal Note Nr: ???
72 Bool_t fInitLookUp; // flag to check it the Look Up table was created
74 TMatrixD *fLookUpErOverEz[kNPhi]; // Array to store electric field integral (int Er/Ez)
75 TMatrixD *fLookUpEphiOverEz[kNPhi]; // Array to store electric field integral (int Er/Ez)
76 TMatrixD *fLookUpDeltaEz[kNPhi]; // Array to store electric field integral (int Er/Ez)
78 TString fSCDataFileName; // file which contains the space charge distribution
79 TString fSCLookUpPOCsFileName3D; // filename of the precalculated lookup tables (for individual voxels)
80 TString fSCLookUpPOCsFileNameRZ; // filename of the precalculated lookup tables (for individual voxels)
81 TString fSCLookUpPOCsFileNameRPhi; // filename of the precalculated lookup tables (for individual voxels)
84 TMatrixD *fSCdensityDistribution[kNPhi]; // 3D space charge distribution
85 TMatrixD *fSCdensityInRZ; // (r,z) space charge distribution
86 TMatrixD *fSCdensityInRPhiA; // (r,phi) space charge distribution
87 TMatrixD *fSCdensityInRPhiC; // (r,phi) space charge distribution
89 ClassDef(AliTPCSpaceCharge3D,1);