Import Geant4 10.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2017-12-08 12:52:30 +01:00
parent 98e455a940
commit fc6af9e721
2166 changed files with 276760 additions and 100873 deletions
+12 -1
View File
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4IonisParamMat.hh 97248 2016-05-30 15:00:11Z gcosmo $
// $Id: G4IonisParamMat.hh 106243 2017-09-26 01:56:43Z gcosmo $
//
// class description
@@ -49,6 +49,7 @@
#include "globals.hh"
#include "G4Log.hh"
#include "G4Exp.hh"
#include "G4Threading.hh"
class G4Material; // forward declaration
class G4DensityEffectData;
@@ -93,6 +94,13 @@ public:
G4double GetX1density() const {return fX1density;};
inline
G4double GetD0density() const {return fD0density;};
// user defined density correction parameterisation
void SetDensityEffectParameters(G4double cd, G4double md, G4double ad,
G4double x0, G4double x1, G4double d0);
// defined density correction parameterisation via base material
void SetDensityEffectParameters(const G4Material* bmat);
// compute density correction as a function of the kinematic variable
// x = log10(beta*gamma)
@@ -211,6 +219,9 @@ private:
// static data created only once
static G4DensityEffectData* fDensityData;
G4double twoln10;
#ifdef G4MULTITHREADED
static G4Mutex ionisMutex;
#endif
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... ....oooOO0OOooo....
+6 -4
View File
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Material.hh 100406 2016-10-21 08:18:05Z gcosmo $
// $Id: G4Material.hh 106243 2017-09-26 01:56:43Z gcosmo $
//
//---------------------------------------------------------------------------
@@ -110,6 +110,7 @@
#include "G4SandiaTable.hh"
#include "G4ElementVector.hh"
#include "G4MaterialTable.hh"
#include "G4Threading.hh"
enum G4State { kStateUndefined = 0, kStateSolid, kStateLiquid, kStateGas };
@@ -246,8 +247,7 @@ public: // with description
G4double GetA() const;
//the MaterialPropertiesTable (if any) attached to this material:
inline void SetMaterialPropertiesTable(G4MaterialPropertiesTable* anMPT)
{fMaterialPropertiesTable = anMPT;}
void SetMaterialPropertiesTable(G4MaterialPropertiesTable* anMPT);
inline G4MaterialPropertiesTable* GetMaterialPropertiesTable() const
{return fMaterialPropertiesTable;}
@@ -278,7 +278,6 @@ public: // with description
inline void SetName (const G4String& name) {fName=name;}
public:
virtual G4bool IsExtended() const;
private:
@@ -352,6 +351,9 @@ private:
G4double fMassOfMolecule; // for materials built by atoms count
std::map<G4Material*,G4double> fMatComponents; // for composites built via
// AddMaterial()
#ifdef G4MULTITHREADED
static G4Mutex materialMutex;
#endif
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,173 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MaterialPropertiesIndex.hh 103256 2017-03-23 08:53:38Z gcosmo $
//
// File: G4MaterialPropertiesIndex.hh
// Description: Indices and Names for G4MaterialProperties
// Created: 29-06-2017
// Author: Soon Yung Jun
////////////////////////////////////////////////////////////////////////
#ifndef G4MaterialPropertiesIndex_h
#define G4MaterialPropertiesIndex_h 1
#include <vector>
#include "G4String.hh"
enum G4MaterialPropertyIndex {
kNullPropertyIndex = -1, // the number of G4MaterialPropertyIndex
kRINDEX, // index of refraction
kREFLECTIVITY, // reflectivity
kREALRINDEX, // real part of the refractive index
kIMAGINARYRINDEX, // imaginary part of the refractive index
kEFFICIENCY, // efficiency
kTRANSMITTANCE, // transmittance of a dielectric surface
kSPECULARLOBECONSTANT, // reflection probability about the normal of a micro facet.
kSPECULARSPIKECONSTANT, // reflection probability about the average surface normal
kBACKSCATTERCONSTANT, // for the case of several reflections within a deep groove
kGROUPVEL, // group velocity
kMIEHG, // Mie scattering length
kRAYLEIGH, // Rayleigh scattering attenuation length
kWLSCOMPONENT, // the relative emission spectrum of the material as a function of the photon's momentum
kWLSABSLENGTH, // the absorption length of the material as a function of the photon's momentum
kABSLENGTH, // the absorption length
kFASTCOMPONENT, // fast component of scintillation
kSLOWCOMPONENT, // slow component of scintillation
kPROTONSCINTILLATIONYIELD, // scintillation light yield by protons
kDEUTERONSCINTILLATIONYIELD, // scintillation light yield by deuterons
kTRITONSCINTILLATIONYIELD, // scintillation light yield by tritons
kALPHASCINTILLATIONYIELD, // scintillation light yield by alphas
kIONSCINTILLATIONYIELD, // scintillation light yield by ions
kELECTRONSCINTILLATIONYIELD, // scintillation light yield by electrons
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
kSURFACEROUGHNESS, // surface microroughness
kISOTHERMAL_COMPRESSIBILITY, // isothermal compressibility
kRS_SCALE_FACTOR, // Rayleigh scattering scale factor
kWLSMEANNUMBERPHOTONS, // WLS mean number of photons
kWLSTIMECONSTANT, // any time delay which may occur between absorption and re-emission of the photon
kMIEHG_FORWARD, // forward angle of Mie scattering based on Henyey-Greenstein phase function
kMIEHG_BACKWARD, // backward angle of Mie scattering based on Henyey-Greenstein phase function
kMIEHG_FORWARD_RATIO, // ratio of the MIEHG forward scattering
kSCINTILLATIONYIELD, // scintillation light yield
kRESOLUTIONSCALE, // resolution scale
kFASTTIMECONSTANT, // fast scintillation time constant
kFASTSCINTILLATIONRISETIME, // rise time of fast scintillation
kSLOWTIMECONSTANT, // slow scintillation time constant
kSLOWSCINTILLATIONRISETIME, // rise time of slow scintillation
kYIELDRATIO, // yield ratio
kFERMIPOT, // the Fermi potential (in neV)
kDIFFUSION, // diffusion
kSPINFLIP, // spin flip
kLOSS, // loss
kLOSSCS, // loss cross-section
kABSCS, // 1/v energy dependent absorption cross section
kSCATCS, // incoherent elastic scattering cross-section
kMR_NBTHETA, // number of theta bins of microroughness (MR)
kMR_NBE, // number of energy bins
kMR_RRMS, // RMS of roughness
kMR_CORRLEN, // correlation length
kMR_THETAMIN, // minimum value of theta
kMR_THETAMAX, // maximum value of theta
kMR_EMIN, // mininum value of energy
kMR_EMAX, // maximum value of energy
kMR_ANGNOTHETA, // number of theta angles in the look-up table
kMR_ANGNOPHI, // number of phi angles in the look-up table
kMR_ANGCUT, // angular cut
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 99765 2016-10-05 08:49:47Z gcosmo $
// $Id: G4MaterialPropertiesTable.hh 106997 2017-10-31 10:22:36Z gcosmo $
//
////////////////////////////////////////////////////////////////////////
//
@@ -61,6 +61,7 @@
#include <cmath>
#include <map>
#include "globals.hh"
#include "G4MaterialPropertiesIndex.hh"
#include "G4MaterialPropertyVector.hh"
/////////////////////
@@ -80,14 +81,14 @@ class G4MaterialPropertiesTable
G4double PropertyValue);
// Add a new property to the table by giving a key-name and value
inline G4MaterialPropertyVector* AddProperty(const char *key,
G4double *PhotonEnergies,
G4double *PropertyValues,
G4int NumEntries);
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.
inline void AddProperty(const char *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.
@@ -100,29 +101,50 @@ 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;
// 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);
// Get the property from the table corresponding to the key-name.
G4MaterialPropertyVector* GetProperty(const G4MPindex index);
// Get the property from the table corresponding to the key-index.
void AddEntry(const char *key, G4double aPhotonEnergy,
G4double aPropertyValue);
G4double aPropertyValue);
// Add a new entry (pair of numbers) to the table for a given key.
G4MCPindex GetConstPropertyIndex(const G4String& key) const;
// Get the constant property index from the key-name
G4MPindex GetPropertyIndex(const G4String& key) const;
// Get the property index by the key-name.
void DumpTable();
public: // without description
const std::map< G4String, G4MaterialPropertyVector*, std::less<G4String> >*
GetPropertiesMap() const { return &MPT; }
const std::map< G4String, G4double, std::less<G4String> >*
GetPropertiesCMap() const { return &MPTC; }
std::map< G4String, G4MaterialPropertyVector*, std::less<G4String> >*
GetPropertiesMap();
std::map< G4String, G4double, std::less<G4String> >*
GetPropertiesCMap();
const std::map<G4MPindex, G4MaterialPropertyVector*, std::less<G4MPindex> >*
GetPropertyMap() const { return &MP; }
const std::map<G4MCPindex, G4double, std::less<G4MCPindex> >*
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:
@@ -133,6 +155,17 @@ class G4MaterialPropertiesTable
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<G4MPindex, G4MaterialPropertyVector*, std::less<G4MPindex> > MP;
typedef std::map< G4MPindex, G4MaterialPropertyVector*,
std::less<G4MPindex> >::const_iterator MPiterator;
std::map< G4MCPindex, G4double, std::less<G4MCPindex> > MCP;
typedef std::map< G4MCPindex, G4double,
std::less<G4MCPindex> >::const_iterator MCPiterator;
//material property map and constant property map by index types
};
/////////////////////
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4MaterialPropertiesTable.icc 99765 2016-10-05 08:49:47Z gcosmo $
// $Id: G4MaterialPropertiesTable.icc 106997 2017-10-31 10:22:36Z gcosmo $
//
////////////////////////////////////////////////////////////////////////
//
@@ -45,45 +45,21 @@ void G4MaterialPropertiesTable::AddConstProperty(const char *key,
{
// Provides a way of adding a constant property to the Material Properties
// Table given a key
MPTC [G4String(key)] = PropertyValue;
G4MCPindex index = GetConstPropertyIndex(G4String(key));
MCP[index] = PropertyValue;
}
inline
G4MaterialPropertyVector* G4MaterialPropertiesTable::AddProperty(
const char *key,
G4double *PhotonEnergies,
G4double *PropertyValues,
G4int NumEntries)
{
// Provides a way of adding a property to the Material Properties
// Table given a pair of numbers and a key
G4MaterialPropertyVector *mpv = new G4MaterialPropertyVector(PhotonEnergies,
PropertyValues, NumEntries);
MPT [G4String(key)] = mpv;
return mpv;
}
inline
void G4MaterialPropertiesTable::
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
MPT [G4String(key)] = mpv;
}
inline
void G4MaterialPropertiesTable::RemoveConstProperty(const char *key)
{
MPTC.erase(G4String(key));
G4MCPindex index = GetConstPropertyIndex(G4String(key));
MCP.erase(index);
}
inline
void G4MaterialPropertiesTable::RemoveProperty(const char *key)
{
MPT.erase(G4String(key));
G4MPindex index = GetPropertyIndex(G4String(key));
MP.erase(index);
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NistElementBuilder.hh 96794 2016-05-09 10:09:30Z gcosmo $
// $Id: G4NistElementBuilder.hh 105820 2017-08-22 08:03:26Z gcosmo $
#ifndef G4NistElementBuilder_h
#define G4NistElementBuilder_h 1
@@ -59,6 +59,7 @@
#include "globals.hh"
#include "G4Element.hh"
#include "G4Threading.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -152,6 +153,9 @@ private:
G4int verbose;
std::vector<G4String> elmNames;
#ifdef G4MULTITHREADED
static G4Mutex nistElementMutex;
#endif
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+6 -2
View File
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4NistManager.hh 97248 2016-05-30 15:00:11Z gcosmo $
// $Id: G4NistManager.hh 105820 2017-08-22 08:03:26Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -73,6 +73,7 @@
#include "G4NistElementBuilder.hh"
#include "G4NistMaterialBuilder.hh"
#include "G4Pow.hh"
#include "G4Threading.hh"
class G4NistMessenger;
@@ -278,7 +279,7 @@ public:
private:
G4NistManager();
explicit G4NistManager();
static G4NistManager* instance;
G4Pow* g4pow;
@@ -297,6 +298,9 @@ private:
G4NistMaterialBuilder* matBuilder;
G4NistMessenger* messenger;
#ifdef G4MULTITHREADED
static G4Mutex nistManagerMutex;
#endif
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......