//-----------------------------------------------------------------------
//
+// Class to handle the field
+// I/O and interpolation
+// of the field map to return the value
+// of the magnetic field in an arbitrary position
// Author: Andreas Morsch <andreas.morsch@cern.ch>
//
//-----------------------------------------------------------------------
#include <TSystem.h>
-#include <TVector.h>
+#include "AliLog.h"
#include "AliFieldMap.h"
ClassImp(AliFieldMap)
Int_t ix, iy, iz, ipx, ipy, ipz;
Float_t bx, by, bz;
char *fname = 0;
- printf("%s: Reading Magnetic Field Map %s from file %s\n",
- ClassName(),fName.Data(),fTitle.Data());
+ AliInfo(Form("Reading Magnetic Field Map %s from file %s",
+ fName.Data(),fTitle.Data()));
fname = gSystem->ExpandPathName(fTitle.Data());
magfile = fopen(fname,"r");
}
//_______________________________________________________________________
-void AliFieldMap::Field(Float_t *x, Float_t *b)
+void AliFieldMap::Field(Float_t *x, Float_t *b) const
{
//
// Use simple interpolation to obtain field at point x
raty1=kone-raty;
ratz1=kone-ratz;
+ if (!fB) return;
+
bhyhz = Bx(ix ,iy+1,iz+1)*ratx1+Bx(ix+1,iy+1,iz+1)*ratx;
bhylz = Bx(ix ,iy+1,iz )*ratx1+Bx(ix+1,iy+1,iz )*ratx;
blyhz = Bx(ix ,iy ,iz+1)*ratx1+Bx(ix+1,iy ,iz+1)*ratx;
}
//_______________________________________________________________________
-void AliFieldMap::Copy(AliFieldMap & /* magf */) const
+void AliFieldMap::Copy(TObject & /* magf */) const
{
//
// Copy *this onto magf -- Not implemented
//
- Fatal("Copy","Not implemented!\n");
+ AliFatal("Not implemented!");
}
//_______________________________________________________________________