| [822] | 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 | //
|
|---|
| [1058] | 27 | // $Id: G4MaterialPropertiesTable.hh,v 1.20 2009/04/21 15:35:45 gcosmo Exp $
|
|---|
| 28 | // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
|
|---|
| [822] | 29 | //
|
|---|
| 30 | ////////////////////////////////////////////////////////////////////////
|
|---|
| 31 | //
|
|---|
| [1058] | 32 | // class G4MaterialPropertiesTable
|
|---|
| 33 | //
|
|---|
| 34 | // Class description:
|
|---|
| 35 | //
|
|---|
| 36 | // A Material properties table is a hash table, with
|
|---|
| 37 | // key = property name, and value either G4double or
|
|---|
| 38 | // G4MaterialPropertyVector
|
|---|
| 39 |
|
|---|
| [822] | 40 | // File: G4MaterialPropertiesTable.hh
|
|---|
| 41 | // Version: 1.0
|
|---|
| 42 | // Created: 1996-02-08
|
|---|
| 43 | // Author: Juliet Armstrong
|
|---|
| 44 | // Updated: 2005-05-12 add SetGROUPVEL() by P. Gumplinger
|
|---|
| 45 | // 2002-11-05 add named material constants by P. Gumplinger
|
|---|
| 46 | // 1999-11-05 Migration from G4RWTPtrHashDictionary to STL
|
|---|
| 47 | // by John Allison
|
|---|
| 48 | // 1999-10-29 add method and class descriptors
|
|---|
| 49 | // 1997-03-25 by Peter Gumplinger
|
|---|
| 50 | // > cosmetics (only)
|
|---|
| 51 | // mail: gum@triumf.ca
|
|---|
| 52 | //
|
|---|
| 53 | ////////////////////////////////////////////////////////////////////////
|
|---|
| 54 |
|
|---|
| 55 | #ifndef G4MaterialPropertiesTable_h
|
|---|
| 56 | #define G4MaterialPropertiesTable_h 1
|
|---|
| 57 |
|
|---|
| 58 | /////////////
|
|---|
| 59 | // Includes
|
|---|
| 60 | /////////////
|
|---|
| 61 |
|
|---|
| 62 | #include <cmath>
|
|---|
| 63 | #include <map>
|
|---|
| 64 | #include "globals.hh"
|
|---|
| 65 | #include "G4MaterialPropertyVector.hh"
|
|---|
| 66 |
|
|---|
| 67 | /////////////////////
|
|---|
| 68 | // Class Definition
|
|---|
| 69 | /////////////////////
|
|---|
| 70 |
|
|---|
| [1058] | 71 | class G4MaterialPropertiesTable
|
|---|
| 72 | {
|
|---|
| 73 | public: // Without description
|
|---|
| [822] | 74 |
|
|---|
| [1058] | 75 | G4MaterialPropertiesTable();
|
|---|
| 76 | ~G4MaterialPropertiesTable();
|
|---|
| [822] | 77 |
|
|---|
| [1058] | 78 | public: // With description
|
|---|
| [822] | 79 |
|
|---|
| [1058] | 80 | inline void AddConstProperty(const char *key,
|
|---|
| 81 | G4double PropertyValue);
|
|---|
| 82 | // Add a new property to the table by giving a key-name and value
|
|---|
| [822] | 83 |
|
|---|
| [1058] | 84 | inline void AddProperty(const char *key,
|
|---|
| 85 | G4double *PhotonEnergies,
|
|---|
| 86 | G4double *PropertyValues,
|
|---|
| 87 | G4int NumEntries);
|
|---|
| 88 | // Add a new property to the table by giving a key-name and the
|
|---|
| 89 | // arrays x and y of size NumEntries.
|
|---|
| [822] | 90 |
|
|---|
| [1058] | 91 | inline void AddProperty(const char *key, G4MaterialPropertyVector *opv);
|
|---|
| 92 | // Add a new property to the table by giving a key-name and an
|
|---|
| 93 | // already constructed G4MaterialPropertyVector.
|
|---|
| [822] | 94 |
|
|---|
| [1058] | 95 | inline void RemoveConstProperty(const char *key);
|
|---|
| 96 | // Remove a constant property from the table.
|
|---|
| [822] | 97 |
|
|---|
| [1058] | 98 | inline void RemoveProperty(const char *key);
|
|---|
| 99 | // Remove a property from the table.
|
|---|
| [822] | 100 |
|
|---|
| [1058] | 101 | inline G4double GetConstProperty(const char *key);
|
|---|
| 102 | // Get the constant property from the table corresponding to the key-name
|
|---|
| [822] | 103 |
|
|---|
| [1058] | 104 | inline G4bool ConstPropertyExists(const char *key);
|
|---|
| 105 | // Return true if a const property 'key' exists.
|
|---|
| [822] | 106 |
|
|---|
| [1058] | 107 | inline G4MaterialPropertyVector* GetProperty(const char *key);
|
|---|
| 108 | // Get the property from the table corresponding to the key-name.
|
|---|
| [822] | 109 |
|
|---|
| [1058] | 110 | inline void AddEntry(const char *key, G4double aPhotonEnergy,
|
|---|
| 111 | G4double aPropertyValue);
|
|---|
| 112 | // Add a new entry (pair of numbers) to the table for a given key.
|
|---|
| [822] | 113 |
|
|---|
| [1058] | 114 | inline void RemoveEntry(const char *key, G4double aPhotonEnergy);
|
|---|
| 115 | // Remove an entry from the table for a given key and x-value.
|
|---|
| [822] | 116 |
|
|---|
| [1058] | 117 | void DumpTable();
|
|---|
| [822] | 118 |
|
|---|
| [1058] | 119 | public: // without description
|
|---|
| [822] | 120 |
|
|---|
| [1058] | 121 | const std::map< G4String, G4MaterialPropertyVector*, std::less<G4String> >*
|
|---|
| 122 | GetPropertiesMap() const { return &MPT; }
|
|---|
| 123 | const std::map< G4String, G4double, std::less<G4String> >*
|
|---|
| 124 | GetPropertiesCMap() const { return &MPTC; }
|
|---|
| 125 | // Accessors required for persistency purposes
|
|---|
| [822] | 126 |
|
|---|
| [1058] | 127 | private:
|
|---|
| [822] | 128 |
|
|---|
| [1058] | 129 | G4MaterialPropertyVector* SetGROUPVEL();
|
|---|
| [822] | 130 |
|
|---|
| [1058] | 131 | private:
|
|---|
| [822] | 132 |
|
|---|
| [1058] | 133 | std::map<G4String, G4MaterialPropertyVector*, std::less<G4String> > MPT;
|
|---|
| 134 | typedef std::map< G4String, G4MaterialPropertyVector*,
|
|---|
| 135 | std::less<G4String> >::iterator MPTiterator;
|
|---|
| [822] | 136 |
|
|---|
| [1058] | 137 | std::map< G4String, G4double, std::less<G4String> > MPTC;
|
|---|
| 138 | typedef std::map< G4String, G4double,
|
|---|
| 139 | std::less<G4String> >::iterator MPTCiterator;
|
|---|
| 140 | };
|
|---|
| [822] | 141 |
|
|---|
| [1058] | 142 | /////////////////////
|
|---|
| 143 | // Inline definitions
|
|---|
| 144 | /////////////////////
|
|---|
| [822] | 145 |
|
|---|
| [1058] | 146 | #include "G4MaterialPropertiesTable.icc"
|
|---|
| [822] | 147 |
|
|---|
| 148 | #endif /* G4MaterialPropertiesTable_h */
|
|---|