]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCCorrection.h
AliTPCCorrection.h ... additional funtionality to deal with 3D problem...
[u/mrichter/AliRoot.git] / TPC / AliTPCCorrection.h
index c2c4b5d9359473b5aa88b52a931420a73450d344..b1fd7f3f82ba8fa6057611cdee413ad539ef0dbc 100644 (file)
@@ -71,8 +71,13 @@ public:
  
   TH2F* CreateHistoDRinXY   (Float_t z=10.,Int_t nx=100,Int_t ny=100);
   TH2F* CreateHistoDRPhiinXY(Float_t z=10.,Int_t nx=100,Int_t nphi=100);
+  TH2F* CreateHistoDZinXY   (Float_t z=10.,Int_t nx=100,Int_t ny=100);
+
   TH2F* CreateHistoDRinZR   (Float_t phi=0.,Int_t nZ=100,Int_t nR=100);
   TH2F* CreateHistoDRPhiinZR(Float_t phi=0.,Int_t nZ=100,Int_t nR=100);
+  TH2F* CreateHistoDZinZR   (Float_t phi=0.,Int_t nZ=100,Int_t nR=100);
+
+
   TTree* CreateDistortionTree(Double_t step=5);
   static void  MakeDistortionMap(THnSparse * his0, TTreeSRedirector *pcstream, const char* hname, Int_t run);
   // normally called directly in the correction classes which inherit from this class
@@ -94,37 +99,67 @@ protected:
                   Int_t nbinsx,Double_t xlow,Double_t xup,
                   Int_t nbinsy,Double_t ylow,Double_t yup);
  
-  static const Double_t fgkTPCZ0;      // nominal gating grid position 
+  static const Double_t fgkTPCZ0;       // nominal gating grid position 
   static const Double_t fgkIFCRadius;   // Mean Radius of the Inner Field Cage ( 82.43 min,  83.70 max) (cm)
   static const Double_t fgkOFCRadius;   // Mean Radius of the Outer Field Cage (252.55 min, 256.45 max) (cm)
   static const Double_t fgkZOffSet;     // Offset from CE: calculate all distortions closer to CE as if at this point
   static const Double_t fgkCathodeV;    // Cathode Voltage (volts)
   static const Double_t fgkGG;          // Gating Grid voltage (volts)
+  static const Double_t fgkdvdE;        // [cm/V] drift velocity dependency on the E field (from Magboltz for NeCO2N2 at standard environment)
+  static const Double_t fgkEM;          // charge/mass in [C/kg]
+  static const Double_t fgke0;          // vacuum permittivity [A·s/(V·m)]
 
-  enum {kNR=   92};              // Number of R points in the table for interpolating distortion data
+
+  enum {kNR=   118};             // Number of R points in the table for interpolating distortion data
+  enum {kNPhi= 18*10+1};          // Number of Phi points in the table for interpolating distortion data ( plus one extra for 360 == 0 ) 
   enum {kNZ=  270};              // Number of Z points in the table for interpolating distortion data
+
   static const Double_t fgkRList[kNR]; // points in the radial direction (for the lookup table)
+  Double_t fgkPhiList[kNPhi]; // points in the phi direction (for the lookup table)
   static const Double_t fgkZList[kNZ]; // points in the z direction (for the lookup table)
 
   // Simple Interpolation functions: e.g. with tricubic interpolation (not yet in TH3)
-  Int_t fJLow;         // variable to help in the interpolation 
-  Int_t fKLow;         // variable to help in the interpolation 
+  Int_t fILow, fJLow, fKLow;          // variable to help in the interpolation 
   void Interpolate2DEdistortion( const Int_t order, const Double_t r, const Double_t z, 
                                 const Double_t er[kNZ][kNR], Double_t &erValue );
+  void Interpolate3DEdistortion( const Int_t order, const Double_t r, const Float_t phi, const Double_t z, 
+                                const Double_t er[kNZ][kNPhi][kNR], const Double_t ephi[kNZ][kNPhi][kNR], const Double_t ez[kNZ][kNPhi][kNR],
+                                Double_t &erValue, Double_t &ephiValue, Double_t &ezValue);
+  Double_t Interpolate2DTable( const Int_t order, const Double_t x, const Double_t y, 
+                             const Int_t nx,  const Int_t ny, const Double_t xv[], const Double_t yv[], 
+                             const TMatrixD &array );
+  Double_t Interpolate3DTable( const Int_t order, const Double_t x,   const Double_t y,   const Double_t z,
+                             const Int_t  nx,    const Int_t  ny,    const Int_t  nz,
+                             const Double_t xv[], const Double_t yv[], const Double_t zv[],
+                             TMatrixD **arrayofArrays );
   Double_t Interpolate( const Double_t xArray[], const Double_t yArray[], 
                        const Int_t order, const Double_t x );
   void Search( const Int_t n, const Double_t xArray[], const Double_t x, Int_t &low );
   virtual Int_t IsPowerOfTwo ( Int_t i ) const  ;
-    
-  // Algorithms to solve the laplace or possion equation 
-  void PoissonRelaxation2D(TMatrixD &arrayV, const TMatrixD &chargeDensity, TMatrixD &arrayErOverEz, const Int_t rows, const Int_t columns, const Int_t iterations );
 
+  
+  // Algorithms to solve the laplace or poisson equation 
+  void PoissonRelaxation2D(TMatrixD &arrayV, TMatrixD &chargeDensity, 
+                          TMatrixD &arrayErOverEz, TMatrixD &arrayDeltaEz,
+                          const Int_t rows, const Int_t columns, const Int_t iterations,
+                          const Bool_t rocDisplacement = kTRUE);
+
+  void PoissonRelaxation3D( TMatrixD **arrayofArrayV, TMatrixD **arrayofChargeDensities, 
+                           TMatrixD **arrayofEroverEz, TMatrixD **arrayofEPhioverEz, TMatrixD **arrayofEz,
+                           const Int_t rows, const Int_t columns,  const Int_t phislices, 
+                           const Float_t deltaphi, const Int_t iterations, const Int_t summetry,
+                           const Bool_t rocDisplacement = kTRUE); 
+    
 protected:
   Double_t fT1;         // tensor term of wt - T1
   Double_t fT2;         // tensor term of wt - T2
   static TObjArray *fgVisualCorrection;  // array of orrection for visualization
 private:
-  ClassDef(AliTPCCorrection,2);
+  AliTPCCorrection(const AliTPCCorrection &);               // not implemented
+  AliTPCCorrection &operator=(const AliTPCCorrection &);    // not implemented
+
+  ClassDef(AliTPCCorrection,3);
 };
 
 #endif