G4MaterialPropertiesTable.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: G4MaterialPropertiesTable.hh 67044 2013-01-30 08:50:06Z gcosmo $
00028 //
00030 //
00031 // class G4MaterialPropertiesTable
00032 //
00033 // Class description:
00034 //
00035 // A Material properties table is a hash table, with 
00036 // key = property name, and value either G4double or
00037 // G4MaterialPropertyVector
00038 
00039 // File:        G4MaterialPropertiesTable.hh
00040 // Version:     1.0
00041 // Created:     1996-02-08
00042 // Author:      Juliet Armstrong
00043 // Updated:     2005-05-12 add SetGROUPVEL() by P. Gumplinger
00044 //              2002-11-05 add named material constants by P. Gumplinger
00045 //              1999-11-05 Migration from G4RWTPtrHashDictionary to STL
00046 //                         by John Allison
00047 //              1999-10-29 add method and class descriptors
00048 //              1997-03-25 by Peter Gumplinger
00049 //              > cosmetics (only)
00050 // mail:        gum@triumf.ca
00051 //
00053 
00054 #ifndef G4MaterialPropertiesTable_h
00055 #define G4MaterialPropertiesTable_h 1
00056 
00058 // Includes
00060 
00061 #include <cmath>
00062 #include <map>
00063 #include "globals.hh"
00064 #include "G4MaterialPropertyVector.hh"
00065 
00067 // Class Definition
00069 
00070 class G4MaterialPropertiesTable
00071 {
00072   public: // Without description
00073 
00074     G4MaterialPropertiesTable(); 
00075    ~G4MaterialPropertiesTable();
00076 
00077   public: // With description
00078 
00079     inline void AddConstProperty(const char     *key,
00080                                  G4double PropertyValue);
00081     // Add a new property to the table by giving a key-name and value 
00082 
00083     inline G4MaterialPropertyVector* AddProperty(const char     *key,
00084                                                  G4double *PhotonEnergies,
00085                                                  G4double *PropertyValues,
00086                                                  G4int     NumEntries);
00087     // Add a new property to the table by giving a key-name and the
00088     // arrays x and y of size NumEntries.
00089 
00090     inline void AddProperty(const char *key, G4MaterialPropertyVector *opv);
00091     // Add a new property to the table by giving a key-name and an
00092     // already constructed G4MaterialPropertyVector.
00093 
00094     inline void RemoveConstProperty(const char *key);
00095     // Remove a constant property from the table.
00096 
00097     inline void RemoveProperty(const char *key);
00098     // Remove a property from the table.
00099 
00100     inline G4double GetConstProperty(const char *key);
00101     // Get the constant property from the table corresponding to the key-name
00102 
00103     inline G4bool ConstPropertyExists(const char *key);
00104     // Return true if a const property 'key' exists.
00105 
00106     inline G4MaterialPropertyVector* GetProperty(const char *key);
00107     // Get the property from the table corresponding to the key-name.
00108 
00109     inline void AddEntry(const char *key, G4double aPhotonEnergy,
00110                                           G4double aPropertyValue);
00111     // Add a new entry (pair of numbers) to the table for a given key.
00112 
00113     void DumpTable();
00114 
00115   public:  // without description
00116 
00117     const std::map< G4String, G4MaterialPropertyVector*, std::less<G4String> >*
00118     GetPropertiesMap() const { return &MPT; }
00119     const std::map< G4String, G4double, std::less<G4String> >*
00120     GetPropertiesCMap() const { return &MPTC; }
00121     // Accessors required for persistency purposes
00122 
00123   private:
00124 
00125     G4MaterialPropertyVector* SetGROUPVEL();
00126 
00127   private:
00128 
00129     std::map<G4String, G4MaterialPropertyVector*, std::less<G4String> > MPT;
00130     typedef std::map< G4String, G4MaterialPropertyVector*,
00131                       std::less<G4String> >::iterator MPTiterator;
00132 
00133     std::map< G4String, G4double, std::less<G4String> > MPTC;
00134     typedef std::map< G4String, G4double,
00135                       std::less<G4String> >::iterator MPTCiterator;
00136 };
00137 
00139 // Inline definitions
00141 
00142 #include "G4MaterialPropertiesTable.icc"
00143 
00144 #endif /* G4MaterialPropertiesTable_h */

Generated on Mon May 27 17:48:51 2013 for Geant4 by  doxygen 1.4.7