84737f5e |
1 | #ifndef ALIFIELDMAP_H |
2 | #define ALIFIELDMAP_H |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
4 | * See cxx source for full Copyright notice */ |
5 | |
6 | /* $Id$ */ |
7 | |
8 | // |
9 | // Author: Andreas Morsch <andreas.morsch@cern.ch> |
10 | // |
11 | #include <TNamed.h> |
12 | #include <TVector.h> |
13 | |
14 | class AliFieldMap : public TNamed |
15 | { |
16 | //Alice Magnetic Field with constant mesh |
17 | |
18 | public: |
19 | AliFieldMap(); |
20 | AliFieldMap(const char *name, const char *title); |
21 | AliFieldMap(const AliFieldMap &mag); |
22 | virtual ~AliFieldMap(); |
23 | void Copy(AliFieldMap &map) const; |
24 | virtual AliFieldMap & operator=(const AliFieldMap &map); |
25 | |
26 | virtual void Field(Float_t *x, Float_t *b); |
27 | Float_t Bx(const Int_t ix, const Int_t iy, const Int_t iz) { |
28 | return (*fB)(3*(ix*(fZn*fYn)+iy*fZn+iz)); |
29 | } |
30 | Float_t By(const Int_t ix, const Int_t iy, const Int_t iz) { |
31 | return (*fB)(3*(ix*(fZn*fYn)+iy*fZn+iz)+1); |
32 | } |
33 | Float_t Bz(const Int_t ix, const Int_t iy, const Int_t iz) { |
34 | return (*fB)(3*(ix*(fZn*fYn)+iy*fZn+iz)+2); |
35 | } |
36 | |
37 | Bool_t Inside(Float_t x, Float_t y, Float_t z) |
38 | { return (x > fXbeg && x <= fXend && |
39 | y > fYbeg && y <= fYend && |
40 | z > fZbeg && z <= fZend); |
41 | } |
42 | Float_t Xmin() {return fXbeg;} |
43 | Float_t Xmax() {return fXend;} |
44 | Float_t DelX() {return fXdel;} |
45 | Float_t DeliX() {return fXdeli;} |
46 | |
47 | Float_t Ymin() {return fYbeg;} |
48 | Float_t Ymax() {return fYend;} |
49 | Float_t DelY() {return fYdel;} |
50 | Float_t DeliY() {return fYdeli;} |
51 | |
52 | Float_t Zmin() {return fZbeg;} |
53 | Float_t Zmax() {return fZend;} |
54 | Float_t DelZ() {return fZdel;} |
55 | Float_t DeliZ() {return fZdeli;} |
56 | private: |
57 | void ReadField(); |
58 | protected: |
59 | |
60 | Float_t fXbeg; // Start of mesh in x |
61 | Float_t fYbeg; // Start of mesh in y |
62 | Float_t fZbeg; // Start of mesh in z |
63 | Float_t fXend; // End of mesh in x |
64 | Float_t fYend; // End of mesh in y |
65 | Float_t fZend; // End of mesh in z |
66 | Float_t fXdel; // Mesh step in x |
67 | Float_t fYdel; // Mesh step in y |
68 | Float_t fZdel; // Mesh step in z |
69 | Double_t fXdeli; // Inverse of Mesh step in x |
70 | Double_t fYdeli; // Inverse of Mesh step in y |
71 | Double_t fZdeli; // Inverse of Mesh step in z |
72 | Int_t fXn; // Number of mesh points in x |
73 | Int_t fYn; // Number of mesh points in y |
74 | Int_t fZn; // Number of mesh points in z |
75 | TVector* fB; // Field map |
76 | |
77 | ClassDef(AliFieldMap,1) //Class for Field Map |
78 | }; |
79 | |
80 | #endif |