3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
9 // Author: Andreas Morsch <andreas.morsch@cern.ch>
15 class AliFieldMap : public TNamed
17 //Alice Magnetic Field with constant mesh
21 AliFieldMap(const char *name, const char *title);
22 AliFieldMap(const AliFieldMap &mag);
23 virtual ~AliFieldMap();
24 void Copy(AliFieldMap &map) const;
25 virtual AliFieldMap & operator=(const AliFieldMap &map);
27 virtual void Field(Float_t *x, Float_t *b);
28 Float_t Bx(const Int_t ix, const Int_t iy, const Int_t iz) {
29 return (*fB)(3*(ix*(fZn*fYn)+iy*fZn+iz));
31 Float_t By(const Int_t ix, const Int_t iy, const Int_t iz) {
32 return (*fB)(3*(ix*(fZn*fYn)+iy*fZn+iz)+1);
34 Float_t Bz(const Int_t ix, const Int_t iy, const Int_t iz) {
35 return (*fB)(3*(ix*(fZn*fYn)+iy*fZn+iz)+2);
38 Bool_t Inside(Float_t x, Float_t y, Float_t z)
39 { return (x > fXbeg && x <= fXend &&
40 y > fYbeg && y <= fYend &&
41 z > fZbeg && z <= fZend);
43 Float_t Xmin() {return fXbeg;}
44 Float_t Xmax() {return fXend;}
45 Float_t DelX() {return fXdel;}
46 Float_t DeliX() {return fXdeli;}
48 Float_t Ymin() {return fYbeg;}
49 Float_t Ymax() {return fYend;}
50 Float_t DelY() {return fYdel;}
51 Float_t DeliY() {return fYdeli;}
53 Float_t Zmin() {return fZbeg;}
54 Float_t Zmax() {return fZend;}
55 Float_t DelZ() {return fZdel;}
56 Float_t DeliZ() {return fZdeli;}
57 void SetLimits(Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax,
58 Float_t zmin, Float_t zmax)
60 fXbeg = xmin; fXend = xmax; fYbeg = ymin; fYend = ymax;
61 fZbeg = zmin; fZend = zmax;
63 void SetWriteEnable(Int_t flag = 1) {fWriteEnable = flag;}
68 Float_t fXbeg; // Start of mesh in x
69 Float_t fYbeg; // Start of mesh in y
70 Float_t fZbeg; // Start of mesh in z
71 Float_t fXend; // End of mesh in x
72 Float_t fYend; // End of mesh in y
73 Float_t fZend; // End of mesh in z
74 Float_t fXdel; // Mesh step in x
75 Float_t fYdel; // Mesh step in y
76 Float_t fZdel; // Mesh step in z
77 Double_t fXdeli; // Inverse of Mesh step in x
78 Double_t fYdeli; // Inverse of Mesh step in y
79 Double_t fZdeli; // Inverse of Mesh step in z
80 Int_t fXn; // Number of mesh points in x
81 Int_t fYn; // Number of mesh points in y
82 Int_t fZn; // Number of mesh points in z
83 Int_t fWriteEnable; // Enable flag for writing of field data.
84 TVector* fB; // Field map
86 ClassDef(AliFieldMap,3) //Class for Field Map