]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCSpaceCharge3D.h
Fix leaks in AliIsolationCut and AlianaOmegaToPi0Gamma
[u/mrichter/AliRoot.git] / TPC / 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
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);
47
48
49   void WriteChargeDistributionToFile(const char* fname = "SC-Alice.root");
50
51   virtual void Print(const Option_t* option="") const;
52
53 protected:
54   virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]);
55
56 private:
57
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    
62
63   AliTPCSpaceCharge3D(const AliTPCSpaceCharge3D &);               // not implemented
64   AliTPCSpaceCharge3D &operator=(const AliTPCSpaceCharge3D &);    // not implemented
65
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: ???
71
72   Bool_t fInitLookUp;                 // flag to check it the Look Up table was created
73
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)
77
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)
82
83
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
88  
89   ClassDef(AliTPCSpaceCharge3D,1); 
90 };
91
92 #endif