aee8290b |
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 | |
db83d72f |
6 | // |
7 | // Interface between the TVirtualMagField and AliMagWrapCheb: wrapper to |
8 | // the set of magnetic field data + Tosca parameterization by |
9 | // Chebyshev polynomials |
10 | // |
11 | // Author: ruben.shahoyan@cern.ch |
12 | // |
fe4da5cc |
13 | |
db83d72f |
14 | //#include <TGeoGlobalMagField.h> |
15 | #include <TVirtualMagField.h> |
16 | class AliMagWrapCheb; |
0742d588 |
17 | |
db83d72f |
18 | class AliMagF : public TVirtualMagField |
19 | { |
20 | public: |
21 | enum BMap_t {k2kG, k5kG, k5kGUniform}; |
22 | enum BeamType_t {kBeamTypeAA, kBeamTypepp, kNoBeamField}; |
1dd3d90e |
23 | enum PolarityConvention_t {kConvMap2005,kConvDCS2008,kConvLHC}; |
db83d72f |
24 | // |
e2afb3b6 |
25 | AliMagF(); |
db83d72f |
26 | AliMagF(const char *name, const char* title, Int_t integ, |
27 | Double_t factorSol=1., Double_t factorDip=1., |
28 | Double_t fmax=15, BMap_t maptype = k5kG, |
29 | const char* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root", |
9251fceb |
30 | BeamType_t btype=kBeamTypepp, Double_t benergy=7000.); |
db83d72f |
31 | AliMagF(const AliMagF& src); |
32 | AliMagF& operator=(const AliMagF& src); |
33 | virtual ~AliMagF(); |
34 | // |
35 | virtual void Field(const Double_t *x, Double_t *b); |
36 | void GetTPCInt(const Double_t *xyz, Double_t *b) const; |
37 | void GetTPCIntCyl(const Double_t *rphiz, Double_t *b) const; |
38 | Double_t GetBz(const Double_t *xyz) const; |
39 | // |
40 | AliMagWrapCheb* GetMeasuredMap() const {return fMeasuredMap;} |
41 | // |
42 | // former AliMagF methods or their aliases |
1dd3d90e |
43 | void SetFactorSol(Float_t fc=1.); |
44 | void SetFactorDip(Float_t fc=1.); |
45 | Double_t GetFactorSol() const; |
46 | Double_t GetFactorDip() const; |
db83d72f |
47 | Double_t Factor() const {return GetFactorSol();} |
48 | Bool_t IsUniform() const {return fMapType == k5kGUniform;} |
49 | // |
50 | void MachineField(const Double_t *x, Double_t *b) const; |
51 | BMap_t GetMapType() const {return fMapType;} |
db83d72f |
52 | BeamType_t GetBeamType() const {return fBeamType;} |
53 | Double_t GetBeamEnergy() const {return fBeamEnergy;} |
54 | Double_t Max() const {return fMax;} |
55 | Int_t Integ() const {return fInteg;} |
56 | Int_t PrecInteg() const {return fPrecInteg;} |
f04e7f5f |
57 | Double_t SolenoidField() const {return fFactorSol*fSolenoid;} |
db83d72f |
58 | // |
59 | Char_t* GetDataFileName() const {return (Char_t*)fParNames.GetName();} |
60 | Char_t* GetParamName() const {return (Char_t*)fParNames.GetTitle();} |
61 | void SetDataFileName(const Char_t* nm) {fParNames.SetName(nm);} |
62 | void SetParamName(const Char_t* nm) {fParNames.SetTitle(nm);} |
63 | // |
64 | Bool_t LoadParameterization(); |
1dd3d90e |
65 | static Int_t GetPolarityConvention() {return Int_t(fgkPolarityConvention);} |
db83d72f |
66 | // |
a0201063 |
67 | protected: |
db83d72f |
68 | // not supposed to be changed during the run, set only at the initialization via constructor |
69 | void InitMachineField(BeamType_t btype, Double_t benergy); |
70 | void SetBeamType(BeamType_t type) {fBeamType = type;} |
71 | void SetBeamEnergy(Float_t energy) {fBeamEnergy = energy;} |
db83d72f |
72 | // |
73 | protected: |
74 | AliMagWrapCheb* fMeasuredMap; //! Measured part of the field map |
75 | BMap_t fMapType; // field map type |
76 | Double_t fSolenoid; // Solenoid field setting |
77 | BeamType_t fBeamType; // Beam type: A-A (fBeamType=0) or p-p (fBeamType=1) |
78 | Double_t fBeamEnergy; // Beam energy in GeV |
db83d72f |
79 | // |
80 | Int_t fInteg; // Default integration method as indicated in Geant |
81 | Int_t fPrecInteg; // Alternative integration method, e.g. for higher precision |
82 | Double_t fFactorSol; // Multiplicative factor for solenoid |
83 | Double_t fFactorDip; // Multiplicative factor for dipole |
84 | Double_t fMax; // Max Field as indicated in Geant |
85 | Bool_t fDipoleOFF; // Dipole ON/OFF flag |
86 | // |
87 | Double_t fQuadGradient; // Gradient field for inner triplet quadrupoles |
88 | Double_t fDipoleField; // Field value for D1 and D2 dipoles |
89 | Double_t fCCorrField; // Side C 2nd compensator field |
90 | Double_t fACorr1Field; // Side A 1st compensator field |
91 | Double_t fACorr2Field; // Side A 2nd compensator field |
92 | // |
93 | TNamed fParNames; // file and parameterization loadad |
94 | // |
1dd3d90e |
95 | static const Double_t fgkSol2DipZ; // conventional Z of transition from L3 to Dipole field |
96 | static const UShort_t fgkPolarityConvention; // convention for the mapping of the curr.sign on main component sign |
db83d72f |
97 | // |
9251fceb |
98 | ClassDef(AliMagF, 2) // Class for all Alice MagField wrapper for measured data + Tosca parameterization |
fe4da5cc |
99 | }; |
7a15f6b8 |
100 | |
db83d72f |
101 | |
fe4da5cc |
102 | #endif |