fork download
  1. Boolean HitUnderside(PhotonStruct * Photon_Ptr,
  2. InputStruct * In_Ptr)
  3. {
  4. double dl_b; /* length to boundary. */
  5. short layer = Photon_Ptr->layer;
  6. double uz = Photon_Ptr->uz;
  7. double ux = Photon_Ptr->ux;
  8. double uy = Photon_Ptr->uy;
  9. double x0 = Photon_Ptr->x;
  10. double y0 = Photon_Ptr->y;
  11. double z0 = Photon_Ptr->z;
  12. double x1 = 0;
  13. double y1 = 0;
  14. double s = Photon_Ptr->s;
  15. double rt = In_Ptr->rtum;
  16. double lb, xx, yy;
  17. double t1, t2;
  18. double zb1 = In_Ptr->layerspecs[In_Ptr->ntum].z0;
  19. double zb2 = In_Ptr->tz;
  20. double mut;
  21. double rr;
  22. Boolean hit;
  23. rr = sqrt(x0*x0+y0*y0);
  24.  
  25. t1=(zb1-z0)/uz;
  26. t2=(zb2-z0)/uz;
  27. /* Distance to the boundary. */
  28.  
  29. if(t2>=0 && layer==In_Ptr->ntum && uz<0){
  30. dl_b = t2;
  31. xx = x0+dl_b*ux;
  32. yy = y0+dl_b*uy;
  33. lb = sqrt(xx*xx+yy*yy);
  34. if(uz!=0 && lb<rt && s>dl_b){
  35.  
  36. mut = In_Ptr->layerspecs[In_Ptr->ntum].mua
  37. + In_Ptr->layerspecs[In_Ptr->ntum].mus;
  38.  
  39. Photon_Ptr->sleft = (Photon_Ptr->s - dl_b)*mut;
  40. Photon_Ptr->s = dl_b;
  41. hit = 1;
  42. }
  43. else
  44. hit = 0;
  45. }
  46. else if(t1>=0 && layer==In_Ptr->num_layers+1 && uz<0){
  47. dl_b = t1;
  48. xx = x0+dl_b*ux;
  49. yy = y0+dl_b*uy;
  50. lb = sqrt(xx*xx+yy*yy);
  51. if(uz!=0 && lb<rt && s>dl_b){
  52.  
  53. mut = In_Ptr->tmua
  54. + In_Ptr->tmus;
  55.  
  56. Photon_Ptr->sleft = (Photon_Ptr->s - dl_b)*mut;
  57. Photon_Ptr->s = dl_b;
  58. hit = 1;
  59. }
  60. else
  61. hit = 0;
  62. }
  63. else if(t2>=0 && layer==In_Ptr->num_layers+1 && uz>0){
  64. dl_b = t2;
  65. xx = x0+dl_b*ux;
  66. yy = y0+dl_b*uy;
  67. lb = sqrt(xx*xx+yy*yy);
  68. if(uz!=0 && lb<rt && s>dl_b){
  69.  
  70. mut = In_Ptr->tmua
  71. + In_Ptr->tmus;
  72.  
  73. Photon_Ptr->sleft = (Photon_Ptr->s - dl_b)*mut;
  74. Photon_Ptr->s = dl_b;
  75. hit = 1;
  76. }
  77. else
  78. hit = 0;
  79. }
  80. else
  81. hit = 0;
  82.  
  83. return(hit);
  84. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:2: error: ‘Boolean’ does not name a type
stdout
Standard output is empty