00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // The last G4int argument of G4gstmed(..) is used for sending 00030 // info whether the Geant3 tracking medium parameters should 00031 // be set (the max step, later: G3 default cut values). 00032 // 00033 // by I.Hrivnacova, 27 Sep 99 00034 00035 #include "G4SystemOfUnits.hh" 00036 #include "G4LogicalVolume.hh" 00037 #include "G3toG4.hh" 00038 #include "G3MatTable.hh" 00039 #include "G3MedTable.hh" 00040 #include "G4UserLimits.hh" 00041 #include "G4MagneticField.hh" 00042 #include "G4Material.hh" 00043 00044 void PG4gstmed(G4String *tokens) 00045 { 00046 // fill the parameter containers 00047 G3fillParams(tokens,PTgstmed); 00048 00049 // interpret the parameters 00050 G4String name = Spar[0]; 00051 G4int itmed = Ipar[0]; 00052 G4int nmat = Ipar[1]; 00053 G4int isvol = Ipar[2]; 00054 G4int ifield = Ipar[3]; 00055 G4int nwbuf = Ipar[4]; 00056 G4double fieldm = Rpar[0]; 00057 G4double tmaxfd = Rpar[1]; 00058 G4double stemax = Rpar[2]; 00059 G4double deemax = Rpar[3]; 00060 G4double epsil = Rpar[4]; 00061 G4double stmin = Rpar[5]; 00062 G4double *ubuf = &Rpar[6]; 00063 00064 G4gstmed(itmed,name,nmat,isvol,ifield,fieldm,tmaxfd,stemax, 00065 deemax,epsil,stmin,ubuf,nwbuf); 00066 } 00067 00068 void G4gstmed(G4int itmed, G4String, G4int nmat, G4int isvol, 00069 G4int, G4double, G4double, 00070 G4double stemax, G4double, G4double, 00071 G4double, G4double*, G4int useG3TMLimits) 00072 { 00073 // get the pointer to material nmat 00074 G4Material* material = G3Mat.get(nmat); 00075 00076 // NB. there is the possibility for redundancy in the mag field 00077 // and user limits objects. Who cares. 00078 // Generate the mag field object 00079 // $$$ G4MagneticField* field = new G4MagneticField(ifield, fieldm, tmaxfd); 00080 G4MagneticField* field = 0; 00081 00082 // Generate the user limits object 00083 // !!! only "stemax" has its equivalent in G4 00084 00085 G4UserLimits* limits = 0; 00086 if (useG3TMLimits) { 00087 limits = new G4UserLimits(); 00088 limits->SetMaxAllowedStep(stemax*cm); 00089 // limits->SetG3DefaultCuts(); 00090 // this is arranged globally by physics manager 00091 } 00092 00093 // Store this medium in the G3Med structure 00094 G3Med.put(itmed, material, field, limits, isvol); 00095 }