100 theMaterialPropertiesTable(0)
110 else if ( model ==
LUT ) {
118 else if ( model ==
DAVIS ) {
123 G4Exception(
"G4OpticalSurface::G4OpticalSurface()",
"mat309",
125 "Constructor called with INVALID model.");
308 readLUTFileName =
"PolishedLumirrorGlue.dat";
311 readLUTFileName =
"PolishedLumirror.dat";
314 readLUTFileName =
"PolishedTeflon.dat";
317 readLUTFileName =
"PolishedTiO.dat";
320 readLUTFileName =
"PolishedTyvek.dat";
323 readLUTFileName =
"PolishedVM2000Glue.dat";
326 readLUTFileName =
"PolishedVM2000.dat";
329 readLUTFileName =
"EtchedLumirrorGlue.dat";
332 readLUTFileName =
"EtchedLumirror.dat";
335 readLUTFileName =
"EtchedTeflon.dat";
338 readLUTFileName =
"EtchedTiO.dat";
341 readLUTFileName =
"EtchedTyvek.dat";
344 readLUTFileName =
"EtchedVM2000Glue.dat";
347 readLUTFileName =
"EtchedVM2000.dat";
350 readLUTFileName =
"GroundLumirrorGlue.dat";
353 readLUTFileName =
"GroundLumirror.dat";
356 readLUTFileName =
"GroundTeflon.dat";
359 readLUTFileName =
"GroundTiO.dat";
362 readLUTFileName =
"GroundTyvek.dat";
365 readLUTFileName =
"GroundVM2000Glue.dat";
368 readLUTFileName =
"GroundVM2000.dat";
371 if (readLUTFileName ==
" ")
return;
373 char* path = std::getenv(
"G4REALSURFACEDATA");
376 "G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
377 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat310",
383 readLUTFileName = pathString +
"/" + readLUTFileName;
385 std::ifstream readLUTFileHandle(readLUTFileName,
std::ios::in);
387 if (readLUTFileHandle) {
389 for (
G4int i = 0; i<idxmax; i++) {
390 if (readLUTFileHandle.eof())
break;
393 if (!readLUTFileHandle.bad()) {
394 G4cout <<
"LUT - data file: "<< readLUTFileName <<
" read in! "<<
G4endl;
397 G4String excep=
"LUT - data file: "+readLUTFileName+
" not read propery";
398 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat312",
404 G4String excep =
"LUT - data file: "+readLUTFileName+
" not found";
405 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat311",
409 readLUTFileHandle.close();
414 G4String readLUTDAVISFileName =
" ";
417 readLUTDAVISFileName =
"Rough_LUT.dat";
419 readLUTDAVISFileName =
"RoughTeflon_LUT.dat";
421 readLUTDAVISFileName =
"RoughESR_LUT.dat";
423 readLUTDAVISFileName =
"RoughESRGrease_LUT.dat";
425 readLUTDAVISFileName =
"Polished_LUT.dat";
427 readLUTDAVISFileName =
"PolishedTeflon_LUT.dat";
429 readLUTDAVISFileName =
"PolishedESR_LUT.dat";
431 readLUTDAVISFileName =
"PolishedESRGrease_LUT.dat";
433 readLUTDAVISFileName =
"Detector_LUT.dat";
436 if (readLUTDAVISFileName ==
" ")
return;
438 char* path = std::getenv(
"G4REALSURFACEDATA");
441 "G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
442 G4Exception(
"G4OpticalSurface::ReadLUTDAVISFile()",
"mat310",
448 readLUTDAVISFileName = pathString +
"/" + readLUTDAVISFileName;
450 std::ifstream readLUTDAVISFileHandle(readLUTDAVISFileName,
std::ios::in);
452 if (readLUTDAVISFileHandle) {
455 if (readLUTDAVISFileHandle.eof())
break;
458 if (!readLUTDAVISFileHandle.bad()) {
459 G4cout <<
"LUT DAVIS - data file: " <<
460 readLUTDAVISFileName <<
" read in! " <<
G4endl;
463 G4String excep=
"LUT DAVIS- data file: "+readLUTDAVISFileName+
" not read propery";
464 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat312",
470 G4String excep =
"LUT DAVIS- data file: "+readLUTDAVISFileName+
" not found";
471 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat311",
475 readLUTDAVISFileHandle.close();
480 G4String readReflectivityLUTFileName =
" ";
483 readReflectivityLUTFileName =
"Rough_LUTR.dat";
486 readReflectivityLUTFileName =
"RoughTeflon_LUTR.dat";
489 readReflectivityLUTFileName =
"RoughESR_LUTR.dat";
492 readReflectivityLUTFileName =
"RoughESRGrease_LUTR.dat";
495 readReflectivityLUTFileName =
"Polished_LUTR.dat";
498 readReflectivityLUTFileName =
"PolishedTeflon_LUTR.dat";
501 readReflectivityLUTFileName =
"PolishedESR_LUTR.dat";
504 readReflectivityLUTFileName =
"PolishedESRGrease_LUTR.dat";
507 readReflectivityLUTFileName =
"Detector_LUTR.dat";
510 if (readReflectivityLUTFileName ==
" ")
return;
512 char* path = std::getenv(
"G4REALSURFACEDATA");
515 "G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
516 G4Exception(
"G4OpticalSurface::ReadReflectivityLUTFile()",
"mat310",
522 readReflectivityLUTFileName = pathString +
"/" + readReflectivityLUTFileName;
524 std::ifstream readReflectivityLUTFileHandle(readReflectivityLUTFileName,
527 if (readReflectivityLUTFileHandle) {
529 if (readReflectivityLUTFileHandle.eof())
break;
532 if (!readReflectivityLUTFileHandle.bad()) {
533 G4cout <<
"Reflectivity LUT DAVIS - data file: " <<
534 readReflectivityLUTFileName <<
" read in! " <<
G4endl;
537 G4String excep=
"Reflectivity LUT DAVIS- data file: "+readReflectivityLUTFileName+
" not read propery";
538 G4Exception(
"G4OpticalSurface::ReadReflectivityLUTFile()",
"mat312",
544 G4String excep =
"Reflectivity LUT DAVIS - data file: "+readReflectivityLUTFileName+
" not found";
545 G4Exception(
"G4OpticalSurface::ReadReflectivityLUTFile()",
"mat311",
549 readReflectivityLUTFileHandle.close();
554 const char* datadir = std::getenv(
"G4DICHROICDATA");
557 G4Exception(
"G4OpticalSurface::ReadDichroicFile()",
"mat313",
558 FatalException,
"Environment variable G4DICHROICDATA not defined");
562 std::ostringstream ost;
564 std::ifstream
fin(ost.str().c_str());
565 if( !
fin.is_open()) {
567 ed <<
"Dichroic surface data file <" << ost.str().c_str()
568 <<
"> is not opened!" <<
G4endl;
569 G4Exception(
"G4OpticalSurface::ReadDichroicFile()",
"mat314",
576 ed <<
"Dichroic surface data file <" << ost.str().c_str()
577 <<
"> is not opened!" <<
G4endl;
578 G4Exception(
"G4OpticalSurface::ReadDichroicFile()",
"mat315",
585 G4cout <<
" *** Dichroic surface data file *** " <<
G4endl;
590 G4cout <<
"numberOfXNodes: " << numberOfXNodes <<
G4endl;
591 G4cout <<
"numberOfYNodes: " << numberOfYNodes <<
G4endl;
593 if (0 > numberOfXNodes || numberOfXNodes >=
INT_MAX) numberOfXNodes = 0;
594 if (0 > numberOfYNodes || numberOfYNodes >=
INT_MAX) numberOfYNodes = 0;
599 xVector.resize(numberOfXNodes,0.);
600 yVector.resize(numberOfYNodes,0.);
602 for(
G4int i = 0; i<numberOfXNodes; ++i) {
606 for(
G4int j = 0; j<numberOfYNodes; ++j) {
611 for(
G4int j = 0; j<numberOfYNodes; ++j) {
612 for(
G4int i = 0; i<numberOfXNodes; ++i) {
613 G4cout <<
" i: " << i <<
" j: " << j <<
" "