source: trunk/source/materials/include/G4NistMaterialBuilder.hh @ 835

Last change on this file since 835 was 822, checked in by garnier, 16 years ago

import all except CVS

File size: 6.3 KB
Line 
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// $Id: G4NistMaterialBuilder.hh,v 1.12 2007/10/30 10:05:52 vnivanch Exp $
27// GEANT4 tag $Name:  $
28
29#ifndef G4NistMaterialBuilder_h
30#define G4NistMaterialBuilder_h 1
31
32//---------------------------------------------------------------------------
33//
34// ClassName:   G4NistMaterialBuilder
35//
36// Description: Utility class to hold and manipulate G4Materials
37//
38// Author:      V.Ivanchenko 21.11.2004
39//
40// Modifications:
41// 31.10.05 Add chemical effect and gas properties (V.Ivanchenko)
42// 27.02.06 V.Ivanchneko add ConstructNewGasMaterial
43// 11.05.06 V.Ivanchneko add warning flag to FindOrBuildMaterial method
44// 27.07.06 V.Ivanchneko set defaul warning=true for FindOrBuildMaterial
45// 27.07.07 V.Ivanchneko add matIndex vector to control built materials
46// 28.07.07 V.Ivanchneko add BuildMaterial method using Nist index
47//
48//----------------------------------------------------------------------------
49//
50// Class Description:
51//
52// Element data from the NIST DB on Atomic Weights and Isotope Compositions
53// http://physics.nist.gov/PhysRefData/Compositions/index.html
54//
55
56//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57
58#include "globals.hh"
59#include "G4Material.hh"
60#include <vector>
61
62//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
63
64class G4NistElementBuilder;
65
66class G4NistMaterialBuilder
67{
68public:
69
70  G4NistMaterialBuilder(G4NistElementBuilder*, G4int verb=0);
71                       
72  ~G4NistMaterialBuilder();
73 
74  // Find or build a G4Material by name, from dataBase
75  //
76  G4Material* FindOrBuildMaterial (const G4String& name, 
77                                   G4bool isotopes=true,
78                                   G4bool warning=true);
79                                           
80  // construct a G4Material from scratch by atome count
81  //
82  G4Material* ConstructNewMaterial (const G4String& name,
83                                    const std::vector<G4String>& elm,
84                                    const std::vector<G4int>& nbAtoms,
85                                    G4double dens, 
86                                    G4bool isotopes=true,
87                                    G4State   state    = kStateSolid,     
88                                    G4double  temp     = STP_Temperature, 
89                                    G4double  pressure = STP_Pressure); 
90                                     
91  // construct a G4Material from scratch by fraction mass
92  //
93  G4Material* ConstructNewMaterial (const G4String& name,
94                                    const std::vector<G4String>& elm,
95                                    const std::vector<G4double>& weight,
96                                    G4double dens, 
97                                    G4bool isotopes=true,
98                                    G4State   state    = kStateSolid,     
99                                    G4double  temp     = STP_Temperature, 
100                                    G4double  pressure = STP_Pressure); 
101
102
103  // construct a gas G4Material from scratch by atome count
104  //
105  G4Material* ConstructNewGasMaterial(const G4String& name, 
106                                      const G4String& nameNist,
107                                      G4double temp, G4double pres, 
108                                      G4bool isotopes=true);
109
110  void SetVerbose(G4int val);
111  void ListMaterials(const G4String&);
112  void ListNistSimpleMaterials();
113  void ListNistCompoundMaterials();
114  void ListHepMaterials();
115
116  const std::vector<G4String>& GetMaterialNames() const;
117
118private:
119
120  void Initialise();
121  void NistSimpleMaterials();
122  void NistCompoundMaterials();
123  void HepAndNuclearMaterials();
124
125  void AddMaterial(const G4String& nameMat, G4double dens, G4int Z=0,
126                         G4double pot=0.0, G4int ncomp=1,
127                         G4State=kStateSolid,
128                         G4double temp=STP_Temperature,
129                         G4double pres=STP_Pressure);
130
131  void AddChemicalFormula(const G4String& nameMat, const G4String& ch);
132  void AddGas(const G4String& nameMat, G4double t=STP_Temperature,
133              G4double p=STP_Pressure);
134
135  void AddElementByWeightFraction(G4int Z, G4double);
136  void AddElementByAtomCount     (G4int Z, G4int);
137
138  void AddElementByWeightFraction(const G4String& name, G4double);
139  void AddElementByAtomCount     (const G4String& name, G4int);
140
141  // build a G4Material from dataBase
142  G4Material* BuildMaterial(const G4String& name, G4bool isotopes);
143  G4Material* BuildMaterial(G4int idx, G4bool isotopes);
144
145  void DumpElm(G4int);
146  void DumpMix(G4int);
147
148private:
149
150  G4NistElementBuilder*  elmBuilder;
151
152  G4int                  verbose;
153  G4int                  nMaterials;
154  G4int                  nComponents;
155  G4int                  nCurrent;
156  G4int                  nElementary;
157  G4int                  nNIST;
158
159  std::vector<G4String>  names;
160  std::vector<G4String>  chFormulas;
161
162  std::vector<G4double>  densities;
163  std::vector<G4double>  ionPotentials;
164  std::vector<G4State>   states;
165  std::vector<G4double>  fractions;
166  std::vector<G4int>     components;
167  std::vector<G4int>     indexes;
168  std::vector<G4int>     elements;
169
170  std::vector<G4int>     matIndex;
171
172  std::vector<G4double>  temperatures;
173  std::vector<G4double>  presures;
174
175  G4bool                 first;
176
177};
178
179inline const std::vector<G4String>& 
180       G4NistMaterialBuilder::GetMaterialNames() const
181{
182  return names;
183}
184
185#endif
Note: See TracBrowser for help on using the repository browser.