/scratch0/jsnuveri/BDSIM/BDSIMgit/bdsim/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   double _lenUnit, _fieldUnit;
00030   void Prepare(G4VPhysicalVolume *referenceVolume);
00031   
00032 public:
00033   BDS3DMagField(const char* filename, double zOffset );
00034   void  GetFieldValue( const  double Point[4],
00035                        double *Bfield          ) const;
00036 };
00037 

Generated on 28 Jun 2015 for BDSIM by  doxygen 1.4.7