3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
7 // Interface between the TVirtualMagField and AliMagWrapCheb: wrapper to
8 // the set of magnetic field data + Tosca parameterization by
9 // Chebyshev polynomials
11 // Author: ruben.shahoyan@cern.ch
14 //#include <TGeoGlobalMagField.h>
15 #include <TVirtualMagField.h>
18 class AliMagF : public TVirtualMagField
21 enum BMap_t {k2kG, k5kG, k5kGUniform};
22 enum BeamType_t {kBeamTypeAA, kBeamTypepp, kNoBeamField};
25 AliMagF(const char *name, const char* title, Int_t integ,
26 Double_t factorSol=1., Double_t factorDip=1.,
27 Double_t fmax=15, BMap_t maptype = k5kG,
28 const char* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root",
29 BeamType_t btype=kBeamTypepp, Double_t benergy=7000.);
30 AliMagF(const AliMagF& src);
31 AliMagF& operator=(const AliMagF& src);
34 virtual void Field(const Double_t *x, Double_t *b);
35 void GetTPCInt(const Double_t *xyz, Double_t *b) const;
36 void GetTPCIntCyl(const Double_t *rphiz, Double_t *b) const;
37 Double_t GetBz(const Double_t *xyz) const;
39 AliMagWrapCheb* GetMeasuredMap() const {return fMeasuredMap;}
41 // former AliMagF methods or their aliases
42 void SetFactorSol(Float_t fc=1.) {fFactorSol = fc;}
43 void SetFactorDip(Float_t fc=1.) {fFactorDip = fc;}
44 Double_t GetFactorSol() const {return fFactorSol;}
45 Double_t GetFactorDip() const {return fFactorSol;}
46 Double_t Factor() const {return GetFactorSol();}
47 Bool_t IsUniform() const {return fMapType == k5kGUniform;}
49 void MachineField(const Double_t *x, Double_t *b) const;
50 BMap_t GetMapType() const {return fMapType;}
51 BeamType_t GetBeamType() const {return fBeamType;}
52 Double_t GetBeamEnergy() const {return fBeamEnergy;}
53 Double_t Max() const {return fMax;}
54 Int_t Integ() const {return fInteg;}
55 Int_t PrecInteg() const {return fPrecInteg;}
56 Double_t SolenoidField() const {return fFactorSol*fSolenoid;}
58 Char_t* GetDataFileName() const {return (Char_t*)fParNames.GetName();}
59 Char_t* GetParamName() const {return (Char_t*)fParNames.GetTitle();}
60 void SetDataFileName(const Char_t* nm) {fParNames.SetName(nm);}
61 void SetParamName(const Char_t* nm) {fParNames.SetTitle(nm);}
63 Bool_t LoadParameterization();
66 // not supposed to be changed during the run, set only at the initialization via constructor
67 void InitMachineField(BeamType_t btype, Double_t benergy);
68 void SetBeamType(BeamType_t type) {fBeamType = type;}
69 void SetBeamEnergy(Float_t energy) {fBeamEnergy = energy;}
72 AliMagWrapCheb* fMeasuredMap; //! Measured part of the field map
73 BMap_t fMapType; // field map type
74 Double_t fSolenoid; // Solenoid field setting
75 BeamType_t fBeamType; // Beam type: A-A (fBeamType=0) or p-p (fBeamType=1)
76 Double_t fBeamEnergy; // Beam energy in GeV
78 Int_t fInteg; // Default integration method as indicated in Geant
79 Int_t fPrecInteg; // Alternative integration method, e.g. for higher precision
80 Double_t fFactorSol; // Multiplicative factor for solenoid
81 Double_t fFactorDip; // Multiplicative factor for dipole
82 Double_t fMax; // Max Field as indicated in Geant
83 Bool_t fDipoleOFF; // Dipole ON/OFF flag
85 Double_t fQuadGradient; // Gradient field for inner triplet quadrupoles
86 Double_t fDipoleField; // Field value for D1 and D2 dipoles
87 Double_t fCCorrField; // Side C 2nd compensator field
88 Double_t fACorr1Field; // Side A 1st compensator field
89 Double_t fACorr2Field; // Side A 2nd compensator field
91 TNamed fParNames; // file and parameterization loadad
93 static const Double_t fgkSol2DipZ; // conventional Z of transition from L3 to Dipole field
95 ClassDef(AliMagF, 2) // Class for all Alice MagField wrapper for measured data + Tosca parameterization