[1035] | 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: G4tgbMaterialMgr.hh,v 1.4 2008/12/18 12:58:10 gunter Exp $ |
---|
[1228] | 28 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
[1035] | 29 | // |
---|
| 30 | // |
---|
| 31 | // class G4tgbMaterialMgr |
---|
| 32 | // |
---|
| 33 | // Class description: |
---|
| 34 | // |
---|
| 35 | // Singleton class to manage the building of transient materials, |
---|
| 36 | // as well as the construction of the corresponding G4Material's. |
---|
| 37 | |
---|
| 38 | // History: |
---|
| 39 | // - Created. P.Arce, CIEMAT (November 2007) |
---|
| 40 | // ------------------------------------------------------------------------- |
---|
| 41 | |
---|
| 42 | #ifndef G4tgbMaterialMgr_h |
---|
| 43 | #define G4tgbMaterialMgr_h |
---|
| 44 | |
---|
| 45 | #include "globals.hh" |
---|
| 46 | |
---|
| 47 | #include "G4tgbIsotope.hh" |
---|
| 48 | #include "G4tgbElement.hh" |
---|
| 49 | #include "G4tgbMaterial.hh" |
---|
| 50 | |
---|
| 51 | #include "G4tgrIsotope.hh" |
---|
| 52 | #include "G4tgrElement.hh" |
---|
| 53 | #include "G4tgrElement.hh" |
---|
| 54 | #include "G4tgrMaterial.hh" |
---|
| 55 | |
---|
| 56 | #include "G4Isotope.hh" |
---|
| 57 | #include "G4Element.hh" |
---|
| 58 | #include "G4Material.hh" |
---|
| 59 | |
---|
| 60 | typedef std::map< G4String, G4tgbIsotope* > G4mstgbisot; |
---|
| 61 | typedef std::map< G4String, G4tgbElement* > G4mstgbelem; |
---|
| 62 | typedef std::map< G4String, G4tgbMaterial* > G4mstgbmate; |
---|
| 63 | typedef std::map< G4String, G4Isotope* > G4msg4isot; |
---|
| 64 | typedef std::map< G4String, G4Element* > G4msg4elem; |
---|
| 65 | typedef std::map< G4String, G4Material* > G4msg4mate; |
---|
| 66 | |
---|
| 67 | class G4tgbMaterialMgr |
---|
| 68 | { |
---|
| 69 | public: // with description |
---|
| 70 | |
---|
| 71 | ~G4tgbMaterialMgr(); |
---|
| 72 | |
---|
| 73 | static G4tgbMaterialMgr* GetInstance(); |
---|
| 74 | // Get only instance (it it does not exists, create it) |
---|
| 75 | |
---|
| 76 | void CopyIsotopes(); |
---|
| 77 | // Copy the G4tgrIsotopes into G4tgbIsotopes |
---|
| 78 | void CopyElements(); |
---|
| 79 | // Copy the G4tgrElements into G4tgbElements |
---|
| 80 | void CopyMaterials(); |
---|
| 81 | // Copy the G4tgrMaterials into G4tgbMaterials |
---|
| 82 | |
---|
| 83 | G4Isotope* FindOrBuildG4Isotope(const G4String & name); |
---|
| 84 | // Look for a G4Isotope that has to exists |
---|
| 85 | // (if not found create it from the corresponding G4tgbIsotope) |
---|
| 86 | G4Isotope* FindBuiltG4Isotope(const G4String & name) const; |
---|
| 87 | // Look for a G4Isotope and if not found return 0 |
---|
| 88 | G4tgbIsotope* FindG4tgbIsotope(const G4String& name, |
---|
| 89 | G4bool bMustExist = 0) const; |
---|
| 90 | // Look for a G4Isotope and if not found return 0 |
---|
| 91 | |
---|
| 92 | G4Element* FindOrBuildG4Element(const G4String & name, |
---|
| 93 | G4bool bMustExist = 1); |
---|
| 94 | // Look for a G4Element that has to exists by default |
---|
| 95 | // (if not found create it from the corresponding G4tgbElement) |
---|
| 96 | G4Element* FindBuiltG4Element(const G4String& name) const; |
---|
| 97 | // Look for a G4Element and if not found return 0 |
---|
| 98 | G4tgbElement* FindG4tgbElement(const G4String& name, |
---|
| 99 | G4bool bMustExist = 0) const; |
---|
| 100 | // Look for a G4Element and if not found return 0 |
---|
| 101 | |
---|
| 102 | G4Material* FindOrBuildG4Material(const G4String& name, |
---|
| 103 | G4bool bMustExist = 1); |
---|
| 104 | // Look for a G4Material that has to exists by default |
---|
| 105 | // (if not found create it from the corresponding G4tgbMaterial) |
---|
| 106 | G4Material* FindBuiltG4Material(const G4String& name) const; |
---|
| 107 | // Look for a G4Material and if not found return 0 |
---|
| 108 | G4tgbMaterial* FindG4tgbMaterial(const G4String& name, |
---|
| 109 | G4bool bMustExist = 0) const; |
---|
| 110 | // Look for a G4tgbMaterial and if not found return 0 |
---|
| 111 | |
---|
| 112 | const G4msg4isot GetG4IsotopeList() const { return theG4Isotopes; } |
---|
| 113 | const G4msg4elem GetG4ElementList() const { return theG4Elements; } |
---|
| 114 | const G4msg4mate GetG4MaterialList() const { return theG4Materials; } |
---|
| 115 | |
---|
| 116 | private: |
---|
| 117 | |
---|
| 118 | G4tgbMaterialMgr(); |
---|
| 119 | // Private Constructor |
---|
| 120 | |
---|
| 121 | private: |
---|
| 122 | |
---|
| 123 | static G4tgbMaterialMgr* theInstance; |
---|
| 124 | |
---|
| 125 | G4mstgbisot theG4tgbIsotopes; |
---|
| 126 | // List of all tgbIsotopes created |
---|
| 127 | G4mstgbelem theG4tgbElements; |
---|
| 128 | // List of all tgbElements created |
---|
| 129 | G4mstgbmate theG4tgbMaterials; |
---|
| 130 | // List of all G4tgbMaterials created |
---|
| 131 | G4msg4isot theG4Isotopes; |
---|
| 132 | // Container of all G4Isotopes created |
---|
| 133 | G4msg4elem theG4Elements; |
---|
| 134 | // Container of all G4Elements created |
---|
| 135 | G4msg4mate theG4Materials; |
---|
| 136 | // Container of all G4Materials created |
---|
| 137 | }; |
---|
| 138 | |
---|
| 139 | #endif |
---|