63 theModel = right.theModel;
64 theFinish = right.theFinish;
65 sigma_alpha = right.sigma_alpha;
66 polish = right.polish;
67 theMaterialPropertiesTable = right.theMaterialPropertiesTable;
68 if (AngularDistribution)
delete [] AngularDistribution;
70 new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
71 *(AngularDistribution) = *(right.AngularDistribution);
72 if (DichroicVector)
delete DichroicVector;
74 *DichroicVector = *(right.DichroicVector);
91 theMaterialPropertiesTable(0)
101 else if ( model ==
LUT ) {
110 G4Exception(
"G4OpticalSurface::G4OpticalSurface()",
"mat309",
112 "Constructor called with INVALID model.");
115 AngularDistribution = NULL;
116 DichroicVector = NULL;
119 AngularDistribution =
120 new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
132 if (AngularDistribution)
delete [] AngularDistribution;
133 if (DichroicVector)
delete DichroicVector;
142 this->theModel = right.theModel;
143 this->theFinish = right.theFinish;
144 this->sigma_alpha = right.sigma_alpha;
145 this->polish = right.polish;
146 this->theMaterialPropertiesTable = right.theMaterialPropertiesTable;
147 if (this->AngularDistribution)
delete [] AngularDistribution;
148 this->AngularDistribution =
149 new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
150 *(this->AngularDistribution) = *(right.AngularDistribution);
151 if (this->DichroicVector)
delete DichroicVector;
153 *(this->DichroicVector) = *(right.DichroicVector);
176 " Surface finish = " <<
G4int(theFinish) <<
G4endl <<
186 else if (theModel ==
LUT ){
199 if (!AngularDistribution) AngularDistribution =
200 new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
213 if (!AngularDistribution) AngularDistribution =
214 new G4float[incidentIndexMax*thetaIndexMax*phiIndexMax];
228 readLUTFileName =
"PolishedLumirrorGlue.dat";
231 readLUTFileName =
"PolishedLumirror.dat";
234 readLUTFileName =
"PolishedTeflon.dat";
237 readLUTFileName =
"PolishedTiO.dat";
240 readLUTFileName =
"PolishedTyvek.dat";
243 readLUTFileName =
"PolishedVM2000Glue.dat";
246 readLUTFileName =
"PolishedVM2000.dat";
249 readLUTFileName =
"EtchedLumirrorGlue.dat";
252 readLUTFileName =
"EtchedLumirror.dat";
255 readLUTFileName =
"EtchedTeflon.dat";
258 readLUTFileName =
"EtchedTiO.dat";
261 readLUTFileName =
"EtchedTyvek.dat";
264 readLUTFileName =
"EtchedVM2000Glue.dat";
267 readLUTFileName =
"EtchedVM2000.dat";
270 readLUTFileName =
"GroundLumirrorGlue.dat";
273 readLUTFileName =
"GroundLumirror.dat";
276 readLUTFileName =
"GroundTeflon.dat";
279 readLUTFileName =
"GroundTiO.dat";
282 readLUTFileName =
"GroundTyvek.dat";
285 readLUTFileName =
"GroundVM2000Glue.dat";
288 readLUTFileName =
"GroundVM2000.dat";
291 if (readLUTFileName ==
" ")
return;
293 char* path = getenv(
"G4REALSURFACEDATA");
296 "G4OpBoundaryProcess - G4REALSURFACEDATA environment variable not set";
297 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat310",
303 readLUTFileName = pathString +
"/" + readLUTFileName;
305 std::ifstream readLUTFileHandle(readLUTFileName, std::ios::in);
307 if (readLUTFileHandle) {
308 G4int idxmax = incidentIndexMax*thetaIndexMax*phiIndexMax;
309 for (
G4int i = 0; i<idxmax; i++) {
310 if (readLUTFileHandle.eof())
break;
311 readLUTFileHandle >> AngularDistribution[i];
313 if (!readLUTFileHandle.bad()) {
314 G4cout <<
"LUT - data file: "<< readLUTFileName <<
" read in! "<<
G4endl;
317 G4String excep=
"LUT - data file: "+readLUTFileName+
" not read propery";
318 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat312",
324 G4String excep =
"LUT - data file: "+readLUTFileName+
" not found";
325 G4Exception(
"G4OpticalSurface::ReadLUTFile()",
"mat311",
329 readLUTFileHandle.close();
334 const char* datadir = getenv(
"G4DICHROICDATA");
337 G4Exception(
"G4OpticalSurface::ReadDichroicFile()",
"mat313",
338 FatalException,
"Environment variable G4DICHROICDATA not defined");
342 std::ostringstream ost;
344 std::ifstream fin(ost.str().c_str());
345 if( !fin.is_open()) {
347 ed <<
"Dichroic surface data file <" << ost.str().c_str()
348 <<
"> is not opened!" <<
G4endl;
349 G4Exception(
"G4OpticalSurface::ReadDichroicFile()",
"mat314",
354 if( !(DichroicVector->
Retrieve(fin)) ) {
356 ed <<
"Dichroic surface data file <" << ost.str().c_str()
357 <<
"> is not opened!" <<
G4endl;
358 G4Exception(
"G4OpticalSurface::ReadDichroicFile()",
"mat315",
365 G4cout <<
" *** Dichroic surface data file *** " <<
G4endl;
370 G4cout <<
"numberOfXNodes: " << numberOfXNodes <<
G4endl;
371 G4cout <<
"numberOfYNodes: " << numberOfYNodes <<
G4endl;
373 if (0 > numberOfXNodes || numberOfXNodes >=
INT_MAX) numberOfXNodes = 0;
374 if (0 > numberOfYNodes || numberOfYNodes >=
INT_MAX) numberOfYNodes = 0;
379 xVector.resize(numberOfXNodes,0.);
380 yVector.resize(numberOfYNodes,0.);
382 for(
G4int i = 0; i<numberOfXNodes; ++i) {
384 xVector[i] = DichroicVector->
GetX(i);
386 for(
G4int j = 0; j<numberOfYNodes; ++j) {
388 yVector[j] = DichroicVector->
GetY(j);
391 for(
G4int j = 0; j<numberOfYNodes; ++j) {
392 for(
G4int i = 0; i<numberOfXNodes; ++i) {
393 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
const XML_Char int const XML_Char * value
G4OpticalSurface & operator=(const G4OpticalSurface &right)
G4int operator!=(const G4OpticalSurface &right) const
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
void ReadDichroicFile(void)
G4double GetX(size_t index) const
const XML_Char XML_Content * model
void SetType(const G4SurfaceType &type)