/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /* $Log$ Revision 1.2 2000/07/12 08:56:25 fca Coding convention correction and warning removal Revision 1.1 2000/07/11 18:24:59 fca Coding convention corrections + few minor bug fixes */ #include #include "AliMagFDM.h" #include "TSystem.h" ClassImp(AliMagFDM) //________________________________________ AliMagFDM::AliMagFDM(const char *name, const char *title, const Int_t integ, const Int_t map, const Float_t factor, const Float_t fmax) : AliMagF(name,title,integ,map,factor,fmax) { // // Standard constructor for the Dipole field // fType = kDipoMap; 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()); } //________________________________________ void AliMagFDM::Field(Float_t *xfi, Float_t *b) { // // Main routine to compute the field in a point // static const Double_t keps=0.1E-06; static const Double_t kpi2=.6283185E+01; static const Double_t kone=1; static const Int_t kiip=33; static const Int_t kmiip=0; static const Int_t kliip=0; static const Int_t kiic=0; static const Int_t kmiic=0; static const Int_t kliic=0; static const Double_t kfdZbg=502.92; // Start of Map using in z static const Double_t kfdZL3=600; // Beginning of L3 door in z Double_t x[3]; Double_t xL3[3]; Double_t bint[3]; Double_t r0; Double_t bbj; Int_t iKvar,jb; Double_t zp1, zp2,xp1,xp2,yp1,yp2; Double_t zz1, zz2,yy1,yy2,x2,x1; // --- start the map fiel from z = 502.92 cm --- x[0] = xfi[0]; x[1] = xfi[1]; x[2] = xfi[2]; b[0]=b[1]=b[2]=0; // printf("x[0] %f,x[1] %f,x[2] %f\n",x[0],x[1],x[2]); Double_t rr=TMath::Sqrt(x[0]*x[0]+x[1]*x[1]); r0=rr/100; Double_t rPmax; rPmax=fdRmax; if ( (-700=rPmax*100) ) { b[2]=2; } xL3[0]=x[0]/100; xL3[1]=(x[1]+30)/100; xL3[2]=x[2]/100; Double_t xminn=xL3[2]*fdAx1+fdCx1; Double_t xmaxx=xL3[2]*fdAx2+fdCx2; Double_t zCmin,zCmax,yCmin,yCmax; zCmin=fdZmin; zCmax=fdZmax; yCmin=fdYmin; yCmax=fdYmax; if ((kfdZbg/100(xx1+(m0+1)*dx)) { m0=m0+1; printf(" m0 %d, m0+1 %d\n",m0,m0+1); } x2=(xL3[0]-( xx1+m0*dx))/dx; x1=kone-x2; m0=m0-1; for (jb=3; jb<6; jb++) { iKvar=jb; FGfuncBi(&zz1,&zz2,&yy1,&yy2,&x1,&x2,&iKvar,&k0, &l0, &m0, &bbj); bint[jb-3] = bbj*10 ; } b[0]=bint[0]; b[1]=bint[1]; b[2]=bint[2]; // fprintf(fitest,"------------ Freg1 run -----------------\n"); } } else { printf("Unknown map of Dipole region %d\n",fMap); } } else { //This is the ZDC part Float_t rad2=x[0]*x[0]+x[1]*x[1]; if(rad2kD2BEG) { // Separator Dipole D2 if(x[2]kD1BEG) { // Separator Dipole D1 if(x[2]kZ4BEG) { if(x[2] 3060 b[0]=-kG1*x[1]; b[1]=-kG1*x[0]; } } else if(x[2]>kZ3BEG) { if(x[2] 2080 b[0]=kG1*x[1]; b[1]=kG1*x[0]; } } else if(x[2]>kZ2BEG) { if(x[2] 1430 b[0]=kG1*x[1]; b[1]=kG1*x[0]; } } else if(x[2]>kZ1BEG) { if(x[2] 630 b[0]=-kG1*x[1]; b[1]=-kG1*x[0]; } } else if(x[2]>kCORBEG) { if(x[2]ExpandPathName(fTitle.Data()); magfile=fopen(fname,"r"); delete [] fname; printf("Cartensian part\n"); if (magfile) { // Cartensian part fscanf(magfile,"%d %d %d ",&fdYl, &fdXl, &fdZl); printf("fdYl %d, fdXl %d, fdZl %d\n",fdYl, fdXl, fdZl); for (ik=0; ik