Index: /trunk/Mars/hawc/fresnellens_traceray.C
===================================================================
--- /trunk/Mars/hawc/fresnellens_traceray.C	(revision 19784)
+++ /trunk/Mars/hawc/fresnellens_traceray.C	(revision 19785)
@@ -44,7 +44,10 @@
     const double lambda  = 546; // [nm] Wavelength for the simulated photons
 
-    double angle = 6; // Angle of incidence of the simulated rays
+    const bool point_source = false;  // Enable simulation of a point source
 
-    double Z0 = 3;    // Starting Z-position of rays
+    const double angle = 6; // [deg] Angle of incidence of the simulated rays
+
+    const double Z0 = point_source ? F : 3; // [cm] Starting Z-position of rays
+    const double X0 = Z0*atan(angle*TMath::DegToRad()); // [cm] (If<0: parallel rays (see angle), If>=0: point source at X0/Z0)
 
     MFresnelLens lens;
@@ -94,4 +97,9 @@
     // ------------------------------------------------------
 
+    if (point_source)
+        cout << "\nPoint source at x=" << X0 << " z=" << Z0 << "\n" << endl;
+
+    // ------------------------------------------------------
+
     TArrow arrow;
     TMarker marker;
@@ -112,10 +120,14 @@
         TVector3 dir(0, 0, -1);
 
-        dir.SetMagThetaPhi(1, (180-angle)*TMath::DegToRad(), 0);
+        double theta = point_source ?
+            TMath::Pi()-atan((X+X0)/Z0) :
+            (180-angle)*TMath::DegToRad();
+
+        dir.SetMagThetaPhi(1, theta, 0);
 
         MQuaternion p(pos, 0);
         MQuaternion u(dir, vc);
 
-        // Photon must be at the lens surface before it can enter the lens
+        // Propagate to starting plane in front of the lens
         p.PropagateZ(u, Z0);
 
@@ -125,5 +137,5 @@
         const int cnt = lens.TraceRay(vec, p, u, lambda, true);
 
-        // Particle sucdessfully reached the focal plane
+        // Particle successfully reached the focal plane
         if (cnt>=0)
         {
