Ptotections added. (M. van Leeuwen)
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Jul 2008 23:16:58 +0000 (23:16 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Jul 2008 23:16:58 +0000 (23:16 +0000)
PYTHIA6/AliPythia.cxx
PYTHIA6/AliPythia6.cxx

index fd73290e0ef06a42692c9a17236ca3561bd784df..2fa643e816e48b542aff31a7abe6a327c8e8b803 100644 (file)
@@ -796,7 +796,7 @@ void  AliPythia::Quench()
            //
            // Avoid complete loss
            //
-           if (fZQuench[j] == 1.) fZQuench[j] = fZmax;
+           if (fZQuench[j] > fZmax) fZQuench[j] = fZmax;
            //
            // Some debug printing
 
index 4a4eedbcbbd53365063fbff1d41eaee472c8776b..8c9be14f70cc3ffc468beec8b34636eef22373d4 100644 (file)
@@ -810,7 +810,7 @@ void  AliPythia6::Quench()
            //
            // Avoid complete loss
            //
-           if (fZQuench[j] == 1.) fZQuench[j] = fZmax;
+           if (fZQuench[j] > fZmax) fZQuench[j] = fZmax;
            //
            // Some debug printing
 
@@ -975,8 +975,13 @@ void  AliPythia6::Quench()
                    //
                    //     Calculate new px, py
                    //
-                   Double_t pxNew   = jtNew / jt * pxs;
-                   Double_t pyNew   = jtNew / jt * pys;        
+                   Double_t pxNew = 0;
+                   Double_t pyNew = 0;
+
+                   if (jt > 0.) {
+                       pxNew   = jtNew / jt * pxs;
+                       pyNew   = jtNew / jt * pys;     
+                   }
                    
 //                 Double_t dpx = pxs - pxNew;
 //                 Double_t dpy = pys - pyNew;