Bug corrected
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Jul 2004 13:10:57 +0000 (13:10 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 16 Jul 2004 13:10:57 +0000 (13:10 +0000)
ANALYSIS/AliAODPair.cxx

index da609d3a0565434b4f1f13d5ed87fdf3d28dc1db..03e792a7b645048b054b7600ac56b360223bf8ac 100644 (file)
@@ -323,13 +323,22 @@ Double_t AliAODPair::GetQt()
  //returns Q transverse CMS longitudionally co-moving
  if (fQtNotCalc)
   {
+    CalculateSums();
+    CalculateDiffs();
+    
     Double_t dotprod = fPxSum*fPxDiff + fPySum*fPyDiff + fPzSum*fPzDiff;
     Double_t klen =    fPxSum*fPxSum  + fPySum*fPySum  + fPzSum*fPzSum;
     klen = TMath::Sqrt(klen);
     Double_t qlen =    fPxDiff*fPxDiff + fPyDiff*fPyDiff + fPzDiff*fPzDiff;
     qlen = TMath::Sqrt(qlen);
-    
-    Double_t cosopenangle = dotprod/(klen*qlen);
+    Double_t tmp = klen*qlen;
+    if (tmp == 0.0)
+     {
+       fQt = 10e5;
+       fQtNotCalc = kFALSE;
+       return fQt;
+     }
+    Double_t cosopenangle = dotprod/tmp;
     Double_t sinopenangle = TMath::Sqrt(1.0 - cosopenangle*cosopenangle);
     
     fQt = sinopenangle*qlen;