]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCCorrection.h
aa39c2359cf30bdb3012c762553e2e33e7873c56
[u/mrichter/AliRoot.git] / TPC / AliTPCCorrection.h
1 #ifndef ALI_TPC_CORRECTION_H
2 #define ALI_TPC_CORRECTION_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 //                                                                            //
9 // AliTPCCorrection class                                                     //
10 //                                                                            //
11 // This class provides a general framework to deal with space point           //
12 // distortions. An correction class which inherits from here is for example   //
13 // AliTPCExBBShape or AliTPCExBTwist                                          //
14 //                                                                            //
15 // General functions are (for example):                                       //
16 //   CorrectPoint(x,roc) where x is the vector of inital positions in         //
17 //   cartesian coordinates and roc represents the Read Out chamber number     //
18 //   according to the offline naming convention. The vector x is overwritten  //
19 //   with the corrected coordinates.                                          //
20 //                                                                            //
21 // An alternative usage would be CorrectPoint(x,roc,dx), which leaves the     //
22 //   vector x untouched, put returns the distortions via the vector dx        //
23 //                                                                            //
24 // The class allows "effective Omega Tau" corrections to be shifted to the    //
25 // single distortion classes.                                                 //
26 //                                                                            //
27 // Note: This class is normally used via the class AliTPCComposedCorrection   //
28 //                                                                            //
29 // date: 27/04/2010                                                           //
30 // Authors: Magnus Mager, Stefan Rossegger, Jim Thomas                        //
31 ////////////////////////////////////////////////////////////////////////////////
32
33
34 #include <TNamed.h>
35 class TH2F;
36 class TCollection;
37
38 class AliTPCCorrection : public TNamed {
39 public:
40   enum CompositionType {kParallel,kQueue};
41
42   AliTPCCorrection();
43   AliTPCCorrection(const char *name,const char *title);
44   virtual ~AliTPCCorrection();
45   
46
47   // functions to correct a space point
48           void CorrectPoint (      Float_t x[],const Short_t roc);
49           void CorrectPoint (const Float_t x[],const Short_t roc,Float_t xp[]);
50   virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]);
51
52   // functions to distort a space point
53           void DistortPoint (      Float_t x[],const Short_t roc);
54           void DistortPoint (const Float_t x[],const Short_t roc,Float_t xp[]);
55   virtual void GetDistortion(const Float_t x[],const Short_t roc,Float_t dx[]);
56
57   // initialization
58   virtual void Init();
59
60   // convenience functions
61   virtual void Print(Option_t* option="") const;
62  
63   TH2F* CreateHistoDRinXY   (Float_t z=10.,Int_t nx=100,Int_t ny=100);
64   TH2F* CreateHistoDRPhiinXY(Float_t z=10.,Int_t nx=100,Int_t nphi=100);
65   TH2F* CreateHistoDRinZR   (Float_t phi=0.,Int_t nZ=100,Int_t nR=100);
66   TH2F* CreateHistoDRPhiinZR(Float_t phi=0.,Int_t nZ=100,Int_t nR=100);
67
68   // normally called directly in the correction classes which inherit from this class
69   virtual void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2);
70
71 protected:
72   TH2F* CreateTH2F(const char *name,const char *title,
73                    const char *xlabel,const char *ylabel,const char *zlabel,
74                    Int_t nbinsx,Double_t xlow,Double_t xup,
75                    Int_t nbinsy,Double_t ylow,Double_t yup);
76  
77   static const Double_t fgkTPC_Z0;      // nominal gating grid position 
78   static const Double_t fgkIFCRadius;   // Mean Radius of the Inner Field Cage ( 82.43 min,  83.70 max) (cm)
79   static const Double_t fgkOFCRadius;   // Mean Radius of the Outer Field Cage (252.55 min, 256.45 max) (cm)
80   static const Double_t fgkZOffSet;     // Offset from CE: calculate all distortions closer to CE as if at this point
81   static const Double_t fgkCathodeV;    // Cathode Voltage (volts)
82   static const Double_t fgkGG;          // Gating Grid voltage (volts)
83
84   enum {kNR=   92};              // Number of R points in the table for interpolating distortion data
85   enum {kNZ=  270};              // Number of Z points in the table for interpolating distortion data
86   static const Double_t fgkRList[kNR];
87   static const Double_t fgkZList[kNZ];
88
89   // Simple Interpolation functions: e.g. with tricubic interpolation (not yet in TH3)
90   Int_t fJLow; 
91   Int_t fKLow;
92   void Interpolate2DEdistortion( const Int_t order, const Double_t r, const Double_t z, 
93                                  const Double_t er[kNZ][kNR], Double_t &er_value );
94   Double_t Interpolate( const Double_t xArray[], const Double_t yArray[], 
95                         const Int_t order, const Double_t x );
96   void Search( const Int_t n, const Double_t xArray[], const Double_t x, Int_t &low );
97   
98
99
100   ClassDef(AliTPCCorrection,1);
101 };
102
103 #endif