Changeset 1614 for trunk/MagicSoft/Simulation/Detector/ReflectorII/ph2cph.c
- Timestamp:
- 11/14/02 21:39:04 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/ReflectorII/ph2cph.c
r1535 r1614 118 118 r[0] = ph->u; 119 119 r[1] = ph->v; 120 r[2] = (float) sqrt(1.0 - r[0]*r[0] - r[1]*r[1]); 120 121 // AM 11/2002: fixed line below: u v are the direction cosines of the 122 // *downgoing* photon. Hence, third component must be negative! 123 // This was a serious bug affecting all versions before 0.6 (see TDAS 124 // note on Reflector program 0.6). 125 126 r[2] = (float) -sqrt(1.0 - r[0]*r[0] - r[1]*r[1]); 121 127 122 128 /* get photon time and production height */ … … 494 500 /* 495 501 if we still have the photon, we continue with the reflexion; 496 we calculate normal vector in this point 497 (and normalize, with the sign changed) 502 we calculate normal vector in this point and normalize: 498 503 */ 499 504 500 505 rnor[0] = 2.0f*xcut[0]; 501 506 rnor[1] = 2.0f*xcut[1]; 502 rnor[2] = (float) (2.0*(xcut[2] - 2.0*ct_ Focal[i_mirror]));507 rnor[2] = (float) (2.0*(xcut[2] - 2.0*ct_data[i_mirror].f)); 503 508 504 509 /* CBC */ … … 506 511 /* CBC */ 507 512 508 rnorm = -NORM( rnor ); 513 // Changed AM, 11/2002: now we use the normal vector going "outwards" 514 // from inside the sphere (=removed minus sign in normalization below). 515 // It is easier to do so, since now the vector rm indicating the 516 // photon direction also goes from the front to the back of the mirror. 517 518 rnorm = NORM( rnor ); 509 519 rnor[0] /= rnorm; 510 520 rnor[1] /= rnorm; … … 525 535 */ 526 536 527 calpha = (float) fabs(rnor[0]*rm[0] + rnor[1]*rm[1] + rnor[2]*rm[2]); 537 // AM 11/2002: removed absolute value in scalar 538 // product below (it is now unnecessary): 539 540 calpha = (float) (rnor[0]*rm[0] + rnor[1]*rm[1] + rnor[2]*rm[2]); 528 541 529 542 /* CBC */ … … 532 545 533 546 /* finally!!! we have the reflected trajectory of the photon */ 547 534 548 535 549 rrefl[0] = (float) (2.0*rnor[0]*calpha - rm[0]); … … 633 647 calculate angle of incidence between tray. and camera plane 634 648 the camera plane is 635 0 y + 0 y + z - ct_Focal = 0 => (A,B,C,D) = (0,0,1,-ct_Focal)649 0 x + 0 y + z - ct_Focal_mean = 0 => (A,B,C,D) = (0,0,1,-ct_Focal_mean) 636 650 from Table 3.20 "Tasch. der Math." 637 651 */ … … 679 693 /* Output */ 680 694 681 /* cph->w = wl; */ 682 cph->x = xcam[0]; 683 cph->y = xcam[1]; 695 /* AM Nov 2002: Added one further change of coordinates so that the camera 696 * images have the "right" orientation: they will appear as seen by an 697 * observer on ground, standing behind the mirror dish and looking towards 698 * the camera. Formerly cph->x and cph->y were simply xcam[0] and xcam[1]. 699 */ 700 701 cph->x = -xcam[1]; 702 cph->y = -xcam[0]; 703 684 704 cph->u = r[0]; 685 705 cph->v = r[1];
Note:
See TracChangeset
for help on using the changeset viewer.