| [1199] | 1 | //
|
|---|
| 2 | // ********************************************************************
|
|---|
| 3 | // * License and Disclaimer *
|
|---|
| 4 | // * *
|
|---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of *
|
|---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and *
|
|---|
| 7 | // * conditions of the Geant4 Software License, included in the file *
|
|---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These *
|
|---|
| 9 | // * include a list of copyright holders. *
|
|---|
| 10 | // * *
|
|---|
| 11 | // * Neither the authors of this software system, nor their employing *
|
|---|
| 12 | // * institutes,nor the agencies providing financial support for this *
|
|---|
| 13 | // * work make any representation or warranty, express or implied, *
|
|---|
| 14 | // * regarding this software system or assume any liability for its *
|
|---|
| 15 | // * use. Please see the license in the file LICENSE and URL above *
|
|---|
| 16 | // * for the full disclaimer and the limitation of liability. *
|
|---|
| 17 | // * *
|
|---|
| 18 | // * This code implementation is the result of the scientific and *
|
|---|
| 19 | // * technical work of the GEANT4 collaboration. *
|
|---|
| 20 | // * By using, copying, modifying or distributing the software (or *
|
|---|
| 21 | // * any work based on the software) you agree to acknowledge its *
|
|---|
| 22 | // * use in resulting scientific publications, and indicate your *
|
|---|
| 23 | // * acceptance of all terms of the Geant4 Software license. *
|
|---|
| 24 | // ********************************************************************
|
|---|
| 25 | //
|
|---|
| 26 | //
|
|---|
| 27 | // $Id: NistMaterialTest2.cc,v 1.3 2006/06/29 19:13:21 gunter Exp $
|
|---|
| [1315] | 28 | // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
|
|---|
| [1199] | 29 | //
|
|---|
| 30 | //
|
|---|
| 31 | // ------------------------------------------------------------
|
|---|
| 32 | //
|
|---|
| 33 | //
|
|---|
| 34 | // Test the construction of materials from the NIST data base
|
|---|
| 35 | //
|
|---|
| 36 | #include "G4NistManager.hh"
|
|---|
| 37 |
|
|---|
| 38 | #include "globals.hh"
|
|---|
| 39 | #include "G4UnitsTable.hh"
|
|---|
| 40 |
|
|---|
| 41 | int main() {
|
|---|
| 42 |
|
|---|
| 43 | G4int z;
|
|---|
| 44 | G4bool buildIsotopes;
|
|---|
| 45 |
|
|---|
| 46 | G4UnitDefinition::BuildUnitsTable();
|
|---|
| 47 |
|
|---|
| 48 | // initialise NIST data base
|
|---|
| 49 | //
|
|---|
| 50 | G4NistManager* nistMat = G4NistManager::Instance();
|
|---|
| 51 |
|
|---|
| 52 | // define Elements
|
|---|
| 53 | //
|
|---|
| 54 | nistMat->FindOrBuildElement (z=1);
|
|---|
| 55 | nistMat->FindOrBuildElement (z=6);
|
|---|
| 56 | nistMat->FindOrBuildElement (z=7, buildIsotopes=false);
|
|---|
| 57 | nistMat->FindOrBuildElement ("O");
|
|---|
| 58 | nistMat->FindOrBuildElement ("Si", buildIsotopes=false);
|
|---|
| 59 | nistMat->FindOrBuildElement ("Fe");
|
|---|
| 60 | nistMat->FindOrBuildElement ("U");
|
|---|
| 61 |
|
|---|
| 62 | G4cout << *(G4Isotope::GetIsotopeTable()) << G4endl;
|
|---|
| 63 | G4cout << *(G4Element::GetElementTable()) << G4endl;
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 | // define Materials
|
|---|
| 67 | //
|
|---|
| 68 | G4Material* Al =
|
|---|
| 69 | nistMat->FindOrBuildMaterial ("G4_Al");
|
|---|
| 70 | nistMat->FindOrBuildMaterial ("G4_lAr", buildIsotopes=false);
|
|---|
| 71 | nistMat->FindOrBuildMaterial ("G4_Cu" , buildIsotopes=false);
|
|---|
| 72 | G4Material* Pb =
|
|---|
| 73 | nistMat->FindOrBuildMaterial ("G4_Pb");
|
|---|
| 74 |
|
|---|
| 75 | G4Material* H2O =
|
|---|
| 76 | nistMat->FindOrBuildMaterial ("G4_WATER");
|
|---|
| 77 | nistMat->FindOrBuildMaterial ("G4_POLYSTYRENE");
|
|---|
| 78 | nistMat->FindOrBuildMaterial ("G4_SILICON_DIOXIDE");
|
|---|
| 79 | nistMat->FindOrBuildMaterial ("G4_AIR", buildIsotopes=false);
|
|---|
| 80 | // build new materials from scratch
|
|---|
| 81 | //
|
|---|
| 82 | G4String gelSiElm[3] = {"H", "O", "Si"};
|
|---|
| 83 | G4int gelSiAtom[3] = { 4, 4, 1};
|
|---|
| 84 | G4double gelSiW[3] = {0.0416, 0.6661, 0.2923};
|
|---|
| 85 |
|
|---|
| 86 | std::vector<G4String> elm;
|
|---|
| 87 | std::vector<G4int> atom;
|
|---|
| 88 | std::vector<G4double> w;
|
|---|
| 89 | for (G4int j=0; j<3; j++) {
|
|---|
| 90 | elm.push_back(gelSiElm[j]); atom.push_back(gelSiAtom[j]);
|
|---|
| 91 | w.push_back(gelSiW[j]);
|
|---|
| 92 | }
|
|---|
| 93 |
|
|---|
| 94 | // by atom count
|
|---|
| 95 | G4Material* Aerog =
|
|---|
| 96 | nistMat->ConstructNewMaterial ("gel_silicate1", elm, atom, 0.2);
|
|---|
| 97 |
|
|---|
| 98 | // by mass fraction
|
|---|
| 99 | nistMat->ConstructNewMaterial ("gel_silicate2", elm, w, 0.2);
|
|---|
| 100 |
|
|---|
| 101 | // print G4MaterialTable
|
|---|
| 102 | //
|
|---|
| 103 | G4cout << *(G4Material::GetMaterialTable()) << G4endl;
|
|---|
| 104 |
|
|---|
| 105 | // print additional informations
|
|---|
| 106 | //
|
|---|
| 107 | G4cout << " Nuclear interaction length of Aluminium: "
|
|---|
| 108 | << Al->GetNuclearInterLength()/cm << " cm" << G4endl;
|
|---|
| 109 |
|
|---|
| 110 | G4cout << " Nuclear interaction length of Lead: "
|
|---|
| 111 | << Pb->GetNuclearInterLength()/cm << " cm" << G4endl;
|
|---|
| 112 |
|
|---|
| 113 | G4cout << " Nuclear interaction length of Water: "
|
|---|
| 114 | << H2O->GetNuclearInterLength()/cm << " cm" << G4endl;
|
|---|
| 115 |
|
|---|
| 116 | G4cout << " Nuclear interaction length of Aerogel: "
|
|---|
| 117 | << Aerog->GetNuclearInterLength()/cm << " cm" << G4endl;
|
|---|
| 118 |
|
|---|
| 119 | return EXIT_SUCCESS;
|
|---|
| 120 | }
|
|---|