removed possible division by zero
authorsnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 May 2008 14:10:10 +0000 (14:10 +0000)
committersnelling <snelling@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 May 2008 14:10:10 +0000 (14:10 +0000)
PWG2/FLOW/AliFlowAnalysisWithLYZEventPlane.cxx

index f31e0d7e05af77f4c0aedb9cc15fbf0e4e23086a..58b30c23fafe7ab6513683ee323fbb72b909010d 100644 (file)
@@ -197,8 +197,12 @@ void AliFlowAnalysisWithLYZEventPlane::Make(AliFlowEventSimple* fEvent, AliFlowL
     //get the Q vector from the FlowEvent
     fQ = fEvent->GetQ(); 
     //Weight with the multiplicity
-    Double_t fQX = fQ.X()/fQ.GetMult();
-    Double_t fQY = fQ.Y()/fQ.GetMult();
+    Double_t fQX = 0.;
+    Double_t fQY = 0.;
+    if (fQ.GetMult()!=0.) {
+      fQX = fQ.X()/fQ.GetMult();
+      fQY = fQ.Y()/fQ.GetMult();
+    } else {cerr<<"fQ.GetMult() is zero!"<<endl; }
     fQ.Set(fQX,fQY);
     //cout<<"fQ.Mod() = " << fQ.Mod() << endl;
     //for chi calculation:
@@ -374,4 +378,4 @@ void AliFlowAnalysisWithLYZEventPlane::Finish() {
   cout<<".....finished"<<endl;
  }
 
\ No newline at end of file