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 <<
" "
std::vector< G4double > G4PV2DDataVector
G4double GetValue(size_t idx, size_t idy) const
std::ostringstream G4ExceptionDescription
size_t GetLengthY() const
G4GLOB_DLL std::ostream G4cout
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
G4double GetX(size_t index) const