// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * 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. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // // $Id: G4gsmixt.cc,v 1.13 2006/06/29 18:14:37 gunter Exp $ // GEANT4 tag $Name: geant4-09-03 $ // // by I.Hrivnacova, 27 Sep 99 #include "globals.hh" #include #include #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+std::abs(nlmat); G4double *wmat = Rpar + 1 + 2*std::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 = std::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 && std::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