Changeset 2046
- Timestamp:
- 04/29/03 23:47:38 (22 years ago)
- Location:
- trunk/MagicSoft/Simulation/Detector/ReflectorII
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/ReflectorII/Changelog
r1960 r2046 1 1 ** Add changes at the beginning! ** 2 3 29/04/2003 A. Moralejo 4 5 ph2cph.c: 6 Changed determination of which mirror element is hit. Before there was a 7 problem when going to very large distances from the mirror center, sometimes 8 a wrong mirror was chosen, which was actually further away from the impact 9 point than the mirror size, and therefore the photon was discarded later as 10 "not hitting any mirror". Now we measure the distance on the paraboloid. The 11 new code is: 12 13 /* calculate the mirror to be used */ 14 15 distmirr = 1000000.0f; 16 17 for (i=0; i<ct_NMirrors && distmirr>=ct_RMirror; ++i) { 18 distmirr2 = (float) sqrt(SQR(ct_data[i].sx - sx) + 19 SQR(ct_data[i].sy - sy)); 20 21 if (distmirr2 < distmirr) { 22 i_mirror = i; 23 distmirr = distmirr2; 24 } 25 } 26 27 geometry.c: 28 Small change in calculation of ct_nax_radius (introduced fabs, but nothing 29 changes) 2 30 3 31 16/04/2003 A. Moralejo -
trunk/MagicSoft/Simulation/Detector/ReflectorII/geometry.c
r1908 r2046 49 49 if (12 != fscanf(geofile, "%d %f %f %f %f %f %f %f %f %f %f %f", 50 50 &ct_data[i].i, &ct_data[i].f, 51 &ct_data[i].sx, 52 &ct_data[i].x, &ct_data[i].y, 53 &ct_data[i].theta, 54 &ct_data[i].xn, 51 &ct_data[i].sx, &ct_data[i].sy, 52 &ct_data[i].x, &ct_data[i].y, &ct_data[i].z, 53 &ct_data[i].theta, &ct_data[i].phi, 54 &ct_data[i].xn, &ct_data[i].yn, &ct_data[i].zn)) 55 55 break; 56 56 57 ct_max_radius = (ct_data[i].sx > ct_max_radius? ct_data[i].sx : 58 ct_max_radius); 59 ct_max_radius = (ct_data[i].sy > ct_max_radius? ct_data[i].sy : 60 ct_max_radius); 57 ct_max_radius = 58 (fabs(ct_data[i].sx) > ct_max_radius? fabs(ct_data[i].sx) : 59 ct_max_radius); 60 ct_max_radius = 61 (fabs(ct_data[i].sy) > ct_max_radius? fabs(ct_data[i].sy) : 62 ct_max_radius); 61 63 } 62 64 -
trunk/MagicSoft/Simulation/Detector/ReflectorII/ph2cph.c
r1908 r2046 142 142 143 143 /* get director cosines x,y on ground */ 144 145 144 /* 146 145 r[0] = 0.0; 147 146 r[1] = 0.0; 148 r[2] = 1.0;147 r[2] = -1.0; 149 148 */ 150 149 /* CBC */ … … 194 193 applyMxV( OmegaCT, x, xCT ); 195 194 applyMxV( OmegaCT, r, rCT ); 195 196 196 197 197 /* CBC */ … … 293 293 xcut[0] = xCT[0] + rCT[0]/rCT[2]*(xcut[2]-xCT[2]); 294 294 xcut[1] = xCT[1] + rCT[1]/rCT[2]*(xcut[2]-xCT[2]); 295 296 295 297 296 /* CBC */ … … 317 316 } 318 317 318 319 319 /* calculate the mirror to be used */ 320 320 … … 322 322 323 323 for (i=0; i<ct_NMirrors && distmirr>=ct_RMirror; ++i) { 324 distmirr2 = (float) sqrt(SQR(ct_data[i]. x - xcut[0]) +325 SQR(ct_data[i].y - xcut[1]) +326 SQR(ct_data[i].z - xcut[2])); 324 distmirr2 = (float) sqrt(SQR(ct_data[i].sx - sx) + 325 SQR(ct_data[i].sy - sy)); 326 327 327 if (distmirr2 < distmirr) { 328 328 i_mirror = i; … … 332 332 333 333 /* 334 the mirror to use is i_mirror (calculated several linesabove)334 the mirror to use is i_mirror (calculated above) 335 335 check whether the photon is outside the nearest (this) mirror 336 336 */
Note:
See TracChangeset
for help on using the changeset viewer.