]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliMagFDM.cxx
Geometry builder classes moved from base to sim.
[u/mrichter/AliRoot.git] / STEER / AliMagFDM.cxx
CommitLineData
aee8290b 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
acd84897 16/* $Id$ */
aee8290b 17
116cbefd 18//-------------------------------------------------------------------------
116cbefd 19// Field with Magnetic Field map
5d8718b8 20// Used by AliRun class
21// Author:
116cbefd 22//-------------------------------------------------------------------------
23
aee8290b 24#include "TSystem.h"
e2afb3b6 25
594d8990 26#include "AliLog.h"
e2afb3b6 27#include "AliMagFDM.h"
aee8290b 28
29ClassImp(AliMagFDM)
30
e2afb3b6 31//_______________________________________________________________________
32AliMagFDM::AliMagFDM():
33 fSolenoid(0),
34 fInd(0),
35 fZmin(0),
36 fZmax(0),
37 fYmax(0),
38 fYmin(0),
39 fZpmx(0),
40 fZpmn(0),
41 fRmax(0),
42 fRmin(0),
43 fXdel(0),
44 fYdel(0),
45 fZdel(0),
46 fRdel(0),
47 fPhid(0),
48 fZpdl(0),
49 fCx1(0),
50 fCx2(0),
51 fAx1(0),
52 fAx2(0),
53 fXl(0),
54 fYl(0),
55 fZl(0),
56 fRn(0),
57 fPhin(0),
58 fZpl(0)
59{
60 //
61 // Default constructor for the Dipole field
62 //
63}
64
65//_______________________________________________________________________
d0f1ee3b 66AliMagFDM::AliMagFDM(const char *name, const char *title, Int_t integ,
67 Float_t factor, Float_t fmax):
57754f18 68 AliMagFC(name,title,integ,factor,fmax),
e2afb3b6 69 fSolenoid(0),
70 fInd(0),
71 fZmin(0),
72 fZmax(0),
73 fYmax(0),
74 fYmin(0),
75 fZpmx(0),
76 fZpmn(0),
77 fRmax(0),
78 fRmin(0),
79 fXdel(0),
80 fYdel(0),
81 fZdel(0),
82 fRdel(0),
83 fPhid(0),
84 fZpdl(0),
85 fCx1(0),
86 fCx2(0),
87 fAx1(0),
88 fAx2(0),
89 fXl(0),
90 fYl(0),
91 fZl(0),
92 fRn(0),
93 fPhin(0),
94 fZpl(0)
aee8290b 95{
ef42d733 96 //
97 // Standard constructor for the Dipole field
98 //
aee8290b 99 fType = kDipoMap;
d8408e76 100 fMap = 3;
4cc8933f 101 SetSolenoidField();
d8408e76 102
594d8990 103 AliDebug(1, Form(
104 "Field Map for Muon Arm from IP till muon filter %s created: map= %d, integ= %d, factor= %f, file=%s",
105 fName.Data(), fMap ,integ,factor,fTitle.Data()));
e678332c 106
aee8290b 107}
108
e2afb3b6 109//_______________________________________________________________________
6f3038e9 110void AliMagFDM::Field(Float_t *xfi, Float_t *b) const
aee8290b 111{
112 //
113 // Main routine to compute the field in a point
114 //
e2afb3b6 115 const Double_t keps=0.1E-06;
116cbefd 116 const Double_t kPI2=2.*TMath::Pi();
e2afb3b6 117 const Double_t kone=1;
118
119 const Int_t kiip=33;
120 const Int_t kmiip=0;
121 const Int_t kliip=0;
122
123 const Int_t kiic=0;
124 const Int_t kmiic=0;
125 const Int_t kliic=0;
126
127 const Double_t kfZbg=502.92; // Start of Map using in z
128 const Double_t kfZL3=600; // Beginning of L3 door in z
aee8290b 129
130 Double_t x[3];
131 Double_t xL3[3];
132 Double_t bint[3];
133
134 Double_t r0;
e2afb3b6 135 Int_t iKvar,jb;
aee8290b 136
137 Double_t zp1, zp2,xp1,xp2,yp1,yp2;
138 Double_t zz1, zz2,yy1,yy2,x2,x1;
139
140// --- start the map fiel from z = 502.92 cm ---
57754f18 141//
142// This map has been calculated in a coordinate system in which the muon spectrometer sits at z > 0
143// Transfor correspondingly.
aee8290b 144
57754f18 145 x[0] = - xfi[0];
146 x[1] = xfi[1];
147 x[2] = - xfi[2];
e678332c 148 b[0]=b[1]=b[2]=0;
57754f18 149//
aee8290b 150 // printf("x[0] %f,x[1] %f,x[2] %f\n",x[0],x[1],x[2]);
151
152 Double_t rr=TMath::Sqrt(x[0]*x[0]+x[1]*x[1]);
153 r0=rr/100;
154 Double_t rPmax;
803c9752 155 rPmax=fRmax;
156 if ( (-700<x[2] && x[2]<=kfZbg &&
aee8290b 157 (x[0]*x[0]+(x[1]+30)*(x[1]+30))< 560*560)
803c9752 158 || (kfZbg<x[2] && x[2]<=kfZL3 && (rr>rPmax*100 && rr< 560)) )
aee8290b 159 {
803c9752 160 b[0]=b[1]=0;
4cc8933f 161 b[2]=fSolenoid;
aee8290b 162 }
163
164 xL3[0]=x[0]/100;
165 xL3[1]=(x[1]+30)/100;
166 xL3[2]=x[2]/100;
803c9752 167
aee8290b 168
803c9752 169 if (TMath::Abs(xL3[0])<=0.1E-06) xL3[0]=TMath::Sign(0.1E-05,xL3[0]);
170 if (TMath::Abs(xL3[1])<=0.1E-06) xL3[1]=TMath::Sign(0.1E-05,xL3[1]);
171
172 Double_t xminn=xL3[2]*fAx1+fCx1;
173 Double_t xmaxx=xL3[2]*fAx2+fCx2;
aee8290b 174 Double_t zCmin,zCmax,yCmin,yCmax;
175
803c9752 176 zCmin=fZmin;
177 zCmax=fZmax;
178 yCmin=fYmin;
179 yCmax=fYmax;
803c9752 180if ((kfZbg/100<xL3[2] && xL3[2]<=zCmin && r0<=rPmax) || ((zCmin<xL3[2] && xL3[2] <= zCmax ) && (yCmin<xL3[1] && xL3[1]<= yCmax) && (xminn<xL3[0] && xL3[0] <= xmaxx)))
aee8290b 181 {
182 if(fMap==3)
183 {
803c9752 184 if (kfZbg/100<xL3[2] && xL3[2]<=zCmin && r0<=rPmax)
aee8290b 185 {
186 //--------------------- Polar part ----------------------
187
188 Double_t yyp,ph0;
189 Int_t kp0, lp0, mp0;
190 Int_t kpi,lpi,mpi;
191 Double_t alp1,alp2,alp3;
192 Double_t zpz,rp,fip,cphi;
193
194 kpi=kiip;
195 lpi=kliip;
196 mpi=kmiip;
197
198 zpz=xL3[2];
e678332c 199 kp0=FZ(zpz, fZp ,fZpdl,kpi,fZpl) ;
200 zp2=(zpz-fZp[kp0])/(fZp[kp0+1]-fZp[kp0]);
201 zp1= kone-zp2;
aee8290b 202 yyp=xL3[1]- 0.3;
e678332c 203 cphi=TMath::Abs(yyp/r0);
204 Int_t kcphi=0;
205 if (cphi > kone) {
594d8990 206 AliDebug(2,Form("xL3[0] %e, xL3[1] %e, xL3[2] %e, yyp %e, r0 %e, cphi %e",xL3[0],xL3[1],xL3[2],yyp,r0,cphi));
e678332c 207 cphi =kone;
208 kcphi=777;
209 }
aee8290b 210 ph0=TMath::ACos(cphi);
116cbefd 211 if (xL3[0] < 0 && yyp > 0 ) {ph0=kPI2/2 - ph0;}
212 if (xL3[0] < 0 && yyp < 0 ) {ph0=kPI2/2 + ph0;}
213 if (xL3[0] > 0 && yyp < 0 ) {ph0=kPI2 - ph0;}
214 if (ph0 > kPI2) { ph0=ph0 - kPI2;}
e678332c 215 if (kcphi==777) {
594d8990 216 AliDebug(2,Form("xL3[0] %e, xL3[1] %e, xL3[2] %e, yyp %e, r0 %e, ph0 %e",xL3[0],xL3[1],xL3[2],yyp,r0,ph0));
e678332c 217 }
218 fip=ph0;
219 mp0=FZ(fip,fPhi,fPhid ,mpi,fPhin);
220 xp2=(fip-fPhi[mp0])/(fPhi[mp0+1]-fPhi[mp0]);
221 xp1=kone-xp2;
aee8290b 222
223 Double_t rDel;
803c9752 224 rDel=fRdel;
aee8290b 225
803c9752 226 if (r0<= fRdel)
aee8290b 227 {
228
229 if(r0< keps)
230 {
231
803c9752 232 bint[0]=(zp1*fBpx[kp0][0][0] + zp2*fBpx[kp0+1][0][0])*10;
233 bint[1]=(zp1*fBpy[kp0][0][0] + zp2*fBpy[kp0+1][0][0])*10;
234 bint[2]=(zp1*fBpz[kp0][0][0] + zp2*fBpz[kp0+1][0][0])*10;
aee8290b 235
803c9752 236 } else {
aee8290b 237
803c9752 238 alp2= fB[0][0][mp0]*yyp + fB[0][1][mp0]*xL3[0];
239 alp3= fB[1][0][mp0]*yyp + fB[1][1][mp0]*xL3[0];
aee8290b 240 alp1= kone - alp2 - alp3;
241
242 for (jb=0; jb<3 ; jb++)
803c9752 243 {
244 iKvar=jb;
e678332c 245 bint[jb] = Ba(iKvar,zp1,zp2,alp1,alp2,alp3, kp0,mp0)*10 ;
803c9752 246 }
247 } // end of keps <=r0
aee8290b 248 }
249 else
250 {
251 rp=r0;
252
e678332c 253 lp0=FZ(rp,fR ,fRdel,lpi,fRn);
254 yp2=(rp-fR[lp0])/(fR[lp0+1]-fR[lp0]);
255 yp1=kone-yp2;
aee8290b 256
257 for (jb=0; jb<3 ; jb++)
258 {
259 iKvar=jb;
e678332c 260 bint[jb] = Bb(zp1,zp2,yp1,yp2,xp1,xp2,iKvar,kp0,lp0,mp0)*10 ;
aee8290b 261 }
262 }
263
57754f18 264 b[0]=-bint[0];
aee8290b 265 b[1]=bint[1];
57754f18 266 b[2]=-bint[2];
aee8290b 267
aee8290b 268 }
269 else
270 {
271 //-------------- Cartensian part ------------------
272
273 Double_t zzc,yyc;
274 Int_t k0, l0,m0;
275 Double_t xx1, xx2,dx, xxx ,xXl;
276 Int_t kci,mci,lci;
277
278 kci=kiic;
279 lci=kliic;
280 mci=kmiic;
281
803c9752 282 xx1 = fAx1*xL3[2] + fCx1;
283 xx2 = fAx2*xL3[2] + fCx2;
aee8290b 284
285 zzc=xL3[2];
e678332c 286 k0=FZ(zzc, fZc ,fZdel, kci, fZl);
287 zz2=(zzc-fZc[k0])/(fZc[k0+1]-fZc[k0]);
288 zz1=kone - zz2;;
aee8290b 289
290 yyc=xL3[1];
e678332c 291 l0=FZ(yyc, fY , fYdel,lci,fYl);
292 yy2=(yyc-fY[l0])/(fY[l0+1]-fY[l0]);;
293 yy1=kone - yy2;
803c9752 294 xXl = fXl-kone;
aee8290b 295 dx = (xx2-xx1)/xXl;
296 xxx= xL3[0]-xx1;
aee8290b 297 m0 = int(xxx/dx);
298
299 if(xL3[0]<(xx1+m0*dx) || xL3[0] >(xx1+(m0+1)*dx))
300 {
301 m0=m0+1;
594d8990 302 AliDebug(2,Form(" m0 %d, m0+1 %d\n",m0,m0+1));
aee8290b 303 }
304
305 x2=(xL3[0]-( xx1+m0*dx))/dx;
306 x1=kone-x2;
307 m0=m0-1;
308 for (jb=3; jb<6; jb++)
309 {
310 iKvar=jb;
e678332c 311 bint[jb-3] = Bb(zz1,zz2,yy1,yy2,x1,x2,iKvar,k0, l0, m0)*10 ;
aee8290b 312 }
313
57754f18 314 b[0]=-bint[0];
aee8290b 315 b[1]=bint[1];
57754f18 316 b[2]=-bint[2];
aee8290b 317
aee8290b 318 }
e678332c 319
aee8290b 320
321 } else {
594d8990 322 AliError(Form("Unknown map of Dipole region %d",fMap));
aee8290b 323 }
324
325} else {
57754f18 326 ZDCField(xfi,b);
aee8290b 327
d95ea23f 328 }
aee8290b 329
330 if(fFactor!=1) {
331 b[0]*=fFactor;
332 b[1]*=fFactor;
333 b[2]*=fFactor;
334 }
335}
336
e2afb3b6 337//_______________________________________________________________________
6f3038e9 338Int_t AliMagFDM::FZ(Double_t temp, const Float_t *Ar,
ecd57058 339 Float_t delu, Int_t ik, Int_t nk) const
aee8290b 340{
341 //
e678332c 342 // Quest of a point position at x,y,z (Cartensian) and R,Phi,z (Polar) axises
aee8290b 343 //
e678332c 344 Int_t l,ikj;
345 Double_t ddu,ar;
aee8290b 346
e678332c 347 Int_t ku,kf;
348 kf=0;
aee8290b 349 ar=Ar[ik];
350 ddu=temp-ar;
351
352 ku=int(ddu/delu);
e678332c 353 ikj=ik+ku+1;
aee8290b 354 if (ddu<=0) ikj=0;
355
356 for(l=ikj; l<nk; l++)
357 {
e678332c 358
803c9752 359 if(temp <= Ar[l])
aee8290b 360 {
803c9752 361
e678332c 362 kf=l-1;
363 break;
aee8290b 364 }
365 }
e678332c 366 return kf;
aee8290b 367 }
368
e2afb3b6 369//_______________________________________________________________________
370Double_t AliMagFDM::Ba(Int_t kaai,Double_t zaa1, Double_t zaa2,
371 Double_t alf1, Double_t alf2, Double_t alf3,
6f3038e9 372 Int_t kaa, Int_t maa) const
aee8290b 373{
374 //
e678332c 375 // Calculation of field componet for case (keps <r0<= fRdel) at a given axis
aee8290b 376 //
0742d588 377 Double_t fa11=0,fa12=0,fa13=0;
378 Double_t fa21=0,fa22=0,fa23=0;
379 Double_t faY1=0,faY2=0;
380 Double_t bba=0;
e678332c 381
8918e700 382 switch (kaai) {
383 case 0:
803c9752 384 fa11 = fBpx[kaa][0][0];
385 fa12 = fBpx[kaa][0][maa];
386 fa13 = fBpx[kaa][0][maa+1];
387 fa21 = fBpx[kaa+1][0][0];
388 fa22 = fBpx[kaa+1][0][maa];
389 fa23 = fBpx[kaa+1][0][maa+1];
8918e700 390 break;
391 case 1:
803c9752 392 fa11 = fBpy[kaa][0][0];
393 fa12 = fBpy[kaa][0][maa];
394 fa13 = fBpy[kaa][0][maa+1];
395 fa21 = fBpy[kaa+1][0][0];
396 fa22 = fBpy[kaa+1][0][maa];
397 fa23 = fBpy[kaa+1][0][maa+1];
8918e700 398 break;
399 case 2:
803c9752 400 fa11 = fBpz[kaa][0][0];
401 fa12 = fBpz[kaa][0][maa];
402 fa13 = fBpz[kaa][0][maa+1];
403 fa21 = fBpz[kaa+1][0][0];
404 fa22 = fBpz[kaa+1][0][maa];
405 fa23 = fBpz[kaa+1][0][maa+1];
8918e700 406 break;
407 default:
594d8990 408 AliFatal(Form("Invalid value of kaai %d",kaai));
aee8290b 409 }
410 faY1=alf1*fa11+alf2*fa12+alf3*fa13;
411 faY2=alf1*fa21+alf2*fa22+alf3*fa23;
412 bba = zaa1*faY1+zaa2*faY2;
e678332c 413 return bba;
aee8290b 414}
415
416
e2afb3b6 417//_______________________________________________________________________
418Double_t AliMagFDM::Bb(Double_t z1,Double_t z2, Double_t y1,Double_t y2,
6f3038e9 419 Double_t x1,Double_t x2, Int_t kv, Int_t k, Int_t l, Int_t m) const
aee8290b 420{
421 //
e678332c 422 // Calculation of field componet at a given axis (general case)
aee8290b 423 //
0742d588 424 Double_t fy1=0,fy2=0,ffy=0;
425 Double_t gy1=0,gy2=0,ggy=0;
426 Double_t bbi=0;
427 Double_t bf11=0,bf12=0,bf21=0,bf22=0;
428 Double_t bg11=0,bg12=0,bg21=0,bg22=0;
e678332c 429
aee8290b 430
431 /*-----------------Polar part ------------------*/
432
8918e700 433 switch (kv) {
434 case 0:
803c9752 435 bf11=fBpx[k][l][m];
436 bf12=fBpx[k+1][l][m];
437 bf21=fBpx[k+1][l+1][m];
438 bf22=fBpx[k][l+1][m];
aee8290b 439
803c9752 440 bg11=fBpx[k][l][m+1];
441 bg12=fBpx[k+1][l][m+1];
442 bg21=fBpx[k+1][l+1][m+1];
443 bg22=fBpx[k][l+1][m+1];
8918e700 444 break;
445
446 case 1:
803c9752 447 bf11=fBpy[k][l][m];
448 bf12=fBpy[k+1][l][m];
449 bf21=fBpy[k+1][l+1][m];
450 bf22=fBpy[k][l+1][m];
aee8290b 451
803c9752 452 bg11=fBpy[k][l][m+1];
453 bg12=fBpy[k+1][l][m+1];
454 bg21=fBpy[k+1][l+1][m+1];
455 bg22=fBpy[k][l+1][m+1];
8918e700 456 break;
457
458 case 2:
803c9752 459 bf11=fBpz[k][l][m];
460 bf12=fBpz[k+1][l][m];
461 bf21=fBpz[k+1][l+1][m];
462 bf22=fBpz[k][l+1][m];
aee8290b 463
803c9752 464 bg11=fBpz[k][l][m+1];
465 bg12=fBpz[k+1][l][m+1];
466 bg21=fBpz[k+1][l+1][m+1];
467 bg22=fBpz[k][l+1][m+1];
8918e700 468 break;
aee8290b 469 /*-----------------Cartensian part ---------------*/
470
8918e700 471 case 3:
803c9752 472 bf11=fBcx[k][l][m];
473 bf12=fBcx[k+1][l][m];
474 bf21=fBcx[k+1][l+1][m];
475 bf22=fBcx[k][l+1][m];
aee8290b 476
803c9752 477 bg11=fBcx[k][l][m+1];
478 bg12=fBcx[k+1][l][m+1];
479 bg21=fBcx[k+1][l+1][m+1];
480 bg22=fBcx[k][l+1][m+1];
8918e700 481 break;
482
483 case 4:
803c9752 484 bf11=fBcy[k][l][m];
485 bf12=fBcy[k+1][l][m];
486 bf21=fBcy[k+1][l+1][m];
487 bf22=fBcy[k][l+1][m];
aee8290b 488
803c9752 489 bg11=fBcy[k][l][m+1];
490 bg12=fBcy[k+1][l][m+1];
491 bg21=fBcy[k+1][l+1][m+1];
492 bg22=fBcy[k][l+1][m+1];
8918e700 493 break;
494
495 case 5:
803c9752 496 bf11=fBcz[k][l][m];
497 bf12=fBcz[k+1][l][m];
498 bf21=fBcz[k+1][l+1][m];
499 bf22=fBcz[k][l+1][m];
aee8290b 500
803c9752 501 bg11=fBcz[k][l][m+1];
502 bg12=fBcz[k+1][l][m+1];
503 bg21=fBcz[k+1][l+1][m+1];
504 bg22=fBcz[k][l+1][m+1];
8918e700 505 break;
506
507 default:
594d8990 508 AliFatal(Form("Invalid value of kv %d",kv));
aee8290b 509 }
510
511
512
513 fy1=z1*bf11+z2*bf12;
514 fy2=z2*bf21+z1* bf22;
515 ffy=y1*fy1+ y2*fy2;
516
517
518 gy1 = z1*bg11+z2*bg12;
519 gy2 = z2*bg21+z1*bg22;
520 ggy= y1*gy1 + y2*gy2;
521
522 bbi = x1*ffy+x2*ggy;
e678332c 523
524 return bbi;
aee8290b 525
526}
aee8290b 527
e2afb3b6 528//_______________________________________________________________________
aee8290b 529void AliMagFDM::ReadField()
530{
531 //
532 // Method to read the magnetic field from file
533 //
534 FILE *magfile;
535
536 Int_t ik, il, im;
537 Float_t zzp, rr,phii;
538 Float_t zz, yy, bx,by,bz,bb;
539
540 char *fname;
594d8990 541 AliDebug(1,Form("Reading Magnetic Field %s from file %s",fName.Data(),fTitle.Data()));
aee8290b 542 fname = gSystem->ExpandPathName(fTitle.Data());
543 magfile=fopen(fname,"r");
544 delete [] fname;
545
594d8990 546 AliDebug(2,"Cartensian part");
aee8290b 547
548 if (magfile) {
549
550// Cartensian part
551
803c9752 552 fscanf(magfile,"%d %d %d ",&fYl, &fXl, &fZl);
aee8290b 553
594d8990 554 AliDebug(3,Form("fYl %d, fXl %d, fZl %d",fYl, fXl, fZl));
aee8290b 555
803c9752 556 for (ik=0; ik<fZl; ik++)
aee8290b 557 {
558
559 fscanf(magfile, " %e ", &zz);
803c9752 560 fZc[ik]=zz;
aee8290b 561
562 }
563
803c9752 564 for (ik=0; ik<fYl; ik++)
aee8290b 565 {
566 fscanf(magfile, " %e ", &yy);
803c9752 567 fY[ik]=yy;
aee8290b 568
569 }
570 for (ik=0; ik<81; ik++)
571 {
594d8990 572 AliDebug(4,Form("fZc %e,fY %e", fZc[ik],fY[ik]));
aee8290b 573 }
574
803c9752 575 fscanf(magfile," %e %e %e %e %e %e %e %e %e %e %e ", &fYdel,&fXdel,&fZdel,&fZmax,&fZmin,&fYmax,&fYmin,&fAx1,&fCx1,&fAx2,&fCx2);
aee8290b 576
594d8990 577AliDebug(3,Form("fYdel %e, fXdel %e, fZdel %e",fYdel,fXdel,fZdel));
578AliDebug(3,Form("fZmax %e, fZmin %e, fYmax %e,fYmin %e",fZmax,fZmin,fYmax,fYmin));
579AliDebug(3,Form("fAx1 %e, fCx1 %e, fAx2 %e, fCx %e",fAx1,fCx1,fAx2,fCx2));
aee8290b 580
581 for (il=0; il<44; il++) {
582 for (im=0; im<81; im++) {
583 for (ik=0; ik<81; ik++) {
584
585 fscanf(magfile, " %e ", &by);
803c9752 586 fBcy[ik][im][il]=by;
aee8290b 587 }
588 }
589 }
590
591 for (il=0; il<44; il++) {
592 for (im=0; im<81; im++) {
593 for (ik=0; ik<81; ik++) {
594
595 fscanf(magfile, " %e ", &bx);
803c9752 596 fBcx[ik][im][il]=bx;
aee8290b 597 }
598 }
599 }
600
601 for (il=0; il<44; il++) {
602 for (im=0; im<81; im++) {
603 for (ik=0; ik<81; ik++) {
604
605 fscanf(magfile, " %e ", &bz);
803c9752 606 fBcz[ik][im][il]=bz;
aee8290b 607 }
608 }
609 }
610//---------------------- Polar part ---------------------------------
611
594d8990 612 AliDebug(2,"Polar part");
803c9752 613 fscanf(magfile,"%d %d %d ", &fZpl, &fRn, &fPhin);
594d8990 614 AliDebug(3,Form("fZpl %d, fRn %d, fPhin %d",fZpl,fRn,fPhin));
aee8290b 615
594d8990 616 AliDebug(4," fZp array");
aee8290b 617
618 for (ik=0; ik<51; ik++)
619 {
620 fscanf(magfile, " %e ", &zzp);
803c9752 621 fZp[ik]=zzp;
594d8990 622 AliDebug(4,Form(" %e",fZp[ik]));
aee8290b 623 }
624
594d8990 625 AliDebug(4," fR array");
aee8290b 626
627 for (ik=0; ik<10; ik++)
628 {
629 fscanf(magfile, " %e ", &rr);
803c9752 630 fR[ik]=rr;
594d8990 631 AliDebug(4,Form(" %e",fR[ik]));
aee8290b 632 }
633
594d8990 634// AliDebug(4,"fPhi array");
aee8290b 635
636 for (il=0; il<33; il++)
637 {
638 fscanf(magfile, " %e ", &phii);
803c9752 639 fPhi[il]=phii;
594d8990 640// AliDebug(4,Form(" %e",fPhi[il]));
aee8290b 641 }
642
803c9752 643 fscanf(magfile," %e %e %e %e %e %e %e ",&fZpdl,&fPhid,&fRdel,&fZpmx,&fZpmn,&fRmax, &fRmin);
aee8290b 644
594d8990 645AliDebug(3,Form("fZpdl %e, fPhid %e, fRdel %e, fZpmx %e, fZpmn %e,fRmax %e,fRmin %e", fZpdl,fPhid, fRdel,fZpmx, fZpmn,fRmax, fRmin));
aee8290b 646
647
648 for (il=0; il<33; il++) {
649 for (im=0; im<10; im++) {
650 for (ik=0; ik<51; ik++) {
651 fscanf(magfile, " %e ", &by);
803c9752 652 fBpy[ik][im][il]=by;
aee8290b 653 }
654 }
655 }
656
657 for (il=0; il<33; il++) {
658 for (im=0; im<10; im++) {
659 for (ik=0; ik<51; ik++) {
660 fscanf(magfile, " %e ", &bx);
803c9752 661 fBpx[ik][im][il]=bx;
aee8290b 662 }
663 }
664 }
665
666
667 for (il=0; il<33; il++) {
668 for (im=0; im<10; im++) {
669 for (ik=0; ik<51; ik++) {
670 fscanf(magfile, " %e ", &bz);
803c9752 671 fBpz[ik][im][il]=bz;
aee8290b 672 }
673 }
674 }
675
676
677 for (il=0; il<32; il++) {
678 for (im=0; im<2; im++) {
679 for (ik=0; ik<2; ik++) {
680 fscanf(magfile, " %e ", &bb);
803c9752 681 fB[ik][im][il]=bb;
aee8290b 682 }
683 }
684 }
685//
686 } else {
594d8990 687 AliFatal(Form("File %s not found !",fTitle.Data()));
aee8290b 688 }
689}