]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliMagFDM.cxx
Mainly coding conventions + some small bug fixes
[u/mrichter/AliRoot.git] / STEER / AliMagFDM.cxx
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
16 /*
17 $Log$
18 Revision 1.2  2000/07/12 08:56:25  fca
19 Coding convention correction and warning removal
20
21 Revision 1.1  2000/07/11 18:24:59  fca
22 Coding convention corrections + few minor bug fixes
23
24 */
25
26 #include <stdlib.h>
27
28 #include "AliMagFDM.h"
29 #include "TSystem.h"
30     
31
32 ClassImp(AliMagFDM)
33
34 //________________________________________
35 AliMagFDM::AliMagFDM(const char *name, const char *title, const Int_t integ,
36 const Int_t map, const Float_t factor, const Float_t fmax)
37   : AliMagF(name,title,integ,map,factor,fmax)
38   
39 {
40   //
41   // Standard constructor for the Dipole field
42   //
43   fType = kDipoMap;
44
45   printf("Field Map for Muon Arm from IP till muon filter %s created: map= %d, factor= %f, file=%s\n",fName.Data(),map,factor,fTitle.Data());
46   
47 }
48
49 //________________________________________
50
51 void AliMagFDM::Field(Float_t *xfi, Float_t *b)
52 {
53   //
54   // Main routine to compute the field in a point
55   //
56   static  const Double_t keps=0.1E-06;
57   static  const Double_t kpi2=.6283185E+01;
58   static  const Double_t kone=1;
59
60   static  const    Int_t  kiip=33; 
61   static  const    Int_t  kmiip=0;    
62   static  const    Int_t  kliip=0;
63
64   static  const    Int_t  kiic=0;
65   static  const    Int_t  kmiic=0;    
66   static  const    Int_t  kliic=0;       
67
68   static  const Double_t    kfdZbg=502.92;  // Start of Map using in z
69   static  const Double_t    kfdZL3=600;  // Beginning of L3 door in z
70
71   Double_t   x[3];   
72   Double_t   xL3[3]; 
73   Double_t   bint[3]; 
74   
75   Double_t r0;
76   
77   Double_t bbj;
78   Int_t iKvar,jb;
79
80   Double_t zp1, zp2,xp1,xp2,yp1,yp2; 
81   Double_t zz1, zz2,yy1,yy2,x2,x1; 
82      
83 // --- start the map fiel from z = 502.92 cm ---
84
85   x[0] = xfi[0];
86   x[1] = xfi[1];
87   x[2] = xfi[2];
88   b[0]=b[1]=b[2]=0;
89   //       printf("x[0]  %f,x[1] %f,x[2]  %f\n",x[0],x[1],x[2]); 
90
91   Double_t rr=TMath::Sqrt(x[0]*x[0]+x[1]*x[1]);
92            r0=rr/100;
93   Double_t rPmax;
94   rPmax=fdRmax; 
95   if ( (-700<x[2] && x[2]<=kfdZbg && 
96         (x[0]*x[0]+(x[1]+30)*(x[1]+30))< 560*560)
97        || (kfdZbg<x[2] && x[2]<=kfdZL3 && rr>=rPmax*100) )
98        {
99         b[2]=2;
100        }
101
102   xL3[0]=x[0]/100;
103   xL3[1]=(x[1]+30)/100;
104   xL3[2]=x[2]/100; 
105  
106   Double_t xminn=xL3[2]*fdAx1+fdCx1;
107   Double_t xmaxx=xL3[2]*fdAx2+fdCx2;
108   Double_t zCmin,zCmax,yCmin,yCmax;
109
110   zCmin=fdZmin;
111   zCmax=fdZmax;
112   yCmin=fdYmin;
113   yCmax=fdYmax;
114           
115 if ((kfdZbg/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)))
116     {
117      if(fMap==3) 
118       { 
119        if (xL3[2]<zCmin && r0<rPmax)   
120        {
121        //---------------------  Polar part ----------------------
122        
123        Double_t yyp,ph0;
124        Int_t  kp0, lp0, mp0;
125        Int_t kpi,lpi,mpi;
126        Double_t alp1,alp2,alp3;
127        Double_t zpz,rp,fip,cphi; 
128
129        kpi=kiip; 
130        lpi=kliip;
131        mpi=kmiip;
132    
133        zpz=xL3[2];
134
135        FZ(&zpz, fdZp ,&fdZpdl,&kpi,&kp0,&zp1 ,&zp2,&fdZpl) ;
136
137        yyp=xL3[1]- 0.3;
138        cphi=yyp/r0;
139        ph0=TMath::ACos(cphi);
140        if (xL3[0]< 0) {ph0=kpi2 - ph0;}  
141                                   
142        fip=ph0;
143        FZ(&fip,fdPhi,&fdPhid ,&mpi,&mp0, &xp1,&xp2,&fdPhin); 
144
145        Double_t rDel;
146        rDel=fdRdel;
147
148        if (r0<= fdRdel)
149         {
150
151          if(r0< keps) 
152          {
153
154           bint[0]=(zp1*fdBpx[kp0][0][0] + zp2*fdBpx[kp0+1][0][0])*10;     
155           bint[1]=(zp1*fdBpy[kp0][0][0] + zp2*fdBpy[kp0+1][0][0])*10;      
156           bint[2]=(zp1*fdBpz[kp0][0][0] + zp2*fdBpz[kp0+1][0][0])*10; 
157
158          }  
159       
160         alp2= fdB[0][0][mp0]*yyp + fdB[0][1][mp0]*xL3[0]; 
161         alp3= fdB[1][0][mp0]*yyp + fdB[1][1][mp0]*xL3[0];      
162         alp1= kone - alp2 - alp3;
163      
164         for (jb=0; jb<3 ; jb++) 
165         {
166          iKvar=jb;     
167          FRfuncBi(&iKvar,&zp1,&zp2,&alp1,&alp2,&alp3, &kp0,&mp0, &bbj);
168          bint[jb] = bbj*10 ;
169         }  
170        }
171         else
172        {
173         rp=r0;
174
175         FZ(&rp,fdR ,&fdRdel,&lpi,&lp0,&yp1,&yp2,&fdRn);
176
177         for (jb=0; jb<3 ; jb++) 
178         {
179          iKvar=jb;
180          FGfuncBi(&zp1,&zp2,&yp1,&yp2,&xp1,&xp2,&iKvar,&kp0,&lp0,&mp0,&bbj); 
181
182          bint[jb] = bbj*10 ;
183         }
184        }
185
186        b[0]=bint[0];
187        b[1]=bint[1];
188        b[2]=bint[2];
189
190 //    fprintf(fitest,"-------------   Freg2 run -------------\n");       
191   
192    }  
193    else 
194    {
195    //-------------- Cartensian part ------------------
196           
197    Double_t zzc,yyc; 
198    Int_t k0, l0,m0;
199    Double_t  xx1, xx2,dx, xxx ,xXl; 
200    Int_t kci,mci,lci;
201
202    kci=kiic;
203    lci=kliic;
204    mci=kmiic;
205
206    xx1 = fdAx1*xL3[2] + fdCx1;
207    xx2 = fdAx2*xL3[2] + fdCx2;
208
209    zzc=xL3[2];
210    FZ(&zzc, fdZc ,&fdZdel, &kci,&k0, &zz1, &zz2, &fdZl);     
211
212    yyc=xL3[1];
213    FZ(&yyc, fdY , &fdYdel,&lci, &l0, &yy1, &yy2,&fdYl);  
214
215    xXl = fdXl-kone; 
216    dx = (xx2-xx1)/xXl;
217    xxx= xL3[0]-xx1;
218    //     xm = xxx/dx; 
219    m0 = int(xxx/dx);   
220
221    if(xL3[0]<(xx1+m0*dx) || xL3[0] >(xx1+(m0+1)*dx)) 
222     {
223       m0=m0+1;   
224       printf(" m0 %d, m0+1 %d\n",m0,m0+1);  
225     }
226
227    x2=(xL3[0]-( xx1+m0*dx))/dx;
228    x1=kone-x2;
229    m0=m0-1;
230    for (jb=3; jb<6; jb++) 
231      {
232        iKvar=jb;     
233        FGfuncBi(&zz1,&zz2,&yy1,&yy2,&x1,&x2,&iKvar,&k0, &l0, &m0, &bbj); 
234        bint[jb-3] = bbj*10 ; 
235      }    
236  
237    b[0]=bint[0];
238    b[1]=bint[1];
239    b[2]=bint[2]; 
240
241 //   fprintf(fitest,"------------   Freg1 run -----------------\n");            
242    } 
243
244   } else {
245         printf("Unknown map of Dipole region %d\n",fMap);
246  }
247            
248 } else {
249
250 //This is the ZDC part
251       Float_t rad2=x[0]*x[0]+x[1]*x[1];
252       if(rad2<kD2RA2) {
253         if(x[2]>kD2BEG) {
254           
255 //    Separator Dipole D2
256           if(x[2]<kD2END) b[1]=kFDIP;
257         } else if(x[2]>kD1BEG) {
258
259 //    Separator Dipole D1
260           if(x[2]<kD1END) b[1]=-kFDIP;
261         }
262         if(rad2<kCORRA2) {
263
264 //    First quadrupole of inner triplet de-focussing in x-direction
265 //    Inner triplet
266           if(x[2]>kZ4BEG) {
267             if(x[2]<kZ4END) {
268               
269 //    2430 <-> 3060
270               b[0]=-kG1*x[1];
271               b[1]=-kG1*x[0];
272             }
273           } else if(x[2]>kZ3BEG) {
274             if(x[2]<kZ3END) {
275
276 //    1530 <-> 2080
277               b[0]=kG1*x[1];
278               b[1]=kG1*x[0];
279             }
280           } else if(x[2]>kZ2BEG) {
281             if(x[2]<kZ2END) {
282
283 //    890 <-> 1430
284               b[0]=kG1*x[1];
285               b[1]=kG1*x[0];
286             }
287           } else if(x[2]>kZ1BEG) {
288             if(x[2]<kZ1END) {
289
290 //    0 <->  630
291               b[0]=-kG1*x[1];
292               b[1]=-kG1*x[0];
293             }
294           } else if(x[2]>kCORBEG) {
295             if(x[2]<kCOREND) {
296 //    Corrector dipole (because of dimuon arm)
297 //            b[0]=kFCORN;
298               b[0]=-kFCORN;
299             }
300           }
301         }
302       }
303     }
304
305   if(fFactor!=1) {
306     b[0]*=fFactor;
307     b[1]*=fFactor;
308     b[2]*=fFactor;
309   }
310 }
311
312 //_________________________________________
313
314 void AliMagFDM::FZ(Double_t *u, Float_t  *Ar, Float_t *du,Int_t *ki,Int_t *kf,Double_t *a1,Double_t *a2 ,Int_t *nu)
315   
316 {
317   //
318   // Z component of the field
319   //
320   static  const Double_t kone=1;
321   Int_t l,ik,ikj;
322   Double_t temp;
323   Double_t ddu,delu,ar;
324
325   Int_t nk,ku;
326   temp=*u;
327   nk=*nu;
328   ik=*ki;
329   delu=*du; 
330
331   ar=Ar[ik];
332   ddu=temp-ar;
333
334   ku=int(ddu/delu);
335   ikj=ik+ku;
336   if (ddu<=0) ikj=0;
337
338    for(l=ikj; l<nk; l++)
339    {
340
341     if(temp < Ar[l])
342      {
343       *kf=l;
344       *a2=(temp-Ar[l])/(Ar[l+1]-Ar[l]);
345       *a1= kone - *a2;
346       break;     
347      }
348     }
349   }
350
351 /*-------------FRfuncBi----------------*/
352
353 void AliMagFDM::FRfuncBi(Int_t *kai,Double_t *za1, Double_t *za2, Double_t *al1, Double_t *al2, Double_t *al3, Int_t *ka, Int_t *ma, Double_t *ba)
354 {
355   //
356   // This method needs to be commented
357   //
358   Double_t fa11,fa12,fa13;
359   Double_t fa21,fa22,fa23;
360   Double_t faY1,faY2;
361   Double_t bba;
362   
363   Double_t zaa1,zaa2,alf1,alf2,alf3;
364   Int_t kaai,kaa,maa;
365   kaai=*kai;
366   kaa=*ka;
367   maa=*ma;
368   zaa1=*za1;
369   zaa2=*za2;
370   alf1=*al1;  
371   alf2=*al2;
372   alf3=*al3; 
373   
374   switch (kaai) {
375   case 0:
376     fa11 = fdBpx[kaa][0][0];
377     fa12 = fdBpx[kaa][0][maa];
378     fa13 = fdBpx[kaa][0][maa+1];
379     fa21 = fdBpx[kaa+1][0][0];
380     fa22 = fdBpx[kaa+1][0][maa];               
381     fa23 = fdBpx[kaa+1][0][maa+1]; 
382     break;
383   case 1:
384     fa11 = fdBpy[kaa][0][0];
385     fa12 = fdBpy[kaa][0][maa];
386     fa13 = fdBpy[kaa][0][maa+1];
387     fa21 = fdBpy[kaa+1][0][0];
388     fa22 = fdBpy[kaa+1][0][maa];               
389     fa23 = fdBpy[kaa+1][0][maa+1]; 
390     break;
391   case 2:
392     fa11 = fdBpz[kaa][0][0];
393     fa12 = fdBpz[kaa][0][maa];
394     fa13 = fdBpz[kaa][0][maa+1];
395     fa21 = fdBpz[kaa+1][0][0];
396     fa22 = fdBpz[kaa+1][0][maa];               
397     fa23 = fdBpz[kaa+1][0][maa+1]; 
398     break;
399   default:
400     Fatal("FRfuncBi","Invalid value of kaai %d\n",kaai);
401     exit(1);
402   }                            
403   faY1=alf1*fa11+alf2*fa12+alf3*fa13;
404   faY2=alf1*fa21+alf2*fa22+alf3*fa23;
405   bba =  zaa1*faY1+zaa2*faY2;    
406   *ba=bba;
407   
408 }
409
410   
411 /*----------- FGfuncBi------------*/
412
413 void AliMagFDM::FGfuncBi(Double_t *zz1,Double_t *zz2, Double_t *yy1,Double_t *yy2, Double_t *xx1,Double_t *xx2, Int_t *kvr, Int_t *kk, Int_t *ll, Int_t *mm, Double_t *bb)
414 {  
415   //
416   // This method needs to be commented
417   //
418   Double_t fy1, fy2, ffy;
419   Double_t gy1,gy2,ggy;
420   Double_t z1,z2,y1,y2,x1,x2;
421   
422   Int_t k,l,m,kv;
423   Double_t bbi;
424   
425   Double_t bf11,bf12,bf21,bf22;
426   Double_t bg11,bg12,bg21,bg22;
427   k=*kk;
428   l=*ll;
429   m=*mm;
430   
431   kv=*kvr;
432   
433   z1=*zz1;
434   z2=*zz2;
435   y1=*yy1;
436   y2=*yy2;
437   x1=*xx1;
438   x2=*xx2; 
439   
440   /*-----------------Polar part ------------------*/
441   
442   switch (kv) {
443   case 0:
444     bf11=fdBpx[k][l][m];
445     bf12=fdBpx[k+1][l][m];
446     bf21=fdBpx[k+1][l+1][m];
447     bf22=fdBpx[k][l+1][m];
448     
449     bg11=fdBpx[k][l][m+1];
450     bg12=fdBpx[k+1][l][m+1];
451     bg21=fdBpx[k+1][l+1][m+1];
452     bg22=fdBpx[k][l+1][m+1];
453     break;
454
455   case 1:
456     bf11=fdBpy[k][l][m];
457     bf12=fdBpy[k+1][l][m];
458     bf21=fdBpy[k+1][l+1][m];
459     bf22=fdBpy[k][l+1][m];
460     
461     bg11=fdBpy[k][l][m+1];
462     bg12=fdBpy[k+1][l][m+1];
463     bg21=fdBpy[k+1][l+1][m+1];
464     bg22=fdBpy[k][l+1][m+1];
465     break;
466
467   case 2:
468     bf11=fdBpz[k][l][m];
469     bf12=fdBpz[k+1][l][m];
470     bf21=fdBpz[k+1][l+1][m];
471     bf22=fdBpz[k][l+1][m];
472     
473     bg11=fdBpz[k][l][m+1];
474     bg12=fdBpz[k+1][l][m+1];
475     bg21=fdBpz[k+1][l+1][m+1];
476     bg22=fdBpz[k][l+1][m+1]; 
477     break;
478   /*-----------------Cartensian part ---------------*/ 
479   
480   case 3:
481     bf11=fdBcx[k][l][m];
482     bf12=fdBcx[k+1][l][m];
483     bf21=fdBcx[k+1][l+1][m];
484     bf22=fdBcx[k][l+1][m];
485     
486     bg11=fdBcx[k][l][m+1];
487     bg12=fdBcx[k+1][l][m+1];
488     bg21=fdBcx[k+1][l+1][m+1];
489     bg22=fdBcx[k][l+1][m+1];
490     break;
491
492   case 4:
493     bf11=fdBcy[k][l][m];
494     bf12=fdBcy[k+1][l][m];
495     bf21=fdBcy[k+1][l+1][m];
496     bf22=fdBcy[k][l+1][m];
497     
498     bg11=fdBcy[k][l][m+1];
499     bg12=fdBcy[k+1][l][m+1];
500     bg21=fdBcy[k+1][l+1][m+1];
501     bg22=fdBcy[k][l+1][m+1];
502     break;
503
504   case 5:
505     bf11=fdBcz[k][l][m];
506     bf12=fdBcz[k+1][l][m];
507     bf21=fdBcz[k+1][l+1][m];
508     bf22=fdBcz[k][l+1][m];
509     
510     bg11=fdBcz[k][l][m+1];
511     bg12=fdBcz[k+1][l][m+1];
512     bg21=fdBcz[k+1][l+1][m+1];
513     bg22=fdBcz[k][l+1][m+1];
514     break;
515
516   default:
517     Fatal("FGfuncBi","Invalid value of kv %d\n",kv);
518     exit(1);
519   }  
520   
521   
522   
523   fy1=z1*bf11+z2*bf12;
524   fy2=z2*bf21+z1* bf22;
525   ffy=y1*fy1+ y2*fy2; 
526   
527   
528   gy1 = z1*bg11+z2*bg12;
529   gy2 = z2*bg21+z1*bg22;
530   ggy= y1*gy1 +  y2*gy2;
531   
532   bbi =  x1*ffy+x2*ggy;
533   
534   *bb=bbi; 
535   
536 }     
537 //____________________________________________
538
539 void AliMagFDM::ReadField()
540 {
541   //
542   // Method to read the magnetic field from file
543   //
544   FILE *magfile;
545
546   Int_t ik, il, im;
547   Float_t zzp, rr,phii;
548   Float_t zz, yy, bx,by,bz,bb;
549
550   char *fname;
551   printf("Reading Magnetic Field %s from file %s\n",fName.Data(),fTitle.Data());
552   fname = gSystem->ExpandPathName(fTitle.Data());
553   magfile=fopen(fname,"r");
554   delete [] fname;
555
556   printf("Cartensian part\n");
557  
558   if (magfile) {
559   
560 //  Cartensian part 
561  
562     fscanf(magfile,"%d %d %d ",&fdYl, &fdXl, &fdZl); 
563     
564     printf("fdYl %d, fdXl %d, fdZl %d\n",fdYl, fdXl, fdZl);     
565     
566     for (ik=0; ik<fdZl; ik++)
567     { 
568    
569       fscanf(magfile, " %e ", &zz);
570       fdZc[ik]=zz; 
571
572     } 
573    
574     for (ik=0; ik<fdYl; ik++)
575     {    
576        fscanf(magfile, " %e ", &yy); 
577        fdY[ik]=yy;
578  
579     } 
580     for (ik=0; ik<81; ik++)
581     {    
582            printf("fdZc %e,fdY %e\n", fdZc[ik],fdY[ik]); 
583     }   
584              
585     fscanf(magfile," %e %e %e %e %e %e %e %e %e %e %e ", &fdYdel,&fdXdel,&fdZdel,&fdZmax,&fdZmin,&fdYmax,&fdYmin,&fdAx1,&fdCx1,&fdAx2,&fdCx2); 
586
587 printf("fdYdel %e, fdXdel %e, fdZdel %e\n",fdYdel,fdXdel,fdZdel);
588 printf("fdZmax %e, fdZmin %e, fdYmax %e,fdYmin %e\n",fdZmax,fdZmin,fdYmax,fdYmin);
589 printf("fdAx1 %e, fdCx1 %e, fdAx2 %e, fdCx %e\n",fdAx1,fdCx1,fdAx2,fdCx2);
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 ", &by); 
596       fdBcy[ik][im][il]=by;        
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 ", &bx); 
606       fdBcx[ik][im][il]=bx;        
607       }    
608      }     
609     }
610     
611    for (il=0; il<44; il++)  { 
612      for (im=0; im<81; im++)  {      
613       for (ik=0; ik<81; ik++)  {      
614       
615       fscanf(magfile, " %e ", &bz); 
616       fdBcz[ik][im][il]=bz;          
617       }              
618      }     
619     } 
620 //----------------------   Polar part ---------------------------------
621
622     printf("Polar part\n");
623     fscanf(magfile,"%d %d %d ", &fdZpl, &fdRn, &fdPhin); 
624     printf("fdZpl %d, fdRn %d, fdPhin %d\n",fdZpl,fdRn,fdPhin);   
625
626     printf(" fdZp array\n"); 
627      
628     for (ik=0; ik<51; ik++) 
629     {    
630      fscanf(magfile, " %e ", &zzp);
631      fdZp[ik]=zzp; 
632      printf(" %e\n",fdZp[ik]);      
633     } 
634   
635     printf(" fdR array\n"); 
636          
637     for (ik=0; ik<10; ik++) 
638     {    
639      fscanf(magfile, " %e ", &rr); 
640      fdR[ik]=rr;
641      printf(" %e\n",fdR[ik]);
642     } 
643     
644 //    printf("fdPhi array\n"); 
645      
646      for (il=0; il<33; il++)  
647      {
648        fscanf(magfile, " %e ", &phii); 
649        fdPhi[il]=phii; 
650 //        printf(" %e\n",fdPhi[il]);          
651      }
652
653     fscanf(magfile," %e %e %e %e %e %e %e ",&fdZpdl,&fdPhid,&fdRdel,&fdZpmx,&fdZpmn,&fdRmax, &fdRmin); 
654
655 printf("fdZpdl %e, fdPhid %e, fdRdel %e, fdZpmx %e, fdZpmn %e,fdRmax %e,fdRmin %e \n", fdZpdl,fdPhid, fdRdel,fdZpmx, fdZpmn,fdRmax, fdRmin);
656
657                       
658     for (il=0; il<33; il++)  { 
659      for (im=0; im<10; im++)  {      
660       for (ik=0; ik<51; ik++)  {
661       fscanf(magfile, " %e ", &by); 
662         fdBpy[ik][im][il]=by;        
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 ", &bx); 
671         fdBpx[ik][im][il]=bx;                     
672       }    
673      }     
674     }      
675
676
677     for (il=0; il<33; il++)  { 
678      for (im=0; im<10; im++)  {      
679       for (ik=0; ik<51; ik++)  {
680       fscanf(magfile, " %e ", &bz); 
681         fdBpz[ik][im][il]=bz;                      
682       }              
683      }     
684     } 
685     
686     
687     for (il=0; il<32; il++) { 
688      for (im=0; im<2; im++)  {      
689       for (ik=0; ik<2; ik++)  {
690       fscanf(magfile, " %e ", &bb);    
691         fdB[ik][im][il]=bb;  
692       }              
693      } 
694     }
695 //
696   } else { 
697     printf("File %s not found !\n",fTitle.Data());
698     exit(1);
699   }
700 }
701 //________________________________