Changeset 2051 for trunk/MagicSoft/Simulation/Detector
- Timestamp:
- 04/30/03 18:22:48 (22 years ago)
- Location:
- trunk/MagicSoft/Simulation/Detector/ReflectorII
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/ReflectorII/Changelog
r2047 r2051 1 1 ** Add changes at the beginning! ** 2 3 30/04/2003 A. Moralejo 4 5 ph2cph.c: Found out that the fix from yesterday, although it "patched" the 6 loss of photons, did not remove the real cause for it. Actually in the 7 determination of the intersection of the photon with the paraboloid there 8 was an overflow which resulted in nonsense coordinates beyond 10 m from 9 the mirror dish center. It has been fixed fixed by changing the following 10 cut: 11 12 if ( fabs(a) < 1.e-3 ) { 13 xcut[2] = -c / b 14 } 15 16 which was formerly < 1.e-6. 17 18 I also noticed that the problem from yesterday was not so serious: it only 19 removed a significant amount of the photons nearly paralel to the telescope 20 axis, but globally, over a cer file there is no big difference. 2 21 3 22 29/04/2003 A. Moralejo -
trunk/MagicSoft/Simulation/Detector/ReflectorII/ph2cph.c
r2046 r2051 78 78 float phi; /* angle between photon and camera plane */ 79 79 80 float a, b, c, t ;/* intermediate variables */80 float a, b, c, t, t1, t2; /* intermediate variables */ 81 81 82 82 float d; /* minimum distance trajectory-mirror center */ … … 95 95 96 96 float sx, sy; 97 float t1, t2;98 97 float dummy = 0.; 99 98 … … 193 192 applyMxV( OmegaCT, x, xCT ); 194 193 applyMxV( OmegaCT, r, rCT ); 195 196 194 197 195 /* CBC */ … … 240 238 241 239 /* the z coordinate is calculated */ 242 240 243 241 a = - SQR(rCT[0]) - SQR(rCT[1]); 244 242 … … 257 255 - SQR(rCT[0])*SQR(xCT[2]) - SQR(rCT[1])*SQR(xCT[2]); 258 256 259 260 if ( fabs(a) < 1.e-6 ) { 261 262 /* only one value */ 263 264 xcut[2] = -c / b; 257 /* Alternative calculation (AM), same result: 258 * 259 * a = SQR(rCT[0])+SQR(rCT[1]); 260 * b = 2*xCT[0]*rCT[0]+2*xCT[1]*rCT[1]-4*ct_Focal_mean*rCT[2]; 261 * c = -4*ct_Focal_mean*xCT[2]+SQR(xCT[0])+SQR(xCT[1]); 262 */ 263 264 if ( fabs(a) < 1.e-3 ) { /* Changed old cut value 1e-6 AM, 04/2003 */ 265 xcut[2] = -c / b; // Only one solution 266 267 /* 268 * Alternative calculation: 269 * if (a < 1.e-3 ) 270 * { 271 * xcut[2] = xCT[2] - c/b*rCT[2]; 272 */ 265 273 266 274 } else { … … 281 289 282 290 /* z must be the minimum of t1 and t2 */ 283 291 284 292 xcut[2] = (t1 < t2) ? t1 : t2; 285 293 294 /* 295 * Alternative calculation: 296 * 297 * xcut[2] = (t1 < t2) ? xCT[2]+t1*rCT[2] : xCT[2]+t2*rCT[2]; 298 */ 286 299 } 287 300 … … 315 328 return 2; 316 329 } 317 318 330 319 331 /* calculate the mirror to be used */
Note:
See TracChangeset
for help on using the changeset viewer.