]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliMagFCheb.h
Quick fix with dummy methods awaiting full implementation by Ruben.
[u/mrichter/AliRoot.git] / STEER / AliMagFCheb.h
1 #ifndef ALIMAGFCHEB_H
2 #define ALIMAGFCHEB_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8
9 // Author: ruben.shahoyan@cern.ch   20/03/2007
10 //
11 ///////////////////////////////////////////////////////////////////////////////////
12 //                                                                               //
13 //  Wrapper for the set of mag.field parameterizations by Chebyshev polinomials  //
14 //  To obtain the field in cartesian coordinates/components use                  //
15 //    Field(float* xyz, float* bxyz);                                            //
16 //  For cylindrical coordinates/components:                                      //
17 //    FieldCyl(float* rphiz, float* brphiz)                                      //
18 //                                                                               //
19 //  For the moment only the solenoid part is parameterized in the volume defined //
20 //  by R<500, -550<Z<550 cm                                                      //
21 //                                                                               //
22 //  The region R<423 cm,  -343.3<Z<481.3 for 30kA and -343.3<Z<481.3 for 12kA    //
23 //  is parameterized using measured data while outside the Tosca calculation     //
24 //  is used (matched to data on the boundary of the measurements)                //
25 //                                                                               //
26 //  If the querried point is outside the validity region no the return values    //
27 //  for the field components are set to 0.                                       //
28 //                                                                               //
29 ///////////////////////////////////////////////////////////////////////////////////
30
31
32 #include <TSystem.h>
33 #include <TNamed.h>
34 #include "AliCheb3D.h"
35 #include "AliCheb3DCalc.h"
36
37 class AliMagFCheb: public TNamed
38 {
39  public:
40     AliMagFCheb();
41     AliMagFCheb(const char* inputFile);
42     AliMagFCheb(const AliMagFCheb &src);
43     AliMagFCheb& operator= (const AliMagFCheb &rhs);
44     
45    ~AliMagFCheb();
46   //
47   void       AddParamSol(AliCheb3D* param);
48   void       AddParamDip(AliCheb3D* param);
49   void       BuildTableSol();
50   //
51   Int_t      GetNParamsSol()                              const {return fNParamsSol;}
52   Int_t      GetNSegZSol()                                const {return fNSegZSol;}
53   Int_t      GetNSegRSol(int iz)                          const {return iz<fNParamsSol ? fNSegRSol[iz]:0;}
54   Int_t      GetSegIDSol(int iz,int ir)                   const {return iz<fNParamsSol&&ir<fNSegRSol[iz] ? fSegZIdSol[iz]+ir:-1;}
55   //
56   Float_t    GetMinZSol()                                 const {return fMinZSol;}
57   Float_t    GetMaxZSol()                                 const {return fMaxZSol;}
58   Float_t    GetMaxRSol()                                 const {return fMaxRSol;}
59   AliCheb3D* GetParamSol(Int_t ipar)                      const {return (AliCheb3D*)fParamsSol->UncheckedAt(ipar);}
60   AliCheb3D* GetParamDip(Int_t ipar)                      const {return (AliCheb3D*)fParamsDip->UncheckedAt(ipar);}
61   //
62   void         LoadData(const char* inpfile);
63   //
64   virtual void Print(Option_t * = "")                     const;
65   //
66   virtual void Field(Float_t *xyz, Float_t *b)            const;
67   virtual void FieldCyl(Float_t *rphiz, Float_t *b)       const;
68   virtual void GetTPCInt(Float_t */*xyz*/,     Float_t */*b*/)    const {;}
69   virtual void GetTPCIntCyl(Float_t */*rphiz*/, Float_t */*b*/)   const {;}
70   //
71   //
72   //
73 #ifdef  _INC_CREATION_ALICHEB3D_                          // see AliCheb3D.h for explanation
74   void         SaveData(const char* outfile)              const;
75 #endif
76   //
77  protected:
78   void         Init0();
79   virtual void FieldCylSol(Float_t *rphiz, Float_t *b)    const;
80   //
81  protected:
82   //
83   Int_t      fNParamsSol;            // Total number of parameterization pieces for Sol 
84   Int_t      fNSegZSol;              // Number of segments is Z
85   //
86   Int_t      fNParamsDip;            // Total number of parameterization pieces for dipole 
87   //
88   Float_t*   fSegZSol;               //[fNSegZSol]       upper boundaries of Z segments
89   Float_t*   fSegRSol;               //[fNParamsSol]     upper boundaries of R segments
90   //
91   Int_t*     fNSegRSol;              //[fNSegZSol]       number of R segments for each Z segment
92   Int_t*     fSegZIdSol;             //[fNSegZSol]       Id of the first R segment of each Z segment in the fSegRSol...
93   //
94   Float_t    fMinZSol;               // Min Z of Sol parameterization (in CYL. coordinates)
95   Float_t    fMaxZSol;               // Max Z of Sol parameterization (in CYL. coordinates)
96   Float_t    fMaxRSol;               // Max R of Sol parameterization (in CYL. coordinates)
97   //
98   TObjArray* fParamsSol;             // Parameterization pieces for Solenoid field
99   TObjArray* fParamsDip;             // Parameterization pieces for Dipole field
100   //
101   ClassDef(AliMagFCheb,1)            // Wrapper class for the set of Chebishev parameterizations of Alice mag.field
102   //
103  };
104
105
106 //__________________________________________________________________________________________
107 inline void AliMagFCheb::FieldCyl(Float_t *rphiz, Float_t *b) const
108 {
109   // compute field in Cylindircal coordinates
110   if (rphiz[2]<GetMinZSol() || rphiz[2]>GetMaxZSol() || rphiz[0]>GetMaxRSol()) {for (int i=3;i--;) b[i]=0; return;}
111   FieldCylSol(rphiz,b);
112 }
113
114 #endif