4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 /* $Id: AliTPCEfield.h 35613 2009-10-16 03:24:40Z marian $ */
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");
25 void MakeFitFunctions(Int_t maxFreq);
27 void DumpField(Double_t gridSize=5, Double_t step=0.5);
29 Double_t EvalField(Int_t ifun, Double_t x, Double_t y, Double_t z, Int_t type=0);
30 Double_t Eval(Double_t x, Double_t y, Double_t z, Int_t type=0);
32 static Double_t EvalS(Double_t x, Double_t y, Double_t z, Int_t type=0);
35 Double_t Field(Int_t ftype, Double_t ifx, Double_t ify, Double_t ifz, Double_t x, Double_t y, Double_t z);
36 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);
37 TMatrixD* MakeCorrelation(TMatrixD &matrix);
39 // get rid of numerical instabilities
40 Double_t SinHNorm(Double_t x, Double_t norm){ return 0.5*(TMath::Exp(x-norm)-TMath::Exp(-x-norm));}
41 Double_t CosHNorm(Double_t x, Double_t norm){ return 0.5*(TMath::Exp(x-norm)+TMath::Exp(-x-norm));}
43 Double_t fMin[3]; // range of coordinates from Min to Max
45 Double_t fScale; // scaling factor
46 Int_t fMaxFreq; // maximal frequency of expansion
47 Bool_t fIs2D; // flag for 2D field
48 Bool_t fUseLinear; // flag to use also linear term of the field
50 TTreeSRedirector * fWorkspace; //! workspace
51 TMatrixD *fFitFunctions; // fit function description
52 TVectorD *fFitParam; // fit parameters - coeficients
53 TMatrixD *fFitCovar; // fit covariance
54 TLinearFitter *fFitter; // linear fitter - temporary solution - integrals to be calculated
55 static AliTPCEfield* fgInstance; // instance of fied - for visualization
56 ClassDef(AliTPCEfield,1)