Index: trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader.hxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader.hxx	(revision 349)
+++ trunk/MagicSoft/Simulation/Detector/include-MC/MCEventHeader.hxx	(revision 350)
@@ -187,16 +187,29 @@
   // get deviations of the CT from the original shower direction
   inline Float_t get_deviations ( Float_t *t1, Float_t *t2 ) {
-
-    float r;
-
-    r = sqrt(deviationTheta*deviationTheta + deviationPhi*deviationPhi);
+ 
+    float ct1,st1,cp1,sp1;
+    float ct2,st2,cp2,sp2;
+    float x1,y1,z1;
+    float x2,y2,z2;
+
+    ct1 = cos(Theta);
+    st1 = sin(Theta);
+    cp1 = cos(Phi);
+    sp1 = sin(Phi);
+
+    ct2 = cos(Theta+deviationTheta);
+    st2 = sin(Theta+deviationTheta);
+    cp2 = cos(Phi+deviationPhi);
+    sp2 = sin(Phi+deviationPhi);
+
+    x1 = st1*cp1; y1 = st1*sp1; z1 = ct1;
+    x2 = st2*cp2; y2 = st2*sp2; z2 = ct2;
+
     *t1 = deviationTheta;
     *t2 = deviationPhi;
-
-    // cerr << '\n' << deviationTheta << ' ' << deviationPhi << '\n' << flush;
-
-    return ( r );
-  }
-
+    
+    return (  acos(x1*x2 + y1*y2 + z1*z2) );
+  }
+  
   inline void print ( void ) {
     float *ptr = (float *)this;
