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>
14 class AliFieldMap : public TNamed
16 //Alice Magnetic Field with constant mesh
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);
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));
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);
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);
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);
42 Float_t Xmin() {return fXbeg;}
43 Float_t Xmax() {return fXend;}
44 Float_t DelX() {return fXdel;}
45 Float_t DeliX() {return fXdeli;}
47 Float_t Ymin() {return fYbeg;}
48 Float_t Ymax() {return fYend;}
49 Float_t DelY() {return fYdel;}
50 Float_t DeliY() {return fYdeli;}
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 void SetLimits(Float_t xmin, Float_t xmax, Float_t ymin, Float_t ymax,
57 Float_t zmin, Float_t zmax)
59 fXbeg = xmin; fXend = xmax; fYbeg = ymin; fYend = ymax;
60 fZbeg = zmin; fZend = zmax;
66 Float_t fXbeg; // Start of mesh in x
67 Float_t fYbeg; // Start of mesh in y
68 Float_t fZbeg; // Start of mesh in z
69 Float_t fXend; // End of mesh in x
70 Float_t fYend; // End of mesh in y
71 Float_t fZend; // End of mesh in z
72 Float_t fXdel; // Mesh step in x
73 Float_t fYdel; // Mesh step in y
74 Float_t fZdel; // Mesh step in z
75 Double_t fXdeli; // Inverse of Mesh step in x
76 Double_t fYdeli; // Inverse of Mesh step in y
77 Double_t fZdeli; // Inverse of Mesh step in z
78 Int_t fXn; // Number of mesh points in x
79 Int_t fYn; // Number of mesh points in y
80 Int_t fZn; // Number of mesh points in z
81 TVector* fB; //!Field map
83 ClassDef(AliFieldMap,2) //Class for Field Map