AliRoot Core  3dc7879 (3dc7879)
Go to the documentation of this file.
1 #ifndef ALIMAGF_H
2 #define ALIMAGF_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
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:
12 //
14 //#include <TGeoGlobalMagField.h>
15 #include <TVirtualMagField.h>
17 class AliMagFast;
18 class AliMagWrapCheb;
20 class AliMagF : public TVirtualMagField
21 {
22  public:
26  enum {kOverrideGRP=BIT(14)}; // don't recreate from GRP if set
27  //
28  AliMagF();
29  AliMagF(const char *name, const char* title,Double_t factorSol=1., Double_t factorDip=1.,
30  BMap_t maptype = k5kG, BeamType_t btype=kBeamTypepp, Double_t benergy=-1, float a2z=1.0,
31  Int_t integ=2, Double_t fmax=15,const char* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
32  AliMagF(const char *name, const char* title,Double_t factorSol, Double_t factorDip,
33  BMap_t maptype, BeamType_t btype, Double_t benergy, Int_t integ, Double_t fmax,const char* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
34  AliMagF(const AliMagF& src);
35  AliMagF& operator=(const AliMagF& src);
36  virtual ~AliMagF();
37  //
38  virtual void Field(const Double_t *x, Double_t *b);
39  void GetTPCInt(const Double_t *xyz, Double_t *b) const;
40  void GetTPCRatInt(const Double_t *xyz, Double_t *b) const;
41  void GetTPCIntCyl(const Double_t *rphiz, Double_t *b) const;
42  void GetTPCRatIntCyl(const Double_t *rphiz, Double_t *b) const;
43  Double_t GetBz(const Double_t *xyz) const;
44  //
45  void AllowFastField(Bool_t v=kTRUE);
46  AliMagFast* GetFastField() const {return fFastField;}
48  //
49  // former AliMagF methods or their aliases
50  void SetFactorSol(Float_t fc=1.);
51  void SetFactorDip(Float_t fc=1.);
52  Double_t GetFactorSol() const;
53  Double_t GetFactorDip() const;
54  Double_t Factor() const {return GetFactorSol();}
55  Double_t GetCurrentSol() const {return GetFactorSol()*(fMapType==k2kG ? 12000:30000);}
56  Double_t GetCurrentDip() const {return GetFactorDip()*6000;}
57  Bool_t IsUniform() const {return fMapType == k5kGUniform;}
58  //
59  void MachineField(const Double_t *x, Double_t *b) const;
60  BMap_t GetMapType() const {return fMapType;}
61  BeamType_t GetBeamType() const {return fBeamType;}
62  const char* GetBeamTypeText() const;
63  Double_t GetBeamEnergy() const {return fBeamEnergy;}
64  Double_t Max() const {return fMax;}
65  Int_t Integ() const {return fInteg;}
66  Int_t PrecInteg() const {return fPrecInteg;}
67  Double_t SolenoidField() const {return fFactorSol*fSolenoid;}
68  //
69  Char_t* GetDataFileName() const {return (Char_t*)fParNames.GetName();}
70  Char_t* GetParamName() const {return (Char_t*)fParNames.GetTitle();}
71  void SetDataFileName(const Char_t* nm) {fParNames.SetName(nm);}
72  void SetParamName(const Char_t* nm) {fParNames.SetTitle(nm);}
73  virtual void Print(Option_t *opt) const;
74  //
75  Bool_t LoadParameterization();
76  static Int_t GetPolarityConvention() {return Int_t(fgkPolarityConvention);}
77  static AliMagF* CreateFieldMap(Float_t l3Current=-30000., Float_t diCurrent=-6000.,
78  Int_t convention=0, Bool_t uniform = kFALSE,
79  Float_t beamenergy=7000, const Char_t* btype="pp", int az0=0, int az1=0,
80  const Char_t* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root",
81  Bool_t returnNullOnInvalidCurrent = kFALSE);
82  //
83  static void SetFastFieldDefault(Bool_t v) {fgAllowFastField = v;}
84  static Bool_t GetFastFieldDefault() {return fgAllowFastField;}
86  protected:
87  // not supposed to be changed during the run, set only at the initialization via constructor
88  void InitMachineField(BeamType_t btype, Double_t benergy, float a2z=1.0);
89  void SetBeamType(BeamType_t type) {fBeamType = type;}
90  void SetBeamEnergy(Float_t energy) {fBeamEnergy = energy;}
91  //
92  protected:
95  BMap_t fMapType; // field map type
96  Double_t fSolenoid; // Solenoid field setting
97  BeamType_t fBeamType; // Beam type: A-A (fBeamType=0) or p-p (fBeamType=1)
98  Double_t fBeamEnergy; // Beam energy in GeV
99  //
100  Int_t fInteg; // Default integration method as indicated in Geant
101  Int_t fPrecInteg; // Alternative integration method, e.g. for higher precision
102  Double_t fFactorSol; // Multiplicative factor for solenoid
103  Double_t fFactorDip; // Multiplicative factor for dipole
104  Double_t fMax; // Max Field as indicated in Geant
105  Bool_t fDipoleOFF; // Dipole ON/OFF flag
106  //
107  Double_t fQuadGradient; // Gradient field for inner triplet quadrupoles
108  Double_t fDipoleField; // Field value for D1 and D2 dipoles
109  Double_t fCCorrField; // Side C 2nd compensator field
110  Double_t fACorr1Field; // Side A 1st compensator field
111  Double_t fACorr2Field; // Side A 2nd compensator field
112  //
113  TNamed fParNames; // file and parameterization loadad
114  //
115  static const Double_t fgkSol2DipZ; // conventional Z of transition from L3 to Dipole field
116  static const UShort_t fgkPolarityConvention; // convention for the mapping of the curr.sign on main component sign
117  static Bool_t fgAllowFastField; // default setting for fast field usage
118  //
119  ClassDef(AliMagF, 2) // Class for all Alice MagField wrapper for measured data + Tosca parameterization
120 };
123 #endif
Double_t GetBeamEnergy() const
Definition: AliMagF.h:63
AliMagWrapCheb * GetMeasuredMap() const
Definition: AliMagF.h:47
TBrowser b
Definition: RunAnaESD.C:12
void AllowFastField(Bool_t v=kTRUE)
Definition: AliMagF.cxx:690
void SetDataFileName(const Char_t *nm)
Definition: AliMagF.h:71
virtual ~AliMagF()
Definition: AliMagF.cxx:249
virtual void Print(Option_t *opt) const
Definition: AliMagF.cxx:673
void SetFactorDip(Float_t fc=1.)
Definition: AliMagF.cxx:517
void SetParamName(const Char_t *nm)
Definition: AliMagF.h:72
AliMagWrapCheb * fMeasuredMap
Definition: AliMagF.h:93
static const Double_t fgkSol2DipZ
Definition: AliMagF.h:115
Char_t * GetDataFileName() const
Definition: AliMagF.h:69
Double_t GetBz(const Double_t *xyz) const
Definition: AliMagF.cxx:296
Int_t PrecInteg() const
Definition: AliMagF.h:66
Double_t fDipoleField
Definition: AliMagF.h:108
const char * path
Bool_t IsUniform() const
Definition: AliMagF.h:57
static Bool_t fgAllowFastField
Definition: AliMagF.h:117
Double_t fACorr2Field
Definition: AliMagF.h:111
virtual void Field(const Double_t *x, Double_t *b)
Definition: AliMagF.cxx:280
void SetFactorSol(Float_t fc=1.)
Definition: AliMagF.cxx:505
static void SetFastFieldDefault(Bool_t v)
Definition: AliMagF.h:83
Char_t * GetParamName() const
Definition: AliMagF.h:70
Double_t fQuadGradient
Definition: AliMagF.h:107
Double_t fACorr1Field
Definition: AliMagF.h:110
Definition: AliMagF.h:24
void SetBeamEnergy(Float_t energy)
Definition: AliMagF.h:90
void GetTPCIntCyl(const Double_t *rphiz, Double_t *b) const
Definition: AliMagF.cxx:481
AliMagFast * fFastField
Measured part of the field map.
Definition: AliMagF.h:94
Double_t SolenoidField() const
Definition: AliMagF.h:67
Double_t fCCorrField
Definition: AliMagF.h:109
void GetTPCRatInt(const Double_t *xyz, Double_t *b) const
Definition: AliMagF.cxx:470
void SetBeamType(BeamType_t type)
Definition: AliMagF.h:89
Definition: AliMagF.h:23
Double_t GetFactorDip() const
Definition: AliMagF.cxx:539
TNamed fParNames
Definition: AliMagF.h:113
BMap_t GetMapType() const
Definition: AliMagF.h:60
static AliMagF * CreateFieldMap(Float_t l3Current=-30000., Float_t diCurrent=-6000., Int_t convention=0, Bool_t uniform=kFALSE, Float_t beamenergy=7000, const Char_t *btype="pp", int az0=0, int az1=0, const Char_t *path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root", Bool_t returnNullOnInvalidCurrent=kFALSE)
Definition: AliMagF.cxx:550
Int_t fInteg
Definition: AliMagF.h:100
Double_t GetFactorSol() const
Definition: AliMagF.cxx:528
Definition: AliMagF.cxx:69
BeamType_t GetBeamType() const
Definition: AliMagF.h:61
Double_t fSolenoid
Definition: AliMagF.h:96
Double_t fFactorDip
Definition: AliMagF.h:103
Double_t GetCurrentDip() const
Definition: AliMagF.h:56
void InitMachineField(BeamType_t btype, Double_t benergy, float a2z=1.0)
Definition: AliMagF.cxx:339
void GetTPCInt(const Double_t *xyz, Double_t *b) const
Definition: AliMagF.cxx:459
static const UShort_t fgkPolarityConvention
Definition: AliMagF.h:116
Definition: AliMagF.h:25
AliMagF & operator=(const AliMagF &src)
Definition: AliMagF.cxx:312
void GetTPCRatIntCyl(const Double_t *rphiz, Double_t *b) const
Definition: AliMagF.cxx:493
BMap_t fMapType
optional fast param
Definition: AliMagF.h:95
BeamType_t fBeamType
Definition: AliMagF.h:97
Double_t Max() const
Definition: AliMagF.h:64
const char * GetBeamTypeText() const
Definition: AliMagF.cxx:654
Double_t Factor() const
Definition: AliMagF.h:54
Bool_t fDipoleOFF
Definition: AliMagF.h:105
Double_t fFactorSol
Definition: AliMagF.h:102
AliMagFast * GetFastField() const
Definition: AliMagF.h:46
void MachineField(const Double_t *x, Double_t *b) const
Definition: AliMagF.cxx:367
Double_t GetCurrentSol() const
Definition: AliMagF.h:55
Double_t fMax
Definition: AliMagF.h:104
static Bool_t GetFastFieldDefault()
Definition: AliMagF.h:84
Double_t fBeamEnergy
Definition: AliMagF.h:98
Bool_t LoadParameterization()
Definition: AliMagF.cxx:256
static Int_t GetPolarityConvention()
Definition: AliMagF.h:76
Int_t Integ() const
Definition: AliMagF.h:65
Int_t fPrecInteg
Definition: AliMagF.h:101