include/BDS3DMagField.hh

00001 //Based on the Geant4 example examples/advanced/purging_magnet/src/PurgMagTabulatedField3D.cc
00002 #include "G4MagneticField.hh"
00003 #include "G4ios.hh"
00004 #include "BDSMagField.hh"
00005 
00006 #include <fstream>
00007 #include <vector>
00008 #include <cmath>
00009 
00010 class BDS3DMagField
00011 #ifndef STANDALONE
00012 // : public G4MagneticField
00013   : public BDSMagField
00014 #endif
00015 {
00016   
00017   // Storage space for the table
00018   std::vector< std::vector< std::vector< double > > > xField;
00019   std::vector< std::vector< std::vector< double > > > yField;
00020   std::vector< std::vector< std::vector< double > > > zField;
00021   // The dimensions of the table
00022   int nx,ny,nz; 
00023   // The physical limits of the defined region
00024   double minx, maxx, miny, maxy, minz, maxz;
00025   // The physical extent of the defined region
00026   double dx, dy, dz;
00027   double fZoffset;
00028   bool invertX, invertY, invertZ;
00029 
00030 public:
00031   BDS3DMagField(const char* filename, double zOffset );
00032   void  GetFieldValue( const  double Point[4],
00033                        double *Bfield          ) const;
00034 };
00035 

Generated on 27 Aug 2013 for BDSIM by  doxygen 1.4.7