Make destructor virtual
[u/mrichter/AliRoot.git] / STEER / AliMagF.h
CommitLineData
fe4da5cc 1#ifndef AliMagF_H
2#define AliMagF_H
3da30618 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
fe4da5cc 7
8#include "TNamed.h"
9#include "TVector.h"
10
11enum Field_t {Undef=1, Const=1, ConMesh=2};
12
13class AliMagF : public TNamed {
14
15protected:
16 Int_t fMap; // Field Map identifier
17 Int_t fType; // Mag Field type
18 Int_t fInteg; // Integration method as indicated in Geant
19 Float_t fFactor; // Multiplicative factor
20 Float_t fMax; // Max Field as indicated in Geant
21
22public:
23 AliMagF(){}
24 AliMagF(const char *name, const char *title, const Int_t integ, const Int_t map,
25 const Float_t factor, const Float_t fmax);
26 virtual ~AliMagF() {}
27 virtual void Field(Float_t *x, Float_t *b);
28 virtual Int_t Type() {return fType;}
29 virtual Float_t Max() const {return fMax;}
30 virtual Int_t Map() const {return fMap;}
31 virtual Int_t Integ() const {return fInteg;}
32 virtual Float_t Factor() const {return fFactor;}
33 virtual void ReadField() {}
34
35 ClassDef(AliMagF,1) //Base class for all Alice MagField
36};
37
38class AliMagFC : public AliMagF
39{
40 //Alice Constant Magnetic Field
41private:
42
43public:
44 AliMagFC(){}
45 AliMagFC(const char *name, const char *title, const Int_t integ, const Int_t map,
46 const Float_t factor, const Float_t fmax);
47 virtual ~AliMagFC() {}
48 virtual void Field(Float_t *x, Float_t *b);
49 virtual void ReadField() {}
50
51 ClassDef(AliMagFC,1) //Class for all Alice Constant MagField
52};
53
54class AliMagFCM : public AliMagF
55{
56 //Alice Magnetic Field with constan mesh
57protected:
58
59 Float_t fXbeg; // Start of mesh in x
60 Float_t fYbeg; // Start of mesh in y
61 Float_t fZbeg; // Start of mesh in z
62 Float_t fXdel; // Mesh step in x
63 Float_t fYdel; // Mesh step in y
64 Float_t fZdel; // Mesh step in z
65 Double_t fXdeli; // Inverse of Mesh step in x
66 Double_t fYdeli; // Inverse of Mesh step in y
67 Double_t fZdeli; // Inverse of Mesh step in z
68 Int_t fXn; // Number of mesh points in x
69 Int_t fYn; // Number of mesh points in y
70 Int_t fZn; // Number of mesh points in z
71 TVector *fB; // Field map
72public:
73 AliMagFCM(){}
74 AliMagFCM(const char *name, const char *title, const Int_t integ, const Int_t map,
75 const Float_t factor, const Float_t fmax);
76 virtual ~AliMagFCM() {delete fB;}
77 virtual void Field(Float_t *x, Float_t *b);
78 virtual void ReadField();
79
80 inline Float_t Bx(const Int_t ix, const Int_t iy, const Int_t iz) {
81 return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix));
82 }
83 inline Float_t By(const Int_t ix, const Int_t iy, const Int_t iz) {
84 return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix)+1);
85 }
86 inline Float_t Bz(const Int_t ix, const Int_t iy, const Int_t iz) {
87 return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix)+2);
88 }
89
90 ClassDef(AliMagFCM,1) //Class for all Alice MagField with Constant Mesh
91};
92
93#endif