+ //
+ Int_t fNParamsSol; // Total number of parameterization pieces for solenoid
+ Int_t fNZSegSol; // number of distinct Z segments in Solenoid
+ Int_t fNPSegSol; // number of distinct P segments in Solenoid
+ Int_t fNRSegSol; // number of distinct R segments in Solenoid
+ Float_t* fSegZSol; //[fNZSegSol] coordinates of distinct Z segments in Solenoid
+ Float_t* fSegPSol; //[fNPSegSol] coordinated of P segments for each Zsegment in Solenoid
+ Float_t* fSegRSol; //[fNRSegSol] coordinated of R segments for each Psegment in Solenoid
+ Int_t* fBegSegPSol; //[fNPSegSol] beginning of P segments array for each Z segment
+ Int_t* fNSegPSol; //[fNZSegSol] number of P segments for each Z segment
+ Int_t* fBegSegRSol; //[fNPSegSol] beginning of R segments array for each P segment
+ Int_t* fNSegRSol; //[fNPSegSol] number of R segments for each P segment
+ Int_t* fSegIDSol; //[fNRSegSol] ID of the solenoid parameterization for given RPZ segment
+ Float_t fMinZSol; // Min Z of Solenoid parameterization
+ Float_t fMaxZSol; // Max Z of Solenoid parameterization
+ TObjArray* fParamsSol; // Parameterization pieces for Solenoid field
+ Float_t fMaxRSol; // max raduis for Solenoid field
+ //
+ Int_t fNParamsTPC; // Total number of parameterization pieces for TPCint
+ Int_t fNZSegTPC; // number of distinct Z segments in TPCint
+ Int_t fNPSegTPC; // number of distinct P segments in TPCint
+ Int_t fNRSegTPC; // number of distinct R segments in TPCint
+ Float_t* fSegZTPC; //[fNZSegTPC] coordinates of distinct Z segments in TPCint
+ Float_t* fSegPTPC; //[fNPSegTPC] coordinated of P segments for each Zsegment in TPCint
+ Float_t* fSegRTPC; //[fNRSegTPC] coordinated of R segments for each Psegment in TPCint
+ Int_t* fBegSegPTPC; //[fNPSegTPC] beginning of P segments array for each Z segment
+ Int_t* fNSegPTPC; //[fNZSegTPC] number of P segments for each Z segment
+ Int_t* fBegSegRTPC; //[fNPSegTPC] beginning of R segments array for each P segment
+ Int_t* fNSegRTPC; //[fNPSegTPC] number of R segments for each P segment
+ Int_t* fSegIDTPC; //[fNRSegTPC] ID of the TPCint parameterization for given RPZ segment
+ Float_t fMinZTPC; // Min Z of TPCint parameterization
+ Float_t fMaxZTPC; // Max Z of TPCint parameterization
+ TObjArray* fParamsTPC; // Parameterization pieces for TPCint field
+ Float_t fMaxRTPC; // max raduis for Solenoid field integral in TPC
+ //
+ Int_t fNParamsDip; // Total number of parameterization pieces for dipole
+ Int_t fNZSegDip; // number of distinct Z segments in Dipole
+ Int_t fNYSegDip; // number of distinct Y segments in Dipole
+ Int_t fNXSegDip; // number of distinct X segments in Dipole
+ Float_t* fSegZDip; //[fNZSegDip] coordinates of distinct Z segments in Dipole
+ Float_t* fSegYDip; //[fNYSegDip] coordinated of Y segments for each Zsegment in Dipole
+ Float_t* fSegXDip; //[fNXSegDip] coordinated of X segments for each Ysegment in Dipole
+ Int_t* fBegSegYDip; //[fNZSegDip] beginning of Y segments array for each Z segment
+ Int_t* fNSegYDip; //[fNZSegDip] number of Y segments for each Z segment
+ Int_t* fBegSegXDip; //[fNYSegDip] beginning of X segments array for each Y segment
+ Int_t* fNSegXDip; //[fNYSegDip] number of X segments for each Y segment
+ Int_t* fSegIDDip; //[fNXSegDip] ID of the dipole parameterization for given XYZ segment
+ Float_t fMinZDip; // Min Z of Dipole parameterization
+ Float_t fMaxZDip; // Max Z of Dipole parameterization
+ TObjArray* fParamsDip; // Parameterization pieces for Dipole field
+ //
+ ClassDef(AliMagWrapCheb,5) // Wrapper class for the set of Chebishev parameterizations of Alice mag.field
+ //
+ };
+
+
+//__________________________________________________________________________________________
+inline void AliMagWrapCheb::FieldCyl(const Double_t *rphiz, Double_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;}
+ b[0] = b[1] = b[2] = 0;
+ FieldCylSol(rphiz,b);
+}
+
+//__________________________________________________________________________________________________
+inline void AliMagWrapCheb::CylToCartCylB(const Double_t *rphiz, const Double_t *brphiz,Double_t *bxyz)
+{
+ // convert field in cylindrical coordinates to cartesian system, point is in cyl.system
+ Double_t btr = TMath::Sqrt(brphiz[0]*brphiz[0]+brphiz[1]*brphiz[1]);
+ Double_t psiPLUSphi = TMath::ATan2(brphiz[1],brphiz[0]) + rphiz[1];
+ bxyz[0] = btr*TMath::Cos(psiPLUSphi);
+ bxyz[1] = btr*TMath::Sin(psiPLUSphi);
+ bxyz[2] = brphiz[2];
+ //
+}
+
+//__________________________________________________________________________________________________
+inline void AliMagWrapCheb::CylToCartCartB(const Double_t* xyz, const Double_t *brphiz, Double_t *bxyz)
+{
+ // convert field in cylindrical coordinates to cartesian system, point is in cart.system
+ Double_t btr = TMath::Sqrt(brphiz[0]*brphiz[0]+brphiz[1]*brphiz[1]);
+ Double_t phiPLUSpsi = TMath::ATan2(xyz[1],xyz[0]) + TMath::ATan2(brphiz[1],brphiz[0]);
+ bxyz[0] = btr*TMath::Cos(phiPLUSpsi);
+ bxyz[1] = btr*TMath::Sin(phiPLUSpsi);
+ bxyz[2] = brphiz[2];
+ //
+}
+
+//__________________________________________________________________________________________________
+inline void AliMagWrapCheb::CartToCylCartB(const Double_t *xyz, const Double_t *bxyz, Double_t *brphiz)
+{
+ // convert field in cylindrical coordinates to cartesian system, poin is in cart.system
+ Double_t btr = TMath::Sqrt(bxyz[0]*bxyz[0]+bxyz[1]*bxyz[1]);
+ Double_t psiMINphi = TMath::ATan2(bxyz[1],bxyz[0]) - TMath::ATan2(xyz[1],xyz[0]);
+ //
+ brphiz[0] = btr*TMath::Cos(psiMINphi);
+ brphiz[1] = btr*TMath::Sin(psiMINphi);
+ brphiz[2] = bxyz[2];
+ //
+}