Changeset 2051 for trunk/MagicSoft/Simulation/Detector/ReflectorII/ph2cph.c
- Timestamp:
- 04/30/03 18:22:48 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.