]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCEfield.h
PWGPP-102, ATO-138, ATO-135 - Adjusting dNdx parameterization for ALICE MC ( NeCo2)
[u/mrichter/AliRoot.git] / TPC / AliTPCEfield.h
CommitLineData
b1f0a2a5 1#ifndef ALITPCEFIELD_H
2#define ALITPCEFIELD_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
0fd1fc0b 7/// \class AliTPCEfield
8/// \brief Calculation of the electric field
b1f0a2a5 9
10#include "TNamed.h"
11#include "TMatrixD.h"
12#include "TVectorD.h"
13#include "TNamed.h"
14class TTreeSRedirector;
15
16class AliTPCEfield:public TNamed {
17public:
18 AliTPCEfield();
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");
0fd1fc0b 24/// \class AliTPCEfield
25
b1f0a2a5 26 void MakeFitFunctions(Int_t maxFreq);
27 void FitField();
28 void DumpField(Double_t gridSize=5, Double_t step=0.5);
29 //
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);
32 //
33 static Double_t EvalS(Double_t x, Double_t y, Double_t z, Int_t type=0);
34 //
35
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);
39
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));}
43 public:
0fd1fc0b 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
b1f0a2a5 50 //
0fd1fc0b 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
b1f0a2a5 57 ClassDef(AliTPCEfield,1)
58};
59
60#endif