X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FAliMagF.h;h=89a671ee4d92f5dfa1cf38d5f3056f077dc0d9ca;hb=b96c3aef7f7f315c41ce5174d704a2beca7b294d;hp=1665243df6e52c79a8d0d17a33148c8151bc54e2;hpb=972ca52f9e9826fa6d827eba700dfe15bf7ecf93;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/AliMagF.h b/STEER/AliMagF.h index 1665243df6e..89a671ee4d9 100644 --- a/STEER/AliMagF.h +++ b/STEER/AliMagF.h @@ -3,45 +3,106 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ -/* $Id$ */ +// +// Interface between the TVirtualMagField and AliMagWrapCheb: wrapper to +// the set of magnetic field data + Tosca parameterization by +// Chebyshev polynomials +// +// Author: ruben.shahoyan@cern.ch +// -//---------------------------------------------------------------------- -// Basic magnetic field class -// Used in all the detectors, and also in the traking classes -// Author: -//---------------------------------------------------------------------- +//#include +#include +class AliMagWrapCheb; -#include "TNamed.h" - -enum Field_t {kUndef=1, kConst=1, kConMesh=2, kDipoMap=3}; - -class AliMagF : public TNamed { - -public: +class AliMagF : public TVirtualMagField +{ + public: + enum BMap_t {k2kG, k5kG, k5kGUniform}; + enum BeamType_t {kNoBeamField, kBeamTypepp, kBeamTypeAA}; + enum PolarityConvention_t {kConvLHC,kConvDCS2008,kConvMap2005}; + enum {kOverrideGRP=BIT(14)}; // don't recreate from GRP if set + // AliMagF(); - AliMagF(const char *name, const char *title, Int_t integ, - Float_t factor = 1., Float_t fmax = 10.); - virtual ~AliMagF() {} - virtual void Field(Float_t *x, Float_t *b) const; - virtual Int_t Type() const {return fType;} - virtual Float_t Max() const {return fMax;} - virtual Int_t Map() const {return fMap;} - virtual Int_t Integ() const {return fInteg;} - virtual Int_t PrecInteg() const {return fPrecInteg;} - virtual Float_t Factor() const {return fFactor;} - virtual void ReadField() {} - virtual Float_t SolenoidField() const {return 2.;} - virtual void SetPrecInteg(Int_t integ) {fPrecInteg = integ;} - virtual void SetReadField(Bool_t flag = kTRUE) {fReadField = flag;} + AliMagF(const char *name, const char* title,Double_t factorSol=1., Double_t factorDip=1., + BMap_t maptype = k5kG, BeamType_t btype=kBeamTypepp, Double_t benergy=-1, + Int_t integ=2, Double_t fmax=10,const char* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); + AliMagF(const AliMagF& src); + AliMagF& operator=(const AliMagF& src); + virtual ~AliMagF(); + // + virtual void Field(const Double_t *x, Double_t *b); + void GetTPCInt(const Double_t *xyz, Double_t *b) const; + void GetTPCIntCyl(const Double_t *rphiz, Double_t *b) const; + Double_t GetBz(const Double_t *xyz) const; + // + AliMagWrapCheb* GetMeasuredMap() const {return fMeasuredMap;} + // + // former AliMagF methods or their aliases + void SetFactorSol(Float_t fc=1.); + void SetFactorDip(Float_t fc=1.); + Double_t GetFactorSol() const; + Double_t GetFactorDip() const; + Double_t Factor() const {return GetFactorSol();} + Double_t GetCurrentSol() const {return GetFactorSol()*(fMapType==k2kG ? 12000:30000);} + Double_t GetCurrentDip() const {return GetFactorDip()*6000;} + Bool_t IsUniform() const {return fMapType == k5kGUniform;} + // + void MachineField(const Double_t *x, Double_t *b) const; + BMap_t GetMapType() const {return fMapType;} + BeamType_t GetBeamType() const {return fBeamType;} + const char* GetBeamTypeText() const; + Double_t GetBeamEnergy() const {return fBeamEnergy;} + Double_t Max() const {return fMax;} + Int_t Integ() const {return fInteg;} + Int_t PrecInteg() const {return fPrecInteg;} + Double_t SolenoidField() const {return fFactorSol*fSolenoid;} + // + Char_t* GetDataFileName() const {return (Char_t*)fParNames.GetName();} + Char_t* GetParamName() const {return (Char_t*)fParNames.GetTitle();} + void SetDataFileName(const Char_t* nm) {fParNames.SetName(nm);} + void SetParamName(const Char_t* nm) {fParNames.SetTitle(nm);} + // + Bool_t LoadParameterization(); + static Int_t GetPolarityConvention() {return Int_t(fgkPolarityConvention);} + 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", + const Char_t* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root"); + // protected: - Int_t fMap; // Field Map identifier - Int_t fType; // Mag Field type - Int_t fInteg; // Default integration method as indicated in Geant - Int_t fPrecInteg; // Alternative integration method, e.g. for higher precision - Float_t fFactor; // Multiplicative factor - Float_t fMax; // Max Field as indicated in Geant - Bool_t fReadField; // Flag for reading the field from file (if available) - ClassDef(AliMagF,5) //Base class for all Alice MagField + // not supposed to be changed during the run, set only at the initialization via constructor + void InitMachineField(BeamType_t btype, Double_t benergy); + void SetBeamType(BeamType_t type) {fBeamType = type;} + void SetBeamEnergy(Float_t energy) {fBeamEnergy = energy;} + // + protected: + AliMagWrapCheb* fMeasuredMap; //! Measured part of the field map + BMap_t fMapType; // field map type + Double_t fSolenoid; // Solenoid field setting + BeamType_t fBeamType; // Beam type: A-A (fBeamType=0) or p-p (fBeamType=1) + Double_t fBeamEnergy; // Beam energy in GeV + // + Int_t fInteg; // Default integration method as indicated in Geant + Int_t fPrecInteg; // Alternative integration method, e.g. for higher precision + Double_t fFactorSol; // Multiplicative factor for solenoid + Double_t fFactorDip; // Multiplicative factor for dipole + Double_t fMax; // Max Field as indicated in Geant + Bool_t fDipoleOFF; // Dipole ON/OFF flag + // + Double_t fQuadGradient; // Gradient field for inner triplet quadrupoles + Double_t fDipoleField; // Field value for D1 and D2 dipoles + Double_t fCCorrField; // Side C 2nd compensator field + Double_t fACorr1Field; // Side A 1st compensator field + Double_t fACorr2Field; // Side A 2nd compensator field + // + TNamed fParNames; // file and parameterization loadad + // + static const Double_t fgkSol2DipZ; // conventional Z of transition from L3 to Dipole field + static const UShort_t fgkPolarityConvention; // convention for the mapping of the curr.sign on main component sign + // + ClassDef(AliMagF, 2) // Class for all Alice MagField wrapper for measured data + Tosca parameterization }; + #endif