1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
4 ////////////////////////////////////////////////////////////////////////////
5 // AliTPCCorrectionLookupTable class //
6 // Authors: Jens Wiechula //
7 ////////////////////////////////////////////////////////////////////////////
9 #include "AliTPCCorrection.h"
11 #include <TMatrixFfwd.h>
14 class AliTPCCorrectionLookupTable : public AliTPCCorrection {
17 AliTPCCorrectionLookupTable();
18 virtual ~AliTPCCorrectionLookupTable();
20 virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]);
21 virtual void GetDistortion(const Float_t x[],const Short_t roc,Float_t dx[]);
23 void SetupDefaultLimits();
24 void CreateLookupTable(AliTPCCorrection &tpcCorr, Float_t stepSize=5.);
25 void CreateLookupTableSinglePhi(AliTPCCorrection &tpcCorr, Int_t iPhi, Float_t stepSize=5.);
27 void CreateLookupTableFromResidualDistortion(THn &resDist);
28 void CreateResidual(AliTPCCorrection *distortion, AliTPCCorrection* correction);
30 void MergePhiTables(const char* files);
32 void SetFillCorrection(Bool_t fill) { fFillCorrection=fill; }
33 Bool_t GetFillCorrection() const { return fFillCorrection; }
34 void BuildExactInverse();
36 Int_t GetNR() const { return fNR; }
37 Int_t GetNPhi() const { return fNPhi; }
38 Int_t GetNZ() const { return fNZ; }
40 const TVectorD& GetLimitsR() const { return fLimitsR; }
41 const TVectorD& GetLimitsPhi() const { return fLimitsPhi; }
42 const TVectorD& GetLimitsZ() const { return fLimitsZ; }
44 void SetCorrScaleFactor(Float_t val) { fCorrScaleFactor = val; }
45 Float_t GetCorrScaleFactor() const { return fCorrScaleFactor; }
49 // sizes of lookup tables
50 // TODO: Remove, since it will be stored in the TVectorD anyhow?
51 Int_t fNR; // number of rows (r) used for lookup table
52 Int_t fNPhi; // number of phi slices used for lookup table
53 Int_t fNZ; // number of columns (z) used for lookup table
55 Float_t fCorrScaleFactor; // overall scaling factor for the correction
57 Bool_t fFillCorrection; // whether to also fill the correction tables
59 TVectorD fLimitsR; // bin limits in row direction
60 TVectorD fLimitsPhi; // bin limits in phi direction
61 TVectorD fLimitsZ; // bin limits in z direction
63 TMatrixF **fLookUpDxDist; //[fNPhi] Array to store electric field integral (int Er/Ez)
64 TMatrixF **fLookUpDyDist; //[fNPhi] Array to store electric field integral (int Er/Ez)
65 TMatrixF **fLookUpDzDist; //[fNPhi] Array to store electric field integral (int Er/Ez)
68 TMatrixF **fLookUpDxCorr; //[fNPhi] Array to store electric field integral (int Er/Ez)
69 TMatrixF **fLookUpDyCorr; //[fNPhi] Array to store electric field integral (int Er/Ez)
70 TMatrixF **fLookUpDzCorr; //[fNPhi] Array to store electric field integral (int Er/Ez)
73 void InitTableArrays();
74 void InitTablesPhiBin(Int_t iPhi);
79 void GetInterpolation(const Float_t x[],const Short_t roc,Float_t dx[],
80 TMatrixF **mR, TMatrixF **mPhi, TMatrixF **mZ);
82 void CreateLookupTablePhiBin(AliTPCCorrection &tpcCorr, Int_t iPhi, Float_t stepSize);
84 void FindClosestPosition(const Int_t binR, const Int_t binZ, const Int_t binPhi,
85 const Float_t xref[3], Float_t xret[3]);
86 AliTPCCorrectionLookupTable(const AliTPCCorrectionLookupTable &corr);
87 AliTPCCorrectionLookupTable& operator= (const AliTPCCorrectionLookupTable &corr);
89 ClassDef(AliTPCCorrectionLookupTable,3); // TPC corrections dumped into a lookup table