/************************************************************************** * 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$ */ #include "AliMagFCM.h" #include "TSystem.h" ClassImp(AliMagFCM) //________________________________________ AliMagFCM::AliMagFCM(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 // fType = kConMesh; printf("Constant Mesh Field %s created: map= %d, factor= %f, file= %s\n", fName.Data(),map,factor,fTitle.Data()); } //________________________________________ AliMagFCM::AliMagFCM(const AliMagFCM &magf) { // // Copy constructor // magf.Copy(*this); } //________________________________________ void AliMagFCM::Field(Float_t *x, Float_t *b) { // // Method to calculate the magnetic field // Double_t ratx, raty, ratz, hix, hiy, hiz, ratx1, raty1, ratz1, bhyhz, bhylz, blyhz, blylz, bhz, blz, xl[3]; const Double_t kone=1; Int_t ix, iy, iz; // --- find the position in the grid --- b[0]=b[1]=b[2]=0; if(-700kD2BEG) { // 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; if (magfile) { fscanf(magfile,"%d %d %d %f %f %f %f %f %f", &fXn, &fYn, &fZn, &fXdel, &fYdel, &fZdel, &fXbeg, &fYbeg, &fZbeg); printf("fXn %d, fYn %d, fZn %d, fXdel %f, fYdel %f, fZdel %f, fXbeg %f, fYbeg %f, fZbeg %f\n", fXn, fYn, fZn, fXdel, fYdel, fZdel, fXbeg, fYbeg, fZbeg); fXdeli=1./fXdel; fYdeli=1./fYdel; fZdeli=1./fZdel; fB = new TVector(3*fXn*fYn*fZn); for (iz=0; iz