60 theModel = right.theModel;
61 theFinish = right.theFinish;
62 sigma_alpha = right.sigma_alpha;
63 polish = right.polish;
64 theMaterialPropertiesTable = right.theMaterialPropertiesTable;
65 AngularDistribution = right.AngularDistribution;
66 readLUTFileHandle = right.readLUTFileHandle;
67 DichroicVector = right.DichroicVector;
86 theMaterialPropertiesTable(0)
96 else if ( model ==
LUT ) {
105 G4Exception(
"G4OpticalSurface::G4OpticalSurface()",
"mat309",
107 "Constructor called with INVALID model.");
110 AngularDistribution = NULL;
111 DichroicVector = NULL;
113 readLUTFileHandle = NULL;
116 AngularDistribution =
117 new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
129 if (AngularDistribution)
delete AngularDistribution;
130 if (DichroicVector)
delete DichroicVector;
132 if (readLUTFileHandle)
delete readLUTFileHandle;
141 this->theModel = right.theModel;
142 this->theFinish = right.theFinish;
143 this->sigma_alpha = right.sigma_alpha;
144 this->polish = right.polish;
145 this->theMaterialPropertiesTable = right.theMaterialPropertiesTable;
146 this->AngularDistribution = right.AngularDistribution;
147 this->readLUTFileHandle = right.readLUTFileHandle;
148 this->DichroicVector = right.DichroicVector;
171 " Surface finish = " <<
G4int(theFinish) <<
G4endl <<
181 else if (theModel ==
LUT ){
194 if (!AngularDistribution) AngularDistribution =
195 new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
208 if (!AngularDistribution) AngularDistribution =
209 new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
223 readLUTFileName =
"PolishedLumirrorGlue.dat";
226 readLUTFileName =
"PolishedLumirror.dat";
229 readLUTFileName =
"PolishedTeflon.dat";
232 readLUTFileName =
"PolishedTiO.dat";
235 readLUTFileName =
"PolishedTyvek.dat";
238 readLUTFileName =
"PolishedVM2000Glue.dat";
241 readLUTFileName =
"PolishedVM2000.dat";
244 readLUTFileName =
"EtchedLumirrorGlue.dat";
247 readLUTFileName =
"EtchedLumirror.dat";
250 readLUTFileName =
"EtchedTeflon.dat";
253 readLUTFileName =
"EtchedTiO.dat";
256 readLUTFileName =
"EtchedTyvek.dat";
259 readLUTFileName =
"EtchedVM2000Glue.dat";
262 readLUTFileName =
"EtchedVM2000.dat";
265 readLUTFileName =
"GroundLumirrorGlue.dat";
268 readLUTFileName =
"GroundLumirror.dat";
271 readLUTFileName =
"GroundTeflon.dat";
274 readLUTFileName =
"GroundTiO.dat";
277 readLUTFileName =
"GroundTyvek.dat";
280 readLUTFileName =
"GroundVM2000Glue.dat";
283 readLUTFileName =
"GroundVM2000.dat";
286 if (readLUTFileName ==
" ")
return;
288 char* path = getenv(
"G4REALSURFACEDATA");
291 "G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
292 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat310",
298 readLUTFileName = pathString +
"/" + readLUTFileName;
300 readLUTFileHandle = fopen(readLUTFileName,
"r");
302 if (readLUTFileHandle) {
304 G4int idxmax = incidentIndexMax*thetaIndexMax*phiIndexMax;
305 for (
G4int i = 0; i<idxmax; i++) {
306 ncols = fscanf(readLUTFileHandle,
"%6f", &AngularDistribution[i]);
307 if (ncols < 0)
break;
310 G4cout <<
"LUT - data file: " << readLUTFileName <<
" read in! " <<
G4endl;
313 G4String excep =
"LUT - data file: "+ readLUTFileName +
" not read propery";
314 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat312",
320 G4String excep =
"LUT - data file: " + readLUTFileName +
" not found";
321 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat311",
325 fclose(readLUTFileHandle);
330 const char* datadir = getenv(
"G4DICHROICDATA");
333 G4Exception(
"G4OpticalSurface::ReadDichroicFile()",
"mat313",
334 FatalException,
"Environment variable G4DICHROICDATA not defined");
338 std::ostringstream ost;
340 std::ifstream fin(ost.str().c_str());
341 if( !fin.is_open()) {
343 ed <<
"Dichroic surface data file <" << ost.str().c_str()
344 <<
"> is not opened!" <<
G4endl;
345 G4Exception(
"G4OpticalSurface::ReadDichroicFile()",
"mat314",
350 if( !(DichroicVector->
Retrieve(fin)) ) {
352 ed <<
"Dichroic surface data file <" << ost.str().c_str()
353 <<
"> is not opened!" <<
G4endl;
354 G4Exception(
"G4OpticalSurface::ReadDichroicFile()",
"mat315",
361 G4cout <<
" *** Dichroic surface data file *** " <<
G4endl;
363 size_t numberOfXNodes = DichroicVector->
GetLengthX();
364 size_t numberOfYNodes = DichroicVector->
GetLengthY();
366 G4cout <<
"numberOfXNodes: " << numberOfXNodes <<
G4endl;
367 G4cout <<
"numberOfYNodes: " << numberOfYNodes <<
G4endl;
372 xVector.resize(numberOfXNodes,0.);
373 yVector.resize(numberOfYNodes,0.);
375 for(
size_t i = 0; i<numberOfXNodes; ++i) {
377 xVector[i] = DichroicVector->
GetX(i);
379 for(
size_t j = 0; j<numberOfYNodes; ++j) {
381 yVector[j] = DichroicVector->
GetY(j);
384 for(
size_t j = 0; j<numberOfYNodes; ++j) {
385 for(
size_t i = 0; i<numberOfXNodes; ++i) {
386 G4cout <<
" i: " << i <<
" j: " << j <<
" "
void SetFinish(const G4OpticalSurfaceFinish)
std::vector< G4double > G4PV2DDataVector
G4double GetValue(size_t idx, size_t idy) const
std::ostringstream G4ExceptionDescription
G4int operator==(const G4OpticalSurface &right) const
size_t GetLengthY() const
G4OpticalSurface(const G4OpticalSurface &right)
virtual ~G4OpticalSurface()
G4GLOB_DLL std::ostream G4cout
G4OpticalSurface & operator=(const G4OpticalSurface &right)
G4int operator!=(const G4OpticalSurface &right) const
const XML_Char XML_Content * model
size_t GetLengthX() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4bool Retrieve(std::ifstream &fIn)
G4double GetY(size_t index) const
const XML_Char int const XML_Char * value
static G4SurfacePropertyTable theSurfacePropertyTable
void ReadDichroicFile(void)
G4double GetX(size_t index) const
void SetType(const G4SurfaceType &type)