]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliMagF.h
Technical fixes + coding conventions
[u/mrichter/AliRoot.git] / STEER / AliMagF.h
index dd5ecc4032ac050e6175a84e0297fda62932e80f..6fa0f6c35d4be1e35f1786f8201db09ddfd4c4ea 100644 (file)
@@ -19,14 +19,14 @@ class AliMagF : public TVirtualMagField
 {
  public:
   enum BMap_t      {k2kG, k5kG, k5kGUniform};
-  enum BeamType_t  {kBeamTypeAA, kBeamTypepp, kNoBeamField};
+  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, 
-         Double_t factorSol=1., Double_t factorDip=1., 
-         Double_t fmax=15, BMap_t maptype = k5kG,
-         const char* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root",
-         BeamType_t btype=kBeamTypepp, Double_t benergy=7000., Bool_t compensator=kFALSE);
+  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();
@@ -39,22 +39,24 @@ class AliMagF : public TVirtualMagField
   AliMagWrapCheb* GetMeasuredMap()                              const {return fMeasuredMap;}
   //
   // former AliMagF methods or their aliases
-  void         SetFactorSol(Float_t fc=1.)                            {fFactorSol = fc;}
-  void         SetFactorDip(Float_t fc=1.)                            {fFactorDip = fc;}
-  Double_t     GetFactorSol()                                   const {return fFactorSol;}
-  Double_t     GetFactorDip()                                   const {return fFactorSol;}
+  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;}
-  Bool_t       GetCompensator()                                 const {return fCompensator;}
   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;}
+  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();}
@@ -62,13 +64,17 @@ class AliMagF : public TVirtualMagField
   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 sqrts=14000, const Char_t* btype="pp",
+                                const Char_t* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
   //
  protected:
   // 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;}
-  void         SetCompensatorMagnet(Bool_t flag)                      {fCompensator = flag;}
   //
  protected:
   AliMagWrapCheb*  fMeasuredMap;     //! Measured part of the field map
@@ -76,7 +82,6 @@ class AliMagF : public TVirtualMagField
   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
-  Bool_t           fCompensator;     // Flag for compensator magnetic field (kTrue -> ON)
   // 
   Int_t            fInteg;           // Default integration method as indicated in Geant
   Int_t            fPrecInteg;       // Alternative integration method, e.g. for higher precision
@@ -93,11 +98,10 @@ class AliMagF : public TVirtualMagField
   //
   TNamed           fParNames;        // file and parameterization loadad
   //
-  static const Double_t  fgkSol2DipZ;    // conventional Z of transition from L3 to Dipole field 
-  static const Double_t  fgkBMachineZ1;  // Min Z of the LHC mag field range (to be checked?)
-  static const Double_t  fgkBMachineZ2;  // Max Z of the LHC mag field range
+  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, 1)           // Class for all Alice MagField wrapper for measured data + Tosca parameterization
+  ClassDef(AliMagF, 2)           // Class for all Alice MagField wrapper for measured data + Tosca parameterization
 };