Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4MaterialPropertiesTable.hh
이 파일의 문서화 페이지로 가기
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 // $Id: G4MaterialPropertiesTable.hh 108515 2018-02-16 07:15:12Z gcosmo $
28 //
30 //
31 // class G4MaterialPropertiesTable
32 //
33 // Class description:
34 //
35 // A Material properties table is a hash table, with
36 // key = property name, and value either G4double or
37 // G4MaterialPropertyVector
38 
39 // File: G4MaterialPropertiesTable.hh
40 // Version: 1.0
41 // Created: 1996-02-08
42 // Author: Juliet Armstrong
43 // Updated: 2005-05-12 add SetGROUPVEL() by P. Gumplinger
44 // 2002-11-05 add named material constants by P. Gumplinger
45 // 1999-11-05 Migration from G4RWTPtrHashDictionary to STL
46 // by John Allison
47 // 1999-10-29 add method and class descriptors
48 // 1997-03-25 by Peter Gumplinger
49 // > cosmetics (only)
50 // mail: gum@triumf.ca
51 //
53 
54 #ifndef G4MaterialPropertiesTable_h
55 #define G4MaterialPropertiesTable_h 1
56 
58 // Includes
60 
61 #include <cmath>
62 #include <map>
63 #include "globals.hh"
66 
68 // Class Definition
70 
72 {
73  public: // Without description
74 
77 
78  public: // With description
79 
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 
84  G4MaterialPropertyVector* 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.
90 
91  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.
94 
95  inline void RemoveConstProperty(const char *key);
96  // Remove a constant property from the table.
97 
98  inline void RemoveProperty(const char *key);
99  // Remove a property from the table.
100 
101  G4double GetConstProperty(const char *key) const;
102  // Get the constant property from the table corresponding to the key-name
103 
104  G4double GetConstProperty(const G4int index) const;
105  // Get the constant property from the table corresponding to the key-index
106 
107  G4bool ConstPropertyExists(const char *key) const;
108  // Return true if a const property 'key' exists.
109 
110  G4MaterialPropertyVector* GetProperty(const char *key,
111  G4bool warning=false);
112  // Get the property from the table corresponding to the key-name.
113 
115  G4bool warning=false);
116  // Get the property from the table corresponding to the key-index.
117 
118  void AddEntry(const char *key, G4double aPhotonEnergy,
119  G4double aPropertyValue);
120  // Add a new entry (pair of numbers) to the table for a given key.
121 
123  G4bool warning=false) const;
124  // Get the constant property index from the key-name
125 
126  G4int GetPropertyIndex(const G4String& key, G4bool warning=false) const;
127  // Get the property index by the key-name.
128 
129  std::vector<G4String> GetMaterialPropertyNames() const;
130  std::vector<G4String> GetMaterialConstPropertyNames() const;
131 
132  void DumpTable();
133 
134  public: // without description
135 
136  std::map< G4String, G4MaterialPropertyVector*, std::less<G4String> >*
137  GetPropertiesMap();
138  std::map< G4String, G4double, std::less<G4String> >*
140 
141  const std::map<G4int, G4MaterialPropertyVector*, std::less<G4int> >*
142  GetPropertyMap() const { return &MP; }
143  const std::map<G4int, G4double, std::less<G4int> >*
144  GetConstPropertyMap() const { return &MCP; }
145  // Accessors required for persistency purposes
146 
147  private:
148 
150  // Calculate the group velocity based on RINDEX
151 
153  // Dummy method: will be obsolete from the next (version 11) release
154 
155  private:
156 
157  std::map<G4String, G4MaterialPropertyVector*, std::less<G4String> > MPT;
158  typedef std::map< G4String, G4MaterialPropertyVector*,
159  std::less<G4String> >::const_iterator MPTiterator;
160 
161  std::map< G4String, G4double, std::less<G4String> > MPTC;
162  typedef std::map< G4String, G4double,
163  std::less<G4String> >::const_iterator MPTCiterator;
164  // MPT and MPTC will be obsolete when associate public interfaces,
165  // GetPropertiesMap and GetPropertiesCMap are removed from the version 11.
166 
167  std::map<G4int, G4MaterialPropertyVector*, std::less<G4int> > MP;
168  typedef std::map< G4int, G4MaterialPropertyVector*,
169  std::less<G4int> >::const_iterator MPiterator;
170 
171  std::map< G4int, G4double, std::less<G4int> > MCP;
172  typedef std::map< G4int, G4double,
173  std::less<G4int> >::const_iterator MCPiterator;
174  //material property map and constant property map by index types
175 
176  std::vector<G4String> G4MaterialPropertyName;
177  std::vector<G4String> G4MaterialConstPropertyName;
178  // vectors of strings of property names
179 
180 };
181 
183 // Inline definitions
185 
186 #include "G4MaterialPropertiesTable.icc"
187 
188 #endif /* G4MaterialPropertiesTable_h */
std::map< G4String, G4double, std::less< G4String > >::const_iterator MPTCiterator
const std::map< G4int, G4double, std::less< G4int > > * GetConstPropertyMap() const
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > >::const_iterator MPTiterator
const std::map< G4int, G4MaterialPropertyVector *, std::less< G4int > > * GetPropertyMap() const
G4double GetConstProperty(const char *key) const
std::map< G4int, G4double, std::less< G4int > >::const_iterator MCPiterator
void RemoveProperty(const char *key)
void AddConstProperty(const char *key, G4double PropertyValue)
std::vector< G4String > GetMaterialPropertyNames() const
std::map< G4String, G4double, std::less< G4String > > MPTC
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
G4bool ConstPropertyExists(const char *key) const
G4MaterialPropertyVector * CalculateGROUPVEL()
G4MaterialPropertyVector * AddProperty(const char *key, G4double *PhotonEnergies, G4double *PropertyValues, G4int NumEntries)
void AddEntry(const char *key, G4double aPhotonEnergy, G4double aPropertyValue)
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > > * GetPropertiesMap()
G4int GetPropertyIndex(const G4String &key, G4bool warning=false) const
std::vector< G4String > G4MaterialConstPropertyName
std::map< G4int, G4MaterialPropertyVector *, std::less< G4int > > MP
std::map< G4String, G4double, std::less< G4String > > * GetPropertiesCMap()
std::map< G4int, G4double, std::less< G4int > > MCP
std::vector< G4String > G4MaterialPropertyName
int G4int
Definition: G4Types.hh:78
std::vector< G4String > GetMaterialConstPropertyNames() const
G4MaterialPropertyVector * SetGROUPVEL()
std::map< G4String, G4MaterialPropertyVector *, std::less< G4String > > MPT
G4int GetConstPropertyIndex(const G4String &key, G4bool warning=false) const
G4MaterialPropertyVector * GetProperty(const char *key, G4bool warning=false)
void RemoveConstProperty(const char *key)
std::map< G4int, G4MaterialPropertyVector *, std::less< G4int > >::const_iterator MPiterator