71 lines
2.6 KiB
C++
71 lines
2.6 KiB
C++
//
|
|
// ********************************************************************
|
|
// * DISCLAIMER *
|
|
// * *
|
|
// * The following disclaimer summarizes all the specific disclaimers *
|
|
// * of contributors to this software. The specific disclaimers,which *
|
|
// * govern, are listed with their locations in: *
|
|
// * http://cern.ch/geant4/license *
|
|
// * *
|
|
// * Neither the authors of this software system, nor their employing *
|
|
// * institutes,nor the agencies providing financial support for this *
|
|
// * work make any representation or warranty, express or implied, *
|
|
// * regarding this software system or assume any liability for its *
|
|
// * use. *
|
|
// * *
|
|
// * This code implementation is the intellectual property of the *
|
|
// * GEANT4 collaboration. *
|
|
// * By copying, distributing or modifying the Program (or any work *
|
|
// * based on the Program) you indicate your acceptance of this *
|
|
// * statement, and all its terms. *
|
|
// ********************************************************************
|
|
//
|
|
// Code developed by:
|
|
// S.Larsson and J. Generowicz.
|
|
//
|
|
// *************************************
|
|
// * *
|
|
// * PurgMagTabulatedField3D.hh *
|
|
// * *
|
|
// *************************************
|
|
//
|
|
// $Id: PurgMagTabulatedField3D.hh,v 1.2 2004/06/18 09:17:52 gunter Exp $
|
|
// GEANT4 tag $Name: geant4-06-02 $
|
|
//
|
|
|
|
#include "globals.hh"
|
|
#include "G4MagneticField.hh"
|
|
#include "G4ios.hh"
|
|
|
|
#include <fstream>
|
|
#include <vector>
|
|
#include <cmath>
|
|
|
|
using namespace std;
|
|
|
|
class PurgMagTabulatedField3D
|
|
#ifndef STANDALONE
|
|
: public G4MagneticField
|
|
#endif
|
|
{
|
|
|
|
// Storage space for the table
|
|
vector< vector< vector< double > > > xField;
|
|
vector< vector< vector< double > > > yField;
|
|
vector< vector< vector< double > > > zField;
|
|
// The dimensions of the table
|
|
int nx,ny,nz;
|
|
// The physical limits of the defined region
|
|
double minx, maxx, miny, maxy, minz, maxz;
|
|
// The physical extent of the defined region
|
|
double dx, dy, dz;
|
|
double fZoffset;
|
|
bool invertX, invertY, invertZ;
|
|
|
|
public:
|
|
PurgMagTabulatedField3D(const char* filename, double zOffset );
|
|
void GetFieldValue( const double Point[4],
|
|
double *Bfield ) const;
|
|
};
|
|
|