Changeset 9947 for trunk/Mars/msimreflector/MReflector.cc
- Timestamp:
- 09/29/10 08:07:08 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/msimreflector/MReflector.cc
r9565 r9947 351 351 } 352 352 353 // ------------------------------------------------------------------------ 354 // 355 Bool_t MReflector::WriteFile(TString fname) const 356 { 357 gSystem->ExpandPathName(fname); 358 359 ofstream fout(fname); 360 if (!fout) 361 { 362 *fLog << err << "Cannot open file " << fname << ": "; 363 *fLog << (errno!=0?strerror(errno):"Insufficient memory for decompression") << endl; 364 return kFALSE; 365 } 366 367 TIter Next(&fMirrors); 368 MMirror *m = 0; 369 while ((m=static_cast<MMirror*>(Next()))) 370 { 371 // x: x-coordinate of the mirror's center 372 // y: y-coordinate of the mirror's center 373 // z: z-coordinate of the mirror's center 374 // nx: x-component of the normal vecor in the mirror center 375 // ny: y-component of the normal vecor in the mirror center 376 // nz: z-component of the normal vecor in the mirror center 377 // [shape]: S for spherical <default>, P for parabolic 378 // F: Focal distance of a spherical mirror 379 // [psf]: This number is the psf given in the units of x,y,z and 380 // defined at the focal distance F. It can be used to overwrite 381 // the second argument given in ReadFile for individual mirrors. 382 // Type: A instance of a mirrot of the class Type MMirrorType is created 383 // (Type can be, for example, Hex for for MMirrorHex). 384 // ...: Additional arguments as defined in MMirrorType::ReadM 385 386 fout << setw(12) << m->X() << " "; 387 fout << setw(12) << m->Y() << " "; 388 fout << setw(12) << m->Z() << " "; 389 fout << setw(12) << m->Nx() << " "; 390 fout << setw(12) << m->Ny() << " "; 391 fout << setw(12) << m->Nz() << " "; 392 if (m->GetShape()==1) 393 fout << "P "; 394 fout << m->GetFocalLength() << " "; 395 // cout << m->GetSigmaPSF() << " "; 396 fout << m->ClassName()+7 << " "; 397 m->WriteM(fout); 398 fout << endl; 399 } 400 return kTRUE; 401 } 402 353 403 // -------------------------------------------------------------------------- 354 404 //
Note:
See TracChangeset
for help on using the changeset viewer.