Index: trunk/MagicSoft/Mars/macros/tutorials/mirrordelay.C
===================================================================
--- trunk/MagicSoft/Mars/macros/tutorials/mirrordelay.C	(revision 8322)
+++ trunk/MagicSoft/Mars/macros/tutorials/mirrordelay.C	(revision 8337)
@@ -25,15 +25,15 @@
 void mirrordelay()
 {
-    TF1 fpar("Parab",  "[0]*x*x");
-    TF1 fsph("Sphere", "-sqrt([0]*[0] - x*x)+[0]");
+    TF1 fpar("Parab",  "x*x/(4*[0])");
+    TF1 fsph("Sphere", "-sqrt(4*[0]*[0] - x*x) + 2*[0]");
 
     Double_t F = 4.92; // Fokallaenge = 1/4a
     Double_t D = 4.5;  // Mirror Diameter
     Double_t x = 1.85; // incident point for photon
-
+                                     
     fsph.SetRange(-D*0.55, D*0.55);
     fpar.SetRange(-D*0.55, D*0.55);
 
-    fpar.SetParameter(0, 1./(4*F));
+    fpar.SetParameter(0, F);
     fsph.SetParameter(0, F);
 
@@ -79,12 +79,19 @@
     TLegend leg(0.40, 0.6, 0.60, 0.85);//, "NDC");
 
-    TF1 fdel("Diff", "(Sphere-Parab+TMath::Hypot(x-0, Parab-[0])-[0])/3e8*1e9");
-    fdel.SetRange(-D*0.55, D*0.55);
-    fdel.SetLineWidth(2);
-
     for (int i=-2; i<3; i++)
     {
+        // Make sure to set the parameters BEFORE reusing the function!
+        fsph.SetParameter(0, F+i*0.10*F);
+        fpar.SetParameter(0, F+i*0.10*F);
 
+        TF1 fdel1("Diff1", "Sphere-Parab");
+        TF1 fdel2("Diff2", "TMath::Hypot(x-0, Parab-[0])-TMath::Hypot(x-0, Sphere-[0])");
+        fdel2.SetParameter(0, F+i*0.10*F);
+
+        TF1 fdel("Diff", "(Diff1+Diff2)/3e8*1e9");
+        fdel.SetRange(-D*0.55, D*0.55);
+        fdel.SetLineWidth(2);
         fdel.SetParameter(0, F+i*0.10*F);
+
         fdel.SetLineColor(kBlack+(abs(i)==2?3:abs(i)));
         if (i<0)
@@ -98,5 +105,5 @@
 
         f->GetXaxis()->SetTitle("x [m]");
-        f->GetYaxis()->SetTitle("Delay \\Delta t [ns]");
+        f->GetYaxis()->SetTitle("Delay  \\Delta t [ns]");
         f->GetXaxis()->CenterTitle();
 
