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(TObject &map) const;
24 virtual AliFieldMap & operator=(const AliFieldMap &map);
26 virtual void Field(Float_t *x, Float_t *b);
27 Float_t Bx(Int_t ix, Int_t iy, Int_t iz) const{
28 return (*fB)(3*((ix*fYn+iy)*fZn+iz));
30 Float_t By(Int_t ix, Int_t iy, Int_t iz) const{
31 return (*fB)(3*((ix*fYn+iy)*fZn+iz)+1);
33 Float_t Bz(Int_t ix, Int_t iy, Int_t iz) const{
34 return (*fB)(3*((ix*fYn+iy)*fZn+iz)+2);
37 Bool_t Inside(Float_t x, Float_t y, Float_t z) const
38 { return (x > fXbeg && x <= fXend &&
39 y > fYbeg && y <= fYend &&
40 z > fZbeg && z <= fZend);
42 Float_t Xmin() const {return fXbeg;}
43 Float_t Xmax() const {return fXend;}
44 Float_t DelX() const {return fXdel;}
45 Float_t DeliX() const {return fXdeli;}
47 Float_t Ymin() const {return fYbeg;}
48 Float_t Ymax() const {return fYend;}
49 Float_t DelY() const {return fYdel;}
50 Float_t DeliY() const {return fYdeli;}
52 Float_t Zmin() const {return fZbeg;}
53 Float_t Zmax() const {return fZend;}
54 Float_t DelZ() const {return fZdel;}
55 Float_t DeliZ() const {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;
62 void SetWriteEnable(Int_t flag = 1) {fWriteEnable = flag;}
65 Float_t fXbeg; // Start of mesh in x
66 Float_t fYbeg; // Start of mesh in y
67 Float_t fZbeg; // Start of mesh in z
68 Float_t fXend; // End of mesh in x
69 Float_t fYend; // End of mesh in y
70 Float_t fZend; // End of mesh in z
71 Float_t fXdel; // Mesh step in x
72 Float_t fYdel; // Mesh step in y
73 Float_t fZdel; // Mesh step in z
74 Double_t fXdeli; // Inverse of Mesh step in x
75 Double_t fYdeli; // Inverse of Mesh step in y
76 Double_t fZdeli; // Inverse of Mesh step in z
77 Int_t fXn; // Number of mesh points in x
78 Int_t fYn; // Number of mesh points in y
79 Int_t fZn; // Number of mesh points in z
80 Int_t fWriteEnable; // Enable flag for writing of field data.
81 TVector* fB; // Field map
86 ClassDef(AliFieldMap,3) //Class for Field Map