Initialization of all returned variables in GetRPHIintersections
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 2 Jul 2005 08:38:15 +0000 (08:38 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 2 Jul 2005 08:38:15 +0000 (08:38 +0000)
STEER/AliHelix.cxx

index 1810a0f..dc9c65b 100644 (file)
@@ -341,6 +341,11 @@ Int_t    AliHelix::GetRPHIintersections(AliHelix &h, Double_t phase[2][2], Doubl
   //  Double_t * c1 = &fHelix[6];
   //Double_t * c2 = &(h.fHelix[6]);
   //  Double_t  c1[3] = {fHelix[5],fHelix[0],fHelix[8]};
+
+  // PH initiaziation in case of return
+  phase[0][0]=phase[0][1]=phase[1][0]=phase[1][1]=0;
+  ri[0]=ri[1]=1000000;
+
   Double_t  c1[3] = {0,0,fHelix[8]};
   Double_t  c2[3] = {h.fHelix[5]-fHelix[5],h.fHelix[0]-fHelix[0],h.fHelix[8]};
 
@@ -355,9 +360,9 @@ Int_t    AliHelix::GetRPHIintersections(AliHelix &h, Double_t phase[2][2], Doubl
     x0[0] = (d+c1[2]-c2[2])*c2[0]/(2*d)+ fHelix[5];
     y0[0] = (d+c1[2]-c2[2])*c2[1]/(2*d)+ fHelix[0];
     //    return 0;
-    phase[0][0] = GetPhase(x0[0],y0[0]);
-    phase[0][1] = h.GetPhase(x0[0],y0[0]);
-    ri[0] = x0[0]*x0[0]+y0[0]*y0[0];
+    phase[1][0] = phase[0][0] = GetPhase(x0[0],y0[0]);
+    phase[1][1] = phase[0][1] = h.GetPhase(x0[0],y0[0]);
+    ri[1] = ri[0] = x0[0]*x0[0]+y0[0]*y0[0];
     return 1;
   }
   if ( (d+c2[2])<c1[2]){
@@ -365,12 +370,12 @@ Int_t    AliHelix::GetRPHIintersections(AliHelix &h, Double_t phase[2][2], Doubl
     //
     Double_t xx = c2[0]+ c2[0]*c2[2]/d+ fHelix[5];
     Double_t yy = c2[1]+ c2[1]*c2[2]/d+ fHelix[0]; 
-    phase[0][1] = h.GetPhase(xx,yy);
+    phase[1][1] = phase[0][1] = h.GetPhase(xx,yy);
     //
     Double_t xx2 = c2[0]*c1[2]/d+ fHelix[5];
     Double_t yy2 = c2[1]*c1[2]/d+ fHelix[0]; 
-    phase[0][0] = GetPhase(xx2,yy2);
-    ri[0] = xx*xx+yy*yy;
+    phase[1][0] = phase[0][0] = GetPhase(xx2,yy2);
+    ri[1] = ri[0] = xx*xx+yy*yy;
     return 1;
   }
 
@@ -379,12 +384,12 @@ Int_t    AliHelix::GetRPHIintersections(AliHelix &h, Double_t phase[2][2], Doubl
     //
     Double_t xx = -c2[0]*c1[2]/d+ fHelix[5];
     Double_t yy = -c2[1]*c1[2]/d+ fHelix[0]; 
-    phase[0][1] = GetPhase(xx,yy);
+    phase[1][1] = phase[0][1] = GetPhase(xx,yy);
     //
     Double_t xx2 = c2[0]- c2[0]*c2[2]/d+ fHelix[5];
     Double_t yy2 = c2[1]- c2[1]*c2[2]/d+ fHelix[0]; 
-    phase[0][0] = h.GetPhase(xx2,yy2);
-    ri[0] = xx*xx+yy*yy;
+    phase[1][0] = phase[0][0] = h.GetPhase(xx2,yy2);
+    ri[1] = ri[0] = xx*xx+yy*yy;
     return 1;
   }