]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PYTHIA6/AliPythia.cxx
Ptotections added. (M. van Leeuwen)
[u/mrichter/AliRoot.git] / PYTHIA6 / AliPythia.cxx
index 9173c056a66f04a4b56d8566ac17ec5194b70794..2fa643e816e48b542aff31a7abe6a327c8e8b803 100644 (file)
@@ -100,18 +100,18 @@ void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfun
     fEcms = energy;
     fStrucFunc = strucfunc;
 //...Switch off decay of pi0, K0S, Lambda, Sigma+-, Xi0-, Omega-.
-    SetMDCY(Pycomp(111) ,1,0);
-    SetMDCY(Pycomp(310) ,1,0);
-    SetMDCY(Pycomp(3122),1,0);
-    SetMDCY(Pycomp(3112),1,0);
-    SetMDCY(Pycomp(3212),1,0);
-    SetMDCY(Pycomp(3222),1,0);
-    SetMDCY(Pycomp(3312),1,0);
-    SetMDCY(Pycomp(3322),1,0);
-    SetMDCY(Pycomp(3334),1,0);
+    SetMDCY(Pycomp(111) ,1,0); // pi0
+    SetMDCY(Pycomp(310) ,1,0); // K0S
+    SetMDCY(Pycomp(3122),1,0); // kLambda
+    SetMDCY(Pycomp(3112),1,0); // sigma -
+    SetMDCY(Pycomp(3212),1,0); // sigma 0 
+    SetMDCY(Pycomp(3222),1,0); // sigma +
+    SetMDCY(Pycomp(3312),1,0); // xi - 
+    SetMDCY(Pycomp(3322),1,0); // xi 0
+    SetMDCY(Pycomp(3334),1,0); // omega-
     // Select structure function 
     SetMSTP(52,2);
-    SetMSTP(51,strucfunc);
+    SetMSTP(51, AliStructFuncType::PDFsetIndex(strucfunc));
     // Particles produced in string fragmentation point directly to either of the two endpoints
     // of the string (depending in the side they were generated from).
     SetMSTU(16,2);
@@ -265,7 +265,7 @@ void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfun
        SetMSUB(94,1);             // double diffraction
        SetMSUB(95,1);             // low pt production
 
-        SetMSTP(51,kCTEQ6ll);      // CTEQ6ll pdf
+        SetMSTP(51,AliStructFuncType::PDFsetIndex(kCTEQ6ll));      // CTEQ6ll pdf
        SetMSTP(52,2);
        SetMSTP(68,1);
        SetMSTP(70,2);
@@ -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
 
@@ -961,9 +961,13 @@ void  AliPythia::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;
 //                 Double_t dpz = pl  - plNew;
@@ -1102,16 +1106,16 @@ void  AliPythia::Quench()
                // Isotropic decay ????
                Double_t cost = 2. * gRandom->Rndm() - 1.;
                Double_t sint = TMath::Sqrt(1. - cost * cost);
-               Double_t phi =  2. * TMath::Pi() * gRandom->Rndm();
+               Double_t phis =  2. * TMath::Pi() * gRandom->Rndm();
                
                Double_t pz1 =   pst * cost;
                Double_t pz2 =  -pst * cost;
                Double_t pt1 =   pst * sint;
                Double_t pt2 =  -pst * sint;
-               Double_t px1 =   pt1 * TMath::Cos(phi);
-               Double_t py1 =   pt1 * TMath::Sin(phi);     
-               Double_t px2 =   pt2 * TMath::Cos(phi);
-               Double_t py2 =   pt2 * TMath::Sin(phi);     
+               Double_t px1 =   pt1 * TMath::Cos(phis);
+               Double_t py1 =   pt1 * TMath::Sin(phis);            
+               Double_t px2 =   pt2 * TMath::Cos(phis);
+               Double_t py2 =   pt2 * TMath::Sin(phis);            
                
                fPyjets->P[0][iGlu] = px1;
                fPyjets->P[1][iGlu] = py1;
@@ -1273,7 +1277,7 @@ void AliPythia::AtlasTuning()
 {
     //
     // Configuration for the ATLAS tuning
-        SetMSTP(51, kCTEQ5L);      // CTEQ5L pdf
+        SetMSTP(51, AliStructFuncType::PDFsetIndex(kCTEQ5L));      // CTEQ5L pdf
        SetMSTP(81,1);             // Multiple Interactions ON
        SetMSTP(82,4);             // Double Gaussian Model
        SetPARP(81,1.9);           // Min. pt for multiple interactions (default in 6.2-14)