Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MaterialPropertiesTable.hh
Go to the documentation of this file.
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//
28////////////////////////////////////////////////////////////////////////
29//
30// class G4MaterialPropertiesTable
31//
32// Class description:
33//
34// A Material properties table is a hash table, with
35// key = property name, and value either G4double or
36// G4MaterialPropertyVector
37
38// File: G4MaterialPropertiesTable.hh
39// Version: 1.0
40// Created: 1996-02-08
41// Author: Juliet Armstrong
42// Updated: 2005-05-12 add SetGROUPVEL() by P. Gumplinger
43// 2002-11-05 add named material constants by P. Gumplinger
44// 1999-11-05 Migration from G4RWTPtrHashDictionary to STL
45// by John Allison
46// 1999-10-29 add method and class descriptors
47// 1997-03-25 by Peter Gumplinger
48// > cosmetics (only)
49//
50////////////////////////////////////////////////////////////////////////
51
52#ifndef G4MaterialPropertiesTable_h
53#define G4MaterialPropertiesTable_h 1
54
55/////////////
56// Includes
57/////////////
58
59#include <cmath>
60#include <map>
61#include "globals.hh"
64
65/////////////////////
66// Class Definition
67/////////////////////
68
70{
71 public: // Without description
72
75
76 public: // With description
77
78 inline void AddConstProperty(const G4String& key,
79 G4double PropertyValue);
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
83
85 const std::vector<G4double>& photonEnergies,
86 const std::vector<G4double>& propertyValues);
87
89 G4double *PhotonEnergies,
90 G4double *PropertyValues,
91 G4int NumEntries);
92 // Add a new property to the table by giving a key-name and the
93 // arrays x and y of size NumEntries.
94
95 void AddProperty(const G4String& key, G4MaterialPropertyVector* opv);
96 void AddProperty(const char *key, G4MaterialPropertyVector *opv);
97 // Add a new property to the table by giving a key-name and an
98 // already constructed G4MaterialPropertyVector.
99
100 inline void RemoveConstProperty(const G4String& key);
101 inline void RemoveConstProperty(const char *key);
102 // Remove a constant property from the table.
103
104 inline void RemoveProperty(const G4String& key);
105 inline void RemoveProperty(const char *key);
106 // Remove a property from the table.
107
108 G4double GetConstProperty(const G4String& key) const;
109 G4double GetConstProperty(const char *key) const;
110 // Get the constant property from the table corresponding to the key-name
111
112 G4double GetConstProperty(const G4int index) const;
113 // Get the constant property from the table corresponding to the key-index
114
115 G4bool ConstPropertyExists(const G4String& key) const;
116 G4bool ConstPropertyExists(const char *key) const;
117 // Return true if a const property 'key' exists.
118
119 G4bool ConstPropertyExists(const G4int index) const;
120 // Return true if a const property with key-index 'index' exists.
121
122 G4MaterialPropertyVector* GetProperty(const char *key,
123 G4bool warning=false);
125 G4bool warning=false);
126 // Get the property from the table corresponding to the key-name.
127
129 G4bool warning=false);
130 // Get the property from the table corresponding to the key-index.
131
132 void AddEntry(const G4String& key, G4double aPhotonEnergy,
133 G4double aPropertyValue);
134 void AddEntry(const char *key, G4double aPhotonEnergy,
135 G4double aPropertyValue);
136 // Add a new entry (pair of numbers) to the table for a given key.
137
139 G4bool warning=false) const;
140 // Get the constant property index from the key-name
141
142 G4int GetPropertyIndex(const G4String& key, G4bool warning=false) const;
143 // Get the property index by the key-name.
144
145 std::vector<G4String> GetMaterialPropertyNames() const;
146 std::vector<G4String> GetMaterialConstPropertyNames() const;
147
148 void DumpTable();
149
150 public: // without description
151
152 std::map< G4String, G4MaterialPropertyVector*, std::less<G4String> >*
154 std::map< G4String, G4double, std::less<G4String> >*
156
157 const std::map<G4int, G4MaterialPropertyVector*, std::less<G4int> >*
158 GetPropertyMap() const { return &MP; }
159 const std::map<G4int, G4double, std::less<G4int> >*
160 GetConstPropertyMap() const { return &MCP; }
161 // Accessors required for persistency purposes
162
163 private:
164
165 G4MaterialPropertyVector* CalculateGROUPVEL();
166 // Calculate the group velocity based on RINDEX
167
168 G4MaterialPropertyVector* SetGROUPVEL();
169 // Dummy method: will be obsolete from the next (version 11) release
170
171 private:
172
173 std::map<G4String, G4MaterialPropertyVector*, std::less<G4String> > MPT;
174 typedef std::map< G4String, G4MaterialPropertyVector*,
175 std::less<G4String> >::const_iterator MPTiterator;
176
177 std::map< G4String, G4double, std::less<G4String> > MPTC;
178 typedef std::map< G4String, G4double,
179 std::less<G4String> >::const_iterator MPTCiterator;
180 // MPT and MPTC will be obsolete when associate public interfaces,
181 // GetPropertiesMap and GetPropertiesCMap are removed from the version 11.
182
183 std::map<G4int, G4MaterialPropertyVector*, std::less<G4int> > MP;
184 typedef std::map< G4int, G4MaterialPropertyVector*,
185 std::less<G4int> >::const_iterator MPiterator;
186
187 std::map< G4int, G4double, std::less<G4int> > MCP;
188 typedef std::map< G4int, G4double,
189 std::less<G4int> >::const_iterator MCPiterator;
190 //material property map and constant property map by index types
191
192 std::vector<G4String> G4MaterialPropertyName;
193 std::vector<G4String> G4MaterialConstPropertyName;
194 // vectors of strings of property names
195
196};
197
198/////////////////////
199// Inline definitions
200/////////////////////
201
202#include "G4MaterialPropertiesTable.icc"
203
204#endif /* G4MaterialPropertiesTable_h */
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
std::vector< G4String > GetMaterialPropertyNames() const
G4MaterialPropertyVector * GetProperty(const char *key, G4bool warning=false)
std::vector< G4String > GetMaterialConstPropertyNames() const
std::map< G4String, G4double, std::less< G4String > > * GetPropertiesCMap()
G4int GetPropertyIndex(const G4String &key, G4bool warning=false) const
G4int GetConstPropertyIndex(const G4String &key, G4bool warning=false) const
G4MaterialPropertyVector * AddProperty(const G4String &key, const std::vector< G4double > &photonEnergies, const std::vector< G4double > &propertyValues)
G4bool ConstPropertyExists(const G4String &key) const
const std::map< G4int, G4double, std::less< G4int > > * GetConstPropertyMap() const
void RemoveProperty(const G4String &key)
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > > * GetPropertiesMap()
void AddConstProperty(const G4String &key, G4double PropertyValue)
void AddConstProperty(const char *key, G4double PropertyValue)
void RemoveConstProperty(const char *key)
G4double GetConstProperty(const G4String &key) const
void AddEntry(const G4String &key, G4double aPhotonEnergy, G4double aPropertyValue)
void RemoveProperty(const char *key)
const std::map< G4int, G4MaterialPropertyVector *, std::less< G4int > > * GetPropertyMap() const
void RemoveConstProperty(const G4String &key)