G4tgbMaterialMgr.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id: G4tgbMaterialMgr.hh 69803 2013-05-15 15:24:50Z gcosmo $
00028 //
00029 //
00030 // class G4tgbMaterialMgr
00031 //
00032 // Class description:
00033 //
00034 // Singleton class to manage the building of transient materials,
00035 // as well as the construction of the corresponding G4Material's.
00036 
00037 // History:
00038 // - Created.                                 P.Arce, CIEMAT (November 2007)
00039 // -------------------------------------------------------------------------
00040 
00041 #ifndef G4tgbMaterialMgr_h
00042 #define G4tgbMaterialMgr_h
00043 
00044 #include "globals.hh"
00045 
00046 #include "G4tgbIsotope.hh"
00047 #include "G4tgbElement.hh"
00048 #include "G4tgbMaterial.hh"
00049 
00050 #include "G4tgrIsotope.hh"
00051 #include "G4tgrElement.hh"
00052 #include "G4tgrElement.hh"
00053 #include "G4tgrMaterial.hh"
00054 
00055 #include "G4Isotope.hh"
00056 #include "G4Element.hh"
00057 #include "G4Material.hh"
00058 
00059 typedef std::map< G4String, G4tgbIsotope* > G4mstgbisot;
00060 typedef std::map< G4String, G4tgbElement* > G4mstgbelem;
00061 typedef std::map< G4String, G4tgbMaterial* > G4mstgbmate;
00062 typedef std::map< G4String, G4Isotope* > G4msg4isot;
00063 typedef std::map< G4String, G4Element* > G4msg4elem;
00064 typedef std::map< G4String, G4Material* > G4msg4mate;
00065 
00066 class G4tgbMaterialMgr 
00067 {
00068   public:  // with description
00069 
00070     ~G4tgbMaterialMgr();
00071   
00072     static G4tgbMaterialMgr* GetInstance();
00073       // Get only instance (it it does not exists, create it)
00074 
00075     void CopyIsotopes();
00076       // Copy the G4tgrIsotopes into G4tgbIsotopes
00077     void CopyElements();
00078       // Copy the G4tgrElements into G4tgbElements
00079     void CopyMaterials();
00080       // Copy the G4tgrMaterials into G4tgbMaterials
00081 
00082     G4Isotope* FindOrBuildG4Isotope(const G4String & name);
00083       // Look for a G4Isotope that has to exists
00084       // (if not found create it from the corresponding G4tgbIsotope)
00085     G4Isotope* FindBuiltG4Isotope(const G4String & name) const;
00086       // Look for a G4Isotope and if not found return 0
00087     G4tgbIsotope* FindG4tgbIsotope(const G4String& name,
00088                                          G4bool bMustExist = 0) const;
00089       // Look for a G4Isotope and if not found return 0
00090 
00091     G4Element* FindOrBuildG4Element(const G4String & name,
00092                                           G4bool bMustExist = 1);
00093       // Look for a G4Element that has to exists by default
00094       // (if not found create it from the corresponding G4tgbElement)
00095     G4Element* FindBuiltG4Element(const G4String& name) const;
00096       // Look for a G4Element and if not found return 0
00097     G4tgbElement* FindG4tgbElement(const G4String& name,
00098                                          G4bool bMustExist = 0) const;
00099       // Look for a G4Element and if not found return 0
00100 
00101     G4Material* FindOrBuildG4Material(const G4String& name,
00102                                          G4bool bMustExist = 1);
00103      // Look for a G4Material that has to exists by default
00104      // (if not found create it from the corresponding G4tgbMaterial)
00105     G4Material* FindBuiltG4Material(const G4String& name) const;
00106      // Look for a G4Material and if not found return 0
00107     G4tgbMaterial* FindG4tgbMaterial(const G4String& name,
00108                                            G4bool bMustExist = 0) const;
00109      // Look for a G4tgbMaterial and if not found return 0
00110 
00111     const G4msg4isot GetG4IsotopeList()  const { return theG4Isotopes;  }
00112     const G4msg4elem GetG4ElementList()  const { return theG4Elements;  }
00113     const G4msg4mate GetG4MaterialList() const { return theG4Materials; }
00114 
00115  private:
00116 
00117     G4tgbMaterialMgr();
00118       // Private Constructor
00119   
00120  private:
00121 
00122     static G4tgbMaterialMgr* theInstance;
00123 
00124     G4mstgbisot theG4tgbIsotopes;
00125       // List of all tgbIsotopes created
00126     G4mstgbelem theG4tgbElements;
00127       // List of all tgbElements created
00128     G4mstgbmate theG4tgbMaterials;
00129       // List of all G4tgbMaterials created
00130     G4msg4isot theG4Isotopes;  
00131       // Container of all G4Isotopes created
00132     G4msg4elem theG4Elements;  
00133       // Container of all G4Elements created
00134     G4msg4mate theG4Materials;  
00135       // Container of all G4Materials created
00136 };
00137 
00138 #endif

Generated on Mon May 27 17:49:58 2013 for Geant4 by  doxygen 1.4.7