Import Geant4 11.0.0.beta source tree
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
//
|
||||
// Class description:
|
||||
//
|
||||
// A Material properties table is a hash table, with
|
||||
// A Material properties table is a hash table, with
|
||||
// key = property name, and value either G4double or
|
||||
// G4MaterialPropertyVector
|
||||
|
||||
@@ -52,153 +52,127 @@
|
||||
#ifndef G4MaterialPropertiesTable_h
|
||||
#define G4MaterialPropertiesTable_h 1
|
||||
|
||||
/////////////
|
||||
// Includes
|
||||
/////////////
|
||||
|
||||
#include <cmath>
|
||||
#include <map>
|
||||
#include "globals.hh"
|
||||
#include "G4MaterialPropertiesIndex.hh"
|
||||
#include "G4MaterialPropertyVector.hh"
|
||||
|
||||
/////////////////////
|
||||
// Class Definition
|
||||
/////////////////////
|
||||
#include <map>
|
||||
|
||||
class G4MaterialPropertiesTable
|
||||
{
|
||||
public: // Without description
|
||||
public:
|
||||
G4MaterialPropertiesTable();
|
||||
virtual ~G4MaterialPropertiesTable();
|
||||
|
||||
G4MaterialPropertiesTable();
|
||||
virtual ~G4MaterialPropertiesTable();
|
||||
void AddConstProperty(const G4String& key, G4double PropertyValue,
|
||||
G4bool createNewKey = false);
|
||||
void AddConstProperty(const char* key, G4double PropertyValue,
|
||||
G4bool createNewKey = false);
|
||||
// Add a new property to the table by giving a key-name and value
|
||||
|
||||
public: // With description
|
||||
G4MaterialPropertyVector* AddProperty(
|
||||
const G4String& key, const std::vector<G4double>& photonEnergies,
|
||||
const std::vector<G4double>& propertyValues, G4bool createNewKey = false);
|
||||
// Add a new property to the table by giving a key-name and
|
||||
// vectors of values
|
||||
|
||||
inline void AddConstProperty(const G4String& key,
|
||||
G4double PropertyValue);
|
||||
inline void AddConstProperty(const char *key,
|
||||
G4double PropertyValue);
|
||||
// Add a new property to the table by giving a key-name and value
|
||||
G4MaterialPropertyVector* AddProperty(const char* key,
|
||||
G4double* PhotonEnergies,
|
||||
G4double* PropertyValues,
|
||||
G4int NumEntries,
|
||||
G4bool createNewKey = false);
|
||||
// Add a new property to the table by giving a key-name and the
|
||||
// arrays x and y of size NumEntries.
|
||||
|
||||
G4MaterialPropertyVector* AddProperty(const G4String& key,
|
||||
const std::vector<G4double>& photonEnergies,
|
||||
const std::vector<G4double>& propertyValues);
|
||||
void AddProperty(const G4String& key, G4MaterialPropertyVector* opv,
|
||||
G4bool createNewKey = false);
|
||||
void AddProperty(const char* key, G4MaterialPropertyVector* opv,
|
||||
G4bool createNewKey = false);
|
||||
// Add a new property to the table by giving a key-name and an
|
||||
// already constructed G4MaterialPropertyVector.
|
||||
|
||||
G4MaterialPropertyVector* AddProperty(const char *key,
|
||||
G4double *PhotonEnergies,
|
||||
G4double *PropertyValues,
|
||||
G4int NumEntries);
|
||||
// Add a new property to the table by giving a key-name and the
|
||||
// arrays x and y of size NumEntries.
|
||||
void AddProperty(const G4String& key, const G4String& mat);
|
||||
// Add a new property to the table by giving a key name and a material
|
||||
// name. Properties are in namespace G4OpticalMaterialProperties
|
||||
// Not possible to create a new key with this method.
|
||||
|
||||
void AddProperty(const G4String& key, G4MaterialPropertyVector* opv);
|
||||
void AddProperty(const char *key, G4MaterialPropertyVector *opv);
|
||||
// Add a new property to the table by giving a key-name and an
|
||||
// already constructed G4MaterialPropertyVector.
|
||||
void RemoveConstProperty(const G4String& key);
|
||||
void RemoveConstProperty(const char* key);
|
||||
// Remove a constant property from the table.
|
||||
|
||||
inline void RemoveConstProperty(const G4String& key);
|
||||
inline void RemoveConstProperty(const char *key);
|
||||
// Remove a constant property from the table.
|
||||
void RemoveProperty(const G4String& key);
|
||||
void RemoveProperty(const char* key);
|
||||
// Remove a property from the table.
|
||||
|
||||
inline void RemoveProperty(const G4String& key);
|
||||
inline void RemoveProperty(const char *key);
|
||||
// Remove a property from the table.
|
||||
G4double GetConstProperty(const G4String& key) const;
|
||||
G4double GetConstProperty(const char* key) const;
|
||||
// Get the constant property from the table corresponding to the key-name
|
||||
|
||||
G4double GetConstProperty(const G4String& key) const;
|
||||
G4double GetConstProperty(const char *key) const;
|
||||
// Get the constant property from the table corresponding to the key-name
|
||||
G4double GetConstProperty(const G4int index) const;
|
||||
// Get the constant property from the table corresponding to the key-index
|
||||
|
||||
G4double GetConstProperty(const G4int index) const;
|
||||
// Get the constant property from the table corresponding to the key-index
|
||||
G4bool ConstPropertyExists(const G4String& key) const;
|
||||
G4bool ConstPropertyExists(const char* key) const;
|
||||
// Return true if a const property 'key' exists.
|
||||
|
||||
G4bool ConstPropertyExists(const G4String& key) const;
|
||||
G4bool ConstPropertyExists(const char *key) const;
|
||||
// Return true if a const property 'key' exists.
|
||||
G4bool ConstPropertyExists(const G4int index) const;
|
||||
// Return true if a const property with key-index 'index' exists.
|
||||
|
||||
G4bool ConstPropertyExists(const G4int index) const;
|
||||
// Return true if a const property with key-index 'index' exists.
|
||||
G4MaterialPropertyVector* GetProperty(const char* key,
|
||||
G4bool warning = false);
|
||||
G4MaterialPropertyVector* GetProperty(const G4String& key,
|
||||
G4bool warning = false);
|
||||
// Get the property from the table corresponding to the key-name.
|
||||
|
||||
G4MaterialPropertyVector* GetProperty(const char *key,
|
||||
G4bool warning=false);
|
||||
G4MaterialPropertyVector* GetProperty(const G4String& key,
|
||||
G4bool warning=false);
|
||||
// Get the property from the table corresponding to the key-name.
|
||||
G4MaterialPropertyVector* GetProperty(const G4int index,
|
||||
G4bool warning = false);
|
||||
// Get the property from the table corresponding to the key-index.
|
||||
|
||||
G4MaterialPropertyVector* GetProperty(const G4int index,
|
||||
G4bool warning=false);
|
||||
// Get the property from the table corresponding to the key-index.
|
||||
void AddEntry(const G4String& key, G4double aPhotonEnergy,
|
||||
G4double aPropertyValue);
|
||||
void AddEntry(const char* key, G4double aPhotonEnergy,
|
||||
G4double aPropertyValue);
|
||||
// Add a new entry (pair of numbers) to the table for a given key.
|
||||
|
||||
void AddEntry(const G4String& key, G4double aPhotonEnergy,
|
||||
G4double aPropertyValue);
|
||||
void AddEntry(const char *key, G4double aPhotonEnergy,
|
||||
G4double aPropertyValue);
|
||||
// Add a new entry (pair of numbers) to the table for a given key.
|
||||
G4int GetConstPropertyIndex(const G4String& key,
|
||||
G4bool warning = false) const;
|
||||
// Get the constant property index from the key-name
|
||||
|
||||
G4int GetConstPropertyIndex(const G4String& key,
|
||||
G4bool warning=false) const;
|
||||
// Get the constant property index from the key-name
|
||||
G4int GetPropertyIndex(const G4String& key, G4bool warning = false) const;
|
||||
// Get the property index by the key-name.
|
||||
|
||||
G4int GetPropertyIndex(const G4String& key, G4bool warning=false) const;
|
||||
// Get the property index by the key-name.
|
||||
std::vector<G4String> GetMaterialPropertyNames() const;
|
||||
std::vector<G4String> GetMaterialConstPropertyNames() const;
|
||||
|
||||
std::vector<G4String> GetMaterialPropertyNames() const;
|
||||
std::vector<G4String> GetMaterialConstPropertyNames() const;
|
||||
void DumpTable();
|
||||
|
||||
void DumpTable();
|
||||
const std::map<G4int, G4MaterialPropertyVector*, std::less<G4int>>*
|
||||
GetPropertyMap() const
|
||||
{
|
||||
return &MP;
|
||||
}
|
||||
const std::map<G4int, G4double, std::less<G4int>>* GetConstPropertyMap() const
|
||||
{
|
||||
return &MCP;
|
||||
}
|
||||
// Accessors required for persistency purposes
|
||||
|
||||
public: // without description
|
||||
private:
|
||||
G4MaterialPropertyVector* CalculateGROUPVEL();
|
||||
// Calculate the group velocity based on RINDEX
|
||||
|
||||
std::map< G4String, G4MaterialPropertyVector*, std::less<G4String> >*
|
||||
GetPropertiesMap();
|
||||
std::map< G4String, G4double, std::less<G4String> >*
|
||||
GetPropertiesCMap();
|
||||
std::map<G4int, G4MaterialPropertyVector*, std::less<G4int>> MP;
|
||||
typedef std::map<G4int, G4MaterialPropertyVector*,
|
||||
std::less<G4int>>::const_iterator MPiterator;
|
||||
|
||||
const std::map<G4int, G4MaterialPropertyVector*, std::less<G4int> >*
|
||||
GetPropertyMap() const { return &MP; }
|
||||
const std::map<G4int, G4double, std::less<G4int> >*
|
||||
GetConstPropertyMap() const { return &MCP; }
|
||||
// Accessors required for persistency purposes
|
||||
|
||||
private:
|
||||
|
||||
G4MaterialPropertyVector* CalculateGROUPVEL();
|
||||
// Calculate the group velocity based on RINDEX
|
||||
|
||||
G4MaterialPropertyVector* SetGROUPVEL();
|
||||
// Dummy method: will be obsolete from the next (version 11) release
|
||||
|
||||
private:
|
||||
|
||||
std::map<G4String, G4MaterialPropertyVector*, std::less<G4String> > MPT;
|
||||
typedef std::map< G4String, G4MaterialPropertyVector*,
|
||||
std::less<G4String> >::const_iterator MPTiterator;
|
||||
|
||||
std::map< G4String, G4double, std::less<G4String> > MPTC;
|
||||
typedef std::map< G4String, G4double,
|
||||
std::less<G4String> >::const_iterator MPTCiterator;
|
||||
// MPT and MPTC will be obsolete when associate public interfaces,
|
||||
// GetPropertiesMap and GetPropertiesCMap are removed from the version 11.
|
||||
|
||||
std::map<G4int, G4MaterialPropertyVector*, std::less<G4int> > MP;
|
||||
typedef std::map< G4int, G4MaterialPropertyVector*,
|
||||
std::less<G4int> >::const_iterator MPiterator;
|
||||
|
||||
std::map< G4int, G4double, std::less<G4int> > MCP;
|
||||
typedef std::map< G4int, G4double,
|
||||
std::less<G4int> >::const_iterator MCPiterator;
|
||||
//material property map and constant property map by index types
|
||||
|
||||
std::vector<G4String> G4MaterialPropertyName;
|
||||
std::vector<G4String> G4MaterialConstPropertyName;
|
||||
// vectors of strings of property names
|
||||
std::map<G4int, G4double, std::less<G4int>> MCP;
|
||||
typedef std::map<G4int, G4double, std::less<G4int>>::const_iterator
|
||||
MCPiterator;
|
||||
// material property map and constant property map by index types
|
||||
|
||||
std::vector<G4String> G4MaterialPropertyName;
|
||||
std::vector<G4String> G4MaterialConstPropertyName;
|
||||
// vectors of strings of property names
|
||||
};
|
||||
|
||||
/////////////////////
|
||||
// Inline definitions
|
||||
/////////////////////
|
||||
|
||||
#include "G4MaterialPropertiesTable.icc"
|
||||
|
||||
#endif /* G4MaterialPropertiesTable_h */
|
||||
|
||||
Reference in New Issue
Block a user