]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliMagFCheb.h
Swapped the names AliMagFCheb and AliMagWrapCheb. The former should be used
[u/mrichter/AliRoot.git] / STEER / AliMagFCheb.h
index 157176254a694383be4a733fcecbbaba1128ec18..74e706fed8970ceffc9bf06c02591ed563b27a50 100644 (file)
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-/* $Id$ */
-
-
-// Author: ruben.shahoyan@cern.ch   20/03/2007
 //
-///////////////////////////////////////////////////////////////////////////////////
-//                                                                               //
-//  Wrapper for the set of mag.field parameterizations by Chebyshev polinomials  //
-//  To obtain the field in cartesian coordinates/components use                  //
-//    Field(float* xyz, float* bxyz);                                            //
-//  For cylindrical coordinates/components:                                      //
-//    FieldCyl(float* rphiz, float* brphiz)                                      //
-//                                                                               //
-//  For the moment only the solenoid part is parameterized in the volume defined //
-//  by R<500, -550<Z<550 cm                                                      //
-//                                                                               //
-//  The region R<423 cm,  -343.3<Z<481.3 for 30kA and -343.3<Z<481.3 for 12kA    //
-//  is parameterized using measured data while outside the Tosca calculation     //
-//  is used (matched to data on the boundary of the measurements)                //
-//                                                                               //
-//  If the querried point is outside the validity region no the return values    //
-//  for the field components are set to 0.                                       //
-//                                                                               //
-///////////////////////////////////////////////////////////////////////////////////
+// Interface between the AliMagWrapCheb and AliMagF: set of magnetic field data + Tosca 
+// parameterization by Chebyshev polynomials
+// 
+// Author: ruben.shahoyan@cern.ch
+//
 
+#include "AliMagFC.h"
+class AliMagWrapCheb;
 
-#include <TSystem.h>
-#include <TNamed.h>
-#include "AliCheb3D.h"
 
-class AliMagFCheb: public TNamed
+class AliMagFCheb : public AliMagFC
 {
- public:
-  AliMagFCheb()                                                  {Init0();}
-  AliMagFCheb(const char* inputFile);
-  ~AliMagFCheb();
-  //
-  void       AddParamSol(AliCheb3D* param);
-  void       AddParamDip(AliCheb3D* param);
-  void       BuildTableSol();
-  //
-  Int_t      GetNParamsSol()                              const {return fNParamsSol;}
-  Int_t      GetNSegZSol()                                const {return fNSegZSol;}
-  Int_t      GetNSegRSol(int iz)                          const {return iz<fNParamsSol ? fNSegRSol[iz]:0;}
-  Int_t      GetSegIDSol(int iz,int ir)                   const {return iz<fNParamsSol&&ir<fNSegRSol[iz] ? fSegZIdSol[iz]+ir:-1;}
-  //
-  Float_t    GetMinZSol()                                 const {return fMinZSol;}
-  Float_t    GetMaxZSol()                                 const {return fMaxZSol;}
-  Float_t    GetMaxRSol()                                 const {return fMaxRSol;}
-  AliCheb3D* GetParamSol(Int_t ipar)                      const {return (AliCheb3D*)fParamsSol->UncheckedAt(ipar);}
-  AliCheb3D* GetParamDip(Int_t ipar)                      const {return (AliCheb3D*)fParamsDip->UncheckedAt(ipar);}
-  //
-  void         LoadData(const char* inpfile);
-  //
-  virtual void Print(Option_t * = "")                     const;
-  //
-  virtual void Field(Float_t *xyz, Float_t *b)            const;
-  virtual void FieldCyl(Float_t *rphiz, Float_t *b)       const;
-  //
-  //
-#ifdef  _INC_CREATION_ALICHEB3D_                          // see AliCheb3D.h for explanation
-  void         SaveData(const char* outfile)              const;
-#endif
+public:
+  enum constants {k2kG, k4kG, k5kG};
+  AliMagFCheb();
+  AliMagFCheb(const char *name, const char *title, Int_t integ,
+             Float_t factor=1, Float_t fmax=15, Int_t map = k2kG,
+             Bool_t dipoleON = kTRUE,
+             const char* path="$(ALICE_ROOT)/data/maps/mfchebKGI_sym.root");
+  AliMagFCheb(const AliMagFCheb& maps);             
+  AliMagFCheb& operator=(const AliMagFCheb& maps);
+  virtual ~AliMagFCheb();
+  //
+  virtual void Field(const Float_t *x, Float_t *b)              const;
+  virtual void Field(const Double_t *x, Double_t *b)            const;
+  virtual void GetTPCInt(const Float_t *xyz, Float_t *b)        const;
+  virtual void GetTPCIntCyl(const Float_t *rphiz, Float_t *b)   const;
+  //
+  AliMagWrapCheb* GetMeasuredMap()                              const {return fMeasuredMap;}
+  void SetMeasuredMap(AliMagWrapCheb* parm);
+  virtual Float_t SolenoidField()                               const {return -Factor()*fSolenoid;}
   //
  protected:
-  void         Init0();
-  virtual void FieldCylSol(Float_t *rphiz, Float_t *b)    const;
-  //
- protected:
-  //
-  Int_t      fNParamsSol;            // Total number of parameterization pieces for Sol 
-  Int_t      fNSegZSol;              // Number of segments is Z
-  //
-  Int_t      fNParamsDip;            // Total number of parameterization pieces for dipole 
-  //
-  Float_t*   fSegZSol;               //[fNSegZSol]       upper boundaries of Z segments
-  Float_t*   fSegRSol;               //[fNParamsSol]     upper boundaries of R segments
-  //
-  Int_t*     fNSegRSol;              //[fNSegZSol]       number of R segments for each Z segment
-  Int_t*     fSegZIdSol;             //[fNSegZSol]       Id of the first R segment of each Z segment in the fSegRSol...
-  //
-  Float_t    fMinZSol;               // Min Z of Sol parameterization (in CYL. coordinates)
-  Float_t    fMaxZSol;               // Max Z of Sol parameterization (in CYL. coordinates)
-  Float_t    fMaxRSol;               // Max R of Sol parameterization (in CYL. coordinates)
-  //
-  TObjArray* fParamsSol;             // Parameterization pieces for Solenoid field
-  TObjArray* fParamsDip;             // Parameterization pieces for Dipole field
-  //
-  ClassDef(AliMagFCheb,1)            // Wrapper class for the set of Chebishev parameterizations of Alice mag.field
-  //
- };
-
+  AliMagWrapCheb* fMeasuredMap;     // Measured part of the field map
+  Float_t         fSolenoid;        // Solenoid field setting
+  //   
+  ClassDef(AliMagFCheb, 2)       // Class for all Alice MagField wrapper for measured data + Tosca parameterization
+};
 
-//__________________________________________________________________________________________
-inline void AliMagFCheb::FieldCyl(Float_t *rphiz, Float_t *b) const
-{
-  // compute field in Cylindircal coordinates
-  if (rphiz[2]<GetMinZSol() || rphiz[2]>GetMaxZSol() || rphiz[0]>GetMaxRSol()) {for (int i=3;i--;) b[i]=0; return;}
-  FieldCylSol(rphiz,b);
-}
 
 #endif