LCOV - code coverage report
Current view: top level - STEER/STEERBase - AliMagF.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 14 18 77.8 %
Date: 2016-06-14 17:26:59 Functions: 15 22 68.2 %

          Line data    Source code
       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                               */
       5             : 
       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             : //
      13             : 
      14             : //#include <TGeoGlobalMagField.h>
      15             : #include <TVirtualMagField.h>
      16             : class AliMagWrapCheb;
      17             : 
      18             : class AliMagF : public TVirtualMagField
      19             : {
      20             :  public:
      21             :   enum BMap_t      {k2kG, k5kG, k5kGUniform};
      22             :   enum BeamType_t  {kNoBeamField, kBeamTypepp, kBeamTypeAA, kBeamTypepA, kBeamTypeAp};
      23             :   enum PolarityConvention_t {kConvLHC,kConvDCS2008,kConvMap2005};
      24             :   enum             {kOverrideGRP=BIT(14)}; // don't recreate from GRP if set
      25             :   //
      26             :   AliMagF();
      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=15,const char* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
      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       GetTPCRatInt(const Double_t *xyz, Double_t *b)      const;
      37             :   void       GetTPCIntCyl(const Double_t *rphiz, Double_t *b)    const;
      38             :   void       GetTPCRatIntCyl(const Double_t *rphiz, Double_t *b) const;
      39             :   Double_t   GetBz(const Double_t *xyz)                          const;
      40             :   //
      41           0 :   AliMagWrapCheb* GetMeasuredMap()                              const {return fMeasuredMap;}
      42             :   //
      43             :   // former AliMagF methods or their aliases
      44             :   void         SetFactorSol(Float_t fc=1.);
      45             :   void         SetFactorDip(Float_t fc=1.);
      46             :   Double_t     GetFactorSol()                                   const;
      47             :   Double_t     GetFactorDip()                                   const;
      48           0 :   Double_t     Factor()                                         const {return GetFactorSol();}
      49          32 :   Double_t     GetCurrentSol()                                  const {return GetFactorSol()*(fMapType==k2kG ? 12000:30000);}
      50          32 :   Double_t     GetCurrentDip()                                  const {return GetFactorDip()*6000;}
      51     1163498 :   Bool_t       IsUniform()                                      const {return fMapType == k5kGUniform;}
      52             :   //
      53             :   void         MachineField(const Double_t  *x, Double_t *b)    const;
      54           0 :   BMap_t       GetMapType()                                     const {return fMapType;}
      55           6 :   BeamType_t   GetBeamType()                                    const {return fBeamType;}
      56             :   const char*  GetBeamTypeText()                                const;
      57           0 :   Double_t     GetBeamEnergy()                                  const {return fBeamEnergy;}
      58          44 :   Double_t     Max()                                            const {return fMax;}
      59          38 :   Int_t        Integ()                                          const {return fInteg;}
      60           8 :   Int_t        PrecInteg()                                      const {return fPrecInteg;}  
      61      911326 :   Double_t     SolenoidField()                                  const {return fFactorSol*fSolenoid;}
      62             :   //
      63          20 :   Char_t*      GetDataFileName()                                const {return (Char_t*)fParNames.GetName();}
      64          20 :   Char_t*      GetParamName()                                   const {return (Char_t*)fParNames.GetTitle();}
      65          10 :   void         SetDataFileName(const Char_t* nm)                      {fParNames.SetName(nm);}
      66          10 :   void         SetParamName(const Char_t* nm)                         {fParNames.SetTitle(nm);}
      67             :   virtual void Print(Option_t *opt)                             const;
      68             :   //
      69             :   Bool_t       LoadParameterization();
      70           8 :   static Int_t GetPolarityConvention()                                {return Int_t(fgkPolarityConvention);}
      71             :   static AliMagF* CreateFieldMap(Float_t l3Current=-30000., Float_t diCurrent=-6000., 
      72             :                                  Int_t convention=0, Bool_t uniform = kFALSE, 
      73             :                                  Float_t beamenergy=7000, const Char_t* btype="pp",
      74             :                                  const Char_t* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root",
      75             :                                  Bool_t returnNullOnInvalidCurrent = kFALSE);
      76             :   //
      77             :  protected:
      78             :   // not supposed to be changed during the run, set only at the initialization via constructor
      79             :   void         InitMachineField(BeamType_t btype, Double_t benergy);
      80             :   void         SetBeamType(BeamType_t type)                           {fBeamType = type;}
      81             :   void         SetBeamEnergy(Float_t energy)                          {fBeamEnergy = energy;}
      82             :   //
      83             :  protected:
      84             :   AliMagWrapCheb*  fMeasuredMap;     //! Measured part of the field map
      85             :   BMap_t           fMapType;         // field map type
      86             :   Double_t         fSolenoid;        // Solenoid field setting
      87             :   BeamType_t       fBeamType;        // Beam type: A-A (fBeamType=0) or p-p (fBeamType=1)
      88             :   Double_t         fBeamEnergy;      // Beam energy in GeV
      89             :   // 
      90             :   Int_t            fInteg;           // Default integration method as indicated in Geant
      91             :   Int_t            fPrecInteg;       // Alternative integration method, e.g. for higher precision
      92             :   Double_t         fFactorSol;       // Multiplicative factor for solenoid
      93             :   Double_t         fFactorDip;       // Multiplicative factor for dipole
      94             :   Double_t         fMax;             // Max Field as indicated in Geant
      95             :   Bool_t           fDipoleOFF;       // Dipole ON/OFF flag
      96             :   //
      97             :   Double_t         fQuadGradient;    // Gradient field for inner triplet quadrupoles
      98             :   Double_t         fDipoleField;     // Field value for D1 and D2 dipoles
      99             :   Double_t         fCCorrField;      // Side C 2nd compensator field
     100             :   Double_t         fACorr1Field;     // Side A 1st compensator field 
     101             :   Double_t         fACorr2Field;     // Side A 2nd compensator field
     102             :   //
     103             :   TNamed           fParNames;        // file and parameterization loadad
     104             :   //
     105             :   static const Double_t  fgkSol2DipZ;    // conventional Z of transition from L3 to Dipole field
     106             :   static const UShort_t  fgkPolarityConvention; // convention for the mapping of the curr.sign on main component sign
     107             :   //   
     108         234 :   ClassDef(AliMagF, 2)           // Class for all Alice MagField wrapper for measured data + Tosca parameterization
     109             : };
     110             : 
     111             : 
     112             : #endif

Generated by: LCOV version 1.11