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 // by I.Hrivnacova, 13.10.99 00030 00031 #include <iomanip> 00032 #include "G3VolTable.hh" 00033 #include "globals.hh" 00034 #include "G3toG4.hh" 00035 #include "G3toG4MakeSolid.hh" 00036 00037 void PG4gsvolu(G4String *tokens) { 00038 // fill the parameter containers 00039 G3fillParams(tokens,PTgsvolu); 00040 00041 // interpret the parameters 00042 G4String vname = Spar[0]; 00043 G4String shape = Spar[1]; 00044 G4int nmed = Ipar[0]; 00045 G4int npar = Ipar[1]; 00046 G4double *pars = Rpar; 00047 00048 G4gsvolu(vname, shape, nmed, pars, npar); 00049 } 00050 00051 G3VolTableEntry* G4CreateVTE(G4String vname, G4String shape, G4int nmed, 00052 G4double rpar[], G4int npar) 00053 { 00054 // create the solid 00055 G4bool hasNegPars; 00056 G4bool deferred; 00057 G4bool okAxis[3]; 00058 G4VSolid* solid 00059 = G3toG4MakeSolid(vname, shape, rpar, npar, hasNegPars, deferred, okAxis); 00060 00061 // if solid has been deferred 00062 // VTE is created with hasNegPars = true 00063 if (deferred) hasNegPars = true; 00064 00065 // create VTE 00066 G3VolTableEntry* vte 00067 = new G3VolTableEntry(vname, shape, rpar, npar, nmed, solid, hasNegPars); 00068 G3Vol.PutVTE(vte); 00069 00070 return vte; 00071 } 00072 00073 void G4gsvolu(G4String vname, G4String shape, G4int nmed, G4double* rpar, 00074 G4int npar) 00075 { 00076 /* 00077 G4cout << "Creating logical volume " << vname << " shape " << shape 00078 << " nmed " << nmed << " #pars "<< npar << " parameters (cm): "; 00079 for (int ipar=0; ipar< npar; ipar++) G4cout << std::setw(8) << rpar[ipar]; 00080 G4cout << G4endl; 00081 */ 00082 if (G3Vol.GetVTE(vname)) { 00083 // abort if VTE with given name exists 00084 G4String text = "G4gsvolu: Attempt to create volume " + vname + " twice."; 00085 G4Exception("G4gsvolu()", "G3toG40024", FatalException, text); 00086 return; 00087 } 00088 else { 00089 G4CreateVTE(vname, shape, nmed, rpar, npar); 00090 } 00091 }