/scratch0/jsnuveri/BDSIM/BDSIMgit/bdsim/include/BDSMaterials.hh

00001 /* BDSIM code.    Version 1.0
00002    Author: Grahame A. Blair, Royal Holloway, Univ. of London.
00003    Last modified 24.7.2002
00004    Copyright (c) 2002 by G.A.Blair.  ALL RIGHTS RESERVED. 
00005 
00006    Added Get method to enable access to materials by passing a string
00007 */
00008 #ifndef BDSMaterials_h
00009 #define BDSMaterials_h 1
00010 
00011 #include <map>
00012 #include <list>
00013 
00014 #include "globals.hh"
00015 #include "G4Material.hh"
00016 
00017 class BDSMaterials
00018 {
00019 public:
00020 
00021   static BDSMaterials* Instance();
00022   ~BDSMaterials(); 
00023 
00025   void PrepareRequiredMaterials();
00026 
00028 
00036   void AddMaterial(G4Material* aMaterial,G4String aName);
00037   void AddMaterial(G4String aName,
00038                    G4double itsZ,
00039                    G4double itsA,
00040                    G4double itsDensity,
00041                    G4State  itsState, 
00042                    G4double itsTemp, 
00043                    G4double itsPressure);
00044 
00045   template <typename Type> void AddMaterial(
00046                         G4String aName, 
00047                         G4double itsDensity, 
00048                         G4State  itsState, 
00049                         G4double itsTemp, 
00050                         G4double itsPressure,
00051                         std::list<const char*> itsComponents,
00052                         std::list<Type> itsComponentsFractions);
00054 
00055   void AddElement(G4Element* aElement,G4String aName);
00056   void AddElement(G4String aName, G4String aSymbol, G4double itsZ, G4double itsA);
00057   
00059   // static since BDSMaterials construction needs BDSGlobalConstants, which needs full options definitions (not ideal, but alas)
00060   static void ListMaterials();
00061 
00062   G4Material* GetMaterial(G4String aMaterial); 
00063   G4Element*  GetElement(G4String aSymbol); 
00064   G4Element* GetElement(const char* aSymbol);
00065 
00066   G4bool CheckMaterial(G4String aMaterial); 
00067   G4bool CheckElement(G4String aSymbol); 
00068 
00069 protected:
00070   BDSMaterials();
00071   // map of materials, convention name lowercase
00072   std::map<G4String,G4Material*> materials; 
00073   std::map<G4String,G4Element*>  elements; 
00074 private:
00075   void Initialise(); 
00076 
00077   static BDSMaterials* _instance;
00078   G4MaterialPropertiesTable* airMaterialPropertiesTable;
00079   G4MaterialPropertiesTable* celluloseMaterialPropertiesTable;
00080   G4MaterialPropertiesTable* fsMaterialPropertiesTable;
00081   G4MaterialPropertiesTable* petMaterialPropertiesTable;
00082   G4MaterialPropertiesTable* vacMaterialPropertiesTable;
00083 
00084 };
00085 
00086 #endif

Generated on 28 Jun 2015 for BDSIM by  doxygen 1.4.7