186{
188
190 readFileName = "PolishedLumirrorGlue.dat";
191 }
193 readFileName = "PolishedLumirror.dat";
194 }
196 readFileName = "PolishedTeflon.dat";
197 }
199 readFileName = "PolishedTiO.dat";
200 }
202 readFileName = "PolishedTyvek.dat";
203 }
205 readFileName = "PolishedVM2000Glue.dat";
206 }
208 readFileName = "PolishedVM2000.dat";
209 }
211 readFileName = "EtchedLumirrorGlue.dat";
212 }
214 readFileName = "EtchedLumirror.dat";
215 }
217 readFileName = "EtchedTeflon.dat";
218 }
220 readFileName = "EtchedTiO.dat";
221 }
223 readFileName = "EtchedTyvek.dat";
224 }
226 readFileName = "EtchedVM2000Glue.dat";
227 }
229 readFileName = "EtchedVM2000.dat";
230 }
232 readFileName = "GroundLumirrorGlue.dat";
233 }
235 readFileName = "GroundLumirror.dat";
236 }
238 readFileName = "GroundTeflon.dat";
239 }
241 readFileName = "GroundTiO.dat";
242 }
244 readFileName = "GroundTyvek.dat";
245 }
247 readFileName = "GroundVM2000Glue.dat";
248 }
250 readFileName = "GroundVM2000.dat";
251 }
252
253 if (readFileName == " ") return;
254
255 char* path = getenv("G4REALSURFACEDATA");
256 if (!path) {
258 "G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
259 G4Exception(
"G4OpticalSurface::ReadFile()",
"mat310",
261 return;
262 }
264
265 readFileName = pathString + "/" + readFileName;
266
267 readFileHandle = fopen(readFileName,"r");
268
269 if (readFileHandle) {
271 G4int idxmax = incidentIndexMax*thetaIndexMax*phiIndexMax;
272 for (
G4int i = 0; i<idxmax; i++) {
273 ncols = fscanf(readFileHandle,"%6f", &AngularDistribution[i]);
274 if (ncols < 0) break;
275 }
276 if (ncols >= 0) {
277 G4cout <<
"LUT - data file: " << readFileName <<
" read in! " <<
G4endl;
278 }
279 else {
280 G4String excep =
"LUT - data file: "+ readFileName +
" not read propery";
281 G4Exception(
"G4OpticalSurface::ReadFile()",
"mat312",
283 return;
284 }
285 }
286 else {
287 G4String excep =
"LUT - data file: " + readFileName +
" not found";
288 G4Exception(
"G4OpticalSurface::ReadFile()",
"mat311",
290 return;
291 }
292 fclose(readFileHandle);
293}