00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef G4NistMaterialBuilder_h
00029 #define G4NistMaterialBuilder_h 1
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #include <vector>
00060 #include <CLHEP/Units/PhysicalConstants.h>
00061
00062 #include "globals.hh"
00063 #include "G4Material.hh"
00064
00065
00066
00067 class G4NistElementBuilder;
00068
00069 class G4NistMaterialBuilder
00070 {
00071 public:
00072
00073 G4NistMaterialBuilder(G4NistElementBuilder*, G4int verb=0);
00074
00075 ~G4NistMaterialBuilder();
00076
00077
00078
00079 G4Material* FindOrBuildMaterial (const G4String& name,
00080 G4bool isotopes=true,
00081 G4bool warning =true);
00082
00083
00084
00085 G4Material* ConstructNewMaterial (const G4String& name,
00086 const std::vector<G4String>& elm,
00087 const std::vector<G4int>& nbAtoms,
00088 G4double dens,
00089 G4bool isotopes = true,
00090 G4State state = kStateSolid,
00091 G4double temp = CLHEP::STP_Temperature,
00092 G4double pressure = CLHEP::STP_Pressure);
00093
00094
00095
00096 G4Material* ConstructNewMaterial (const G4String& name,
00097 const std::vector<G4String>& elm,
00098 const std::vector<G4double>& weight,
00099 G4double dens,
00100 G4bool isotopes = true,
00101 G4State state = kStateSolid,
00102 G4double temp = CLHEP::STP_Temperature,
00103 G4double pressure = CLHEP::STP_Pressure);
00104
00105
00106
00107
00108 G4Material* ConstructNewGasMaterial(const G4String& name,
00109 const G4String& nameDB,
00110 G4double temp, G4double pres,
00111 G4bool isotopes = true);
00112
00113
00114
00115 G4Material* ConstructNewIdealGasMaterial(const G4String& name,
00116 const std::vector<G4String>& elm,
00117 const std::vector<G4int>& nbAtoms,
00118 G4bool isotopes = true,
00119 G4double temp = CLHEP::STP_Temperature,
00120 G4double pressure = CLHEP::STP_Pressure);
00121
00122
00123
00124 void SetVerbose(G4int val);
00125
00126
00127
00128
00129
00130
00131
00132
00133 void ListMaterials(const G4String&);
00134
00135
00136
00137 void ListNistSimpleMaterials();
00138 void ListNistCompoundMaterials();
00139 void ListHepMaterials();
00140 void ListSpaceMaterials();
00141 void ListBioChemicalMaterials();
00142
00143
00144
00145 const std::vector<G4String>& GetMaterialNames() const;
00146
00147
00148
00149 inline G4double GetMeanIonisationEnergy(G4int index) const;
00150
00151 private:
00152
00153 void Initialise();
00154 void NistSimpleMaterials();
00155 void NistCompoundMaterials();
00156 void HepAndNuclearMaterials();
00157 void SpaceMaterials();
00158 void BioChemicalMaterials();
00159
00160
00161
00162
00163 void AddMaterial(const G4String& nameMat, G4double dens, G4int Z=0,
00164 G4double pot=0.0, G4int ncomp=1,
00165 G4State=kStateSolid, G4bool stp = true);
00166
00167 void AddGas(const G4String& nameMat, G4double t=CLHEP::STP_Temperature,
00168 G4double p=CLHEP::STP_Pressure);
00169
00170 void AddElementByWeightFraction(G4int Z, G4double);
00171 void AddElementByAtomCount (G4int Z, G4int);
00172
00173 void AddElementByWeightFraction(const G4String& name, G4double);
00174 void AddElementByAtomCount (const G4String& name, G4int);
00175
00176
00177 G4Material* BuildMaterial(G4int idx, G4bool isotopes);
00178
00179 void DumpElm(G4int);
00180 void DumpMix(G4int);
00181
00182 private:
00183
00184 G4NistElementBuilder* elmBuilder;
00185
00186 G4int verbose;
00187 G4int nMaterials;
00188 G4int nComponents;
00189 G4int nCurrent;
00190 G4int nElementary;
00191 G4int nNIST;
00192 G4int nHEP;
00193 G4int nSpace;
00194
00195 std::vector<G4String> names;
00196 std::vector<G4String> chFormulas;
00197
00198 std::vector<G4double> densities;
00199 std::vector<G4double> ionPotentials;
00200 std::vector<G4State> states;
00201 std::vector<G4double> fractions;
00202 std::vector<G4bool> atomCount;
00203 std::vector<G4int> components;
00204 std::vector<G4int> indexes;
00205 std::vector<G4int> elements;
00206 std::vector<G4int> matIndex;
00207 std::vector<G4bool> STP;
00208
00209 std::vector<G4int> idxGas;
00210 std::vector<G4double> gasTemperature;
00211 std::vector<G4double> gasPressure;
00212
00213 G4bool first;
00214
00215 };
00216
00217 inline const std::vector<G4String>&
00218 G4NistMaterialBuilder::GetMaterialNames() const
00219 {
00220 return names;
00221 }
00222
00223 inline G4double
00224 G4NistMaterialBuilder::GetMeanIonisationEnergy(G4int index) const
00225 {
00226 G4double res = 10*index;
00227 if(index >= 0 && index < nMaterials) { res = ionPotentials[index]; }
00228 return res;
00229 }
00230
00231 #endif