Import Geant4 10.7.0 source tree
This commit is contained in:
@@ -4,19 +4,29 @@
|
||||
|
||||
name := G4materials
|
||||
|
||||
GLOBLIBS = libG4intercoms.lib libG4global.lib
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../..
|
||||
endif
|
||||
|
||||
GLOBLIBS = libG4intercoms.lib libG4global.lib
|
||||
|
||||
ifdef G4LIB_BUILD_ZLIB
|
||||
GLOBLIBS += libG4zlib.lib
|
||||
endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/global/HEPRandom/include \
|
||||
-I$(G4BASE)/global/HEPGeometry/include \
|
||||
-I$(G4BASE)/intercoms/include
|
||||
|
||||
-I$(G4BASE)/intercoms/include
|
||||
|
||||
ifdef G4LIB_BUILD_ZLIB
|
||||
CPPFLAGS += -I$(G4BASE)/externals/zlib/include
|
||||
endif
|
||||
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
|
||||
.PHONY: global
|
||||
|
||||
@@ -16,6 +16,42 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
16-11-20 G.Cosmo (materials-V10-06-12)
|
||||
- Fixed typos in printed-out text. Addressing problem report #2285.
|
||||
|
||||
10-11-20 V.Ivanchenko (materials-V10-06-11)
|
||||
- G4MicroElecMaterialStructure - fixed Coverity warnings (initialize
|
||||
all members of the class)
|
||||
|
||||
04-11-20 D.Sawkey (materials-V10-06-10)
|
||||
- G4OpticalSurface:Add protection against access optical LUT out of
|
||||
array bounds. Addresses bug 2287.
|
||||
|
||||
28-10-20 V.Ivanchenko (materials-V10-06-09)
|
||||
- G4MicroElecMaterialStructure, G4MicroElecSiStructure classes are moved
|
||||
from electromagnetic/lowenergy. These new classes developed by ONERA
|
||||
and CEA group and provided by D. Lambert. The code was updated - no
|
||||
dependence on G4ParticleDefinition
|
||||
|
||||
20-10-20 D. Sawkey (materials-V10-06-08)
|
||||
- G4Element, G4NistManager, G4NistMaterialBuilder: spellcheck cout text
|
||||
|
||||
08-10-20 D. Sawkey (materials-V10-06-07)
|
||||
- G4OpticalSurface: store REALSURFACE optical data files zlib-compressed.
|
||||
|
||||
05-10-20 D. Sawkey (materials-V10-06-06)
|
||||
- G4SurfaceProperty, G4OpticalSurface: apply clang-format style guidelines,
|
||||
use virtual/override/nullptr keywords; add method to select file to read;
|
||||
replace long if/else with switch/case
|
||||
|
||||
20-08-20 V.Ivanchenko (materials-V10-06-05)
|
||||
- G4Material - added two new public methods to add elements to a material
|
||||
according to ATLAS request
|
||||
|
||||
04-08-20 D. Sawkey (materials-V10-06-04)
|
||||
- G4MaterialPropertiesTable: add new methods to access/add properties with
|
||||
G4String and std::vector
|
||||
|
||||
26-05-20 A. Howard (materials-V10-06-03)
|
||||
- G4MaterialPropertiesTable, G4MaterialPropertiesIndex: add new properties
|
||||
for allowing a second wavelength shifter in the same material
|
||||
|
||||
@@ -153,14 +153,18 @@ public: // with description
|
||||
// Add an element, giving number of atoms
|
||||
//
|
||||
void AddElement(G4Element* element, //the element
|
||||
G4int nAtoms); //nb of atoms in
|
||||
// a molecule
|
||||
G4int nAtoms); //nb of atoms in a molecule
|
||||
inline
|
||||
void AddElementByNumberOfAtoms(G4Element* elm, G4int nAtoms) {AddElement(elm, nAtoms);}
|
||||
|
||||
//
|
||||
// Add an element or material, giving fraction of mass
|
||||
//
|
||||
void AddElement (G4Element* element , //the element
|
||||
G4double fraction); //fractionOfMass
|
||||
|
||||
inline
|
||||
void AddElementByMassFraction(G4Element* elm, G4double frac) {AddElement(elm, frac);}
|
||||
|
||||
void AddMaterial(G4Material* material, //the material
|
||||
G4double fraction); //fractionOfMass
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@
|
||||
// 1999-10-29 add method and class descriptors
|
||||
// 1997-03-25 by Peter Gumplinger
|
||||
// > cosmetics (only)
|
||||
// mail: gum@triumf.ca
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -76,10 +75,16 @@ class G4MaterialPropertiesTable
|
||||
|
||||
public: // With description
|
||||
|
||||
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 G4String& key,
|
||||
const std::vector<G4double>& photonEnergies,
|
||||
const std::vector<G4double>& propertyValues);
|
||||
|
||||
G4MaterialPropertyVector* AddProperty(const char *key,
|
||||
G4double *PhotonEnergies,
|
||||
G4double *PropertyValues,
|
||||
@@ -87,22 +92,27 @@ class G4MaterialPropertiesTable
|
||||
// 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, 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.
|
||||
|
||||
inline void RemoveConstProperty(const G4String& key);
|
||||
inline void RemoveConstProperty(const char *key);
|
||||
// Remove a constant 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 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.
|
||||
|
||||
@@ -111,12 +121,16 @@ class G4MaterialPropertiesTable
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
@@ -34,38 +34,57 @@
|
||||
// Created: 1996-02-08
|
||||
// Author: Juliet Armstrong
|
||||
// Updated: moved to inline
|
||||
// mail: gum@triumf.ca
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline
|
||||
void G4MaterialPropertiesTable::AddConstProperty(const G4String& key,
|
||||
G4double PropertyValue)
|
||||
{
|
||||
// Provides a way of adding a constant property to the Material Properties
|
||||
// Table given a key
|
||||
if (std::find(G4MaterialConstPropertyName.begin(),
|
||||
G4MaterialConstPropertyName.end(), key) ==
|
||||
G4MaterialConstPropertyName.end()) {
|
||||
G4MaterialConstPropertyName.push_back(key);
|
||||
}
|
||||
G4int index = GetConstPropertyIndex(key);
|
||||
|
||||
MCP[index] = PropertyValue;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4MaterialPropertiesTable::AddConstProperty(const char *key,
|
||||
G4double PropertyValue)
|
||||
{
|
||||
// Provides a way of adding a constant property to the Material Properties
|
||||
// Table given a 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;
|
||||
AddConstProperty(G4String(key), PropertyValue);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4MaterialPropertiesTable::RemoveConstProperty(const char *key)
|
||||
void G4MaterialPropertiesTable::RemoveConstProperty(const G4String& key)
|
||||
{
|
||||
G4int index = GetConstPropertyIndex(G4String(key));
|
||||
G4int index = GetConstPropertyIndex(key);
|
||||
|
||||
MCP.erase(index);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4MaterialPropertiesTable::RemoveProperty(const char *key)
|
||||
void G4MaterialPropertiesTable::RemoveConstProperty(const char *key)
|
||||
{
|
||||
G4int index = GetPropertyIndex(G4String(key));
|
||||
GetConstPropertyIndex(G4String(key));
|
||||
}
|
||||
|
||||
inline
|
||||
void G4MaterialPropertiesTable::RemoveProperty(const G4String& key)
|
||||
{
|
||||
G4int index = GetPropertyIndex(key);
|
||||
MP.erase(index);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4MaterialPropertiesTable::RemoveProperty(const char *key)
|
||||
{
|
||||
RemoveProperty(G4String(key));
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
// Author: Juliet Armstrong
|
||||
// Updated: 2011-10-13 by Peter Gumplinger
|
||||
// remove the class: simply typedef to G4PhysicsOrderedFreeVector
|
||||
// mail: gum@triumf.ca
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// G4MicroElecMaterialStructure.hh, 2011/08/29 A.Valentin, M. Raine are with CEA [a]
|
||||
// 2020/05/20 P. Caron, C. Inguimbert are with ONERA [b]
|
||||
// Q. Gibaru is with CEA [a], ONERA [b] and CNES [c]
|
||||
// M. Raine and D. Lambert are with CEA [a]
|
||||
//
|
||||
// A part of this work has been funded by the French space agency(CNES[c])
|
||||
// [a] CEA, DAM, DIF - 91297 ARPAJON, France
|
||||
// [b] ONERA - DPHY, 2 avenue E.Belin, 31055 Toulouse, France
|
||||
// [c] CNES, 18 av.E.Belin, 31401 Toulouse CEDEX, France
|
||||
//
|
||||
// Based on the following publications
|
||||
// - A.Valentin, M. Raine,
|
||||
// Inelastic cross-sections of low energy electrons in silicon
|
||||
// for the simulation of heavy ion tracks with the Geant4-DNA toolkit,
|
||||
// NSS Conf. Record 2010, pp. 80-85
|
||||
// https://doi.org/10.1109/NSSMIC.2010.5873720
|
||||
//
|
||||
// - A.Valentin, M. Raine, M.Gaillardin, P.Paillet
|
||||
// Geant4 physics processes for microdosimetry simulation:
|
||||
// very low energy electromagnetic models for electrons in Silicon,
|
||||
// https://doi.org/10.1016/j.nimb.2012.06.007
|
||||
// NIM B, vol. 288, pp. 66-73, 2012, part A
|
||||
// heavy ions in Si, NIM B, vol. 287, pp. 124-129, 2012, part B
|
||||
// https://doi.org/10.1016/j.nimb.2012.07.028
|
||||
//
|
||||
// - M. Raine, M. Gaillardin, P. Paillet
|
||||
// Geant4 physics processes for silicon microdosimetry simulation:
|
||||
// Improvements and extension of the energy-range validity up to 10 GeV/nucleon
|
||||
// NIM B, vol. 325, pp. 97-100, 2014
|
||||
// https://doi.org/10.1016/j.nimb.2014.01.014
|
||||
//
|
||||
// - J. Pierron, C. Inguimbert, M. Belhaj, T. Gineste, J. Puech, M. Raine
|
||||
// Electron emission yield for low energy electrons:
|
||||
// Monte Carlo simulation and experimental comparison for Al, Ag, and Si
|
||||
// Journal of Applied Physics 121 (2017) 215107.
|
||||
// https://doi.org/10.1063/1.4984761
|
||||
//
|
||||
// - P. Caron,
|
||||
// Study of Electron-Induced Single-Event Upset in Integrated Memory Devices
|
||||
// PHD, 16th October 2019
|
||||
//
|
||||
// - Q.Gibaru, C.Inguimbert, P.Caron, M.Raine, D.Lambert, J.Puech,
|
||||
// Geant4 physics processes for microdosimetry and secondary electron emission simulation :
|
||||
// Extension of MicroElec to very low energies and new materials
|
||||
// NIM B, 2020, in review.
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef G4MICROELECMATERIALSTRUCTURE_HH
|
||||
#define G4MICROELECMATERIALSTRUCTURE_HH 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Material.hh"
|
||||
#include <vector>
|
||||
|
||||
class G4MicroElecMaterialStructure
|
||||
{
|
||||
public:
|
||||
G4MicroElecMaterialStructure(const G4String& matName = "");
|
||||
virtual ~G4MicroElecMaterialStructure();
|
||||
|
||||
void ReadMaterialFile();
|
||||
G4double Energy(G4int level);
|
||||
G4int NumberOfLevels() { return nLevels; }
|
||||
G4double GetZ(G4int Shell);
|
||||
G4double ConvertUnit(const G4String& unitName);
|
||||
G4double GetEnergyGap() { return energyGap; }
|
||||
G4double GetInitialEnergy() { return initialEnergy; }
|
||||
G4int GetEADL_Enumerator(G4int shell) { return EADL_Enumerator[shell]; };
|
||||
G4double GetWorkFunction() { return workFunction; };
|
||||
G4String GetMaterialName() { return materialName; };
|
||||
G4double GetLimitEnergy(G4int level);
|
||||
G4double GetElasticModelLowLimit() {return limitElastic[0];}
|
||||
G4double GetElasticModelHighLimit() { return limitElastic[1]; }
|
||||
G4double GetInelasticModelLowLimit(G4int pdg);
|
||||
G4double GetInelasticModelHighLimit(G4int pdg);
|
||||
G4bool IsShellWeaklyBound(G4int level);
|
||||
|
||||
private:
|
||||
// private elements
|
||||
G4int nLevels = 3; // Number of levels of material
|
||||
G4bool isCompound = false;
|
||||
G4String materialName = "";
|
||||
std::vector<G4bool> isShellWeaklyBoundVector;
|
||||
std::vector<G4double> energyConstant;
|
||||
std::vector<G4double> LimitEnergy;
|
||||
std::vector<G4int> EADL_Enumerator;
|
||||
G4double workFunction = 0.0;
|
||||
G4double initialEnergy = 0.0;
|
||||
std::vector<G4double> compoundShellZ;
|
||||
G4double Z = 0.0;
|
||||
G4double energyGap = 0.0;
|
||||
G4double limitElastic[2] = { 0,0 };
|
||||
G4double limitInelastic[4] = { 0,0,0,0 };
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// G4MicroElecSiStructure.hh, 2011/08/29 A.Valentin, M. Raine
|
||||
//
|
||||
// Based on the following publications
|
||||
//
|
||||
// - Inelastic cross-sections of low energy electrons in silicon
|
||||
// for the simulation of heavy ion tracks with theGeant4-DNA toolkit,
|
||||
// NSS Conf. Record 2010, pp. 80-85
|
||||
// - Geant4 physics processes for microdosimetry simulation:
|
||||
// very low energy electromagnetic models for electrons in Si,
|
||||
// NIM B, vol. 288, pp. 66-73, 2012.
|
||||
// - Geant4 physics processes for microdosimetry simulation:
|
||||
// very low energy electromagnetic models for protons and
|
||||
// heavy ions in Si, NIM B, vol. 287, pp. 124-129, 2012.
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
#ifndef G4MICROELECSISTRUCTURE_HH
|
||||
#define G4MICROELECSISTRUCTURE_HH 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include <vector>
|
||||
|
||||
|
||||
class G4MicroElecSiStructure
|
||||
{
|
||||
public:
|
||||
|
||||
G4MicroElecSiStructure();
|
||||
|
||||
virtual ~G4MicroElecSiStructure();
|
||||
|
||||
G4double Energy(G4int level);
|
||||
|
||||
G4int NumberOfLevels() { return nLevels; }
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Number of levels of silicon
|
||||
G4int nLevels;
|
||||
|
||||
std::vector<G4double> energyConstant;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// G4OpticalSurface Definition
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -36,18 +36,13 @@
|
||||
// Created: 1997-06-26
|
||||
// Author: Peter Gumplinger
|
||||
// Updated: 1999-10-29 add method and class descriptors
|
||||
// 2017-02-24 Mariele Stockhoff add DAVIS model
|
||||
// mail: gum@triumf.ca
|
||||
// 2017-02-24 Mariele Stockhoff add DAVIS model
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef G4OpticalSurface_h
|
||||
#define G4OpticalSurface_h 1
|
||||
|
||||
/////////////
|
||||
// Includes
|
||||
/////////////
|
||||
|
||||
#include "G4Types.hh"
|
||||
#include "G4Physics2DVector.hh"
|
||||
#include "G4SurfaceProperty.hh"
|
||||
@@ -60,238 +55,240 @@
|
||||
|
||||
enum G4OpticalSurfaceFinish
|
||||
{
|
||||
polished, // smooth perfectly polished surface
|
||||
polishedfrontpainted, // smooth top-layer (front) paint
|
||||
polishedbackpainted, // same is 'polished' but with a back-paint
|
||||
polished, // smooth perfectly polished surface
|
||||
polishedfrontpainted, // smooth top-layer (front) paint
|
||||
polishedbackpainted, // same is 'polished' but with a back-paint
|
||||
|
||||
ground, // rough surface
|
||||
groundfrontpainted, // rough top-layer (front) paint
|
||||
groundbackpainted, // same as 'ground' but with a back-paint
|
||||
ground, // rough surface
|
||||
groundfrontpainted, // rough top-layer (front) paint
|
||||
groundbackpainted, // same as 'ground' but with a back-paint
|
||||
|
||||
polishedlumirrorair, // mechanically polished surface, with lumirror
|
||||
polishedlumirrorglue, // mechanically polished surface, with lumirror & meltmount
|
||||
polishedair, // mechanically polished surface
|
||||
polishedteflonair, // mechanically polished surface, with teflon
|
||||
polishedtioair, // mechanically polished surface, with tio paint
|
||||
polishedtyvekair, // mechanically polished surface, with tyvek
|
||||
polishedvm2000air, // mechanically polished surface, with esr film
|
||||
polishedvm2000glue, // mechanically polished surface, with esr film & meltmount
|
||||
// for LBNL LUT model
|
||||
polishedlumirrorair, // mechanically polished surface, with lumirror
|
||||
polishedlumirrorglue, // mechanically polished surface, with lumirror &
|
||||
// meltmount
|
||||
polishedair, // mechanically polished surface
|
||||
polishedteflonair, // mechanically polished surface, with teflon
|
||||
polishedtioair, // mechanically polished surface, with tio paint
|
||||
polishedtyvekair, // mechanically polished surface, with tyvek
|
||||
polishedvm2000air, // mechanically polished surface, with esr film
|
||||
polishedvm2000glue, // mechanically polished surface, with esr film &
|
||||
// meltmount
|
||||
|
||||
etchedlumirrorair, // chemically etched surface, with lumirror
|
||||
etchedlumirrorglue, // chemically etched surface, with lumirror & meltmount
|
||||
etchedair, // chemically etched surface
|
||||
etchedteflonair, // chemically etched surface, with teflon
|
||||
etchedtioair, // chemically etched surface, with tio paint
|
||||
etchedtyvekair, // chemically etched surface, with tyvek
|
||||
etchedvm2000air, // chemically etched surface, with esr film
|
||||
etchedvm2000glue, // chemically etched surface, with esr film & meltmount
|
||||
etchedlumirrorair, // chemically etched surface, with lumirror
|
||||
etchedlumirrorglue, // chemically etched surface, with lumirror & meltmount
|
||||
etchedair, // chemically etched surface
|
||||
etchedteflonair, // chemically etched surface, with teflon
|
||||
etchedtioair, // chemically etched surface, with tio paint
|
||||
etchedtyvekair, // chemically etched surface, with tyvek
|
||||
etchedvm2000air, // chemically etched surface, with esr film
|
||||
etchedvm2000glue, // chemically etched surface, with esr film & meltmount
|
||||
|
||||
groundlumirrorair, // rough-cut surface, with lumirror
|
||||
groundlumirrorglue, // rough-cut surface, with lumirror & meltmount
|
||||
groundair, // rough-cut surface
|
||||
groundteflonair, // rough-cut surface, with teflon
|
||||
groundtioair, // rough-cut surface, with tio paint
|
||||
groundtyvekair, // rough-cut surface, with tyvek
|
||||
groundvm2000air, // rough-cut surface, with esr film
|
||||
groundvm2000glue, // rough-cut surface, with esr film & meltmount
|
||||
|
||||
// for DAVIS model
|
||||
Rough_LUT, //rough surface
|
||||
RoughTeflon_LUT, //rough surface wrapped in Teflon tape
|
||||
RoughESR_LUT, //rough surface wrapped with ESR
|
||||
RoughESRGrease_LUT, //rough surface wrapped with ESR
|
||||
//and coupled with opical grease
|
||||
Polished_LUT, //polished surface
|
||||
PolishedTeflon_LUT, //polished surface wrapped in Teflon tape
|
||||
PolishedESR_LUT, //polished surface wrapped with ESR
|
||||
PolishedESRGrease_LUT, //polished surface wrapped with ESR
|
||||
//and coupled with opical grease
|
||||
Detector_LUT //polished surface with optical grease
|
||||
groundlumirrorair, // rough-cut surface, with lumirror
|
||||
groundlumirrorglue, // rough-cut surface, with lumirror & meltmount
|
||||
groundair, // rough-cut surface
|
||||
groundteflonair, // rough-cut surface, with teflon
|
||||
groundtioair, // rough-cut surface, with tio paint
|
||||
groundtyvekair, // rough-cut surface, with tyvek
|
||||
groundvm2000air, // rough-cut surface, with esr film
|
||||
groundvm2000glue, // rough-cut surface, with esr film & meltmount
|
||||
|
||||
// for DAVIS model
|
||||
Rough_LUT, // rough surface
|
||||
RoughTeflon_LUT, // rough surface wrapped in Teflon tape
|
||||
RoughESR_LUT, // rough surface wrapped with ESR
|
||||
RoughESRGrease_LUT, // rough surface wrapped with ESR
|
||||
// and coupled with optical grease
|
||||
Polished_LUT, // polished surface
|
||||
PolishedTeflon_LUT, // polished surface wrapped in Teflon tape
|
||||
PolishedESR_LUT, // polished surface wrapped with ESR
|
||||
PolishedESRGrease_LUT, // polished surface wrapped with ESR
|
||||
// and coupled with optical grease
|
||||
Detector_LUT // polished surface with optical grease
|
||||
};
|
||||
|
||||
enum G4OpticalSurfaceModel
|
||||
{
|
||||
glisur, // original GEANT3 model
|
||||
unified, // UNIFIED model
|
||||
LUT, // Look-Up-Table model
|
||||
DAVIS, // DAVIS model
|
||||
dichroic // dichroic filter
|
||||
glisur, // original GEANT3 model
|
||||
unified, // UNIFIED model
|
||||
LUT, // Look-Up-Table model (LBNL model)
|
||||
DAVIS, // DAVIS model
|
||||
dichroic // dichroic filter
|
||||
};
|
||||
|
||||
class G4MaterialPropertiesTable;
|
||||
|
||||
/////////////////////
|
||||
// Class Definition
|
||||
/////////////////////
|
||||
|
||||
class G4OpticalSurface : public G4SurfaceProperty
|
||||
{
|
||||
public:
|
||||
G4OpticalSurface(const G4OpticalSurface& right);
|
||||
G4OpticalSurface& operator=(const G4OpticalSurface& right);
|
||||
|
||||
public: // Without description
|
||||
|
||||
//////////////
|
||||
// Operators
|
||||
//////////////
|
||||
|
||||
G4OpticalSurface(const G4OpticalSurface &right);
|
||||
G4OpticalSurface & operator=(const G4OpticalSurface &right);
|
||||
|
||||
G4bool operator==(const G4OpticalSurface &right) const;
|
||||
G4bool operator!=(const G4OpticalSurface &right) const;
|
||||
G4bool operator==(const G4OpticalSurface& right) const;
|
||||
G4bool operator!=(const G4OpticalSurface& right) const;
|
||||
|
||||
public: // With description
|
||||
G4OpticalSurface(const G4String& name, G4OpticalSurfaceModel model = glisur,
|
||||
G4OpticalSurfaceFinish finish = polished,
|
||||
G4SurfaceType type = dielectric_dielectric,
|
||||
G4double value = 1.0);
|
||||
// Constructor of an optical surface object.
|
||||
|
||||
////////////////////////////////
|
||||
// Constructors and Destructor
|
||||
////////////////////////////////
|
||||
virtual ~G4OpticalSurface();
|
||||
|
||||
G4OpticalSurface(const G4String& name,
|
||||
G4OpticalSurfaceModel model = glisur,
|
||||
G4OpticalSurfaceFinish finish = polished,
|
||||
G4SurfaceType type = dielectric_dielectric,
|
||||
G4double value = 1.0);
|
||||
// Constructor of an optical surface object.
|
||||
void SetType(const G4SurfaceType& type) override;
|
||||
|
||||
public: // Without description
|
||||
inline G4OpticalSurfaceFinish GetFinish() const { return theFinish; }
|
||||
// Returns the optical surface finish.
|
||||
void SetFinish(const G4OpticalSurfaceFinish);
|
||||
// Sets the optical surface finish.
|
||||
|
||||
virtual ~G4OpticalSurface();
|
||||
inline G4OpticalSurfaceModel GetModel() const { return theModel; }
|
||||
// Returns the optical surface model used.
|
||||
inline void SetModel(const G4OpticalSurfaceModel model) { theModel = model; }
|
||||
// Sets the optical surface model to be followed.
|
||||
|
||||
////////////
|
||||
// Methods
|
||||
////////////
|
||||
inline G4double GetSigmaAlpha() const { return sigma_alpha; }
|
||||
// Returns an unified model surface parameter.
|
||||
inline void SetSigmaAlpha(const G4double s_a) { sigma_alpha = s_a; }
|
||||
// Sets an unified model surface parameter.
|
||||
|
||||
// public methods
|
||||
G4double GetPolish() const { return polish; }
|
||||
// Returns the optical surface polish type.
|
||||
inline void SetPolish(const G4double plsh) { polish = plsh; }
|
||||
// Sets the optical surface polish type.
|
||||
|
||||
public: // With description
|
||||
inline G4MaterialPropertiesTable* GetMaterialPropertiesTable() const
|
||||
{
|
||||
return theMaterialPropertiesTable;
|
||||
}
|
||||
// Retrieves the pointer of the G4MaterialPropertiesTable
|
||||
// attached to optical surface.
|
||||
|
||||
void SetType(const G4SurfaceType& type);
|
||||
inline void SetMaterialPropertiesTable(G4MaterialPropertiesTable* anMPT)
|
||||
{
|
||||
theMaterialPropertiesTable = anMPT;
|
||||
}
|
||||
// Attaches a G4MaterialPropertiesTable to the optical surface.
|
||||
|
||||
inline G4OpticalSurfaceFinish GetFinish() const { return theFinish; }
|
||||
// Returns the optical surface finish.
|
||||
void SetFinish(const G4OpticalSurfaceFinish );
|
||||
// Sets the optical surface finish.
|
||||
void DumpInfo() const;
|
||||
// Prints information about the optical surface.
|
||||
|
||||
inline G4OpticalSurfaceModel GetModel() const { return theModel; }
|
||||
// Returns the optical surface model used.
|
||||
inline void SetModel(const G4OpticalSurfaceModel model)
|
||||
{ theModel = model; }
|
||||
// Sets the optical surface model to be followed.
|
||||
void ReadDataFile(void);
|
||||
// call the correct ReadXXXFile
|
||||
|
||||
inline G4double GetSigmaAlpha() const { return sigma_alpha; }
|
||||
// Returns an unified model surface parameter.
|
||||
inline void SetSigmaAlpha(const G4double s_a) { sigma_alpha = s_a; }
|
||||
// Sets an unified model surface parameter.
|
||||
void ReadCompressedFile(G4String, std::istringstream&);
|
||||
// read a zlib-compressed file
|
||||
|
||||
G4double GetPolish() const { return polish; }
|
||||
// Returns the optical surface polish type.
|
||||
inline void SetPolish(const G4double plsh) { polish=plsh; }
|
||||
// Sets the optical surface polish type.
|
||||
void ReadLUTFile(void);
|
||||
// Method to read the Look-Up-Table into array AngularDistribution
|
||||
|
||||
inline G4MaterialPropertiesTable* GetMaterialPropertiesTable() const
|
||||
{ return theMaterialPropertiesTable; }
|
||||
// Retrieves the pointer of the G4MaterialPropertiesTable
|
||||
// attached to optical surface.
|
||||
inline G4double GetAngularDistributionValue(G4int, G4int, G4int);
|
||||
|
||||
inline void SetMaterialPropertiesTable(G4MaterialPropertiesTable *anMPT)
|
||||
{ theMaterialPropertiesTable = anMPT; }
|
||||
// Attaches a G4MaterialPropertiesTable to the optical surface.
|
||||
// for DAVIS model
|
||||
|
||||
void DumpInfo() const;
|
||||
// Prints information about the optical surface.
|
||||
inline G4double GetAngularDistributionValueLUT(G4int);
|
||||
// Returns the AngularDistributionValue
|
||||
|
||||
void ReadLUTFile(void);
|
||||
// Method to read the Look-Up-Table into array AngularDistribution
|
||||
void ReadLUTDAVISFile(void);
|
||||
// Method to read the Davis Look-Up-Table into array AngularDistribution
|
||||
|
||||
inline G4double GetAngularDistributionValue(G4int, G4int, G4int);
|
||||
|
||||
// for DAVIS model
|
||||
void ReadReflectivityLUTFile(void);
|
||||
// Method to read the Look-Up-Table for reflectivity
|
||||
|
||||
inline G4double GetAngularDistributionValueLUT(G4int);
|
||||
// Returns the AngularDistributionValue
|
||||
inline G4double GetReflectivityLUTValue(G4int);
|
||||
// Returns the reflectivity value from the Davis Look-Up-Table
|
||||
|
||||
void ReadLUTDAVISFile(void);
|
||||
// Method to read the Davis Look-Up-Table into array AngularDistribution
|
||||
|
||||
void ReadReflectivityLUTFile(void);
|
||||
// Method to read the Look-Up-Table for reflectivity
|
||||
|
||||
inline G4double GetReflectivityLUTValue(G4int);
|
||||
// Returns the reflectivity value from the Davis Look-Up-Table
|
||||
|
||||
G4int GetInmax(void) const;
|
||||
// Returns the number of lines in the Davis Look-Up-Table
|
||||
G4int GetInmax(void) const;
|
||||
// Returns the number of lines in the Davis Look-Up-Table
|
||||
|
||||
G4int GetLUTbins(void) const;
|
||||
// Returns the number of probability values per incidentangle
|
||||
G4int GetLUTbins(void) const;
|
||||
// Returns the number of probability values per incidentangle
|
||||
|
||||
G4int GetRefMax(void) const;
|
||||
// Returns the number of reflectivity values per angle
|
||||
|
||||
G4int GetThetaIndexMax(void) const;
|
||||
G4int GetPhiIndexMax(void) const;
|
||||
G4int GetRefMax(void) const;
|
||||
// Returns the number of reflectivity values per angle
|
||||
|
||||
void ReadDichroicFile(void);
|
||||
// Method to read the dichroic surface data file into Dichroic
|
||||
G4int GetThetaIndexMax(void) const;
|
||||
G4int GetPhiIndexMax(void) const;
|
||||
|
||||
inline G4Physics2DVector* GetDichroicVector();
|
||||
void ReadDichroicFile(void);
|
||||
// Method to read the dichroic surface data file into Dichroic
|
||||
|
||||
private:
|
||||
inline G4Physics2DVector* GetDichroicVector();
|
||||
|
||||
// ------------------
|
||||
// Basic data members ( To define an optical surface)
|
||||
// ------------------
|
||||
private:
|
||||
G4OpticalSurfaceModel theModel; // Surface model
|
||||
G4OpticalSurfaceFinish theFinish; // Surface finish
|
||||
|
||||
G4OpticalSurfaceModel theModel; // Surface model
|
||||
G4OpticalSurfaceFinish theFinish; // Surface finish
|
||||
G4double sigma_alpha; // The sigma of micro-facet polar angle
|
||||
G4double polish; // Polish parameter in glisur model
|
||||
|
||||
G4double sigma_alpha; // The sigma of micro-facet polar angle
|
||||
G4double polish; // Polish parameter in glisur model
|
||||
G4MaterialPropertiesTable* theMaterialPropertiesTable;
|
||||
|
||||
G4MaterialPropertiesTable* theMaterialPropertiesTable;
|
||||
static const G4int incidentIndexMax = 91;
|
||||
static const G4int thetaIndexMax = 45;
|
||||
static const G4int phiIndexMax = 37;
|
||||
|
||||
static const G4int incidentIndexMax = 91;
|
||||
static const G4int thetaIndexMax = 45;
|
||||
static const G4int phiIndexMax = 37;
|
||||
G4float* AngularDistribution;
|
||||
G4Physics2DVector* DichroicVector;
|
||||
|
||||
G4float* AngularDistribution;
|
||||
G4Physics2DVector* DichroicVector;
|
||||
|
||||
// for DAVIS model
|
||||
static const G4int indexmax = 7280001; // 3640001;
|
||||
static const G4int RefMax = 90;
|
||||
static const G4int LUTbins =20000;
|
||||
G4float* AngularDistributionLUT;
|
||||
G4float* Reflectivity;
|
||||
// for DAVIS model
|
||||
static const G4int indexmax = 7280001; // 3640001;
|
||||
static const G4int RefMax = 90;
|
||||
static const G4int LUTbins = 20000;
|
||||
G4float* AngularDistributionLUT;
|
||||
G4float* Reflectivity;
|
||||
};
|
||||
|
||||
////////////////////
|
||||
// Inline methods
|
||||
////////////////////
|
||||
|
||||
inline
|
||||
G4double G4OpticalSurface::GetAngularDistributionValue(G4int angleIncident,
|
||||
G4int thetaIndex,
|
||||
G4int phiIndex)
|
||||
inline G4double G4OpticalSurface::GetAngularDistributionValue(
|
||||
G4int angleIncident, G4int thetaIndex, G4int phiIndex)
|
||||
{
|
||||
return AngularDistribution[angleIncident+
|
||||
thetaIndex*incidentIndexMax+
|
||||
phiIndex*thetaIndexMax*incidentIndexMax];
|
||||
G4int product = angleIncident * thetaIndex * phiIndex;
|
||||
if(product < 0 || product >= incidentIndexMax * thetaIndexMax * phiIndexMax)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Index angleIncident: " << angleIncident
|
||||
<< " thetaIndex: " << thetaIndex << " phiIndex: " << phiIndex
|
||||
<< " out of range!";
|
||||
G4Exception("G4OpticalSurface::GetAngularDistributionValue", "mat317",
|
||||
FatalException, ed);
|
||||
return 0.;
|
||||
}
|
||||
return (G4double)
|
||||
AngularDistribution[angleIncident + thetaIndex * incidentIndexMax +
|
||||
phiIndex * thetaIndexMax * incidentIndexMax];
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4OpticalSurface::GetAngularDistributionValueLUT(G4int i)
|
||||
inline G4double G4OpticalSurface::GetAngularDistributionValueLUT(G4int i)
|
||||
{
|
||||
return AngularDistributionLUT[i];
|
||||
if(i < 0 || i >= indexmax)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Index " << i << " out of range!";
|
||||
G4Exception("G4OpticalSurface::GetAngularDistributionValueLUT", "mat318",
|
||||
FatalException, ed);
|
||||
return 0.;
|
||||
}
|
||||
return (G4double) AngularDistributionLUT[i];
|
||||
}
|
||||
|
||||
inline
|
||||
G4double G4OpticalSurface::GetReflectivityLUTValue(G4int i)
|
||||
inline G4double G4OpticalSurface::GetReflectivityLUTValue(G4int i)
|
||||
{
|
||||
return Reflectivity[i];
|
||||
if(i < 0 || i >= RefMax)
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Index " << i << " out of range!";
|
||||
G4Exception("G4OpticalSurface::GetReflectivityLUTValue", "mat319",
|
||||
FatalException, ed);
|
||||
return 0.;
|
||||
}
|
||||
return (G4double) Reflectivity[i];
|
||||
}
|
||||
|
||||
inline
|
||||
G4Physics2DVector* G4OpticalSurface::GetDichroicVector()
|
||||
inline G4Physics2DVector* G4OpticalSurface::GetDichroicVector()
|
||||
{
|
||||
return DichroicVector;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// G4SurfaceProperty Definition
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -33,7 +33,7 @@
|
||||
// Class Description:
|
||||
//
|
||||
// A base class describing a surface property.
|
||||
// Derived classes are G4Opticalsurface, G4Firovsurface, etc.
|
||||
// Derived classes are G4Opticalsurface, G4Firovsurface, etc.
|
||||
// Contains the enumeration G4SurfaceType.
|
||||
|
||||
// File: G4SurfaceProperty.hh
|
||||
@@ -42,16 +42,12 @@
|
||||
// Version: 1.0
|
||||
// Created: 13-10-2003
|
||||
// Author: Fan Lei
|
||||
// Updated: Mariele Stockhoff 2017-02-24 add DAVIS model
|
||||
// Updated: Mariele Stockhoff 2017-02-24 add DAVIS model
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef G4SurfaceProperty_h
|
||||
#define G4SurfaceProperty_h 1
|
||||
|
||||
/////////////
|
||||
// Includes
|
||||
/////////////
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "G4Types.hh"
|
||||
@@ -63,81 +59,47 @@ typedef std::vector<G4SurfaceProperty*> G4SurfacePropertyTable;
|
||||
|
||||
enum G4SurfaceType
|
||||
{
|
||||
dielectric_metal, // dielectric-metal interface
|
||||
dielectric_dielectric, // dielectric-dielectric interface
|
||||
dielectric_LUT, // dielectric-Look-Up-Table interface
|
||||
dielectric_LUTDAVIS, // dielectric-Look-Up-Table DAVIS interface
|
||||
dielectric_dichroic, // dichroic filter interface
|
||||
firsov, // for Firsov Process
|
||||
x_ray // for x-ray mirror process
|
||||
dielectric_metal, // dielectric-metal interface
|
||||
dielectric_dielectric, // dielectric-dielectric interface
|
||||
dielectric_LUT, // dielectric-Look-Up-Table interface
|
||||
dielectric_LUTDAVIS, // dielectric-Look-Up-Table DAVIS interface
|
||||
dielectric_dichroic, // dichroic filter interface
|
||||
firsov, // for Firsov Process
|
||||
x_ray // for x-ray mirror process
|
||||
};
|
||||
|
||||
/////////////////////
|
||||
// Class Definition
|
||||
/////////////////////
|
||||
|
||||
class G4SurfaceProperty
|
||||
{
|
||||
public: // Without description
|
||||
public:
|
||||
G4SurfaceProperty(const G4String& name, G4SurfaceType type = x_ray);
|
||||
// Constructor of a X-ray optical surface object.
|
||||
|
||||
//////////////
|
||||
// Operators
|
||||
//////////////
|
||||
G4SurfaceProperty();
|
||||
virtual ~G4SurfaceProperty();
|
||||
|
||||
// G4SurfaceProperty(const G4SurfaceProperty &right);
|
||||
// const G4SurfaceProperty & operator=(const G4SurfaceProperty &right);
|
||||
const G4String& GetName() const { return theName; }
|
||||
// Returns the surface name.
|
||||
void SetName(const G4String& name) { theName = name; }
|
||||
// Sets the surface name.
|
||||
|
||||
// G4bool operator==(const G4SurfaceProperty &right) const;
|
||||
// G4bool operator!=(const G4SurfaceProperty &right) const;
|
||||
const G4SurfaceType& GetType() const { return theType; }
|
||||
// Returns the surface type.
|
||||
virtual void SetType(const G4SurfaceType& type) { theType = type; }
|
||||
// Sets the surface type.
|
||||
|
||||
public: // With description
|
||||
static void CleanSurfacePropertyTable();
|
||||
static const G4SurfacePropertyTable* GetSurfacePropertyTable();
|
||||
static size_t GetNumberOfSurfaceProperties();
|
||||
static void DumpTableInfo();
|
||||
// To handle the table of surface properties.
|
||||
|
||||
////////////////////////////////
|
||||
// Constructors and Destructor
|
||||
////////////////////////////////
|
||||
protected:
|
||||
G4String theName; // Surface name
|
||||
|
||||
G4SurfaceProperty(const G4String& name, G4SurfaceType type = x_ray);
|
||||
// Constructor of a X-ray optical surface object.
|
||||
G4SurfaceType theType; // Surface type
|
||||
|
||||
public: // Without description
|
||||
|
||||
G4SurfaceProperty();
|
||||
virtual ~G4SurfaceProperty();
|
||||
|
||||
////////////
|
||||
// Methods
|
||||
////////////
|
||||
|
||||
public: // With description
|
||||
|
||||
const G4String& GetName() const { return theName; }
|
||||
// Returns the surface name.
|
||||
void SetName(const G4String& name) { theName = name; }
|
||||
// Sets the surface name.
|
||||
|
||||
const G4SurfaceType& GetType() const { return theType; }
|
||||
// Returns the surface type.
|
||||
void SetType(const G4SurfaceType& type) { theType = type; }
|
||||
// Sets the surface type.
|
||||
|
||||
static void CleanSurfacePropertyTable();
|
||||
static const G4SurfacePropertyTable* GetSurfacePropertyTable();
|
||||
static size_t GetNumberOfSurfaceProperties();
|
||||
static void DumpTableInfo();
|
||||
// To handle the table of surface properties.
|
||||
|
||||
protected:
|
||||
|
||||
// ------------------
|
||||
// Basic data members ( To define surface property)
|
||||
// ------------------
|
||||
|
||||
G4String theName; // Surface name
|
||||
|
||||
G4SurfaceType theType; // Surface type
|
||||
|
||||
static G4SurfacePropertyTable theSurfacePropertyTable;
|
||||
// The static Table of SurfaceProperties.
|
||||
static G4SurfacePropertyTable theSurfacePropertyTable;
|
||||
// The static Table of SurfaceProperties.
|
||||
};
|
||||
|
||||
#endif /* G4SurfaceProperty_h */
|
||||
|
||||
Executable → Regular
Executable → Regular
@@ -34,11 +34,13 @@ geant4_define_module(NAME G4materials
|
||||
G4LatticeLogical.hh
|
||||
G4LatticePhysical.hh
|
||||
G4Material.hh
|
||||
G4MaterialPropertiesIndex.hh
|
||||
G4MaterialPropertiesIndex.hh
|
||||
G4MaterialPropertiesTable.hh
|
||||
G4MaterialPropertiesTable.icc
|
||||
G4MaterialPropertyVector.hh
|
||||
G4MaterialTable.hh
|
||||
G4MicroElecMaterialStructure.hh
|
||||
G4MicroElecSiStructure.hh
|
||||
G4NistElementBuilder.hh
|
||||
G4NistManager.hh
|
||||
G4NistMaterialBuilder.hh
|
||||
@@ -73,6 +75,8 @@ geant4_define_module(NAME G4materials
|
||||
G4LatticePhysical.cc
|
||||
G4Material.cc
|
||||
G4MaterialPropertiesTable.cc
|
||||
G4MicroElecMaterialStructure.cc
|
||||
G4MicroElecSiStructure.cc
|
||||
G4NistElementBuilder.cc
|
||||
G4NistManager.cc
|
||||
G4NistMaterialBuilder.cc
|
||||
@@ -90,6 +94,7 @@ geant4_define_module(NAME G4materials
|
||||
G4global
|
||||
G4intercoms
|
||||
LINK_LIBRARIES
|
||||
${ZLIB_LIBRARIES}
|
||||
)
|
||||
|
||||
# List any source specific properties here
|
||||
|
||||
@@ -78,7 +78,7 @@ G4Element::G4Element(const G4String& name, const G4String& symbol,
|
||||
G4int iz = G4lrint(zeff);
|
||||
if (iz < 1) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Fail to create G4Element " << name
|
||||
ed << "Failed to create G4Element " << name
|
||||
<< " Z= " << zeff << " < 1 !";
|
||||
G4Exception ("G4Element::G4Element()", "mat011", FatalException, ed);
|
||||
}
|
||||
@@ -99,7 +99,7 @@ G4Element::G4Element(const G4String& name, const G4String& symbol,
|
||||
|
||||
if (fNeff < zeff) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Fail to create G4Element " << name
|
||||
ed << "Failed to create G4Element " << name
|
||||
<< " with Z= " << zeff << " N= " << fNeff
|
||||
<< " N < Z is not allowed" << G4endl;
|
||||
G4Exception("G4Element::G4Element()", "mat012", FatalException, ed);
|
||||
@@ -134,9 +134,9 @@ G4Element::G4Element(const G4String& name,
|
||||
|
||||
if(0 >= nIsotopes) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Fail to create G4Element " << name
|
||||
ed << "Failed to create G4Element " << name
|
||||
<< " <" << symbol << "> with " << nIsotopes
|
||||
<< " isotopes";
|
||||
<< " isotopes.";
|
||||
G4Exception ("G4Element::G4Element()", "mat012", FatalException, ed);
|
||||
} else {
|
||||
theIsotopeVector = new G4IsotopeVector(n,0);
|
||||
@@ -152,7 +152,7 @@ void G4Element::AddIsotope(G4Isotope* isotope, G4double abundance)
|
||||
{
|
||||
if (theIsotopeVector == 0) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Fail to add Isotope to G4Element " << fName
|
||||
ed << "Failed to add Isotope to G4Element " << fName
|
||||
<< " with Z= " << fZeff << " N= " << fNeff;
|
||||
G4Exception ("G4Element::AddIsotope()", "mat013", FatalException, ed);
|
||||
return;
|
||||
@@ -165,7 +165,7 @@ void G4Element::AddIsotope(G4Isotope* isotope, G4double abundance)
|
||||
if (fNumberOfIsotopes==0) { fZeff = G4double(iz); }
|
||||
else if (G4double(iz) != fZeff) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Fail to add Isotope Z= " << iz << " to G4Element " << fName
|
||||
ed << "Failed to add Isotope Z= " << iz << " to G4Element " << fName
|
||||
<< " with different Z= " << fZeff << fNeff;
|
||||
G4Exception ("G4Element::AddIsotope()", "mat014", FatalException, ed);
|
||||
return;
|
||||
@@ -177,8 +177,8 @@ void G4Element::AddIsotope(G4Isotope* isotope, G4double abundance)
|
||||
|
||||
} else {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Fail to add Isotope Z= " << iz << " to G4Element " << fName
|
||||
<< " - more isotopes than declaired ";
|
||||
ed << "Failed to add Isotope Z= " << iz << " to G4Element " << fName
|
||||
<< " - more isotopes than declared.";
|
||||
G4Exception ("G4Element::AddIsotope()", "mat015", FatalException, ed);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
// by John Allison
|
||||
// 1997-03-26 by Peter Gumplinger
|
||||
// > cosmetics (only)
|
||||
// mail: gum@triumf.ca
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -233,13 +232,17 @@ G4double G4MaterialPropertiesTable::GetConstProperty(const G4int index) const
|
||||
return 0.;
|
||||
}
|
||||
|
||||
G4double G4MaterialPropertiesTable::GetConstProperty(const char *key) const
|
||||
G4double G4MaterialPropertiesTable::GetConstProperty(const G4String& key) const
|
||||
{
|
||||
// Returns the constant material property corresponding to a key
|
||||
// fatal exception if property not found
|
||||
|
||||
const G4int index = GetConstPropertyIndex(G4String(key));
|
||||
return GetConstProperty(index);
|
||||
return GetConstProperty(GetConstPropertyIndex(key));
|
||||
}
|
||||
|
||||
G4double G4MaterialPropertiesTable::GetConstProperty(const char *key) const
|
||||
{
|
||||
return GetConstProperty(G4String(key));
|
||||
}
|
||||
|
||||
G4bool G4MaterialPropertiesTable::ConstPropertyExists(const G4int index) const
|
||||
@@ -252,20 +255,29 @@ G4bool G4MaterialPropertiesTable::ConstPropertyExists(const G4int index) const
|
||||
return false;
|
||||
}
|
||||
|
||||
G4bool G4MaterialPropertiesTable::ConstPropertyExists(const char *key) const
|
||||
G4bool G4MaterialPropertiesTable::ConstPropertyExists(const G4String& key) const
|
||||
{
|
||||
// Returns true if a const property 'key' exists
|
||||
const G4int index = GetConstPropertyIndex(G4String(key));
|
||||
return ConstPropertyExists(index);
|
||||
return ConstPropertyExists(GetConstPropertyIndex(key));
|
||||
}
|
||||
|
||||
G4bool G4MaterialPropertiesTable::ConstPropertyExists(const char *key) const
|
||||
{
|
||||
return ConstPropertyExists(G4String(key));
|
||||
}
|
||||
|
||||
G4MaterialPropertyVector*
|
||||
G4MaterialPropertiesTable::GetProperty(const G4String& key, G4bool warning)
|
||||
{
|
||||
// Returns a Material Property Vector corresponding to a key
|
||||
const G4int index = GetPropertyIndex(key, warning);
|
||||
return GetProperty(index);
|
||||
}
|
||||
|
||||
G4MaterialPropertyVector*
|
||||
G4MaterialPropertiesTable::GetProperty(const char *key, G4bool warning)
|
||||
{
|
||||
// Returns a Material Property Vector corresponding to a key
|
||||
const G4int index = GetPropertyIndex(G4String(key), warning);
|
||||
return GetProperty(index);
|
||||
return GetProperty(G4String(key), warning);
|
||||
}
|
||||
|
||||
G4MaterialPropertyVector*
|
||||
@@ -284,6 +296,39 @@ G4MaterialPropertiesTable::GetProperty(const G4int index, G4bool warning)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
G4MaterialPropertyVector* G4MaterialPropertiesTable::AddProperty(
|
||||
const G4String& key,
|
||||
const std::vector<G4double>& photonEnergies,
|
||||
const std::vector<G4double>& propertyValues)
|
||||
{
|
||||
if (photonEnergies.size() != propertyValues.size()) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "AddProperty error!";
|
||||
G4Exception("G4MaterialPropertiesTable::AddProperty()", "mat210",
|
||||
FatalException, ed);
|
||||
}
|
||||
|
||||
// if the key doesn't exist, add it
|
||||
if (std::find(G4MaterialPropertyName.begin(),
|
||||
G4MaterialPropertyName.end(), key) ==
|
||||
G4MaterialPropertyName.end()) {
|
||||
G4MaterialPropertyName.push_back(key);
|
||||
}
|
||||
|
||||
G4MaterialPropertyVector *mpv = new G4MaterialPropertyVector(photonEnergies,
|
||||
propertyValues);
|
||||
G4int index = GetPropertyIndex(key);
|
||||
MP[index] = mpv;
|
||||
|
||||
// if key is RINDEX, we calculate GROUPVEL -
|
||||
// contribution from Tao Lin (IHEP, the JUNO experiment)
|
||||
if (key=="RINDEX") {
|
||||
CalculateGROUPVEL();
|
||||
}
|
||||
|
||||
return mpv;
|
||||
}
|
||||
|
||||
G4MaterialPropertyVector* G4MaterialPropertiesTable::AddProperty(
|
||||
const char *key,
|
||||
G4double *PhotonEnergies,
|
||||
@@ -293,62 +338,53 @@ G4MaterialPropertyVector* G4MaterialPropertiesTable::AddProperty(
|
||||
// Provides a way of adding a property to the Material Properties
|
||||
// Table given a pair of numbers and a key
|
||||
G4String k(key);
|
||||
std::vector<G4double> energies;
|
||||
std::vector<G4double> values;
|
||||
for (G4int i=0; i<NumEntries; ++i) {
|
||||
energies.push_back(PhotonEnergies[i]);
|
||||
values.push_back(PropertyValues[i]);
|
||||
}
|
||||
return AddProperty(k, energies, values);
|
||||
}
|
||||
|
||||
void G4MaterialPropertiesTable::AddProperty(const G4String& key, G4MaterialPropertyVector* mpv)
|
||||
{
|
||||
// Provides a way of adding a property to the Material Properties
|
||||
// Table given an G4MaterialPropertyVector Reference and a key
|
||||
// if the key doesn't exist, add it
|
||||
if (std::find(G4MaterialPropertyName.begin(),
|
||||
G4MaterialPropertyName.end(), k) ==
|
||||
G4MaterialPropertyName.end(), key) ==
|
||||
G4MaterialPropertyName.end()) {
|
||||
G4MaterialPropertyName.push_back(k);
|
||||
G4MaterialPropertyName.push_back(key);
|
||||
}
|
||||
G4int index = GetPropertyIndex(k);
|
||||
G4int index = GetPropertyIndex(key);
|
||||
MP[ index ] = mpv;
|
||||
|
||||
G4MaterialPropertyVector *mpv = new G4MaterialPropertyVector(PhotonEnergies,
|
||||
PropertyValues, NumEntries);
|
||||
MP[index] = mpv;
|
||||
|
||||
// if key is RINDEX, we calculate GROUPVEL -
|
||||
// if key is RINDEX, we calculate GROUPVEL -
|
||||
// contribution from Tao Lin (IHEP, the JUNO experiment)
|
||||
if (k=="RINDEX") {
|
||||
if (key=="RINDEX") {
|
||||
CalculateGROUPVEL();
|
||||
}
|
||||
|
||||
return mpv;
|
||||
}
|
||||
|
||||
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
|
||||
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;
|
||||
AddProperty(G4String(key), mpv);
|
||||
}
|
||||
|
||||
// if key is RINDEX, we calculate GROUPVEL -
|
||||
// contribution from Tao Lin (IHEP, the JUNO experiment)
|
||||
if (k=="RINDEX") {
|
||||
CalculateGROUPVEL();
|
||||
}
|
||||
}
|
||||
|
||||
void G4MaterialPropertiesTable::AddEntry(const char *key,
|
||||
void G4MaterialPropertiesTable::AddEntry(const G4String& key,
|
||||
G4double aPhotonEnergy,
|
||||
G4double aPropertyValue)
|
||||
{
|
||||
// Allows to add an entry pair directly to the Material Property Vector
|
||||
// given a key
|
||||
G4String k(key);
|
||||
if (std::find(G4MaterialPropertyName.begin(),
|
||||
G4MaterialPropertyName.end(), k) ==
|
||||
G4MaterialPropertyName.end(), key) ==
|
||||
G4MaterialPropertyName.end()) {
|
||||
G4MaterialPropertyName.push_back(k);
|
||||
G4MaterialPropertyName.push_back(key);
|
||||
}
|
||||
G4int index = GetPropertyIndex(k);
|
||||
G4int index = GetPropertyIndex(key);
|
||||
|
||||
G4MaterialPropertyVector *targetVector=MP[index];
|
||||
if (targetVector != nullptr)
|
||||
@@ -362,6 +398,13 @@ void G4MaterialPropertiesTable::AddEntry(const char *key,
|
||||
}
|
||||
}
|
||||
|
||||
void G4MaterialPropertiesTable::AddEntry(const char *key,
|
||||
G4double aPhotonEnergy,
|
||||
G4double aPropertyValue)
|
||||
{
|
||||
AddEntry(G4String(key), aPhotonEnergy, aPropertyValue);
|
||||
}
|
||||
|
||||
void G4MaterialPropertiesTable::DumpTable()
|
||||
{
|
||||
// material properties
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// G4MicroElecMaterialStructure.cc, 2011/08/29 A.Valentin, M. Raine are with CEA [a]
|
||||
// 2020/05/20 P. Caron, C. Inguimbert are with ONERA [b]
|
||||
// Q. Gibaru is with CEA [a], ONERA [b] and CNES [c]
|
||||
// M. Raine and D. Lambert are with CEA [a]
|
||||
//
|
||||
// A part of this work has been funded by the French space agency(CNES[c])
|
||||
// [a] CEA, DAM, DIF - 91297 ARPAJON, France
|
||||
// [b] ONERA - DPHY, 2 avenue E.Belin, 31055 Toulouse, France
|
||||
// [c] CNES, 18 av.E.Belin, 31401 Toulouse CEDEX, France
|
||||
//
|
||||
// Based on the following publications
|
||||
// - A.Valentin, M. Raine,
|
||||
// Inelastic cross-sections of low energy electrons in silicon
|
||||
// for the simulation of heavy ion tracks with the Geant4-DNA toolkit,
|
||||
// NSS Conf. Record 2010, pp. 80-85
|
||||
// https://doi.org/10.1109/NSSMIC.2010.5873720
|
||||
//
|
||||
// - A.Valentin, M. Raine, M.Gaillardin, P.Paillet
|
||||
// Geant4 physics processes for microdosimetry simulation:
|
||||
// very low energy electromagnetic models for electrons in Silicon,
|
||||
// https://doi.org/10.1016/j.nimb.2012.06.007
|
||||
// NIM B, vol. 288, pp. 66-73, 2012, part A
|
||||
// heavy ions in Si, NIM B, vol. 287, pp. 124-129, 2012, part B
|
||||
// https://doi.org/10.1016/j.nimb.2012.07.028
|
||||
//
|
||||
// - M. Raine, M. Gaillardin, P. Paillet
|
||||
// Geant4 physics processes for silicon microdosimetry simulation:
|
||||
// Improvements and extension of the energy-range validity up to 10 GeV/nucleon
|
||||
// NIM B, vol. 325, pp. 97-100, 2014
|
||||
// https://doi.org/10.1016/j.nimb.2014.01.014
|
||||
//
|
||||
// - J. Pierron, C. Inguimbert, M. Belhaj, T. Gineste, J. Puech, M. Raine
|
||||
// Electron emission yield for low energy electrons:
|
||||
// Monte Carlo simulation and experimental comparison for Al, Ag, and Si
|
||||
// Journal of Applied Physics 121 (2017) 215107.
|
||||
// https://doi.org/10.1063/1.4984761
|
||||
//
|
||||
// - P. Caron,
|
||||
// Study of Electron-Induced Single-Event Upset in Integrated Memory Devices
|
||||
// PHD, 16th October 2019
|
||||
//
|
||||
// - Q.Gibaru, C.Inguimbert, P.Caron, M.Raine, D.Lambert, J.Puech,
|
||||
// Geant4 physics processes for microdosimetry and secondary electron emission simulation :
|
||||
// Extension of MicroElec to very low energies and new materials
|
||||
// NIM B, 2020, in review.
|
||||
//
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4MicroElecMaterialStructure.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4MicroElecMaterialStructure::G4MicroElecMaterialStructure(const G4String& matName)
|
||||
{
|
||||
materialName = matName;
|
||||
if (matName == "Vacuum" || matName == "uum") {
|
||||
workFunction = 0;
|
||||
initialEnergy = 0;
|
||||
}
|
||||
else {
|
||||
ReadMaterialFile();
|
||||
}
|
||||
nLevels = energyConstant.size();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4MicroElecMaterialStructure::~G4MicroElecMaterialStructure()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void G4MicroElecMaterialStructure::ReadMaterialFile()
|
||||
{
|
||||
char *path = std::getenv("G4LEDATA");
|
||||
|
||||
if (materialName(0) == 'G' && materialName(1) == '4') {
|
||||
//in the case the NIST database is used
|
||||
materialName.erase(0, 1);
|
||||
materialName.erase(0, 1);
|
||||
materialName.erase(0, 1);
|
||||
}
|
||||
|
||||
std::ostringstream fileName;
|
||||
fileName << path << "/microelec/Structure/Data_" + materialName + ".dat";
|
||||
std::ifstream fichier(fileName.str().c_str());
|
||||
|
||||
int varLength = 0;
|
||||
G4String nameParameter;
|
||||
|
||||
G4String unitName;
|
||||
G4double unitValue;
|
||||
G4double data;
|
||||
G4String filler;
|
||||
G4String type;
|
||||
|
||||
if (fichier)
|
||||
{
|
||||
fichier >> filler >> type;
|
||||
materialName = filler;
|
||||
if (type == "Compound") {isCompound = true; Z = 0; }
|
||||
else { isCompound = false; Z = std::stoi(type); }
|
||||
while(!fichier.eof()) {
|
||||
|
||||
getline(fichier, filler);
|
||||
std::stringstream line(filler);
|
||||
|
||||
if (filler(0) == '#' || filler.empty()) {continue;}
|
||||
|
||||
line >> varLength;
|
||||
line >> nameParameter;
|
||||
line >> unitName;
|
||||
unitValue = ConvertUnit(unitName);
|
||||
|
||||
for (int i = 0; i < varLength; i++)
|
||||
{
|
||||
line >> data; data = data*unitValue;
|
||||
|
||||
if (nameParameter == "WorkFunction") workFunction = data;
|
||||
if (nameParameter == "EnergyGap") energyGap = data;
|
||||
|
||||
if (nameParameter == "EnergyPeak") energyConstant.push_back(data);
|
||||
if (nameParameter == "EnergyLimit") LimitEnergy.push_back(data);
|
||||
if (nameParameter == "EADL") EADL_Enumerator.push_back(data);
|
||||
|
||||
if (nameParameter == "WeaklyBoundShell")
|
||||
{if (data == 0) { isShellWeaklyBoundVector.push_back(false); }
|
||||
else {isShellWeaklyBoundVector.push_back(true);}}
|
||||
|
||||
if (nameParameter == "WeaklyBoundInitialEnergy") initialEnergy = data;
|
||||
|
||||
if (nameParameter == "ShellAtomicNumber") compoundShellZ.push_back(data);
|
||||
|
||||
if (nameParameter == "DielectricModelLowEnergyLimit_e") limitInelastic[0]=data;
|
||||
if (nameParameter == "DielectricModelHighEnergyLimit_e") limitInelastic[1] = data;
|
||||
if (nameParameter == "DielectricModelLowEnergyLimit_p") limitInelastic[2] = data;
|
||||
if (nameParameter == "DielectricModelHighEnergyLimit_p") limitInelastic[3] = data;
|
||||
|
||||
if (nameParameter == "ElasticModelLowEnergyLimit") limitElastic[0] = data;
|
||||
if (nameParameter == "ElasticModelHighEnergyLimit") limitElastic[1] = data;
|
||||
}
|
||||
}
|
||||
fichier.close(); // on ferme le fichier
|
||||
}
|
||||
else {
|
||||
G4String str = "file ";
|
||||
str += fileName.str() + " not found!";
|
||||
G4Exception("G4MicroElecMaterialStructure::ReadMaterialFile", "em0002", FatalException, str);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4MicroElecMaterialStructure::Energy(G4int level)
|
||||
{
|
||||
return (level >= 0 && level < nLevels) ? energyConstant[level] : 0.0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4MicroElecMaterialStructure::GetZ(G4int Shell)
|
||||
{
|
||||
if (Shell >= 0 && Shell < nLevels) {
|
||||
if (!isCompound) return Z;
|
||||
else return compoundShellZ[Shell];
|
||||
}
|
||||
else return 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4MicroElecMaterialStructure::ConvertUnit(const G4String& unitName)
|
||||
{
|
||||
G4double unitValue = 0;
|
||||
if (unitName == "meV") unitValue = 1e-3*CLHEP::eV;
|
||||
else if (unitName == "eV") unitValue = CLHEP::eV;
|
||||
else if (unitName == "keV") unitValue = CLHEP::keV;
|
||||
else if (unitName == "MeV") unitValue = CLHEP::MeV;
|
||||
else if (unitName == "noUnit") unitValue = 1;
|
||||
|
||||
return unitValue;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4MicroElecMaterialStructure::GetLimitEnergy(G4int level)
|
||||
{
|
||||
G4double E = LimitEnergy[level];
|
||||
if (IsShellWeaklyBound(level)) { E = energyGap+ initialEnergy; }
|
||||
return E;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4MicroElecMaterialStructure::GetInelasticModelLowLimit(G4int pdg)
|
||||
{
|
||||
G4double res = 0.0;
|
||||
if (pdg == 11) res = limitInelastic[0];
|
||||
else if (pdg == 2212) res = limitInelastic[2];
|
||||
return res;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4double G4MicroElecMaterialStructure::GetInelasticModelHighLimit(G4int pdg)
|
||||
{
|
||||
G4double res = 0.0;
|
||||
if (pdg == 11) res = limitInelastic[1];
|
||||
else if (pdg == 2212) res = limitInelastic[3];
|
||||
return res;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4bool G4MicroElecMaterialStructure::IsShellWeaklyBound(G4int level)
|
||||
{
|
||||
return isShellWeaklyBoundVector[level];
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// G4MicroElecSiStructure.cc, 2011/08/29 A.Valentin, M. Raine
|
||||
//
|
||||
// Based on the following publications
|
||||
//
|
||||
// - Inelastic cross-sections of low energy electrons in silicon
|
||||
// for the simulation of heavy ion tracks with theGeant4-DNA toolkit,
|
||||
// NSS Conf. Record 2010, pp. 80-85.
|
||||
// - Geant4 physics processes for microdosimetry simulation:
|
||||
// very low energy electromagnetic models for electrons in Si,
|
||||
// NIM B, vol. 288, pp. 66 - 73, 2012.
|
||||
// - Geant4 physics processes for microdosimetry simulation:
|
||||
// very low energy electromagnetic models for protons and
|
||||
// heavy ions in Si, NIM B, vol. 287, pp. 124 - 129, 2012.
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4MicroElecSiStructure.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
G4MicroElecSiStructure::G4MicroElecSiStructure(): nLevels(6)
|
||||
{
|
||||
energyConstant.push_back(16.65*eV);
|
||||
energyConstant.push_back(6.52*eV);
|
||||
energyConstant.push_back(13.63*eV);
|
||||
energyConstant.push_back(107.98*eV);
|
||||
energyConstant.push_back(151.55*eV);
|
||||
energyConstant.push_back(1828.5*eV);
|
||||
|
||||
nLevels = energyConstant.size();
|
||||
}
|
||||
|
||||
|
||||
G4MicroElecSiStructure::~G4MicroElecSiStructure()
|
||||
{ }
|
||||
|
||||
|
||||
G4double G4MicroElecSiStructure::Energy(G4int level)
|
||||
{
|
||||
G4double energ = 0.;
|
||||
|
||||
if (level >=0 && level < nLevels) energ = energyConstant[level];
|
||||
|
||||
return energ;
|
||||
}
|
||||
@@ -128,7 +128,7 @@ G4NistManager::BuildMaterialWithNewDensity(const G4String& name,
|
||||
if(bmat) {
|
||||
G4cout << "G4NistManager::BuildMaterialWithNewDensity ERROR: " << G4endl;
|
||||
G4cout << " New material <" << name << "> cannot be built because material"
|
||||
<< " with the same name already exist" << G4endl;
|
||||
<< " with the same name already exists." << G4endl;
|
||||
G4Exception("G4NistManager::BuildMaterialWithNewDensity()", "mat101",
|
||||
FatalException, "Wrong material name");
|
||||
return 0;
|
||||
@@ -138,7 +138,7 @@ G4NistManager::BuildMaterialWithNewDensity(const G4String& name,
|
||||
G4cout << "G4NistManager::BuildMaterialWithNewDensity ERROR: " << G4endl;
|
||||
G4cout << " New material <" << name << "> cannot be built because "
|
||||
<< G4endl;
|
||||
G4cout << " base material <" << basename << "> does not exist" << G4endl;
|
||||
G4cout << " base material <" << basename << "> does not exist." << G4endl;
|
||||
G4Exception("G4NistManager::BuildMaterialWithNewDensity()", "mat102",
|
||||
FatalException, "Wrong material name");
|
||||
return 0;
|
||||
|
||||
@@ -149,7 +149,7 @@ G4Material* G4NistMaterialBuilder::BuildNistMaterial(const G4String& name,
|
||||
if( (verbose == 1 && warning) || verbose > 1) {
|
||||
G4cout << "G4NistMaterialBuilder::FindOrBuildMaterial WARNING:"
|
||||
<< " material <" << name
|
||||
<< "> is not found out" << G4endl;
|
||||
<< "> is not found." << G4endl;
|
||||
}
|
||||
return mat;
|
||||
}
|
||||
@@ -208,11 +208,11 @@ G4Material* G4NistMaterialBuilder::BuildMaterial(G4int i)
|
||||
G4Element* el = elmBuilder->FindOrBuildElement(Z);
|
||||
if(!el) {
|
||||
G4cout << "G4NistMaterialBuilder::BuildMaterial:"
|
||||
<< " ERROR: elements Z= " << Z << " is not found "
|
||||
<< " ERROR: elements Z= " << Z << " is not found"
|
||||
<< " for material " << names[i]
|
||||
<< G4endl;
|
||||
G4Exception("G4NistMaterialBuilder::BuildMaterial()", "mat103",
|
||||
FatalException, "Fail to construct material");
|
||||
FatalException, "Failed to construct material");
|
||||
return 0;
|
||||
}
|
||||
if(atomCount[i]) {
|
||||
@@ -258,7 +258,7 @@ G4Material* G4NistMaterialBuilder::ConstructNewMaterial(
|
||||
if(mat) {
|
||||
G4cout << "G4NistMaterialBuilder::ConstructNewMaterial:"
|
||||
<< " WARNING: the material <" << name
|
||||
<< "> is already exist" << G4endl;
|
||||
<< "> already exists." << G4endl;
|
||||
G4cout << " New material will NOT be built!"
|
||||
<< G4endl;
|
||||
return mat;
|
||||
@@ -309,7 +309,7 @@ G4Material* G4NistMaterialBuilder::ConstructNewMaterial(
|
||||
if(mat) {
|
||||
G4cout << "G4NistMaterialBuilder::ConstructNewMaterial:"
|
||||
<< " WARNING: the material <" << name
|
||||
<< "> is already exist" << G4endl;
|
||||
<< "> already exists." << G4endl;
|
||||
G4cout << " New material will NOT be built!"
|
||||
<< G4endl;
|
||||
return mat;
|
||||
@@ -356,7 +356,7 @@ G4Material* G4NistMaterialBuilder::ConstructNewGasMaterial(
|
||||
if(mat) {
|
||||
G4cout << "G4NistMaterialBuilder::ConstructNewGasMaterial:"
|
||||
<< " WARNING: the material <" << name
|
||||
<< "> is already exist" << G4endl;
|
||||
<< "> already exists." << G4endl;
|
||||
G4cout << " New material will NOT be built!"
|
||||
<< G4endl;
|
||||
return mat;
|
||||
@@ -366,14 +366,14 @@ G4Material* G4NistMaterialBuilder::ConstructNewGasMaterial(
|
||||
if(!bmat) {
|
||||
G4cout << "G4NistMaterialBuilder::ConstructNewGasMaterial:"
|
||||
<< " WARNING: the Name <" << nameDB
|
||||
<< "> is NOT in the DB: no new gas will be constructed"
|
||||
<< "> is NOT in the database: no new gas will be constructed."
|
||||
<< G4endl;
|
||||
return 0;
|
||||
}
|
||||
if(bmat->GetState() != kStateGas) {
|
||||
G4cout << "G4NistMaterialBuilder::ConstructNewGasMaterial:"
|
||||
<< " WARNING: <" << nameDB
|
||||
<< "> is NOT a gas - no new gas will be constructed"
|
||||
<< "> is NOT a gas - no new gas will be constructed."
|
||||
<< G4endl;
|
||||
return 0;
|
||||
}
|
||||
@@ -406,7 +406,7 @@ G4Material* G4NistMaterialBuilder::ConstructNewIdealGasMaterial(
|
||||
if(mat) {
|
||||
G4cout << "G4NistMaterialBuilder::ConstructNewMaterial:"
|
||||
<< " WARNING: the material <" << name
|
||||
<< "> is already exist" << G4endl;
|
||||
<< "> already exists." << G4endl;
|
||||
G4cout << " New material will NOT be built!"
|
||||
<< G4endl;
|
||||
return mat;
|
||||
@@ -467,10 +467,10 @@ void G4NistMaterialBuilder::AddMaterial(const G4String& nameMat, G4double dens,
|
||||
|
||||
if (nCurrent != 0) {
|
||||
G4cout << "G4NistMaterialBuilder::AddMaterial WARNING: previous "
|
||||
<< "mixture " << nMaterials << " " << names[nMaterials]
|
||||
<< "mixture " << nMaterials << " " << names[nMaterials]
|
||||
<< " is not yet complete!"
|
||||
<< G4endl;
|
||||
G4cout << " New material " << nameMat << " will not be added"
|
||||
G4cout << " New material " << nameMat << " will not be added."
|
||||
<< G4endl;
|
||||
return;
|
||||
}
|
||||
@@ -501,7 +501,7 @@ void G4NistMaterialBuilder::AddMaterial(const G4String& nameMat, G4double dens,
|
||||
++nMaterials;
|
||||
|
||||
if(verbose > 1) {
|
||||
G4cout << "New material " << nameMat << " is prepeared; "
|
||||
G4cout << "New material " << nameMat << " is prepared; "
|
||||
<< " nMaterials= " << nMaterials
|
||||
<< " nComponents= " << nComponents
|
||||
<< " nCurrent= " << nCurrent
|
||||
@@ -536,7 +536,7 @@ void G4NistMaterialBuilder::ListMaterials(const G4String& mnam) const
|
||||
|
||||
} else {
|
||||
G4cout << "### G4NistMaterialBuilder::ListMaterials: Warning "
|
||||
<< mnam << " list is not known" << G4endl;
|
||||
<< mnam << " list is not known." << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -648,7 +648,7 @@ G4NistMaterialBuilder::AddGas(const G4String& nameMat, G4double t, G4double p)
|
||||
}
|
||||
}
|
||||
G4cout << "WARNING: G4NistMaterialBuilder::AddGas problem: there is no "
|
||||
<< nameMat << " in the list of materials;"
|
||||
<< nameMat << " in the list of materials."
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Optical Surface Class Implementation
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -34,553 +34,493 @@
|
||||
// Version: 2.0
|
||||
// Created: 1997-06-26
|
||||
// Author: Peter Gumplinger
|
||||
// updated: 2017-02-24 Mariele Stockhoff add DAVIS model
|
||||
// mail: gum@triumf.ca
|
||||
// updated: 2017-02-24 Mariele Stockhoff add DAVIS model
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <zlib.h>
|
||||
|
||||
//#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4OpticalSurface.hh"
|
||||
|
||||
/////////////////////////
|
||||
// Class Implementation
|
||||
/////////////////////////
|
||||
|
||||
//////////////
|
||||
// Operators
|
||||
//////////////
|
||||
|
||||
G4OpticalSurface& G4OpticalSurface::operator=(const G4OpticalSurface& right)
|
||||
{
|
||||
if (this != &right)
|
||||
{
|
||||
theName = right.theName;
|
||||
theType = right.theType;
|
||||
theModel = right.theModel;
|
||||
theFinish = right.theFinish;
|
||||
sigma_alpha = right.sigma_alpha;
|
||||
polish = right.polish;
|
||||
theMaterialPropertiesTable = right.theMaterialPropertiesTable;
|
||||
if(this != &right)
|
||||
{
|
||||
theName = right.theName;
|
||||
theType = right.theType;
|
||||
theModel = right.theModel;
|
||||
theFinish = right.theFinish;
|
||||
sigma_alpha = right.sigma_alpha;
|
||||
polish = right.polish;
|
||||
theMaterialPropertiesTable = right.theMaterialPropertiesTable;
|
||||
|
||||
if (AngularDistribution) delete [] AngularDistribution;
|
||||
AngularDistribution =
|
||||
new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
|
||||
*(AngularDistribution) = *(right.AngularDistribution);
|
||||
if(AngularDistribution)
|
||||
delete[] AngularDistribution;
|
||||
AngularDistribution =
|
||||
new G4float[incidentIndexMax * thetaIndexMax * phiIndexMax];
|
||||
*(AngularDistribution) = *(right.AngularDistribution);
|
||||
|
||||
if (AngularDistributionLUT) delete [] AngularDistributionLUT;
|
||||
AngularDistributionLUT = new G4float[indexmax];
|
||||
*(AngularDistributionLUT) = *(right.AngularDistributionLUT);
|
||||
|
||||
if (Reflectivity) delete [] Reflectivity;
|
||||
Reflectivity = new G4float[RefMax];
|
||||
*(Reflectivity) = *(right.Reflectivity);
|
||||
|
||||
if (DichroicVector) delete DichroicVector;
|
||||
DichroicVector = new G4Physics2DVector();
|
||||
*DichroicVector = *(right.DichroicVector);
|
||||
}
|
||||
if(AngularDistributionLUT)
|
||||
delete[] AngularDistributionLUT;
|
||||
AngularDistributionLUT = new G4float[indexmax];
|
||||
*(AngularDistributionLUT) = *(right.AngularDistributionLUT);
|
||||
|
||||
if(Reflectivity)
|
||||
delete[] Reflectivity;
|
||||
Reflectivity = new G4float[RefMax];
|
||||
*(Reflectivity) = *(right.Reflectivity);
|
||||
|
||||
if(DichroicVector)
|
||||
delete DichroicVector;
|
||||
DichroicVector = new G4Physics2DVector();
|
||||
*DichroicVector = *(right.DichroicVector);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
/////////////////
|
||||
// Constructors
|
||||
/////////////////
|
||||
|
||||
G4OpticalSurface::G4OpticalSurface(const G4String& name,
|
||||
G4OpticalSurfaceModel model,
|
||||
G4OpticalSurfaceFinish finish,
|
||||
G4SurfaceType type,
|
||||
G4double value)
|
||||
: G4SurfaceProperty(name,type),
|
||||
theModel(model),
|
||||
theFinish(finish),
|
||||
theMaterialPropertiesTable(0)
|
||||
G4SurfaceType type, G4double value)
|
||||
: G4SurfaceProperty(name, type)
|
||||
, theModel(model)
|
||||
, theFinish(finish)
|
||||
, theMaterialPropertiesTable(nullptr)
|
||||
{
|
||||
if ( model == glisur ){
|
||||
polish = value;
|
||||
sigma_alpha = 0.0;
|
||||
}
|
||||
else if ( model == unified ) {
|
||||
sigma_alpha = value;
|
||||
polish = 0.0;
|
||||
}
|
||||
else if ( model == LUT ) {
|
||||
sigma_alpha = value;
|
||||
polish = 0.0;
|
||||
}
|
||||
else if ( model == dichroic ) {
|
||||
sigma_alpha = value;
|
||||
polish = 0.0;
|
||||
}
|
||||
else if ( model == DAVIS ) {
|
||||
sigma_alpha = value;
|
||||
polish = 0.0;
|
||||
}
|
||||
else {
|
||||
G4Exception("G4OpticalSurface::G4OpticalSurface()", "mat309",
|
||||
FatalException,
|
||||
"Constructor called with INVALID model.");
|
||||
}
|
||||
AngularDistribution = nullptr;
|
||||
|
||||
AngularDistribution = NULL;
|
||||
AngularDistributionLUT = nullptr;
|
||||
Reflectivity = nullptr;
|
||||
|
||||
AngularDistributionLUT = NULL;
|
||||
Reflectivity = NULL;
|
||||
|
||||
DichroicVector = NULL;
|
||||
DichroicVector = nullptr;
|
||||
|
||||
if (type == dielectric_LUT) {
|
||||
AngularDistribution =
|
||||
new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
|
||||
ReadLUTFile();
|
||||
}
|
||||
|
||||
if (type == dielectric_LUTDAVIS) {
|
||||
AngularDistributionLUT = new G4float[indexmax];
|
||||
ReadLUTDAVISFile();
|
||||
|
||||
Reflectivity = new G4float[RefMax];
|
||||
ReadReflectivityLUTFile();
|
||||
}
|
||||
|
||||
if (type == dielectric_dichroic) {
|
||||
DichroicVector = new G4Physics2DVector();
|
||||
ReadDichroicFile();
|
||||
}
|
||||
switch(theModel)
|
||||
{
|
||||
case glisur:
|
||||
polish = value;
|
||||
sigma_alpha = 0.0;
|
||||
break;
|
||||
case LUT:
|
||||
case dichroic:
|
||||
case DAVIS:
|
||||
ReadDataFile();
|
||||
// fall through
|
||||
case unified:
|
||||
sigma_alpha = value;
|
||||
polish = 0.0;
|
||||
break;
|
||||
default:
|
||||
G4Exception("G4OpticalSurface::G4OpticalSurface()", "mat309",
|
||||
FatalException, "Constructor called with INVALID model.");
|
||||
}
|
||||
}
|
||||
|
||||
G4OpticalSurface::~G4OpticalSurface()
|
||||
{
|
||||
if (AngularDistribution) delete [] AngularDistribution;
|
||||
if(AngularDistribution)
|
||||
delete[] AngularDistribution;
|
||||
|
||||
if (AngularDistributionLUT) delete [] AngularDistributionLUT;
|
||||
if (Reflectivity) delete [] Reflectivity;
|
||||
if(AngularDistributionLUT)
|
||||
delete[] AngularDistributionLUT;
|
||||
if(Reflectivity)
|
||||
delete[] Reflectivity;
|
||||
|
||||
if (DichroicVector) delete DichroicVector;
|
||||
if(DichroicVector)
|
||||
delete DichroicVector;
|
||||
}
|
||||
|
||||
G4OpticalSurface::G4OpticalSurface(const G4OpticalSurface &right)
|
||||
: G4SurfaceProperty(right.theName,right.theType)
|
||||
G4OpticalSurface::G4OpticalSurface(const G4OpticalSurface& right)
|
||||
: G4SurfaceProperty(right.theName, right.theType)
|
||||
{
|
||||
*this = right;
|
||||
this->theName = right.theName;
|
||||
this->theType = right.theType;
|
||||
this->theModel = right.theModel;
|
||||
this->theFinish = right.theFinish;
|
||||
this->sigma_alpha = right.sigma_alpha;
|
||||
this->polish = right.polish;
|
||||
this->theMaterialPropertiesTable = right.theMaterialPropertiesTable;
|
||||
|
||||
if (this->AngularDistribution) delete [] AngularDistribution;
|
||||
this->AngularDistribution =
|
||||
new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
|
||||
*(this->AngularDistribution) = *(right.AngularDistribution);
|
||||
|
||||
if (this->AngularDistributionLUT) delete [] AngularDistributionLUT;
|
||||
this->AngularDistributionLUT = new G4float[indexmax];
|
||||
*(this->AngularDistributionLUT) = *(right.AngularDistributionLUT);
|
||||
if (this->Reflectivity) delete [] Reflectivity;
|
||||
this->Reflectivity = new G4float[RefMax];
|
||||
*(this->Reflectivity) = *(right.Reflectivity);
|
||||
*this = right;
|
||||
this->theName = right.theName;
|
||||
this->theType = right.theType;
|
||||
this->theModel = right.theModel;
|
||||
this->theFinish = right.theFinish;
|
||||
this->sigma_alpha = right.sigma_alpha;
|
||||
this->polish = right.polish;
|
||||
this->theMaterialPropertiesTable = right.theMaterialPropertiesTable;
|
||||
|
||||
if (this->DichroicVector) delete DichroicVector;
|
||||
this->DichroicVector = new G4Physics2DVector();
|
||||
*(this->DichroicVector) = *(right.DichroicVector);
|
||||
if(this->AngularDistribution)
|
||||
delete[] AngularDistribution;
|
||||
this->AngularDistribution =
|
||||
new G4float[incidentIndexMax * thetaIndexMax * phiIndexMax];
|
||||
*(this->AngularDistribution) = *(right.AngularDistribution);
|
||||
|
||||
if(this->AngularDistributionLUT)
|
||||
delete[] AngularDistributionLUT;
|
||||
this->AngularDistributionLUT = new G4float[indexmax];
|
||||
*(this->AngularDistributionLUT) = *(right.AngularDistributionLUT);
|
||||
if(this->Reflectivity)
|
||||
delete[] Reflectivity;
|
||||
this->Reflectivity = new G4float[RefMax];
|
||||
*(this->Reflectivity) = *(right.Reflectivity);
|
||||
|
||||
if(this->DichroicVector)
|
||||
delete DichroicVector;
|
||||
this->DichroicVector = new G4Physics2DVector();
|
||||
*(this->DichroicVector) = *(right.DichroicVector);
|
||||
}
|
||||
|
||||
G4bool G4OpticalSurface::operator==(const G4OpticalSurface &right) const
|
||||
G4bool G4OpticalSurface::operator==(const G4OpticalSurface& right) const
|
||||
{
|
||||
return (this == (G4OpticalSurface *) &right);
|
||||
return (this == (G4OpticalSurface*) &right);
|
||||
}
|
||||
|
||||
G4bool G4OpticalSurface::operator!=(const G4OpticalSurface &right) const
|
||||
G4bool G4OpticalSurface::operator!=(const G4OpticalSurface& right) const
|
||||
{
|
||||
return (this != (G4OpticalSurface *) &right);
|
||||
}
|
||||
////////////
|
||||
// Methods
|
||||
////////////
|
||||
|
||||
G4int G4OpticalSurface::GetInmax(void) const
|
||||
{
|
||||
return indexmax;
|
||||
return (this != (G4OpticalSurface*) &right);
|
||||
}
|
||||
|
||||
G4int G4OpticalSurface::GetLUTbins(void) const
|
||||
{
|
||||
return LUTbins;
|
||||
}
|
||||
G4int G4OpticalSurface::GetInmax(void) const { return indexmax; }
|
||||
|
||||
G4int G4OpticalSurface::GetRefMax(void) const
|
||||
{
|
||||
return RefMax;
|
||||
}
|
||||
|
||||
G4int G4OpticalSurface::GetThetaIndexMax(void) const
|
||||
{
|
||||
return thetaIndexMax;
|
||||
}
|
||||
G4int G4OpticalSurface::GetLUTbins(void) const { return LUTbins; }
|
||||
|
||||
G4int G4OpticalSurface::GetPhiIndexMax(void) const
|
||||
{
|
||||
return phiIndexMax;
|
||||
}
|
||||
G4int G4OpticalSurface::GetRefMax(void) const { return RefMax; }
|
||||
|
||||
void G4OpticalSurface::DumpInfo() const
|
||||
G4int G4OpticalSurface::GetThetaIndexMax(void) const { return thetaIndexMax; }
|
||||
|
||||
G4int G4OpticalSurface::GetPhiIndexMax(void) const { return phiIndexMax; }
|
||||
|
||||
void G4OpticalSurface::DumpInfo() const
|
||||
{
|
||||
// Dump info for surface
|
||||
// Dump info for surface
|
||||
|
||||
G4cout <<
|
||||
" Surface type = " << G4int(theType) << G4endl <<
|
||||
" Surface finish = " << G4int(theFinish) << G4endl <<
|
||||
" Surface model = " << G4int(theModel) << G4endl;
|
||||
G4cout << " Surface type = " << G4int(theType) << G4endl
|
||||
<< " Surface finish = " << G4int(theFinish) << G4endl
|
||||
<< " Surface model = " << G4int(theModel) << G4endl << G4endl
|
||||
<< " Surface parameter " << G4endl << " ----------------- "
|
||||
<< G4endl;
|
||||
|
||||
G4cout << G4endl;
|
||||
|
||||
G4cout << " Surface parameter " << G4endl;
|
||||
G4cout << " ----------------- " << G4endl;
|
||||
if (theModel == glisur ){
|
||||
G4cout << polish << G4endl;
|
||||
}
|
||||
else if (theModel == LUT ){
|
||||
G4cout << sigma_alpha << G4endl;
|
||||
}
|
||||
else {
|
||||
G4cout << sigma_alpha << G4endl;
|
||||
}
|
||||
G4cout << G4endl;
|
||||
if(theModel == glisur)
|
||||
{
|
||||
G4cout << " polish: " << polish << G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << " sigma_alpha: " << sigma_alpha << G4endl;
|
||||
}
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
void G4OpticalSurface::SetType(const G4SurfaceType& type)
|
||||
{
|
||||
theType = type;
|
||||
|
||||
if (type == dielectric_LUTDAVIS) {
|
||||
if (!AngularDistributionLUT) AngularDistributionLUT =
|
||||
new G4float[indexmax];
|
||||
ReadLUTDAVISFile();
|
||||
}
|
||||
|
||||
if (type == dielectric_LUT) {
|
||||
if (!AngularDistribution) AngularDistribution =
|
||||
new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
|
||||
|
||||
ReadLUTFile();
|
||||
}
|
||||
if (type == dielectric_dichroic) {
|
||||
if (!DichroicVector) DichroicVector = new G4Physics2DVector();
|
||||
ReadDichroicFile();
|
||||
}
|
||||
ReadDataFile();
|
||||
}
|
||||
|
||||
void G4OpticalSurface::SetFinish(const G4OpticalSurfaceFinish finish)
|
||||
{
|
||||
theFinish = finish;
|
||||
if (theType == dielectric_LUT) {
|
||||
if (!AngularDistribution) AngularDistribution =
|
||||
new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
|
||||
ReadLUTFile();
|
||||
}
|
||||
|
||||
if (theType == dielectric_LUTDAVIS) {
|
||||
if (!AngularDistributionLUT) AngularDistributionLUT =
|
||||
new G4float[indexmax];
|
||||
ReadLUTDAVISFile();
|
||||
ReadDataFile();
|
||||
}
|
||||
|
||||
if (!Reflectivity) Reflectivity = new G4float[RefMax];
|
||||
ReadReflectivityLUTFile();
|
||||
}
|
||||
void G4OpticalSurface::ReadDataFile()
|
||||
{
|
||||
// type and finish can be set in either order. Thus, we can't check
|
||||
// for consistency. Need to read file on setting either type or finish.
|
||||
switch(theType)
|
||||
{
|
||||
case dielectric_LUT:
|
||||
if(!AngularDistribution)
|
||||
AngularDistribution =
|
||||
new G4float[incidentIndexMax * thetaIndexMax * phiIndexMax];
|
||||
ReadLUTFile();
|
||||
break;
|
||||
case dielectric_LUTDAVIS:
|
||||
if(!AngularDistributionLUT)
|
||||
AngularDistributionLUT = new G4float[indexmax];
|
||||
ReadLUTDAVISFile();
|
||||
|
||||
if (theType == dielectric_dichroic) {
|
||||
if (!DichroicVector) DichroicVector = new G4Physics2DVector();
|
||||
ReadDichroicFile();
|
||||
if(!Reflectivity)
|
||||
Reflectivity = new G4float[RefMax];
|
||||
ReadReflectivityLUTFile();
|
||||
break;
|
||||
case dielectric_dichroic:
|
||||
if(!DichroicVector)
|
||||
DichroicVector = new G4Physics2DVector();
|
||||
ReadDichroicFile();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void G4OpticalSurface::ReadLUTFile()
|
||||
{
|
||||
G4String readLUTFileName = " ";
|
||||
G4String readLUTFileName;
|
||||
|
||||
if (theFinish == polishedlumirrorglue) {
|
||||
readLUTFileName = "PolishedLumirrorGlue.dat";
|
||||
}
|
||||
else if (theFinish == polishedlumirrorair) {
|
||||
readLUTFileName = "PolishedLumirror.dat";
|
||||
}
|
||||
else if (theFinish == polishedteflonair) {
|
||||
readLUTFileName = "PolishedTeflon.dat";
|
||||
}
|
||||
else if (theFinish == polishedtioair) {
|
||||
readLUTFileName = "PolishedTiO.dat";
|
||||
}
|
||||
else if (theFinish == polishedtyvekair) {
|
||||
readLUTFileName = "PolishedTyvek.dat";
|
||||
}
|
||||
else if (theFinish == polishedvm2000glue) {
|
||||
readLUTFileName = "PolishedVM2000Glue.dat";
|
||||
}
|
||||
else if (theFinish == polishedvm2000air) {
|
||||
readLUTFileName = "PolishedVM2000.dat";
|
||||
}
|
||||
else if (theFinish == etchedlumirrorglue) {
|
||||
readLUTFileName = "EtchedLumirrorGlue.dat";
|
||||
}
|
||||
else if (theFinish == etchedlumirrorair) {
|
||||
readLUTFileName = "EtchedLumirror.dat";
|
||||
}
|
||||
else if (theFinish == etchedteflonair) {
|
||||
readLUTFileName = "EtchedTeflon.dat";
|
||||
}
|
||||
else if (theFinish == etchedtioair) {
|
||||
readLUTFileName = "EtchedTiO.dat";
|
||||
}
|
||||
else if (theFinish == etchedtyvekair) {
|
||||
readLUTFileName = "EtchedTyvek.dat";
|
||||
}
|
||||
else if (theFinish == etchedvm2000glue) {
|
||||
readLUTFileName = "EtchedVM2000Glue.dat";
|
||||
}
|
||||
else if (theFinish == etchedvm2000air) {
|
||||
readLUTFileName = "EtchedVM2000.dat";
|
||||
}
|
||||
else if (theFinish == groundlumirrorglue) {
|
||||
readLUTFileName = "GroundLumirrorGlue.dat";
|
||||
}
|
||||
else if (theFinish == groundlumirrorair) {
|
||||
readLUTFileName = "GroundLumirror.dat";
|
||||
}
|
||||
else if (theFinish == groundteflonair) {
|
||||
readLUTFileName = "GroundTeflon.dat";
|
||||
}
|
||||
else if (theFinish == groundtioair) {
|
||||
readLUTFileName = "GroundTiO.dat";
|
||||
}
|
||||
else if (theFinish == groundtyvekair) {
|
||||
readLUTFileName = "GroundTyvek.dat";
|
||||
}
|
||||
else if (theFinish == groundvm2000glue) {
|
||||
readLUTFileName = "GroundVM2000Glue.dat";
|
||||
}
|
||||
else if (theFinish == groundvm2000air) {
|
||||
readLUTFileName = "GroundVM2000.dat";
|
||||
switch(theFinish)
|
||||
{
|
||||
case polishedlumirrorglue:
|
||||
readLUTFileName = "PolishedLumirrorGlue.z";
|
||||
break;
|
||||
case polishedlumirrorair:
|
||||
readLUTFileName = "PolishedLumirror.z";
|
||||
break;
|
||||
case polishedteflonair:
|
||||
readLUTFileName = "PolishedTeflon.z";
|
||||
break;
|
||||
case polishedtioair:
|
||||
readLUTFileName = "PolishedTiO.z";
|
||||
break;
|
||||
case polishedtyvekair:
|
||||
readLUTFileName = "PolishedTyvek.z";
|
||||
break;
|
||||
case polishedvm2000glue:
|
||||
readLUTFileName = "PolishedVM2000Glue.z";
|
||||
break;
|
||||
case polishedvm2000air:
|
||||
readLUTFileName = "PolishedVM2000.z";
|
||||
break;
|
||||
case etchedlumirrorglue:
|
||||
readLUTFileName = "EtchedLumirrorGlue.z";
|
||||
break;
|
||||
case etchedlumirrorair:
|
||||
readLUTFileName = "EtchedLumirror.z";
|
||||
break;
|
||||
case etchedteflonair:
|
||||
readLUTFileName = "EtchedTeflon.z";
|
||||
break;
|
||||
case etchedtioair:
|
||||
readLUTFileName = "EtchedTiO.z";
|
||||
break;
|
||||
case etchedtyvekair:
|
||||
readLUTFileName = "EtchedTyvek.z";
|
||||
break;
|
||||
case etchedvm2000glue:
|
||||
readLUTFileName = "EtchedVM2000Glue.z";
|
||||
break;
|
||||
case etchedvm2000air:
|
||||
readLUTFileName = "EtchedVM2000.z";
|
||||
break;
|
||||
case groundlumirrorglue:
|
||||
readLUTFileName = "GroundLumirrorGlue.z";
|
||||
break;
|
||||
case groundlumirrorair:
|
||||
readLUTFileName = "GroundLumirror.z";
|
||||
break;
|
||||
case groundteflonair:
|
||||
readLUTFileName = "GroundTeflon.z";
|
||||
break;
|
||||
case groundtioair:
|
||||
readLUTFileName = "GroundTiO.z";
|
||||
break;
|
||||
case groundtyvekair:
|
||||
readLUTFileName = "GroundTyvek.z";
|
||||
break;
|
||||
case groundvm2000glue:
|
||||
readLUTFileName = "GroundVM2000Glue.z";
|
||||
break;
|
||||
case groundvm2000air:
|
||||
readLUTFileName = "GroundVM2000.z";
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (readLUTFileName == " ") return;
|
||||
std::istringstream iss;
|
||||
ReadCompressedFile(readLUTFileName, iss);
|
||||
|
||||
char* path = std::getenv("G4REALSURFACEDATA");
|
||||
if (!path) {
|
||||
G4String excep =
|
||||
"G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
|
||||
G4Exception("G4OpticalSurface::ReadLUTFile()", "mat310",
|
||||
FatalException, excep);
|
||||
return;
|
||||
size_t idxmax = incidentIndexMax * thetaIndexMax * phiIndexMax;
|
||||
for(size_t i = 0; i < idxmax; ++i)
|
||||
{
|
||||
iss >> AngularDistribution[i];
|
||||
}
|
||||
G4String pathString(path);
|
||||
|
||||
readLUTFileName = pathString + "/" + readLUTFileName;
|
||||
|
||||
std::ifstream readLUTFileHandle(readLUTFileName, std::ios::in);
|
||||
|
||||
if (readLUTFileHandle) {
|
||||
G4int idxmax = incidentIndexMax*thetaIndexMax*phiIndexMax;
|
||||
for (G4int i = 0; i<idxmax; i++) {
|
||||
if (readLUTFileHandle.eof()) break;
|
||||
readLUTFileHandle >> AngularDistribution[i];
|
||||
}
|
||||
if (!readLUTFileHandle.bad()) {
|
||||
G4cout <<"LUT - data file: "<< readLUTFileName <<" read in! "<< G4endl;
|
||||
}
|
||||
else {
|
||||
G4String excep="LUT - data file: "+readLUTFileName+" not read propery";
|
||||
G4Exception("G4OpticalSurface::ReadLUTFile()", "mat312",
|
||||
FatalException, excep);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
G4String excep ="LUT - data file: "+readLUTFileName+" not found";
|
||||
G4Exception("G4OpticalSurface::ReadLUTFile()", "mat311",
|
||||
FatalException, excep);
|
||||
return;
|
||||
}
|
||||
readLUTFileHandle.close();
|
||||
G4cout << "LUT - data file: " << readLUTFileName << " read in! " << G4endl;
|
||||
}
|
||||
|
||||
void G4OpticalSurface::ReadLUTDAVISFile()
|
||||
{
|
||||
G4String readLUTDAVISFileName = " ";
|
||||
G4String readLUTDAVISFileName;
|
||||
|
||||
if (theFinish == Rough_LUT) {
|
||||
readLUTDAVISFileName = "Rough_LUT.dat";
|
||||
}else if (theFinish == RoughTeflon_LUT) {
|
||||
readLUTDAVISFileName = "RoughTeflon_LUT.dat";
|
||||
}else if (theFinish == RoughESR_LUT) {
|
||||
readLUTDAVISFileName = "RoughESR_LUT.dat";
|
||||
}else if (theFinish == RoughESRGrease_LUT) {
|
||||
readLUTDAVISFileName = "RoughESRGrease_LUT.dat";
|
||||
}else if (theFinish == Polished_LUT) {
|
||||
readLUTDAVISFileName = "Polished_LUT.dat";
|
||||
}else if (theFinish == PolishedTeflon_LUT) {
|
||||
readLUTDAVISFileName = "PolishedTeflon_LUT.dat";
|
||||
}else if (theFinish == PolishedESR_LUT) {
|
||||
readLUTDAVISFileName = "PolishedESR_LUT.dat";
|
||||
}else if (theFinish == PolishedESRGrease_LUT) {
|
||||
readLUTDAVISFileName = "PolishedESRGrease_LUT.dat";
|
||||
}else if (theFinish == Detector_LUT) {
|
||||
readLUTDAVISFileName = "Detector_LUT.dat";
|
||||
switch(theFinish)
|
||||
{
|
||||
case Rough_LUT:
|
||||
readLUTDAVISFileName = "Rough_LUT.z";
|
||||
break;
|
||||
case RoughTeflon_LUT:
|
||||
readLUTDAVISFileName = "RoughTeflon_LUT.z";
|
||||
break;
|
||||
case RoughESR_LUT:
|
||||
readLUTDAVISFileName = "RoughESR_LUT.z";
|
||||
break;
|
||||
case RoughESRGrease_LUT:
|
||||
readLUTDAVISFileName = "RoughESRGrease_LUT.z";
|
||||
break;
|
||||
case Polished_LUT:
|
||||
readLUTDAVISFileName = "Polished_LUT.z";
|
||||
break;
|
||||
case PolishedTeflon_LUT:
|
||||
readLUTDAVISFileName = "PolishedTeflon_LUT.z";
|
||||
break;
|
||||
case PolishedESR_LUT:
|
||||
readLUTDAVISFileName = "PolishedESR_LUT.z";
|
||||
break;
|
||||
case PolishedESRGrease_LUT:
|
||||
readLUTDAVISFileName = "PolishedESRGrease_LUT.z";
|
||||
break;
|
||||
case Detector_LUT:
|
||||
readLUTDAVISFileName = "Detector_LUT.z";
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (readLUTDAVISFileName == " ") return;
|
||||
std::istringstream iss;
|
||||
ReadCompressedFile(readLUTDAVISFileName, iss);
|
||||
|
||||
char* path = std::getenv("G4REALSURFACEDATA");
|
||||
if (!path) {
|
||||
G4String excep =
|
||||
"G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
|
||||
G4Exception("G4OpticalSurface::ReadLUTDAVISFile()", "mat310",
|
||||
FatalException, excep);
|
||||
return;
|
||||
for(size_t i = 0; i < indexmax; ++i)
|
||||
{
|
||||
iss >> AngularDistributionLUT[i];
|
||||
}
|
||||
G4String pathString(path);
|
||||
|
||||
readLUTDAVISFileName = pathString + "/" + readLUTDAVISFileName;
|
||||
|
||||
std::ifstream readLUTDAVISFileHandle(readLUTDAVISFileName, std::ios::in);
|
||||
|
||||
if (readLUTDAVISFileHandle) {
|
||||
|
||||
for (G4int i = 0; i<indexmax; i++) {
|
||||
if (readLUTDAVISFileHandle.eof()) break;
|
||||
readLUTDAVISFileHandle >> AngularDistributionLUT[i];
|
||||
}
|
||||
if (!readLUTDAVISFileHandle.bad()) {
|
||||
G4cout <<"LUT DAVIS - data file: " <<
|
||||
readLUTDAVISFileName << " read in! " << G4endl;
|
||||
}
|
||||
else {
|
||||
G4String excep="LUT DAVIS- data file: "+readLUTDAVISFileName+" not read propery";
|
||||
G4Exception("G4OpticalSurface::ReadLUTFile()", "mat312",
|
||||
FatalException, excep);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
G4String excep ="LUT DAVIS- data file: "+readLUTDAVISFileName+" not found";
|
||||
G4Exception("G4OpticalSurface::ReadLUTFile()", "mat311",
|
||||
FatalException, excep);
|
||||
return;
|
||||
}
|
||||
readLUTDAVISFileHandle.close();
|
||||
G4cout << "LUT DAVIS - data file: " << readLUTDAVISFileName << " read in! "
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
void G4OpticalSurface::ReadReflectivityLUTFile()
|
||||
{
|
||||
G4String readReflectivityLUTFileName = " ";
|
||||
G4String readReflectivityLUTFileName;
|
||||
|
||||
if (theFinish == Rough_LUT) {
|
||||
readReflectivityLUTFileName = "Rough_LUTR.dat";
|
||||
}
|
||||
if (theFinish == RoughTeflon_LUT) {
|
||||
readReflectivityLUTFileName = "RoughTeflon_LUTR.dat";
|
||||
}
|
||||
if (theFinish== RoughESR_LUT) {
|
||||
readReflectivityLUTFileName = "RoughESR_LUTR.dat";
|
||||
}
|
||||
if (theFinish == RoughESRGrease_LUT) {
|
||||
readReflectivityLUTFileName = "RoughESRGrease_LUTR.dat";
|
||||
}
|
||||
if (theFinish== Polished_LUT) {
|
||||
readReflectivityLUTFileName = "Polished_LUTR.dat";
|
||||
}
|
||||
if (theFinish == PolishedTeflon_LUT) {
|
||||
readReflectivityLUTFileName = "PolishedTeflon_LUTR.dat";
|
||||
}
|
||||
if (theFinish== PolishedESR_LUT) {
|
||||
readReflectivityLUTFileName = "PolishedESR_LUTR.dat";
|
||||
}
|
||||
if (theFinish== PolishedESRGrease_LUT) {
|
||||
readReflectivityLUTFileName = "PolishedESRGrease_LUTR.dat";
|
||||
}
|
||||
if (theFinish== Detector_LUT) {
|
||||
readReflectivityLUTFileName = "Detector_LUTR.dat";
|
||||
switch(theFinish)
|
||||
{
|
||||
case Rough_LUT:
|
||||
readReflectivityLUTFileName = "Rough_LUTR.z";
|
||||
break;
|
||||
case RoughTeflon_LUT:
|
||||
readReflectivityLUTFileName = "RoughTeflon_LUTR.z";
|
||||
break;
|
||||
case RoughESR_LUT:
|
||||
readReflectivityLUTFileName = "RoughESR_LUTR.z";
|
||||
break;
|
||||
case RoughESRGrease_LUT:
|
||||
readReflectivityLUTFileName = "RoughESRGrease_LUTR.z";
|
||||
break;
|
||||
case Polished_LUT:
|
||||
readReflectivityLUTFileName = "Polished_LUTR.z";
|
||||
break;
|
||||
case PolishedTeflon_LUT:
|
||||
readReflectivityLUTFileName = "PolishedTeflon_LUTR.z";
|
||||
break;
|
||||
case PolishedESR_LUT:
|
||||
readReflectivityLUTFileName = "PolishedESR_LUTR.z";
|
||||
break;
|
||||
case PolishedESRGrease_LUT:
|
||||
readReflectivityLUTFileName = "PolishedESRGrease_LUTR.z";
|
||||
break;
|
||||
case Detector_LUT:
|
||||
readReflectivityLUTFileName = "Detector_LUTR.z";
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (readReflectivityLUTFileName == " ") return;
|
||||
std::istringstream iss;
|
||||
ReadCompressedFile(readReflectivityLUTFileName, iss);
|
||||
|
||||
char* path = std::getenv("G4REALSURFACEDATA");
|
||||
if (!path) {
|
||||
G4String excep =
|
||||
"G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
|
||||
G4Exception("G4OpticalSurface::ReadReflectivityLUTFile()", "mat310",
|
||||
FatalException, excep);
|
||||
return;
|
||||
for(size_t i = 0; i < RefMax; ++i)
|
||||
{
|
||||
iss >> Reflectivity[i];
|
||||
}
|
||||
G4String pathString(path);
|
||||
G4cout << "LUT DAVIS - reflectivity data file: "
|
||||
<< readReflectivityLUTFileName << " read in! " << G4endl;
|
||||
}
|
||||
|
||||
readReflectivityLUTFileName = pathString + "/" + readReflectivityLUTFileName;
|
||||
|
||||
std::ifstream readReflectivityLUTFileHandle(readReflectivityLUTFileName,
|
||||
std::ios::in);
|
||||
|
||||
if (readReflectivityLUTFileHandle) {
|
||||
for (G4int i = 0; i<RefMax; i++) {
|
||||
if (readReflectivityLUTFileHandle.eof()) break;
|
||||
readReflectivityLUTFileHandle >> Reflectivity[i];
|
||||
}
|
||||
if (!readReflectivityLUTFileHandle.bad()) {
|
||||
G4cout << "Reflectivity LUT DAVIS - data file: " <<
|
||||
readReflectivityLUTFileName << " read in! " << G4endl;
|
||||
}
|
||||
else {
|
||||
G4String excep="Reflectivity LUT DAVIS- data file: "+readReflectivityLUTFileName+" not read propery";
|
||||
G4Exception("G4OpticalSurface::ReadReflectivityLUTFile()", "mat312",
|
||||
FatalException, excep);
|
||||
return;
|
||||
}
|
||||
// uncompress one data file into the input string stream
|
||||
void G4OpticalSurface::ReadCompressedFile(G4String filename,
|
||||
std::istringstream& iss)
|
||||
{
|
||||
G4String* dataString = nullptr;
|
||||
G4String path = std::getenv("G4REALSURFACEDATA");
|
||||
G4String compfilename = path + "/" + filename;
|
||||
// create input stream with binary mode operation and position at end of file
|
||||
std::ifstream in(compfilename, std::ios::binary | std::ios::ate);
|
||||
if(in.good())
|
||||
{
|
||||
// get current position in the stream (was set to the end)
|
||||
int fileSize = in.tellg();
|
||||
// set current position being the beginning of the stream
|
||||
in.seekg(0, std::ios::beg);
|
||||
// create (zlib) byte buffer for the data
|
||||
Bytef* compdata = new Bytef[fileSize];
|
||||
while(in)
|
||||
{
|
||||
in.read((char*) compdata, fileSize);
|
||||
}
|
||||
// create (zlib) byte buffer for the uncompressed data
|
||||
uLongf complen = (uLongf)(fileSize * 4);
|
||||
Bytef* uncompdata = new Bytef[complen];
|
||||
while(Z_OK != uncompress(uncompdata, &complen, compdata, fileSize))
|
||||
{
|
||||
// increase uncompressed byte buffer
|
||||
delete[] uncompdata;
|
||||
complen *= 2;
|
||||
uncompdata = new Bytef[complen];
|
||||
}
|
||||
// delete the compressed data buffer
|
||||
delete[] compdata;
|
||||
// create a string from uncompressed data (will be deallocated by caller)
|
||||
dataString = new G4String((char*) uncompdata, (long) complen);
|
||||
// delete the uncompressed data buffer
|
||||
delete[] uncompdata;
|
||||
}
|
||||
else {
|
||||
G4String excep ="Reflectivity LUT DAVIS - data file: "+readReflectivityLUTFileName+" not found";
|
||||
G4Exception("G4OpticalSurface::ReadReflectivityLUTFile()", "mat311",
|
||||
FatalException, excep);
|
||||
return;
|
||||
else
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Problem while trying to read " + compfilename + " data file.\n";
|
||||
G4Exception("G4OpticalSurface::ReadCompressedFile", "mat316",
|
||||
FatalException, ed);
|
||||
return;
|
||||
}
|
||||
// create the input string stream from the data string
|
||||
if(dataString)
|
||||
{
|
||||
iss.str(*dataString);
|
||||
in.close();
|
||||
delete dataString;
|
||||
G4cout << "G4OpticalSurface: data file " << compfilename
|
||||
<< " successfully read in." << G4endl;
|
||||
}
|
||||
readReflectivityLUTFileHandle.close();
|
||||
}
|
||||
|
||||
void G4OpticalSurface::ReadDichroicFile()
|
||||
{
|
||||
const char* datadir = std::getenv("G4DICHROICDATA");
|
||||
|
||||
if(!datadir) {
|
||||
G4Exception("G4OpticalSurface::ReadDichroicFile()","mat313",
|
||||
FatalException,"Environment variable G4DICHROICDATA not defined");
|
||||
if(!datadir)
|
||||
{
|
||||
G4Exception("G4OpticalSurface::ReadDichroicFile()", "mat313",
|
||||
FatalException,
|
||||
"Environment variable G4DICHROICDATA not defined");
|
||||
return;
|
||||
}
|
||||
|
||||
std::ostringstream ost;
|
||||
ost << datadir;
|
||||
std::ifstream fin(ost.str().c_str());
|
||||
if( !fin.is_open()) {
|
||||
if(!fin.is_open())
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Dichroic surface data file <" << ost.str().c_str()
|
||||
<< "> is not opened!" << G4endl;
|
||||
G4Exception("G4OpticalSurface::ReadDichroicFile()","mat314",
|
||||
FatalException,ed," ");
|
||||
G4Exception("G4OpticalSurface::ReadDichroicFile()", "mat314",
|
||||
FatalException, ed, " ");
|
||||
return;
|
||||
}
|
||||
|
||||
if( !(DichroicVector->Retrieve(fin)) ) {
|
||||
if(!(DichroicVector->Retrieve(fin)))
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Dichroic surface data file <" << ost.str().c_str()
|
||||
<< "> is not opened!" << G4endl;
|
||||
G4Exception("G4OpticalSurface::ReadDichroicFile()","mat315",
|
||||
FatalException,ed," ");
|
||||
G4Exception("G4OpticalSurface::ReadDichroicFile()", "mat315",
|
||||
FatalException, ed, " ");
|
||||
return;
|
||||
}
|
||||
|
||||
// DichroicVector->SetBicubicInterpolation(true);
|
||||
// DichroicVector->SetBicubicInterpolation(true);
|
||||
|
||||
G4cout << " *** Dichroic surface data file *** " << G4endl;
|
||||
|
||||
@@ -590,40 +530,34 @@ void G4OpticalSurface::ReadDichroicFile()
|
||||
G4cout << "numberOfXNodes: " << numberOfXNodes << G4endl;
|
||||
G4cout << "numberOfYNodes: " << numberOfYNodes << G4endl;
|
||||
|
||||
if (0 > numberOfXNodes || numberOfXNodes >= INT_MAX) numberOfXNodes = 0;
|
||||
if (0 > numberOfYNodes || numberOfYNodes >= INT_MAX) numberOfYNodes = 0;
|
||||
if(0 > numberOfXNodes || numberOfXNodes >= INT_MAX)
|
||||
numberOfXNodes = 0;
|
||||
if(0 > numberOfYNodes || numberOfYNodes >= INT_MAX)
|
||||
numberOfYNodes = 0;
|
||||
|
||||
G4PV2DDataVector xVector;
|
||||
G4PV2DDataVector yVector;
|
||||
G4PV2DDataVector xVector;
|
||||
G4PV2DDataVector yVector;
|
||||
|
||||
xVector.resize(numberOfXNodes,0.);
|
||||
yVector.resize(numberOfYNodes,0.);
|
||||
xVector.resize(numberOfXNodes, 0.);
|
||||
yVector.resize(numberOfYNodes, 0.);
|
||||
|
||||
for(G4int i = 0; i<numberOfXNodes; ++i) {
|
||||
G4cout << "i: " << DichroicVector->GetX(i) << G4endl;
|
||||
xVector[i] = DichroicVector->GetX(i);
|
||||
for(G4int i = 0; i < numberOfXNodes; ++i)
|
||||
{
|
||||
G4cout << "i: " << DichroicVector->GetX(i) << G4endl;
|
||||
xVector[i] = DichroicVector->GetX(i);
|
||||
}
|
||||
for(G4int j = 0; j<numberOfYNodes; ++j) {
|
||||
G4cout << "j: " << DichroicVector->GetY(j) << G4endl;
|
||||
yVector[j] = DichroicVector->GetY(j);
|
||||
for(G4int j = 0; j < numberOfYNodes; ++j)
|
||||
{
|
||||
G4cout << "j: " << DichroicVector->GetY(j) << G4endl;
|
||||
yVector[j] = DichroicVector->GetY(j);
|
||||
}
|
||||
|
||||
for(G4int j = 0; j<numberOfYNodes; ++j) {
|
||||
for(G4int i = 0; i<numberOfXNodes; ++i) {
|
||||
G4cout << " i: " << i << " j: " << j << " "
|
||||
<< DichroicVector->GetValue(i,j) << G4endl;
|
||||
}
|
||||
for(G4int j = 0; j < numberOfYNodes; ++j)
|
||||
{
|
||||
for(G4int i = 0; i < numberOfXNodes; ++i)
|
||||
{
|
||||
G4cout << " i: " << i << " j: " << j << " "
|
||||
<< DichroicVector->GetValue(i, j) << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
// G4int idx, idy;
|
||||
|
||||
// for(G4int j = 0; j<numberOfYNodes-1; ++j) {
|
||||
// G4double y = (yVector[j] + yVector[j+1])/2.;
|
||||
// for(G4int i = 0; i<numberOfXNodes-1; ++i) {
|
||||
// G4double x = (xVector[i] + xVector[i+1])/2.;
|
||||
// G4cout << " x: " << x << " y: " << y << " "
|
||||
// << DichroicVector->Value(x,y,idx,idy) << G4endl;
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// G4SurfaceProperty Implementation
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -33,7 +33,7 @@
|
||||
// Class Description:
|
||||
//
|
||||
// A base class describing a surface property.
|
||||
// Derived classes are G4Opticalsurface, G4Firovsurface, etc.
|
||||
// Derived classes are G4Opticalsurface, G4Firovsurface, etc.
|
||||
//
|
||||
// File: G4SurfaceProperty.cc
|
||||
// Version: 1.0
|
||||
@@ -48,32 +48,21 @@
|
||||
|
||||
G4SurfacePropertyTable G4SurfaceProperty::theSurfacePropertyTable;
|
||||
|
||||
//
|
||||
// Constructor and destructor
|
||||
//
|
||||
G4SurfaceProperty::G4SurfaceProperty( const G4String& name,
|
||||
G4SurfaceType type )
|
||||
: theName(name), theType(type)
|
||||
G4SurfaceProperty::G4SurfaceProperty(const G4String& name, G4SurfaceType type)
|
||||
: theName(name)
|
||||
, theType(type)
|
||||
{
|
||||
theSurfacePropertyTable.push_back(this);
|
||||
}
|
||||
|
||||
//
|
||||
// Dummy constructor
|
||||
//
|
||||
G4SurfaceProperty::G4SurfaceProperty()
|
||||
: theName("Dielectric"), theType(dielectric_metal)
|
||||
: theName("Dielectric")
|
||||
, theType(dielectric_metal)
|
||||
{
|
||||
theSurfacePropertyTable.push_back(this);
|
||||
}
|
||||
|
||||
G4SurfaceProperty::~G4SurfaceProperty()
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// Methods
|
||||
//
|
||||
G4SurfaceProperty::~G4SurfaceProperty() {}
|
||||
|
||||
const G4SurfacePropertyTable* G4SurfaceProperty::GetSurfacePropertyTable()
|
||||
{
|
||||
@@ -86,18 +75,16 @@ size_t G4SurfaceProperty::GetNumberOfSurfaceProperties()
|
||||
}
|
||||
|
||||
// Dump info for known surface properties
|
||||
//
|
||||
void G4SurfaceProperty::DumpTableInfo()
|
||||
{
|
||||
G4cout << "***** Surface Property Table : Nb of Surface Properties = "
|
||||
<< GetNumberOfSurfaceProperties() << " *****" << G4endl;
|
||||
|
||||
for (size_t i=0; i<theSurfacePropertyTable.size(); i++)
|
||||
for(size_t i = 0; i < theSurfacePropertyTable.size(); i++)
|
||||
{
|
||||
G4SurfaceProperty* pSurfaceProperty = theSurfacePropertyTable[i];
|
||||
G4cout << pSurfaceProperty->GetName() << " : " << G4endl
|
||||
<< " Surface Property type = "
|
||||
<< pSurfaceProperty->GetType()
|
||||
<< " Surface Property type = " << pSurfaceProperty->GetType()
|
||||
<< G4endl;
|
||||
}
|
||||
G4cout << G4endl;
|
||||
@@ -107,10 +94,11 @@ void G4SurfaceProperty::CleanSurfacePropertyTable()
|
||||
{
|
||||
DumpTableInfo();
|
||||
G4SurfacePropertyTable::iterator pos;
|
||||
for(pos=theSurfacePropertyTable.begin();
|
||||
pos!=theSurfacePropertyTable.end(); pos++)
|
||||
for(pos = theSurfacePropertyTable.begin();
|
||||
pos != theSurfacePropertyTable.end(); pos++)
|
||||
{
|
||||
if (*pos) delete *pos;
|
||||
if(*pos)
|
||||
delete *pos;
|
||||
}
|
||||
theSurfacePropertyTable.clear();
|
||||
DumpTableInfo();
|
||||
|
||||
Executable → Regular
+1
-1
@@ -245,7 +245,7 @@ G4double G4UCNMaterialPropertiesTable::
|
||||
GetMRIntProbability(G4double theta_i, G4double Energy)
|
||||
{
|
||||
if (!theMicroRoughnessTable) {
|
||||
G4cout << "Dont have theMicroRoughnessTable" << G4endl;
|
||||
G4cout << "Do not have theMicroRoughnessTable" << G4endl;
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
Executable → Regular
Reference in New Issue
Block a user