]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALIMAGFCM_H | |
2 | #define ALIMAGFCM_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 | // Class for Alice magnetic field with constant mesh | |
10 | // Used in the configuration macros (macros/Config.C, etc.) | |
11 | // Author: | |
12 | //----------------------------------------------------------------------- | |
13 | ||
14 | #include "AliMagFC.h" | |
15 | #include <TVector.h> | |
16 | ||
17 | class AliMagFCM : public AliMagFC | |
18 | { | |
19 | //Alice Magnetic Field with constant mesh | |
20 | ||
21 | public: | |
22 | AliMagFCM(); | |
23 | AliMagFCM(const char *name, const char *title, Int_t integ, | |
24 | Float_t factor, Float_t fmax); | |
25 | AliMagFCM(const AliMagFCM &mag); | |
26 | virtual ~AliMagFCM() {delete fB;} | |
27 | virtual void Field(Float_t *x, Float_t *b) const; | |
28 | virtual void ReadField(); | |
29 | virtual void SetSolenoidField(Float_t field = 2.) {fSolenoid = field;} | |
30 | virtual Float_t SolenoidField() const { | |
31 | return -Factor()*fSolenoid; | |
32 | } | |
33 | ||
34 | void Copy(TObject &magf) const; | |
35 | virtual AliMagFCM & operator=(const AliMagFCM &magf) | |
36 | {magf.Copy(*this); return *this;} | |
37 | ||
38 | Float_t Bx(Int_t ix, Int_t iy, Int_t iz) const { | |
39 | return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix)); | |
40 | } | |
41 | Float_t By(Int_t ix, Int_t iy, Int_t iz) const { | |
42 | return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix)+1); | |
43 | } | |
44 | Float_t Bz(Int_t ix, Int_t iy, Int_t iz) const { | |
45 | return (*fB)(3*(iz*(fXn*fYn)+iy*fXn+ix)+2); | |
46 | } | |
47 | ||
48 | protected: | |
49 | ||
50 | Float_t fXbeg; // Start of mesh in x | |
51 | Float_t fYbeg; // Start of mesh in y | |
52 | Float_t fZbeg; // Start of mesh in z | |
53 | Float_t fXdel; // Mesh step in x | |
54 | Float_t fYdel; // Mesh step in y | |
55 | Float_t fZdel; // Mesh step in z | |
56 | Float_t fSolenoid; // Solenoid Field Strength | |
57 | Double_t fXdeli; // Inverse of Mesh step in x | |
58 | Double_t fYdeli; // Inverse of Mesh step in y | |
59 | Double_t fZdeli; // Inverse of Mesh step in z | |
60 | Int_t fXn; // Number of mesh points in x | |
61 | Int_t fYn; // Number of mesh points in y | |
62 | Int_t fZn; // Number of mesh points in z | |
63 | TVector *fB; // Field map | |
64 | ||
65 | ClassDef(AliMagFCM,1) //Class for all Alice MagField with Constant Mesh | |
66 | }; | |
67 | ||
68 | #endif |