00001
00002
00003
00004
00005
00006
00007 #ifndef BDSMagFieldSQL_h
00008 #define BDSMagFieldSQL_h
00009
00010 #include "G4Types.hh"
00011 #include "G4MagneticField.hh"
00012
00013 #include "G4VPhysicalVolume.hh"
00014 #include "BDSField.hh"
00015 #include <string>
00016 #include <vector>
00017
00018
00019
00020 class BDSMagFieldSQL : public BDSField
00021 {
00022 public:
00023
00024 BDSMagFieldSQL(const G4String& FieldFile, G4double aMarkerLength,
00025 std::vector<G4String> Quadvol, std::vector<G4double> QuadBgrad,
00026 std::vector<G4String> Sextvol, std::vector<G4double> SextBgrad,
00027 std::vector<G4String> Octvol, std::vector<G4double> OctBgrad,
00028 std::vector<G4String> Fieldvol, std::vector<G4ThreeVector> UniformField);
00029 virtual ~BDSMagFieldSQL();
00030
00031
00032
00033 void GetFieldValue( const G4double Point[4],G4double *Bfield ) const;
00034
00035 void Prepare(G4VPhysicalVolume *referenceVolume);
00036
00037 private:
00038 ofstream ofs;
00039 ifstream ifs;
00040
00041 G4double itsMarkerLength;
00042 G4String FieldFile;
00043
00044
00045 std::vector<G4double> itsQuadBgrad;
00046 std::vector<G4String> itsQuadVol;
00047 std::vector<G4double> itsSextBgrad;
00048 std::vector<G4String> itsSextVol;
00049 std::vector<G4double> itsOctBgrad;
00050 std::vector<G4String> itsOctVol;
00051
00052
00053 std::vector<G4ThreeVector> itsUniformField;
00054 std::vector<G4String> itsFieldVol;
00055
00056
00057 std::vector<G4double> itsBz;
00058 std::vector<G4double> itsZ;
00059 std::vector<G4double> itsBr_over_r;
00060 std::vector<G4double> itsdBz_by_dz;
00061 double itsdz;
00062 };
00063
00064 #endif