]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/Base/AliTPCSpaceCharge3D.h
o adjust limits for Dz calculation close to the CE to not cross the CE
[u/mrichter/AliRoot.git] / TPC / Base / AliTPCSpaceCharge3D.h
1 #ifndef ALITPCSPACECHARGE3D_H
2 #define ALITPCSPACECHARGE3D_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 ////////////////////////////////////////////////////////////////////////////
8 // AliTPCSpaceCharge3D class                                              //
9 // Authors: Stefan Rossegger                                              //
10 ////////////////////////////////////////////////////////////////////////////
11
12 #include "AliTPCCorrection.h"
13 class TH3F;
14
15 class AliTPCSpaceCharge3D : public AliTPCCorrection {
16 public:
17   AliTPCSpaceCharge3D();
18   virtual ~AliTPCSpaceCharge3D();
19
20   // initialization and update functions
21   virtual void Init();
22   virtual void Update(const TTimeStamp &timeStamp);
23
24   // common setters and getters for tangled ExB effect
25   virtual void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2) {
26     fT1=t1; fT2=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);
29   };
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;}
33
34   // setters and getters
35   void SetCorrectionFactor(Float_t correctionFactor) {fCorrectionFactor=correctionFactor;}
36   Float_t GetCorrectionFactor() const {return fCorrectionFactor;}
37
38   void  SetSCDataFileName(TString fname);
39   const char* GetSCDataFileName() { return fSCDataFileName.Data(); }
40
41   void InitSpaceCharge3DDistortion();       // faster model and more accurate ;-)
42   void InitSpaceCharge3DDistortionCourse(); // real 3D but not accurate enough
43   void ForceInitSpaceCharge3DDistortion() { fInitLookUp=kFALSE; InitSpaceCharge3DDistortion(); }
44
45   Float_t GetSpaceChargeDensity(Float_t r, Float_t phi, Float_t z, Int_t mode=0);
46   TH2F* CreateHistoSCinXY(Float_t z, Int_t nx=100, Int_t ny=100, Int_t mode=0);
47   TH2F* CreateHistoSCinZR(Float_t phi, Int_t nz=100, Int_t nr=100, Int_t mode=0);
48
49
50   void WriteChargeDistributionToFile(const char* fname = "SC-Alice.root");
51
52   virtual void Print(const Option_t* option="") const;
53
54 // protected:
55   virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]);
56
57 private:
58
59   // maximum sizes of lookup tables
60   enum {kNRows= 90 };       // the maximum on row-slices so far ~ 2cm slicing    
61   enum {kNPhiSlices= 144 }; // the maximum of phi-slices so far = (8 per sector) 
62   enum {kNColumns= 130 };   // the maximum on column-slices so  ~ 2cm slicing    
63
64   AliTPCSpaceCharge3D(const AliTPCSpaceCharge3D &);               // not implemented
65   AliTPCSpaceCharge3D &operator=(const AliTPCSpaceCharge3D &);    // not implemented
66
67   Float_t fC0; // coefficient C0                 (compare Jim Thomas's notes for definitions)
68   Float_t fC1; // coefficient C1                 (compare Jim Thomas's notes for definitions)
69   Float_t fCorrectionFactor;       // Space Charge Correction factor in comparison to initialized
70                                    // look up table which was created for M_mb = 900 and IR = 3000
71                                    // compare Internal Note Nr: ???
72
73   Bool_t fInitLookUp;                 // flag to check if the Look Up table was created
74
75   TMatrixF *fLookUpErOverEz[kNPhi];   // Array to store electric field integral (int Er/Ez)
76   TMatrixF *fLookUpEphiOverEz[kNPhi]; // Array to store electric field integral (int Er/Ez)
77   TMatrixF *fLookUpDeltaEz[kNPhi];    // Array to store electric field integral (int Er/Ez)
78
79   TString fSCDataFileName;          // file which contains the space charge distribution
80   TString fSCLookUpPOCsFileName3D;  // filename of the precalculated lookup tables (for individual voxels)
81   TString fSCLookUpPOCsFileNameRZ;  // filename of the precalculated lookup tables (for individual voxels)
82   TString fSCLookUpPOCsFileNameRPhi;  // filename of the precalculated lookup tables (for individual voxels)
83
84
85   TMatrixF *fSCdensityDistribution[kNPhi]; // 3D space charge distribution
86   TMatrixD *fSCdensityInRZ;       // (r,z) space charge distribution
87   TMatrixD *fSCdensityInRPhiA;     // (r,phi) space charge distribution
88   TMatrixD *fSCdensityInRPhiC;     // (r,phi) space charge distribution
89  
90   ClassDef(AliTPCSpaceCharge3D,2); 
91 };
92
93 #endif