4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 /// \class AliTPCEfield
8 /// \brief Calculation of the electric field
14 class TTreeSRedirector;
16 class AliTPCEfield:public TNamed {
19 AliTPCEfield(const char * name, Int_t maxFreq, Bool_t is2D, Bool_t useLinear=kTRUE);
20 virtual ~AliTPCEfield();
21 void SetRange(Double_t x0, Double_t x1, Double_t y0, Double_t y1, Double_t z00,Double_t z1=0);
22 void AddBoundaryLine(Double_t x0,Double_t y0, Double_t z0, Double_t v0, Double_t x1, Double_t y1, Double_t z1, Double_t v1, Int_t id=0, Int_t npoints=100);
23 TTree * GetTree(const char * tname="Boundary");
24 /// \class AliTPCEfield
26 void MakeFitFunctions(Int_t maxFreq);
28 void DumpField(Double_t gridSize=5, Double_t step=0.5);
30 Double_t EvalField(Int_t ifun, Double_t x, Double_t y, Double_t z, Int_t type=0);
31 Double_t Eval(Double_t x, Double_t y, Double_t z, Int_t type=0);
33 static Double_t EvalS(Double_t x, Double_t y, Double_t z, Int_t type=0);
36 Double_t Field(Int_t ftype, Double_t ifx, Double_t ify, Double_t ifz, Double_t x, Double_t y, Double_t z);
37 Double_t FieldDn(Int_t ftype, Double_t ifx, Double_t ify, Double_t ifz, Int_t dn, Double_t x, Double_t y, Double_t z);
38 TMatrixD* MakeCorrelation(TMatrixD &matrix);
40 // get rid of numerical instabilities
41 Double_t SinHNorm(Double_t x, Double_t norm){ return 0.5*(TMath::Exp(x-norm)-TMath::Exp(-x-norm));}
42 Double_t CosHNorm(Double_t x, Double_t norm){ return 0.5*(TMath::Exp(x-norm)+TMath::Exp(-x-norm));}
44 Double_t fMin[3]; ///< range of coordinates from Min to Max
45 Double_t fMax[3]; ///<
46 Double_t fScale; ///< scaling factor
47 Int_t fMaxFreq; ///< maximal frequency of expansion
48 Bool_t fIs2D; ///< flag for 2D field
49 Bool_t fUseLinear; ///< flag to use also linear term of the field
51 TTreeSRedirector * fWorkspace; //!< workspace
52 TMatrixD *fFitFunctions; ///< fit function description
53 TVectorD *fFitParam; ///< fit parameters - coeficients
54 TMatrixD *fFitCovar; ///< fit covariance
55 TLinearFitter *fFitter; ///< linear fitter - temporary solution - integrals to be calculated
56 static AliTPCEfield* fgInstance; ///< instance of fied - for visualization
57 ClassDef(AliTPCEfield,1)