X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FAliMagFDM.cxx;h=e4cccc9b18f07c41629898c9d57ffbb4a4177db5;hb=690d2205d260c6401c46797c529839b4304c506b;hp=350ebb7cb53a3108792b7a85a819066a82121059;hpb=fb17acd412e4de1f64fd41bde1684280cacc9016;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/AliMagFDM.cxx b/STEER/AliMagFDM.cxx index 350ebb7cb53..e4cccc9b18f 100644 --- a/STEER/AliMagFDM.cxx +++ b/STEER/AliMagFDM.cxx @@ -13,14 +13,19 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* $Header$ */ +/* $Id$ */ -#include +//------------------------------------------------------------------------- +// Field with Magnetic Field map +// Used by AliRun class +// Author: +//------------------------------------------------------------------------- -#include "TSystem.h" +#include +#include +#include "AliLog.h" #include "AliMagFDM.h" - ClassImp(AliMagFDM) @@ -59,9 +64,9 @@ AliMagFDM::AliMagFDM(): } //_______________________________________________________________________ -AliMagFDM::AliMagFDM(const char *name, const char *title, const Int_t integ, - const Float_t factor, const Float_t fmax): - AliMagF(name,title,integ,factor,fmax), +AliMagFDM::AliMagFDM(const char *name, const char *title, Int_t integ, + Float_t factor, Float_t fmax): + AliMagFC(name,title,integ,factor,fmax), fSolenoid(0), fInd(0), fZmin(0), @@ -96,20 +101,20 @@ AliMagFDM::AliMagFDM(const char *name, const char *title, const Int_t integ, fMap = 3; SetSolenoidField(); - Info("ctor", - "Field Map for Muon Arm from IP till muon filter %s created: map= %d, integ= %d, factor= %f, file=%s\n", - fName.Data(), fMap ,integ,factor,fTitle.Data()); + AliDebug(1, Form( + "Field Map for Muon Arm from IP till muon filter %s created: map= %d, integ= %d, factor= %f, file=%s", + fName.Data(), fMap ,integ,factor,fTitle.Data())); } //_______________________________________________________________________ -void AliMagFDM::Field(Float_t *xfi, Float_t *b) +void AliMagFDM::Field(Float_t *xfi, Float_t *b) const { // // Main routine to compute the field in a point // const Double_t keps=0.1E-06; - const Double_t PI2=2.*TMath::Pi(); + const Double_t kPI2=2.*TMath::Pi(); const Double_t kone=1; const Int_t kiip=33; @@ -134,11 +139,15 @@ void AliMagFDM::Field(Float_t *xfi, Float_t *b) Double_t zz1, zz2,yy1,yy2,x2,x1; // --- start the map fiel from z = 502.92 cm --- +// +// This map has been calculated in a coordinate system in which the muon spectrometer sits at z > 0 +// Transfor correspondingly. - x[0] = xfi[0]; - x[1] = xfi[1]; - x[2] = xfi[2]; + 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]); @@ -195,17 +204,17 @@ if ((kfZbg/100 kone) { - printf("xL3[0] %e, xL3[1] %e, xL3[2] %e, yyp %e, r0 %e, cphi %e\n",xL3[0],xL3[1],xL3[2],yyp,r0,cphi); + 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)); cphi =kone; kcphi=777; } ph0=TMath::ACos(cphi); - if (xL3[0] < 0 && yyp > 0 ) {ph0=PI2/2 - ph0;} - if (xL3[0] < 0 && yyp < 0 ) {ph0=PI2/2 + ph0;} - if (xL3[0] > 0 && yyp < 0 ) {ph0=PI2 - ph0;} - if (ph0 > PI2) { ph0=ph0 - PI2;} + if (xL3[0] < 0 && yyp > 0 ) {ph0=kPI2/2 - ph0;} + if (xL3[0] < 0 && yyp < 0 ) {ph0=kPI2/2 + ph0;} + if (xL3[0] > 0 && yyp < 0 ) {ph0=kPI2 - ph0;} + if (ph0 > kPI2) { ph0=ph0 - kPI2;} if (kcphi==777) { - printf("xL3[0] %e, xL3[1] %e, xL3[2] %e, yyp %e, r0 %e, ph0 %e\n",xL3[0],xL3[1],xL3[2],yyp,r0,ph0); + 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)); } fip=ph0; mp0=FZ(fip,fPhi,fPhid ,mpi,fPhin); @@ -253,9 +262,9 @@ if ((kfZbg/100(xx1+(m0+1)*dx)) { m0=m0+1; - printf(" m0 %d, m0+1 %d\n",m0,m0+1); + AliDebug(2,Form(" m0 %d, m0+1 %d\n",m0,m0+1)); } x2=(xL3[0]-( xx1+m0*dx))/dx; @@ -303,63 +312,21 @@ if ((kfZbg/100kCORBEG2 && x[2]kZ1BEG && x[2]kZ2BEG && x[2]kZ3BEG && x[2]kZ4BEG && x[2]kD1BEG && x[2]kD2BEG && x[2]ExpandPathName(fTitle.Data()); magfile=fopen(fname,"r"); delete [] fname; - printf("Cartensian part\n"); + AliDebug(2,"Cartensian part"); if (magfile) { @@ -587,7 +552,7 @@ void AliMagFDM::ReadField() fscanf(magfile,"%d %d %d ",&fYl, &fXl, &fZl); - printf("fYl %d, fXl %d, fZl %d\n",fYl, fXl, fZl); + AliDebug(3,Form("fYl %d, fXl %d, fZl %d",fYl, fXl, fZl)); for (ik=0; ik