Import Geant4 9.3.0 source tree
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpticalSurface.cc,v 1.12 2008/12/11 10:23:54 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4OpticalSurface.cc,v 1.16 2009/12/01 08:24:51 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -65,6 +65,7 @@ const G4OpticalSurface&
|
||||
sigma_alpha = right.sigma_alpha;
|
||||
polish = right.polish;
|
||||
theMaterialPropertiesTable = right.theMaterialPropertiesTable;
|
||||
AngularDistribution = right.AngularDistribution;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -91,19 +92,27 @@ G4OpticalSurface::G4OpticalSurface(const G4String& name,
|
||||
sigma_alpha = value;
|
||||
polish = 0.0;
|
||||
}
|
||||
else if ( model == LUT ) {
|
||||
sigma_alpha = value;
|
||||
polish = 0.0;
|
||||
}
|
||||
else {
|
||||
G4Exception("G4OpticalSurface::G4OpticalSurface ==> "
|
||||
"Constructor called with INVALID model.");
|
||||
}
|
||||
}
|
||||
|
||||
G4OpticalSurface::G4OpticalSurface()
|
||||
: G4SurfaceProperty()
|
||||
{
|
||||
AngularDistribution = NULL;
|
||||
|
||||
if (type == dielectric_LUT) {
|
||||
AngularDistribution =
|
||||
new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
|
||||
ReadFile();
|
||||
}
|
||||
}
|
||||
|
||||
G4OpticalSurface::~G4OpticalSurface()
|
||||
{
|
||||
if (AngularDistribution) delete AngularDistribution;
|
||||
}
|
||||
|
||||
G4OpticalSurface::G4OpticalSurface(const G4OpticalSurface &right)
|
||||
@@ -142,8 +151,129 @@ void G4OpticalSurface::DumpInfo() const
|
||||
if (theModel == glisur ){
|
||||
G4cout << polish << G4endl;
|
||||
}
|
||||
else if (theModel == LUT ){
|
||||
G4cout << sigma_alpha << G4endl;
|
||||
}
|
||||
else {
|
||||
G4cout << sigma_alpha << G4endl;
|
||||
}
|
||||
G4cout << G4endl;
|
||||
}
|
||||
|
||||
void G4OpticalSurface::SetType(const G4SurfaceType& type)
|
||||
{
|
||||
theType = type;
|
||||
if (type == dielectric_LUT) {
|
||||
if (!AngularDistribution) AngularDistribution =
|
||||
new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
|
||||
ReadFile();
|
||||
}
|
||||
}
|
||||
|
||||
void G4OpticalSurface::SetFinish(const G4OpticalSurfaceFinish finish)
|
||||
{
|
||||
theFinish = finish;
|
||||
if (theType == dielectric_LUT) {
|
||||
if (!AngularDistribution) AngularDistribution =
|
||||
new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
|
||||
ReadFile();
|
||||
}
|
||||
}
|
||||
|
||||
void G4OpticalSurface::ReadFile()
|
||||
{
|
||||
G4String readFileName = " ";
|
||||
|
||||
if (theFinish == polishedlumirrorglue) {
|
||||
readFileName = "PolishedLumirrorGlue.dat";
|
||||
}
|
||||
else if (theFinish == polishedlumirrorair) {
|
||||
readFileName = "PolishedLumirror.dat";
|
||||
}
|
||||
else if (theFinish == polishedteflonair) {
|
||||
readFileName = "PolishedTeflon.dat";
|
||||
}
|
||||
else if (theFinish == polishedtioair) {
|
||||
readFileName = "PolishedTiO.dat";
|
||||
}
|
||||
else if (theFinish == polishedtyvekair) {
|
||||
readFileName = "PolishedTyvek.dat";
|
||||
}
|
||||
else if (theFinish == polishedvm2000glue) {
|
||||
readFileName = "PolishedVM2000Glue.dat";
|
||||
}
|
||||
else if (theFinish == polishedvm2000air) {
|
||||
readFileName = "PolishedVM2000.dat";
|
||||
}
|
||||
else if (theFinish == etchedlumirrorglue) {
|
||||
readFileName = "EtchedLumirrorGlue.dat";
|
||||
}
|
||||
else if (theFinish == etchedlumirrorair) {
|
||||
readFileName = "EtchedLumirror.dat";
|
||||
}
|
||||
else if (theFinish == etchedteflonair) {
|
||||
readFileName = "EtchedTeflon.dat";
|
||||
}
|
||||
else if (theFinish == etchedtioair) {
|
||||
readFileName = "EtchedTiO.dat";
|
||||
}
|
||||
else if (theFinish == etchedtyvekair) {
|
||||
readFileName = "EtchedTyvek.dat";
|
||||
}
|
||||
else if (theFinish == etchedvm2000glue) {
|
||||
readFileName = "EtchedVM2000Glue.dat";
|
||||
}
|
||||
else if (theFinish == etchedvm2000air) {
|
||||
readFileName = "EtchedVM2000.dat";
|
||||
}
|
||||
else if (theFinish == groundlumirrorglue) {
|
||||
readFileName = "GroundLumirrorGlue.dat";
|
||||
}
|
||||
else if (theFinish == groundlumirrorair) {
|
||||
readFileName = "GroundLumirror.dat";
|
||||
}
|
||||
else if (theFinish == groundteflonair) {
|
||||
readFileName = "GroundTeflon.dat";
|
||||
}
|
||||
else if (theFinish == groundtioair) {
|
||||
readFileName = "GroundTiO.dat";
|
||||
}
|
||||
else if (theFinish == groundtyvekair) {
|
||||
readFileName = "GroundTyvek.dat";
|
||||
}
|
||||
else if (theFinish == groundvm2000glue) {
|
||||
readFileName = "GroundVM2000Glue.dat";
|
||||
}
|
||||
else if (theFinish == groundvm2000air) {
|
||||
readFileName = "GroundVM2000.dat";
|
||||
}
|
||||
|
||||
if (readFileName == " ") return;
|
||||
|
||||
char* path = getenv("G4REALSURFACEDATA");
|
||||
if (!path) {
|
||||
G4String excep =
|
||||
"G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
|
||||
G4Exception(excep);
|
||||
}
|
||||
G4String pathString(path);
|
||||
|
||||
readFileName = pathString + "/" + readFileName;
|
||||
|
||||
// Open LUT with Material and Integer Angle
|
||||
FILE* readFileHandle;
|
||||
|
||||
readFileHandle = fopen(readFileName,"r");
|
||||
|
||||
if (readFileHandle!=NULL) {
|
||||
for (int i=0;i<incidentIndexMax*thetaIndexMax*phiIndexMax;i++) {
|
||||
fscanf(readFileHandle,"%6f", &AngularDistribution[i]);
|
||||
}
|
||||
G4cout << "LUT - data file: " << readFileName << " read in! " << G4endl;
|
||||
}
|
||||
else {
|
||||
G4String excep = "LUT - data file: " + readFileName + " not found";
|
||||
G4Exception(excep);
|
||||
}
|
||||
fclose(readFileHandle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user