]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Protections added
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Jul 2013 16:22:21 +0000 (16:22 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 4 Jul 2013 16:22:21 +0000 (16:22 +0000)
Martin Poghoshyan

PYTHIA6/AliGenPythia.cxx
TDPMjet/AliGenDPMjet.cxx

index 756273c4befe7d804cf58a25eb7a47aba28c75e6..5872c406e2fa3169178caadbeb51804b4c35c8bf 100644 (file)
@@ -1798,7 +1798,9 @@ Bool_t AliGenPythia::CheckDiffraction()
        TParticle *  part = (TParticle *) fParticles.At(iPart);
        Double_t E= part->Energy();
        Double_t P= part->P();
-       M= TMath::Sqrt((fEnergyCMS-E-P)*(fEnergyCMS-E+P));
+       Double_t M2 = (fEnergyCMS-E-P)*(fEnergyCMS-E+P);
+       if(M2<0)  return kFALSE;
+       M= TMath::Sqrt(M2);
      }
 
      Double_t Mmin, Mmax, wSD, wDD, wND;
index 8dd9565310d57fb20a4394a52e3d41089b1e1177..2b9cef5ca083846d8a3836da29f41cfe60cc731d 100644 (file)
@@ -631,7 +631,9 @@ Bool_t AliGenDPMjet::CheckDiffraction()
        TParticle *  part = (TParticle *) fParticles.At(iPart);
        Double_t E= part->Energy();
        Double_t P= part->P();
-       M= TMath::Sqrt((fEnergyCMS-E-P)*(fEnergyCMS-E+P));
+       Double_t M2 = (fEnergyCMS-E-P)*(fEnergyCMS-E+P);
+       if(M2<0)  return kFALSE;
+       M= TMath::Sqrt(M2);
      }
 
      Double_t Mmin, Mmax, wSD, wDD, wND;