]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliMagF.h
AOD data classes moved from PWG4 to STEER (Gustavo Conesa)
[u/mrichter/AliRoot.git] / STEER / AliMagF.h
CommitLineData
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>
16class AliMagWrapCheb;
0742d588 17
db83d72f 18class AliMagF : public TVirtualMagField
19{
20 public:
21 enum BMap_t {k2kG, k5kG, k5kGUniform};
33fe5eb1 22 enum BeamType_t {kNoBeamField, kBeamTypepp, kBeamTypeAA};
99c7d495 23 enum PolarityConvention_t {kConvLHC,kConvDCS2008,kConvMap2005};
5a004fb4 24 enum {kOverrideGRP=BIT(14)}; // don't recreate from GRP if set
db83d72f 25 //
e2afb3b6 26 AliMagF();
02233f2b 27 AliMagF(const char *name, const char* title,Double_t factorSol=1., Double_t factorDip=1.,
28 BMap_t maptype = k5kG, BeamType_t btype=kBeamTypepp, Double_t benergy=-1,
29 Int_t integ=2, Double_t fmax=10,const char* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
db83d72f 30 AliMagF(const AliMagF& src);
31 AliMagF& operator=(const AliMagF& src);
32 virtual ~AliMagF();
33 //
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;
38 //
39 AliMagWrapCheb* GetMeasuredMap() const {return fMeasuredMap;}
40 //
41 // former AliMagF methods or their aliases
1dd3d90e 42 void SetFactorSol(Float_t fc=1.);
43 void SetFactorDip(Float_t fc=1.);
44 Double_t GetFactorSol() const;
45 Double_t GetFactorDip() const;
db83d72f 46 Double_t Factor() const {return GetFactorSol();}
33fe5eb1 47 Double_t GetCurrentSol() const {return GetFactorSol()*(fMapType==k2kG ? 12000:30000);}
48 Double_t GetCurrentDip() const {return GetFactorDip()*6000;}
db83d72f 49 Bool_t IsUniform() const {return fMapType == k5kGUniform;}
50 //
51 void MachineField(const Double_t *x, Double_t *b) const;
52 BMap_t GetMapType() const {return fMapType;}
db83d72f 53 BeamType_t GetBeamType() const {return fBeamType;}
33fe5eb1 54 const char* GetBeamTypeText() const;
db83d72f 55 Double_t GetBeamEnergy() const {return fBeamEnergy;}
56 Double_t Max() const {return fMax;}
57 Int_t Integ() const {return fInteg;}
58 Int_t PrecInteg() const {return fPrecInteg;}
f04e7f5f 59 Double_t SolenoidField() const {return fFactorSol*fSolenoid;}
db83d72f 60 //
61 Char_t* GetDataFileName() const {return (Char_t*)fParNames.GetName();}
62 Char_t* GetParamName() const {return (Char_t*)fParNames.GetTitle();}
63 void SetDataFileName(const Char_t* nm) {fParNames.SetName(nm);}
64 void SetParamName(const Char_t* nm) {fParNames.SetTitle(nm);}
65 //
66 Bool_t LoadParameterization();
1dd3d90e 67 static Int_t GetPolarityConvention() {return Int_t(fgkPolarityConvention);}
33fe5eb1 68 static AliMagF* CreateFieldMap(Float_t l3Current=-30000., Float_t diCurrent=-6000.,
69 Int_t convention=0, Bool_t uniform = kFALSE,
02233f2b 70 Float_t sqrts=14000, const Char_t* btype="pp",
33fe5eb1 71 const Char_t* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
db83d72f 72 //
a0201063 73 protected:
db83d72f 74 // not supposed to be changed during the run, set only at the initialization via constructor
75 void InitMachineField(BeamType_t btype, Double_t benergy);
76 void SetBeamType(BeamType_t type) {fBeamType = type;}
77 void SetBeamEnergy(Float_t energy) {fBeamEnergy = energy;}
db83d72f 78 //
79 protected:
80 AliMagWrapCheb* fMeasuredMap; //! Measured part of the field map
81 BMap_t fMapType; // field map type
82 Double_t fSolenoid; // Solenoid field setting
83 BeamType_t fBeamType; // Beam type: A-A (fBeamType=0) or p-p (fBeamType=1)
84 Double_t fBeamEnergy; // Beam energy in GeV
db83d72f 85 //
86 Int_t fInteg; // Default integration method as indicated in Geant
87 Int_t fPrecInteg; // Alternative integration method, e.g. for higher precision
88 Double_t fFactorSol; // Multiplicative factor for solenoid
89 Double_t fFactorDip; // Multiplicative factor for dipole
90 Double_t fMax; // Max Field as indicated in Geant
91 Bool_t fDipoleOFF; // Dipole ON/OFF flag
92 //
93 Double_t fQuadGradient; // Gradient field for inner triplet quadrupoles
94 Double_t fDipoleField; // Field value for D1 and D2 dipoles
95 Double_t fCCorrField; // Side C 2nd compensator field
96 Double_t fACorr1Field; // Side A 1st compensator field
97 Double_t fACorr2Field; // Side A 2nd compensator field
98 //
99 TNamed fParNames; // file and parameterization loadad
100 //
1dd3d90e 101 static const Double_t fgkSol2DipZ; // conventional Z of transition from L3 to Dipole field
102 static const UShort_t fgkPolarityConvention; // convention for the mapping of the curr.sign on main component sign
db83d72f 103 //
9251fceb 104 ClassDef(AliMagF, 2) // Class for all Alice MagField wrapper for measured data + Tosca parameterization
fe4da5cc 105};
7a15f6b8 106
db83d72f 107
fe4da5cc 108#endif