/************************************************************************** * 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.9 2001/09/04 15:05:13 hristov Pointer fB is initialised to 0 in the default constructor Revision 1.8 2001/05/28 14:10:35 morsch SetSolenoidField method to set the L3 field strength. 2 kG is default. Revision 1.7 2001/05/16 14:57:22 alibrary New files for folders and Stack Revision 1.6 2000/12/18 10:44:01 morsch Possibility to set field map by passing pointer to objet of type AliMagF via SetField(). Example: gAlice->SetField(new AliMagFCM("Map2", "$(ALICE_ROOT)/data/field01.dat",2,1.,10.)); Revision 1.5 2000/12/01 11:20:27 alibrary Corrector dipole removed from ZDC Revision 1.4 2000/11/30 07:12:49 alibrary Introducing new Rndm and QA classes Revision 1.3 2000/11/10 18:09:55 fca New field map for the ZDC 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 "TVector.h" #include "AliMagFCM.h" #include "TSystem.h" ClassImp(AliMagFCM) //_______________________________________________________________________ AliMagFCM::AliMagFCM(): fXbeg(0), fYbeg(0), fZbeg(0), fXdel(0), fYdel(0), fZdel(0), fSolenoid(0), fXdeli(0), fYdeli(0), fZdeli(0), fXn(0), fYn(0), fZn(0), fB(0) { // // Standard constructor // fType = kConMesh; fMap = 2; SetSolenoidField(); } //_______________________________________________________________________ AliMagFCM::AliMagFCM(const char *name, const char *title, const Int_t integ, const Float_t factor, const Float_t fmax): AliMagF(name,title,integ,factor,fmax), fXbeg(0), fYbeg(0), fZbeg(0), fXdel(0), fYdel(0), fZdel(0), fSolenoid(0), fXdeli(0), fYdeli(0), fZdeli(0), fXn(0), fYn(0), fZn(0), fB(0) { // // Standard constructor // fType = kConMesh; fMap = 2; SetSolenoidField(); if(fDebug>-1) Info("ctor", "%s: Constant Mesh Field %s created: map= %d, factor= %f, file= %s\n", ClassName(),fName.Data(), fMap, factor,fTitle.Data()); } //_______________________________________________________________________ AliMagFCM::AliMagFCM(const AliMagFCM &magf): AliMagF(magf), fXbeg(0), fYbeg(0), fZbeg(0), fXdel(0), fYdel(0), fZdel(0), fSolenoid(0), fXdeli(0), fYdeli(0), fZdeli(0), fXn(0), fYn(0), fZn(0), fB(0) { // // 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(-700kCORBEG2 && 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; if (magfile) { fscanf(magfile,"%d %d %d %f %f %f %f %f %f", &fXn, &fYn, &fZn, &fXdel, &fYdel, &fZdel, &fXbeg, &fYbeg, &fZbeg); if(fDebug>1) printf("%s: fXn %d, fYn %d, fZn %d, fXdel %f, fYdel %f, fZdel %f, fXbeg %f, fYbeg %f, fZbeg %f\n", ClassName(),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