- Timestamp:
- 10/24/19 15:02:48 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/hawc/fresnellens_traceray.C
r19649 r19785 44 44 const double lambda = 546; // [nm] Wavelength for the simulated photons 45 45 46 double angle = 6; // Angle of incidence of the simulated rays46 const bool point_source = false; // Enable simulation of a point source 47 47 48 double Z0 = 3; // Starting Z-position of rays 48 const double angle = 6; // [deg] Angle of incidence of the simulated rays 49 50 const double Z0 = point_source ? F : 3; // [cm] Starting Z-position of rays 51 const double X0 = Z0*atan(angle*TMath::DegToRad()); // [cm] (If<0: parallel rays (see angle), If>=0: point source at X0/Z0) 49 52 50 53 MFresnelLens lens; … … 94 97 // ------------------------------------------------------ 95 98 99 if (point_source) 100 cout << "\nPoint source at x=" << X0 << " z=" << Z0 << "\n" << endl; 101 102 // ------------------------------------------------------ 103 96 104 TArrow arrow; 97 105 TMarker marker; … … 112 120 TVector3 dir(0, 0, -1); 113 121 114 dir.SetMagThetaPhi(1, (180-angle)*TMath::DegToRad(), 0); 122 double theta = point_source ? 123 TMath::Pi()-atan((X+X0)/Z0) : 124 (180-angle)*TMath::DegToRad(); 125 126 dir.SetMagThetaPhi(1, theta, 0); 115 127 116 128 MQuaternion p(pos, 0); 117 129 MQuaternion u(dir, vc); 118 130 119 // P hoton must be at the lens surface before it can enterthe lens131 // Propagate to starting plane in front of the lens 120 132 p.PropagateZ(u, Z0); 121 133 … … 125 137 const int cnt = lens.TraceRay(vec, p, u, lambda, true); 126 138 127 // Particle suc dessfully reached the focal plane139 // Particle successfully reached the focal plane 128 140 if (cnt>=0) 129 141 {
Note:
See TracChangeset
for help on using the changeset viewer.