// // ******************************************************************** // * 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. * // ******************************************************************** // //////////////////////////////////////////////////////////////////////////////// // #include "exrdmMaterial.hh" #include "exrdmMaterialData.hh" #include "exrdmMaterialMessenger.hh" #include "globals.hh" #include "G4UnitsTable.hh" #include "G4ios.hh" #include #include //////////////////////////////////////////////////////////////////////////////// // exrdmMaterial::exrdmMaterial () { Material.clear(); Element.clear(); Isotope.clear(); // some default materials vacuum (0), air (1) and aluminium (2) defined here // examples of vacuum // // G4double a,z; static G4bool bmat = false ; if (!bmat) { // vacuum G4double density = universe_mean_density; //from PhysicalConstants.h G4double pressure = 3.e-18*pascal; G4double temperature = 2.73*kelvin; AddMaterial("Vacuum", "H", density,"gas",temperature,pressure); // air density = 1.290*mg/cm3; AddMaterial("Air", "N0.78-O0.22", density, "gas"); // aluminium density=2.700*g/cm3 ; AddMaterial ("Aluminium", "Al", density,""); //silicon density=2.3290*g/cm3 ; AddMaterial ("Silicon", "Si", density,""); bmat = true; } // create commands for interactive definition of the geometry materialMessenger = new exrdmMaterialMessenger(this); } //////////////////////////////////////////////////////////////////////////////// // exrdmMaterial::~exrdmMaterial () { delete materialMessenger; } //////////////////////////////////////////////////////////////////////////////// // void exrdmMaterial::AddMaterial (G4String name, G4String formula, G4double density, G4String state, G4double tem, G4double pres) { G4int isotope, Z; size_t i; for (i = 0; iGetName() == name) { G4cerr <<" AddMaterial : material " < Command rejected." < 0.) { aMaterial = new G4Material(name, density, ncomponents, kStateSolid, tem ); } else if (state == "gas" && pres > 0.) { aMaterial = new G4Material(name, density, ncomponents, kStateGas, tem, pres ); } if (aMaterial == 0) { G4cerr <<" AddMaterial : Name " < Command failed." < Command rejected." < Command rejected." < Command rejected." < Command rejected." < Command rejected." <GetName() == name) break; } G4int k = G4int(i); if (i == Material.size()) k = -1; return k; } //////////////////////////////////////////////////////////////////////////////// // void exrdmMaterial::ListMaterial () { G4cout <<" There are" <GetName() <<" density: " <GetDensity(),"Volumic Mass") <