Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4tgrMaterialFactory.hh
Go to the documentation of this file.
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$
28//
29//
30// class G4tgrMaterialFactory
31//
32// Class description:
33//
34// Singleton class to manage the building of transient materials.
35
36// History:
37// - Created. P.Arce, CIEMAT (November 2007)
38// -------------------------------------------------------------------------
39
40#ifndef G4tgrMaterialFactory_h
41#define G4tgrMaterialFactory_h
42
43#include "globals.hh"
44
45#include <map>
46
47#include "G4tgrIsotope.hh"
48#include "G4tgrElementSimple.hh"
50#include "G4tgrMaterial.hh"
53
54typedef std::map< G4String, G4tgrIsotope* > G4mstgrisot;
55typedef std::map< G4String, G4tgrElement* > G4mstgrelem;
56typedef std::map< G4String, G4tgrMaterial* > G4mstgrmate;
57
59{
60 public: // with decription
61
63
65 // Get only instance (it it does not exist, create it)
66
67 G4tgrIsotope* AddIsotope( const std::vector<G4String>& wl );
68 // Build a G4tgrIsotope
69
70 G4tgrElementSimple* AddElementSimple( const std::vector<G4String>& wl );
71 // Build a G4tgrElementSimple
72 G4tgrElementFromIsotopes* AddElementFromIsotopes( const std::vector<G4String>& wl );
73 // Build a G4tgrElementFromIsotopes
74
75 G4tgrMaterialSimple* AddMaterialSimple( const std::vector<G4String>& wl );
76 // Build a G4tgrMaterialSimple and add it to the Materials list
77
78 G4tgrMaterialMixture* AddMaterialMixture( const std::vector<G4String>& wl, const G4String& mixtType );
79 // Build a G4tgrMaterialByWeight or G4tgrMaterialByNoAtoms
80 // or G4tgrMaterialByVolume and add it to the Materials list
81
82 G4tgrIsotope* FindIsotope(const G4String& name) const;
83 // Look for a G4tgrIsotope and if not found return 0
84
85 G4tgrElement* FindElement(const G4String& name) const;
86 // Look for an G4tgrElement and if not found return 0
87
88 G4tgrMaterial* FindMaterial(const G4String& name) const;
89 // Look for an G4tgrMaterial and if not found return 0
90
91 void DumpIsotopeList() const;
92 // Dump detailed list of isotopes
93 void DumpElementList() const;
94 // Dump detailed list of elements
95 void DumpMaterialList() const;
96 // Dump detailed list of materials
97
98 public: // without description
99
100 const G4mstgrisot& GetIsotopeList() const {return theG4tgrIsotopes; }
101 const G4mstgrelem& GetElementList() const {return theG4tgrElements; }
102 const G4mstgrmate& GetMaterialList() const {return theG4tgrMaterials;}
103
104 private:
105
107 // Constructor
108
109 void ErrorAlreadyExists(const G4String& object,
110 const std::vector<G4String>& wl,
111 const G4bool bNoRepeating = true );
112 private:
113
114 static G4tgrMaterialFactory* theInstance;
115
116 G4mstgrisot theG4tgrIsotopes;
117 // List of all G4tgrIsotopes created
118 G4mstgrelem theG4tgrElements;
119 // List of all G4tgrElements created
120 G4mstgrmate theG4tgrMaterials;
121 // List of all G4tgrMaterials created
122};
123
124#endif
bool G4bool
Definition: G4Types.hh:67
std::map< G4String, G4tgrMaterial * > G4mstgrmate
std::map< G4String, G4tgrIsotope * > G4mstgrisot
std::map< G4String, G4tgrElement * > G4mstgrelem
const G4mstgrelem & GetElementList() const
G4tgrMaterial * FindMaterial(const G4String &name) const
const G4mstgrmate & GetMaterialList() const
static G4tgrMaterialFactory * GetInstance()
G4tgrElementFromIsotopes * AddElementFromIsotopes(const std::vector< G4String > &wl)
G4tgrElementSimple * AddElementSimple(const std::vector< G4String > &wl)
G4tgrElement * FindElement(const G4String &name) const
G4tgrMaterialMixture * AddMaterialMixture(const std::vector< G4String > &wl, const G4String &mixtType)
G4tgrIsotope * FindIsotope(const G4String &name) const
G4tgrIsotope * AddIsotope(const std::vector< G4String > &wl)
const G4mstgrisot & GetIsotopeList() const
G4tgrMaterialSimple * AddMaterialSimple(const std::vector< G4String > &wl)