101 theMaterialPropertiesTable(0)
111 else if ( model ==
LUT ) {
119 else if ( model ==
DAVIS ) {
124 G4Exception(
"G4OpticalSurface::G4OpticalSurface()",
"mat309",
126 "Constructor called with INVALID model.");
309 readLUTFileName =
"PolishedLumirrorGlue.dat";
312 readLUTFileName =
"PolishedLumirror.dat";
315 readLUTFileName =
"PolishedTeflon.dat";
318 readLUTFileName =
"PolishedTiO.dat";
321 readLUTFileName =
"PolishedTyvek.dat";
324 readLUTFileName =
"PolishedVM2000Glue.dat";
327 readLUTFileName =
"PolishedVM2000.dat";
330 readLUTFileName =
"EtchedLumirrorGlue.dat";
333 readLUTFileName =
"EtchedLumirror.dat";
336 readLUTFileName =
"EtchedTeflon.dat";
339 readLUTFileName =
"EtchedTiO.dat";
342 readLUTFileName =
"EtchedTyvek.dat";
345 readLUTFileName =
"EtchedVM2000Glue.dat";
348 readLUTFileName =
"EtchedVM2000.dat";
351 readLUTFileName =
"GroundLumirrorGlue.dat";
354 readLUTFileName =
"GroundLumirror.dat";
357 readLUTFileName =
"GroundTeflon.dat";
360 readLUTFileName =
"GroundTiO.dat";
363 readLUTFileName =
"GroundTyvek.dat";
366 readLUTFileName =
"GroundVM2000Glue.dat";
369 readLUTFileName =
"GroundVM2000.dat";
372 if (readLUTFileName ==
" ")
return;
374 char* path = getenv(
"G4REALSURFACEDATA");
377 "G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
378 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat310",
384 readLUTFileName = pathString +
"/" + readLUTFileName;
386 std::ifstream readLUTFileHandle(readLUTFileName,
std::ios::in);
388 if (readLUTFileHandle) {
390 for (
G4int i = 0; i<idxmax; i++) {
391 if (readLUTFileHandle.eof())
break;
394 if (!readLUTFileHandle.bad()) {
395 G4cout <<
"LUT - data file: "<< readLUTFileName <<
" read in! "<<
G4endl;
398 G4String excep=
"LUT - data file: "+readLUTFileName+
" not read propery";
399 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat312",
405 G4String excep =
"LUT - data file: "+readLUTFileName+
" not found";
406 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat311",
410 readLUTFileHandle.close();
415 G4String readLUTDAVISFileName =
" ";
418 readLUTDAVISFileName =
"Rough_LUT.dat";
420 readLUTDAVISFileName =
"RoughTeflon_LUT.dat";
422 readLUTDAVISFileName =
"RoughESR_LUT.dat";
424 readLUTDAVISFileName =
"RoughESRGrease_LUT.dat";
426 readLUTDAVISFileName =
"Polished_LUT.dat";
428 readLUTDAVISFileName =
"PolishedTeflon_LUT.dat";
430 readLUTDAVISFileName =
"PolishedESR_LUT.dat";
432 readLUTDAVISFileName =
"PolishedESRGrease_LUT.dat";
434 readLUTDAVISFileName =
"Detector_LUT.dat";
437 if (readLUTDAVISFileName ==
" ")
return;
439 char* path = getenv(
"G4REALSURFACEDATA");
442 "G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
443 G4Exception(
"G4OpticalSurface::ReadLUTDAVISFile()",
"mat310",
449 readLUTDAVISFileName = pathString +
"/" + readLUTDAVISFileName;
451 std::ifstream readLUTDAVISFileHandle(readLUTDAVISFileName,
std::ios::in);
453 if (readLUTDAVISFileHandle) {
456 if (readLUTDAVISFileHandle.eof())
break;
459 if (!readLUTDAVISFileHandle.bad()) {
460 G4cout <<
"LUT DAVIS - data file: " <<
461 readLUTDAVISFileName <<
" read in! " <<
G4endl;
464 G4String excep=
"LUT DAVIS- data file: "+readLUTDAVISFileName+
" not read propery";
465 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat312",
471 G4String excep =
"LUT DAVIS- data file: "+readLUTDAVISFileName+
" not found";
472 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat311",
476 readLUTDAVISFileHandle.close();
481 G4String readReflectivityLUTFileName =
" ";
484 readReflectivityLUTFileName =
"Rough_LUTR.dat";
487 readReflectivityLUTFileName =
"RoughTeflon_LUTR.dat";
490 readReflectivityLUTFileName =
"RoughESR_LUTR.dat";
493 readReflectivityLUTFileName =
"RoughESRGrease_LUTR.dat";
496 readReflectivityLUTFileName =
"Polished_LUTR.dat";
499 readReflectivityLUTFileName =
"PolishedTeflon_LUTR.dat";
502 readReflectivityLUTFileName =
"PolishedESR_LUTR.dat";
505 readReflectivityLUTFileName =
"PolishedESRGrease_LUTR.dat";
508 readReflectivityLUTFileName =
"Detector_LUTR.dat";
511 if (readReflectivityLUTFileName ==
" ")
return;
513 char* path = getenv(
"G4REALSURFACEDATA");
516 "G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
517 G4Exception(
"G4OpticalSurface::ReadReflectivityLUTFile()",
"mat310",
523 readReflectivityLUTFileName = pathString +
"/" + readReflectivityLUTFileName;
525 std::ifstream readReflectivityLUTFileHandle(readReflectivityLUTFileName,
528 if (readReflectivityLUTFileHandle) {
530 if (readReflectivityLUTFileHandle.eof())
break;
533 if (!readReflectivityLUTFileHandle.bad()) {
534 G4cout <<
"Reflectivity LUT DAVIS - data file: " <<
535 readReflectivityLUTFileName <<
" read in! " <<
G4endl;
538 G4String excep=
"Reflectivity LUT DAVIS- data file: "+readReflectivityLUTFileName+
" not read propery";
539 G4Exception(
"G4OpticalSurface::ReadReflectivityLUTFile()",
"mat312",
545 G4String excep =
"Reflectivity LUT DAVIS - data file: "+readReflectivityLUTFileName+
" not found";
546 G4Exception(
"G4OpticalSurface::ReadReflectivityLUTFile()",
"mat311",
550 readReflectivityLUTFileHandle.close();
555 const char* datadir = getenv(
"G4DICHROICDATA");
558 G4Exception(
"G4OpticalSurface::ReadDichroicFile()",
"mat313",
559 FatalException,
"Environment variable G4DICHROICDATA not defined");
563 std::ostringstream ost;
565 std::ifstream
fin(ost.str().c_str());
566 if( !
fin.is_open()) {
568 ed <<
"Dichroic surface data file <" << ost.str().c_str()
569 <<
"> is not opened!" <<
G4endl;
570 G4Exception(
"G4OpticalSurface::ReadDichroicFile()",
"mat314",
577 ed <<
"Dichroic surface data file <" << ost.str().c_str()
578 <<
"> is not opened!" <<
G4endl;
579 G4Exception(
"G4OpticalSurface::ReadDichroicFile()",
"mat315",
586 G4cout <<
" *** Dichroic surface data file *** " <<
G4endl;
591 G4cout <<
"numberOfXNodes: " << numberOfXNodes <<
G4endl;
592 G4cout <<
"numberOfYNodes: " << numberOfYNodes <<
G4endl;
594 if (0 > numberOfXNodes || numberOfXNodes >=
INT_MAX) numberOfXNodes = 0;
595 if (0 > numberOfYNodes || numberOfYNodes >=
INT_MAX) numberOfYNodes = 0;
600 xVector.resize(numberOfXNodes,0.);
601 yVector.resize(numberOfYNodes,0.);
603 for(
G4int i = 0; i<numberOfXNodes; ++i) {
607 for(
G4int j = 0; j<numberOfYNodes; ++j) {
612 for(
G4int j = 0; j<numberOfYNodes; ++j) {
613 for(
G4int i = 0; i<numberOfXNodes; ++i) {
614 G4cout <<
" i: " << i <<
" j: " << j <<
" "
static const G4int LUTbins
size_t GetLengthY() const
std::ostringstream G4ExceptionDescription
G4int GetPhiIndexMax(void) const
virtual ~G4OpticalSurface()
G4int GetThetaIndexMax(void) const
G4double GetY(size_t index) const
void ReadLUTDAVISFile(void)
G4bool Retrieve(std::ifstream &fIn)
G4OpticalSurfaceFinish theFinish
void ReadReflectivityLUTFile(void)
G4MaterialPropertiesTable * theMaterialPropertiesTable
static const G4int thetaIndexMax
G4OpticalSurfaceModel theModel
G4double GetX(size_t index) const
const XML_Char int const XML_Char * value
void SetType(const G4SurfaceType &type)
static const G4int RefMax
void ReadDichroicFile(void)
G4Physics2DVector * DichroicVector
G4float * AngularDistributionLUT
static const G4int incidentIndexMax
G4OpticalSurface & operator=(const G4OpticalSurface &right)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4int GetRefMax(void) const
G4int operator==(const G4OpticalSurface &right) const
G4float * AngularDistribution
G4int GetInmax(void) const
G4GLOB_DLL std::ostream G4cout
G4OpticalSurface(const G4OpticalSurface &right)
size_t GetLengthX() const
G4double GetValue(size_t idx, size_t idy) const
static const G4int phiIndexMax
G4int operator!=(const G4OpticalSurface &right) const
const XML_Char XML_Content * model
G4int GetLUTbins(void) const
static const G4int indexmax
void SetFinish(const G4OpticalSurfaceFinish)
std::vector< G4double > G4PV2DDataVector