Import Geant4 10.4.1 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History 106997 2017-10-31 10:22:36Z gcosmo $
|
||||
$Id: History 108517 2018-02-16 08:18:55Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,21 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
15-02-18 D.Sawkey (materials-V10-03-15)
|
||||
- G4MaterialPropertiesTable: Restore return of nullptr if material property
|
||||
not found. Add bool to print warnings. Continuation of bug #2030
|
||||
|
||||
12-02-18 V.Ivanchenko (materials-V10-03-14)
|
||||
- G4OpticalSurface - move static methods to source
|
||||
|
||||
07-02-18 D.Sawkey
|
||||
- Re-enable user-defined material properties (fix bug #2030)
|
||||
in G4MaterialPropertiesTable and G4MaterialPropertiesIndex
|
||||
|
||||
19-12-17 G.Cosmo
|
||||
- Fixed self-consistency in headers (missing #include) in G4ElementTable and
|
||||
G4MaterialTable. Thanks to Raphael Isemann for reporting these.
|
||||
|
||||
20-10-17 S.Y.Jun (materials-V10-03-13)
|
||||
- G4MaterialPropertiesTable - rename SetGROUPVEL to CalculateGROUPVEL
|
||||
and move it from GetProperty to AddProperty to resolve a MT scaling
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ElementTable.hh 66811 2013-01-12 16:04:23Z gcosmo $
|
||||
// $Id: G4ElementTable.hh 108492 2018-02-15 15:00:12Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -38,6 +38,8 @@
|
||||
#ifndef G4ELEMENTTABLE_HH
|
||||
#define G4ELEMENTTABLE_HH
|
||||
|
||||
#include <vector>
|
||||
|
||||
class G4Element;
|
||||
|
||||
typedef std::vector<G4Element*> G4ElementTable;
|
||||
|
||||
@@ -65,34 +65,6 @@ enum G4MaterialPropertyIndex {
|
||||
kNumberOfPropertyIndex // the number of G4MaterialPropertyIndex
|
||||
} ;
|
||||
|
||||
typedef G4MaterialPropertyIndex G4MPindex;
|
||||
|
||||
const std::vector<G4String> G4MaterialPropertyName = {
|
||||
"RINDEX",
|
||||
"REFLECTIVITY",
|
||||
"REALRINDEX",
|
||||
"IMAGINARYRINDEX",
|
||||
"EFFICIENCY",
|
||||
"TRANSMITTANCE",
|
||||
"SPECULARLOBECONSTANT",
|
||||
"SPECULARSPIKECONSTANT",
|
||||
"BACKSCATTERCONSTANT",
|
||||
"GROUPVEL",
|
||||
"MIEHG",
|
||||
"RAYLEIGH",
|
||||
"WLSCOMPONENT",
|
||||
"WLSABSLENGTH",
|
||||
"ABSLENGTH",
|
||||
"FASTCOMPONENT",
|
||||
"SLOWCOMPONENT",
|
||||
"PROTONSCINTILLATIONYIELD",
|
||||
"DEUTERONSCINTILLATIONYIELD",
|
||||
"TRITONSCINTILLATIONYIELD",
|
||||
"ALPHASCINTILLATIONYIELD",
|
||||
"IONSCINTILLATIONYIELD",
|
||||
"ELECTRONSCINTILLATIONYIELD"
|
||||
};
|
||||
|
||||
enum G4MaterialConstPropertyIndex
|
||||
{
|
||||
kNullConstPropertyIndex = -1, // the number of G4MaterialPropertyIndex
|
||||
@@ -132,42 +104,4 @@ enum G4MaterialConstPropertyIndex
|
||||
kNumberOfConstPropertyIndex // the number of G4MaterialConstPropertyIndex
|
||||
};
|
||||
|
||||
typedef G4MaterialConstPropertyIndex G4MCPindex;
|
||||
|
||||
const std::vector<G4String> G4MaterialConstPropertyName = {
|
||||
"SURFACEROUGHNESS",
|
||||
"ISOTHERMAL_COMPRESSIBILITY",
|
||||
"RS_SCALE_FACTOR",
|
||||
"WLSMEANNUMBERPHOTONS",
|
||||
"WLSTIMECONSTANT",
|
||||
"MIEHG_FORWARD",
|
||||
"MIEHG_BACKWARD",
|
||||
"MIEHG_FORWARD_RATIO",
|
||||
"SCINTILLATIONYIELD",
|
||||
"RESOLUTIONSCALE",
|
||||
"FASTTIMECONSTANT",
|
||||
"FASTSCINTILLATIONRISETIME",
|
||||
"SLOWTIMECONSTANT",
|
||||
"SLOWSCINTILLATIONRISETIME",
|
||||
"YIELDRATIO",
|
||||
"FERMIPOT",
|
||||
"DIFFUSION",
|
||||
"SPINFLIP",
|
||||
"LOSS",
|
||||
"LOSSCS",
|
||||
"ABSCS",
|
||||
"SCATCS",
|
||||
"MR_NBTHETA",
|
||||
"MR_NBE",
|
||||
"MR_RRMS",
|
||||
"MR_CORRLEN",
|
||||
"MR_THETAMIN",
|
||||
"MR_THETAMAX",
|
||||
"MR_EMIN",
|
||||
"MR_EMAX",
|
||||
"MR_ANGNOTHETA",
|
||||
"MR_ANGNOPHI",
|
||||
"MR_ANGCUT"
|
||||
};
|
||||
|
||||
#endif /* G4MaterialPropertiesIndex_h */
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MaterialPropertiesTable.hh 106997 2017-10-31 10:22:36Z gcosmo $
|
||||
// $Id: G4MaterialPropertiesTable.hh 108517 2018-02-16 08:18:55Z gcosmo $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -101,28 +101,34 @@ class G4MaterialPropertiesTable
|
||||
G4double GetConstProperty(const char *key) const;
|
||||
// Get the constant property from the table corresponding to the key-name
|
||||
|
||||
G4double GetConstProperty(const G4MCPindex index) const;
|
||||
G4double GetConstProperty(const G4int index) const;
|
||||
// Get the constant property from the table corresponding to the key-index
|
||||
|
||||
G4bool ConstPropertyExists(const char *key) const;
|
||||
// Return true if a const property 'key' exists.
|
||||
|
||||
G4MaterialPropertyVector* GetProperty(const char *key);
|
||||
G4MaterialPropertyVector* GetProperty(const char *key,
|
||||
G4bool warning=false);
|
||||
// Get the property from the table corresponding to the key-name.
|
||||
|
||||
G4MaterialPropertyVector* GetProperty(const G4MPindex index);
|
||||
G4MaterialPropertyVector* GetProperty(const G4int index,
|
||||
G4bool warning=false);
|
||||
// Get the property from the table corresponding to the key-index.
|
||||
|
||||
void AddEntry(const char *key, G4double aPhotonEnergy,
|
||||
G4double aPropertyValue);
|
||||
// Add a new entry (pair of numbers) to the table for a given key.
|
||||
|
||||
G4MCPindex GetConstPropertyIndex(const G4String& key) const;
|
||||
G4int GetConstPropertyIndex(const G4String& key,
|
||||
G4bool warning=false) const;
|
||||
// Get the constant property index from the key-name
|
||||
|
||||
G4MPindex GetPropertyIndex(const G4String& key) const;
|
||||
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;
|
||||
|
||||
void DumpTable();
|
||||
|
||||
public: // without description
|
||||
@@ -132,9 +138,9 @@ class G4MaterialPropertiesTable
|
||||
std::map< G4String, G4double, std::less<G4String> >*
|
||||
GetPropertiesCMap();
|
||||
|
||||
const std::map<G4MPindex, G4MaterialPropertyVector*, std::less<G4MPindex> >*
|
||||
const std::map<G4int, G4MaterialPropertyVector*, std::less<G4int> >*
|
||||
GetPropertyMap() const { return &MP; }
|
||||
const std::map<G4MCPindex, G4double, std::less<G4MCPindex> >*
|
||||
const std::map<G4int, G4double, std::less<G4int> >*
|
||||
GetConstPropertyMap() const { return &MCP; }
|
||||
// Accessors required for persistency purposes
|
||||
|
||||
@@ -158,14 +164,19 @@ class G4MaterialPropertiesTable
|
||||
// MPT and MPTC will be obsolete when associate public interfaces,
|
||||
// GetPropertiesMap and GetPropertiesCMap are removed from the version 11.
|
||||
|
||||
std::map<G4MPindex, G4MaterialPropertyVector*, std::less<G4MPindex> > MP;
|
||||
typedef std::map< G4MPindex, G4MaterialPropertyVector*,
|
||||
std::less<G4MPindex> >::const_iterator MPiterator;
|
||||
std::map<G4int, G4MaterialPropertyVector*, std::less<G4int> > MP;
|
||||
typedef std::map< G4int, G4MaterialPropertyVector*,
|
||||
std::less<G4int> >::const_iterator MPiterator;
|
||||
|
||||
std::map< G4MCPindex, G4double, std::less<G4MCPindex> > MCP;
|
||||
typedef std::map< G4MCPindex, G4double,
|
||||
std::less<G4MCPindex> >::const_iterator MCPiterator;
|
||||
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
|
||||
|
||||
};
|
||||
|
||||
/////////////////////
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MaterialPropertiesTable.icc 106997 2017-10-31 10:22:36Z gcosmo $
|
||||
// $Id: G4MaterialPropertiesTable.icc 108492 2018-02-15 15:00:12Z gcosmo $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -45,14 +45,21 @@ void G4MaterialPropertiesTable::AddConstProperty(const char *key,
|
||||
{
|
||||
// Provides a way of adding a constant property to the Material Properties
|
||||
// Table given a key
|
||||
G4MCPindex index = GetConstPropertyIndex(G4String(key));
|
||||
G4String k(key);
|
||||
if (std::find(G4MaterialConstPropertyName.begin(),
|
||||
G4MaterialConstPropertyName.end(), k) ==
|
||||
G4MaterialConstPropertyName.end()) {
|
||||
G4MaterialConstPropertyName.push_back(k);
|
||||
}
|
||||
G4int index = GetConstPropertyIndex(k);
|
||||
|
||||
MCP[index] = PropertyValue;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4MaterialPropertiesTable::RemoveConstProperty(const char *key)
|
||||
{
|
||||
G4MCPindex index = GetConstPropertyIndex(G4String(key));
|
||||
G4int index = GetConstPropertyIndex(G4String(key));
|
||||
|
||||
MCP.erase(index);
|
||||
}
|
||||
@@ -60,6 +67,6 @@ void G4MaterialPropertiesTable::RemoveConstProperty(const char *key)
|
||||
inline
|
||||
void G4MaterialPropertiesTable::RemoveProperty(const char *key)
|
||||
{
|
||||
G4MPindex index = GetPropertyIndex(G4String(key));
|
||||
G4int index = GetPropertyIndex(G4String(key));
|
||||
MP.erase(index);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MaterialTable.hh 66811 2013-01-12 16:04:23Z gcosmo $
|
||||
// $Id: G4MaterialTable.hh 108492 2018-02-15 15:00:12Z gcosmo $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -38,6 +38,8 @@
|
||||
#ifndef G4MATERIALTABLE_HH
|
||||
#define G4MATERIALTABLE_HH
|
||||
|
||||
#include <vector>
|
||||
|
||||
class G4Material;
|
||||
|
||||
typedef std::vector<G4Material*> G4MaterialTable;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpticalSurface.hh 104459 2017-05-31 15:54:52Z gcosmo $
|
||||
// $Id: G4OpticalSurface.hh 108492 2018-02-15 15:00:12Z gcosmo $
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -219,17 +219,17 @@ public: // With description
|
||||
inline G4double GetReflectivityLUTValue(G4int);
|
||||
// Returns the reflectivity value from the Davis Look-Up-Table
|
||||
|
||||
inline G4int GetInmax(void) const { return indexmax; }
|
||||
G4int GetInmax(void) const;
|
||||
// Returns the number of lines in the Davis Look-Up-Table
|
||||
|
||||
inline G4int GetLUTbins(void) const { return LUTbins; }
|
||||
G4int GetLUTbins(void) const;
|
||||
// Returns the number of probability values per incidentangle
|
||||
|
||||
inline G4int GetRefMax(void) const { return RefMax; }
|
||||
G4int GetRefMax(void) const;
|
||||
// Returns the number of reflectivity values per angle
|
||||
|
||||
inline G4int GetThetaIndexMax(void) const { return thetaIndexMax; }
|
||||
inline G4int GetPhiIndexMax(void) const { return phiIndexMax; }
|
||||
G4int GetThetaIndexMax(void) const;
|
||||
G4int GetPhiIndexMax(void) const;
|
||||
|
||||
void ReadDichroicFile(void);
|
||||
// Method to read the dichroic surface data file into Dichroic
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MaterialPropertiesTable.cc 106997 2017-10-31 10:22:36Z gcosmo $
|
||||
// $Id: G4MaterialPropertiesTable.cc 108517 2018-02-16 08:18:55Z gcosmo $
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -59,6 +59,65 @@
|
||||
|
||||
G4MaterialPropertiesTable::G4MaterialPropertiesTable()
|
||||
{
|
||||
// elements of these 2 vectors must be in same order as
|
||||
// the corresponding enums in G4MaterialPropertiesIndex.hh
|
||||
G4MaterialPropertyName.push_back(G4String("RINDEX"));
|
||||
G4MaterialPropertyName.push_back(G4String("REFLECTIVITY"));
|
||||
G4MaterialPropertyName.push_back(G4String("REALRINDEX"));
|
||||
G4MaterialPropertyName.push_back(G4String("IMAGINARYRINDEX"));
|
||||
G4MaterialPropertyName.push_back(G4String("EFFICIENCY"));
|
||||
G4MaterialPropertyName.push_back(G4String("TRANSMITTANCE"));
|
||||
G4MaterialPropertyName.push_back(G4String("SPECULARLOBECONSTANT"));
|
||||
G4MaterialPropertyName.push_back(G4String("SPECULARSPIKECONSTANT"));
|
||||
G4MaterialPropertyName.push_back(G4String("BACKSCATTERCONSTANT"));
|
||||
G4MaterialPropertyName.push_back(G4String("GROUPVEL"));
|
||||
G4MaterialPropertyName.push_back(G4String("MIEHG"));
|
||||
G4MaterialPropertyName.push_back(G4String("RAYLEIGH"));
|
||||
G4MaterialPropertyName.push_back(G4String("WLSCOMPONENT"));
|
||||
G4MaterialPropertyName.push_back(G4String("WLSABSLENGTH"));
|
||||
G4MaterialPropertyName.push_back(G4String("ABSLENGTH"));
|
||||
G4MaterialPropertyName.push_back(G4String("FASTCOMPONENT"));
|
||||
G4MaterialPropertyName.push_back(G4String("SLOWCOMPONENT"));
|
||||
G4MaterialPropertyName.push_back(G4String("PROTONSCINTILLATIONYIELD"));
|
||||
G4MaterialPropertyName.push_back(G4String("DEUTERONSCINTILLATIONYIELD"));
|
||||
G4MaterialPropertyName.push_back(G4String("TRITONSCINTILLATIONYIELD"));
|
||||
G4MaterialPropertyName.push_back(G4String("ALPHASCINTILLATIONYIELD"));
|
||||
G4MaterialPropertyName.push_back(G4String("IONSCINTILLATIONYIELD"));
|
||||
G4MaterialPropertyName.push_back(G4String("ELECTRONSCINTILLATIONYIELD"));
|
||||
|
||||
G4MaterialConstPropertyName.push_back(G4String("SURFACEROUGHNESS"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("ISOTHERMAL_COMPRESSIBILITY"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("RS_SCALE_FACTOR"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("WLSMEANNUMBERPHOTONS"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("WLSTIMECONSTANT"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MIEHG_FORWARD"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MIEHG_BACKWARD"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MIEHG_FORWARD_RATIO"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("SCINTILLATIONYIELD"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("RESOLUTIONSCALE"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("FASTTIMECONSTANT"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("FASTSCINTILLATIONRISETIME"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("SLOWTIMECONSTANT"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("SLOWSCINTILLATIONRISETIME"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("YIELDRATIO"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("FERMIPOT"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("DIFFUSION"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("SPINFLIP"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("LOSS"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("LOSSCS"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("ABSCS"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("SCATCS"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MR_NBTHETA"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MR_NBE"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MR_RRMS"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MR_CORRLEN"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MR_THETAMIN"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MR_THETAMAX"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MR_EMIN"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MR_EMAX"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MR_ANGNOTHETA"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MR_ANGNOPHI"));
|
||||
G4MaterialConstPropertyName.push_back(G4String("MR_ANGCUT"));
|
||||
}
|
||||
|
||||
////////////////
|
||||
@@ -83,63 +142,77 @@ G4MaterialPropertiesTable::~G4MaterialPropertiesTable()
|
||||
MP.clear();
|
||||
MCP.clear();
|
||||
|
||||
G4MaterialPropertyName.clear();
|
||||
G4MaterialConstPropertyName.clear();
|
||||
}
|
||||
|
||||
////////////
|
||||
// Methods
|
||||
////////////
|
||||
|
||||
G4MCPindex G4MaterialPropertiesTable::GetConstPropertyIndex(const G4String& key) const
|
||||
G4int G4MaterialPropertiesTable::GetConstPropertyIndex(const G4String& key,
|
||||
G4bool warning) const
|
||||
{
|
||||
// Returns the constant material property index corresponding to a key
|
||||
|
||||
size_t index = std::distance(G4MaterialConstPropertyName.begin(),
|
||||
std::find(G4MaterialConstPropertyName.begin(),
|
||||
G4MaterialConstPropertyName.end(), key));
|
||||
if((G4MCPindex)index != kNumberOfConstPropertyIndex) return (G4MCPindex)index;
|
||||
G4cout << "key: " << key << G4endl;
|
||||
G4Exception("G4MaterialPropertiesTable::GetConstPropertyIndex()","mat206",
|
||||
FatalException, "Constant Material Property Index not found.");
|
||||
return kNullConstPropertyIndex;
|
||||
G4MaterialConstPropertyName.end(), key));
|
||||
if(index < G4MaterialConstPropertyName.size()) return index;
|
||||
if (warning) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Constant Material Property Index for key " << key << " not found.";
|
||||
G4Exception("G4MaterialPropertiesTable::GetConstPropertyIndex()","mat206",
|
||||
JustWarning, ed);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
G4MPindex G4MaterialPropertiesTable::GetPropertyIndex(const G4String& key) const
|
||||
G4int G4MaterialPropertiesTable::GetPropertyIndex(const G4String& key,
|
||||
G4bool warning) const
|
||||
{
|
||||
// Returns the material property index corresponding to a key
|
||||
size_t index = std::distance(G4MaterialPropertyName.begin(),
|
||||
std::find(G4MaterialPropertyName.begin(),
|
||||
G4MaterialPropertyName.end(), key));
|
||||
if((G4MPindex)index != kNumberOfPropertyIndex) return (G4MPindex)index;
|
||||
G4cout << "key: " << key << G4endl;
|
||||
G4Exception("G4MaterialPropertiesTable::GetPropertyIndex()","mat207",
|
||||
FatalException, "Material Property Index not found.");
|
||||
return kNullPropertyIndex;
|
||||
if(index < G4MaterialPropertyName.size()) return index;
|
||||
if (warning) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Material Property Index for key " << key << " not found.";
|
||||
G4Exception("G4MaterialPropertiesTable::GetPropertyIndex()","mat207",
|
||||
JustWarning, ed);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
G4double G4MaterialPropertiesTable::GetConstProperty(const G4MCPindex index) const
|
||||
G4double G4MaterialPropertiesTable::GetConstProperty(const G4int index) const
|
||||
{
|
||||
// Returns the constant material property corresponding to an index
|
||||
// fatal exception if property not found
|
||||
|
||||
MCPiterator j;
|
||||
j = MCP.find(index);
|
||||
if ( j != MCP.end() ) return j->second;
|
||||
G4cout << "index: " << index << G4endl;
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Constant Material Property Index " << index << " not found.";
|
||||
G4Exception("G4MaterialPropertiesTable::GetConstProperty()","mat202",
|
||||
FatalException, "Constant Material Property Index not found.");
|
||||
FatalException, ed);
|
||||
return 0.;
|
||||
}
|
||||
|
||||
G4double G4MaterialPropertiesTable::GetConstProperty(const char *key) const
|
||||
{
|
||||
// Returns the constant material property corresponding to a key
|
||||
const G4MCPindex index = GetConstPropertyIndex(G4String(key));
|
||||
// fatal exception if property not found
|
||||
|
||||
const G4int index = GetConstPropertyIndex(G4String(key));
|
||||
return GetConstProperty(index);
|
||||
}
|
||||
|
||||
G4bool G4MaterialPropertiesTable::ConstPropertyExists(const char *key) const
|
||||
{
|
||||
// Returns true if a const property 'key' exists
|
||||
const G4MCPindex index = GetConstPropertyIndex(G4String(key));
|
||||
const G4int index = GetConstPropertyIndex(G4String(key));
|
||||
|
||||
MCPiterator j;
|
||||
j = MCP.find(index);
|
||||
@@ -148,20 +221,26 @@ G4bool G4MaterialPropertiesTable::ConstPropertyExists(const char *key) const
|
||||
}
|
||||
|
||||
G4MaterialPropertyVector*
|
||||
G4MaterialPropertiesTable::GetProperty(const char *key)
|
||||
G4MaterialPropertiesTable::GetProperty(const char *key, G4bool warning)
|
||||
{
|
||||
// Returns a Material Property Vector corresponding to a key
|
||||
const G4MPindex index = GetPropertyIndex(G4String(key));
|
||||
const G4int index = GetPropertyIndex(G4String(key), warning);
|
||||
return GetProperty(index);
|
||||
}
|
||||
|
||||
G4MaterialPropertyVector*
|
||||
G4MaterialPropertiesTable::GetProperty(const G4MPindex index)
|
||||
G4MaterialPropertiesTable::GetProperty(const G4int index, G4bool warning)
|
||||
{
|
||||
// Returns a Material Property Vector corresponding to an index
|
||||
MPiterator i;
|
||||
i = MP.find(index);
|
||||
if ( i != MP.end() ) return i->second;
|
||||
if (warning) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Material Property for index " << index << " not found.";
|
||||
G4Exception("G4MaterialPropertiesTable::GetPropertyIndex()","mat208",
|
||||
JustWarning, ed);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -173,7 +252,14 @@ G4MaterialPropertyVector* G4MaterialPropertiesTable::AddProperty(
|
||||
{
|
||||
// Provides a way of adding a property to the Material Properties
|
||||
// Table given a pair of numbers and a key
|
||||
G4MPindex index = GetPropertyIndex(G4String(key));
|
||||
G4String k(key);
|
||||
// if the key doesn't exist, add it
|
||||
if (std::find(G4MaterialPropertyName.begin(),
|
||||
G4MaterialPropertyName.end(), k) ==
|
||||
G4MaterialPropertyName.end()) {
|
||||
G4MaterialPropertyName.push_back(k);
|
||||
}
|
||||
G4int index = GetPropertyIndex(k);
|
||||
|
||||
G4MaterialPropertyVector *mpv = new G4MaterialPropertyVector(PhotonEnergies,
|
||||
PropertyValues, NumEntries);
|
||||
@@ -181,7 +267,7 @@ G4MaterialPropertyVector* G4MaterialPropertiesTable::AddProperty(
|
||||
|
||||
// if key is RINDEX, we calculate GROUPVEL -
|
||||
// contribution from Tao Lin (IHEP, the JUNO experiment)
|
||||
if (G4String(key)=="RINDEX") {
|
||||
if (k=="RINDEX") {
|
||||
CalculateGROUPVEL();
|
||||
}
|
||||
|
||||
@@ -193,12 +279,19 @@ AddProperty(const char *key, G4MaterialPropertyVector *mpv)
|
||||
{
|
||||
// Provides a way of adding a property to the Material Properties
|
||||
// Table given an G4MaterialPropertyVector Reference and a key
|
||||
G4MPindex index = GetPropertyIndex(G4String(key));
|
||||
G4String k(key);
|
||||
// if the key doesn't exist, add it
|
||||
if (std::find(G4MaterialPropertyName.begin(),
|
||||
G4MaterialPropertyName.end(), k) ==
|
||||
G4MaterialPropertyName.end()) {
|
||||
G4MaterialPropertyName.push_back(k);
|
||||
}
|
||||
G4int index = GetPropertyIndex(k);
|
||||
MP[ index ] = mpv;
|
||||
|
||||
// if key is RINDEX, we calculate GROUPVEL -
|
||||
// contribution from Tao Lin (IHEP, the JUNO experiment)
|
||||
if (G4String(key)=="RINDEX") {
|
||||
if (k=="RINDEX") {
|
||||
CalculateGROUPVEL();
|
||||
}
|
||||
}
|
||||
@@ -209,7 +302,13 @@ void G4MaterialPropertiesTable::AddEntry(const char *key,
|
||||
{
|
||||
// Allows to add an entry pair directly to the Material Property Vector
|
||||
// given a key
|
||||
const G4MPindex index = GetPropertyIndex(G4String(key));
|
||||
G4String k(key);
|
||||
if (std::find(G4MaterialPropertyName.begin(),
|
||||
G4MaterialPropertyName.end(), k) ==
|
||||
G4MaterialPropertyName.end()) {
|
||||
G4MaterialPropertyName.push_back(k);
|
||||
}
|
||||
G4int index = GetPropertyIndex(k);
|
||||
|
||||
G4MaterialPropertyVector *targetVector=MP[index];
|
||||
if (targetVector != nullptr)
|
||||
@@ -225,10 +324,11 @@ void G4MaterialPropertiesTable::AddEntry(const char *key,
|
||||
|
||||
void G4MaterialPropertiesTable::DumpTable()
|
||||
{
|
||||
// material properties
|
||||
MPiterator i;
|
||||
for (i = MP.begin(); i != MP.end(); ++i)
|
||||
{
|
||||
G4cout << (*i).first << G4endl;
|
||||
G4cout << (*i).first << ": "<< G4MaterialPropertyName[(*i).first] <<G4endl;
|
||||
if ( (*i).second != 0 )
|
||||
{
|
||||
(*i).second->DumpValues();
|
||||
@@ -239,10 +339,11 @@ void G4MaterialPropertiesTable::DumpTable()
|
||||
JustWarning, "NULL Material Property Vector Pointer.");
|
||||
}
|
||||
}
|
||||
// material constant properties
|
||||
MCPiterator j;
|
||||
for (j = MCP.begin(); j != MCP.end(); ++j)
|
||||
{
|
||||
G4cout << j->first << G4endl;
|
||||
G4cout << j->first <<": "<< G4MaterialConstPropertyName[j->first] <<G4endl;
|
||||
if ( j->second != 0 )
|
||||
{
|
||||
G4cout << j->second << G4endl;
|
||||
@@ -418,3 +519,13 @@ std::map< G4String, G4double, std::less<G4String> >* G4MaterialPropertiesTable::
|
||||
}
|
||||
return &MPTC;
|
||||
}
|
||||
|
||||
std::vector<G4String> G4MaterialPropertiesTable::GetMaterialPropertyNames() const
|
||||
{
|
||||
return G4MaterialPropertyName;;
|
||||
}
|
||||
|
||||
std::vector<G4String> G4MaterialPropertiesTable::GetMaterialConstPropertyNames() const
|
||||
{
|
||||
return G4MaterialConstPropertyName;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4OpticalSurface.cc 104459 2017-05-31 15:54:52Z gcosmo $
|
||||
// $Id: G4OpticalSurface.cc 108492 2018-02-15 15:00:12Z gcosmo $
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -205,6 +205,31 @@ G4int G4OpticalSurface::operator!=(const G4OpticalSurface &right) const
|
||||
// Methods
|
||||
////////////
|
||||
|
||||
G4int G4OpticalSurface::GetInmax(void) const
|
||||
{
|
||||
return indexmax;
|
||||
}
|
||||
|
||||
G4int G4OpticalSurface::GetLUTbins(void) const
|
||||
{
|
||||
return LUTbins;
|
||||
}
|
||||
|
||||
G4int G4OpticalSurface::GetRefMax(void) const
|
||||
{
|
||||
return RefMax;
|
||||
}
|
||||
|
||||
G4int G4OpticalSurface::GetThetaIndexMax(void) const
|
||||
{
|
||||
return thetaIndexMax;
|
||||
}
|
||||
|
||||
G4int G4OpticalSurface::GetPhiIndexMax(void) const
|
||||
{
|
||||
return phiIndexMax;
|
||||
}
|
||||
|
||||
void G4OpticalSurface::DumpInfo() const
|
||||
{
|
||||
// Dump info for surface
|
||||
|
||||
Reference in New Issue
Block a user