// // ******************************************************************** // * 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. * // ******************************************************************** // // // $Id: G4gsmixt.cc,v 1.8 2001/07/11 09:59:01 gunter Exp $ // GEANT4 tag $Name: geant4-05-00 $ // // by I.Hrivnacova, 27 Sep 99 #include "g4std/iomanip" #include "g4std/strstream" #include "g4std/iomanip" #include #include "globals.hh" #include "G3toG4.hh" #include "G3EleTable.hh" #include "G3MatTable.hh" #include "G4Material.hh" #include "G4Isotope.hh" void PG4gsmixt(G4String tokens[]) { // fill the parameter containers G3fillParams(tokens,PTgsmixt); // interpret the parameters G4String name = Spar[0].data(); G4int imate = Ipar[0]; G4int nlmat = Ipar[1]; //G4double dens = Rpar[0]*g/cm3; G4double dens = Rpar[0]; G4double *a = Rpar + 1; G4double *z = Rpar + 1+abs(nlmat); G4double *wmat = Rpar + 1 + 2*abs(nlmat); for (int i=0; iAddElement(element, wmat[i]); } // add the material to the List G3Mat.put(imate, material); } /* void G4gsmixt(G4int imate, G4String name, G4double a[], G4double z[], G4double dens, G4int nlmat, G4double wmat[]){ G4int nmate = abs(nlmat); G4String sname = name.strip(G4String::both); G4double theDensity = dens*g/cm3; G4Material* theMixture = new G4Material(name, dens, nmate); G4bool ok=true; for (int i=0; i< nmate; i++){ G4Element* theElement = G3Ele.GetEle(z[i]); if (nlmat>0) { G4double fractionmass = wmat[i]; ok = ok && abs(fractionmass)<=1.; theMixture->AddElement(theElement, fractionmass); } else if (nlmat<0) { G4int natoms = wmat[i]; ok = ok && wmat[i] == natoms; theMixture->AddElement(theElement, natoms); } else { ok=false; } } if (ok) { G3Mat.put(imate, theMixture); } else { if (nlmat>0) { G4cerr << "G4gsmixt: for mixture '" << name << "' some |weights|>1 : " << G4endl; for (G4int i=0;i