Changeset 869 for trunk/MagicSoft/Simulation/Detector
- Timestamp:
- 07/18/01 09:26:02 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/ReflectorII/ph2cph.c
r787 r869 122 122 h = ph->h; 123 123 124 /* CBC */ 125 Debug("@0 x r %f %f %f %f %f %f\n", x[0], x[1], x[2], 126 r[0], r[1], r[2]); 127 128 /* 129 x[0] = 125.0; 130 x[1] = 125.0; 131 x[2] = 0.0; */ /* ground => obs. level => z=0 */ 132 133 /* get director cosines x,y on ground */ 134 135 /* 136 r[0] = 0.0; 137 r[1] = 0.0; 138 r[2] = 1.0; 139 */ 140 /* CBC */ 141 124 142 /*!@' 125 143 … … 140 158 /* find data point to be used in Lagrange interpolation (-> k) */ 141 159 142 FindLagrange(Reflectivity,k,wl ,nReflectivity);160 FindLagrange(Reflectivity,k,wl); 143 161 144 162 /* if random > reflectivity then goes to the TOP of the loop again */ … … 160 178 -- */ 161 179 162 Debug("@1 %f %f %f %f %f %f\n", x[0], x[1], x[2], r[0], r[1], r[2]);180 Debug("@1 x r %f %f %f %f %f %f\n", x[0], x[1], x[2], r[0], r[1], r[2]); 163 181 164 182 /* change to the system of the CT */ … … 166 184 applyMxV( OmegaCT, x, xCT ); 167 185 applyMxV( OmegaCT, r, rCT ); 186 187 /* CBC */ 188 Debug("@2 xCT rCT %f %f %f %f %f %f\n", xCT[0], xCT[1], xCT[2], 189 rCT[0], rCT[1], rCT[2]); 190 /* CBC */ 191 168 192 169 193 /* … … 246 270 xcut[1] = xCT[1] + rCT[1]/rCT[2]*(xcut[2]-xCT[2]); 247 271 272 /* CBC */ 273 Debug("@3 xcut %f %f\n", xcut[0], xcut[1]); 274 /* CBC */ 275 248 276 /* convert to Curvilinear distance over the parabolic dish */ 249 277 … … 251 279 sy = Lin2Curv( xcut[1] ); 252 280 281 /* CBC */ 282 Debug("@4 sx sy %f %f\n", sx, sy); 283 /* CBC */ 284 253 285 /* is it outside the dish? */ 254 286 … … 289 321 } 290 322 323 /* CBC */ 324 Debug("@5 theta phi %f %f\n", ct_data[i_mirror].theta, 325 ct_data[i_mirror].phi); 326 /* CBC */ 327 291 328 /* calculate matrices for the mirror */ 292 329 … … 298 335 /* change to the system of the mirror */ 299 336 337 /* CBC */ 338 Debug("@6 mirror %f %f %f\n",ct_data[i_mirror].x, 339 ct_data[i_mirror].y, 340 ct_data[i_mirror].z); 341 /* CBC */ 342 300 343 /* first translation... */ 301 344 … … 303 346 xmm[1] = xCT[1] - ct_data[i_mirror].y; 304 347 xmm[2] = xCT[2] - ct_data[i_mirror].z; 305 348 349 350 /* CBC */ 351 Debug("@7 xmm %f %f %f\n", xmm[0], xmm[1], xmm[2]); 352 /* CBC */ 353 306 354 /* ...then rotation */ 307 355 308 356 applyMxV( Omega, xmm, xm ); 309 357 applyMxV( Omega, rCT, rm ); 358 359 /* CBC */ 360 Debug("@8 xm rm %f %f %f %f %f %f\n", xm[0], xm[1], xm[2], 361 rm[0], rm[1], rm[2]); 362 /* CBC */ 310 363 311 364 /* … … 318 371 rm[1] /= rnorm; 319 372 rm[2] /= rnorm; 373 374 /* CBC */ 375 Debug("@9 rm-norm %f %f %f\n", rm[0], rm[1], rm[2]); 376 /* CBC */ 320 377 321 378 /* … … 400 457 xcut[1] = xm[1] + rm[1]/rm[2]*(xcut[2]-xm[2]); 401 458 459 /* CBC */ 460 Debug("@10 xcut %f %f %f\n", xcut[0], xcut[1], xcut[2]); 461 /* CBC */ 462 402 463 /* 403 464 ++ … … 424 485 rnor[2] = (float) (2.0*(xcut[2] - 2.0*ct_Focal[i_mirror])); 425 486 487 /* CBC */ 488 Debug("@11 rnor %f %f %f\n", rnor[0], rnor[1], rnor[2]); 489 /* CBC */ 490 426 491 rnorm = -NORM( rnor ); 427 492 rnor[0] /= rnorm; 428 493 rnor[1] /= rnorm; 429 494 rnor[2] /= rnorm; 495 496 /* CBC */ 497 Debug("@12 rnor-norm %f %f %f\n", rnor[0], rnor[1], rnor[2]); 498 /* CBC */ 430 499 431 500 /* … … 440 509 441 510 calpha = (float) fabs(rnor[0]*rm[0] + rnor[1]*rm[1] + rnor[2]*rm[2]); 511 512 /* CBC */ 513 Debug("@13 calpha %f\n", calpha); 514 /* CBC */ 442 515 443 516 /* finally!!! we have the reflected trajectory of the photon */ … … 446 519 rrefl[1] = (float) (2.0*rnor[1]*calpha - rm[1]); 447 520 rrefl[2] = (float) (2.0*rnor[2]*calpha - rm[2]); 521 522 /* CBC */ 523 Debug("@14 rrefl %f %f %f\n", rrefl[0], rrefl[1], rrefl[2]); 524 /* CBC */ 448 525 449 526 rnorm = NORM( rrefl ); … … 452 529 rrefl[2] /= rnorm; 453 530 531 /* CBC */ 532 Debug("@15 rrefl-norm %f %f %f\n", rrefl[0], rrefl[1], rrefl[2]); 533 /* CBC */ 534 454 535 /* let's go back to the coordinate system of the CT */ 455 536 … … 458 539 applyMxV( OmegaI, xcut, xcutCT); 459 540 applyMxV( OmegaI, rrefl, rreflCT); 541 542 /* CBC */ 543 Debug("@16 xcutCT rreflCT %f %f %f %f %f %f\n", xcutCT[0], xcutCT[1], 544 xcutCT[2], rreflCT[0], rreflCT[1], rreflCT[2]); 545 /* CBC */ 460 546 461 547 /* ...then translation */ … … 464 550 xcutCT[1] += ct_data[i_mirror].y; 465 551 xcutCT[2] += ct_data[i_mirror].z; 552 553 /* CBC */ 554 Debug("@17 xcutCT %f %f %f\n", xcutCT[0], xcutCT[1], xcutCT[2]); 555 /* CBC */ 466 556 467 557 /* … … 475 565 xcam[1] = xcutCT[1] + rreflCT[1]*t; 476 566 xcam[2] = xcutCT[2] + rreflCT[2]*t; 567 568 /* CBC */ 569 Debug("@18 xcam %f %f %f\n", xcam[0], xcam[1], xcam[2]); 570 /* CBC */ 477 571 478 572 /* … … 486 580 xcam[1] += AxisDeviation[1][i_mirror]; 487 581 582 /* CBC */ 583 Debug("@19 xcam-AD %f %f \n", xcam[0], xcam[1]); 584 /* CBC */ 585 488 586 /* 489 587 ++ … … 500 598 xcam[0] += (float) (NormalRandomNumbers[0] * ct_PSpread_mean); 501 599 xcam[1] += (float) (NormalRandomNumbers[1] * ct_PSpread_mean); 600 601 /* CBC */ 602 Debug("@20 xcam-SM %f %f \n", xcam[0], xcam[1]); 603 /* CBC */ 502 604 503 605 /* check whether the photon goes out of the camera */ … … 548 650 /* show it */ 549 651 550 Debug("@2 %f %f %f %f %f %f %f %f %f\n" 551 "@3 %f %f %d %f %f %f %f\n" 552 "@4 %f %f %f %f\n", 652 Debug("@22 %f %f %f\n" 653 "@23 %f %f %f %f %f %f\n" 654 "@24 %f %f %d %f %f %f %f\n" 655 "@25 %f %f %f %f\n\n", 553 656 xCT[0], xCT[1], xCT[2], rCT[0], rCT[1], rCT[2], 554 657 xcut[0], xcut[1], xcut[2],
Note:
See TracChangeset
for help on using the changeset viewer.