]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PYTHIA6/AliPythia6.cxx
Possibility to change the collision system.
[u/mrichter/AliRoot.git] / PYTHIA6 / AliPythia6.cxx
index 901788f81a620b8bf7e29e341ab8cc595a8ea3c5..2f631f9531bae7d732496fec4b4e98b090b175a5 100644 (file)
@@ -1,4 +1,3 @@
-
 /**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
@@ -32,22 +31,32 @@ ClassImp(AliPythia6)
 # define pyclus pyclus_
 # define pycell pycell_
 # define pyshow pyshow_
+# define pyshowq pyshowq_
 # define pyrobo pyrobo_
 # define pyquen pyquen_
 # define pyevnw pyevnw_
+# define pyjoin pyjoin_
+# define qpygin0 qpygin0_
 # define type_of_call
 #else
 # define pyclus PYCLUS
 # define pycell PYCELL
+# define pyshow PYSHOW
+# define pyshowq PYSHOWQ
 # define pyrobo PYROBO
 # define pyquen PYQUEN
 # define pyevnw PYEVNW
+# define pyjoin PYJOIN
+# define qpygin0 QPYGIN0
 # define type_of_call _stdcall
 #endif
 
+extern "C" void type_of_call pyjoin(Int_t &, Int_t * );
 extern "C" void type_of_call pyclus(Int_t & );
 extern "C" void type_of_call pycell(Int_t & );
 extern "C" void type_of_call pyshow(Int_t &, Int_t &, Double_t &);
+extern "C" void type_of_call pyshowq(Int_t &, Int_t &, Double_t &);
+extern "C" void type_of_call qpygin0();
 extern "C" void type_of_call pyrobo(Int_t &, Int_t &, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &);
 extern "C" void type_of_call pyquen(Double_t &, Int_t &, Double_t &);
 extern "C" void type_of_call pyevnw();
@@ -63,6 +72,8 @@ AliPythia6::AliPythia6():
     fProcess(kPyMb),
     fEcms(0.),
     fStrucFunc(kCTEQ5L),
+    fProjectile("p"),
+    fTarget("p"),
     fXJet(0.),
     fYJet(0.),
     fNGmax(30),
@@ -73,6 +84,11 @@ AliPythia6::AliPythia6():
 // Default Constructor
 //
 //  Set random number
+    Int_t i;
+    for (i = 0; i <  501; i++) fDefMDCY[i] = 0;
+    for (i = 0; i < 2001; i++) fDefMDME[i] = 0;
+    for (i = 0; i <    4; i++) fZQuench[i] = 0;
+
     if (!AliPythiaRndm::GetPythiaRandom()) 
       AliPythiaRndm::SetPythiaRandom(GetRandom());
     fGlauber          = 0;
@@ -85,6 +101,8 @@ AliPythia6::AliPythia6(const AliPythia6& pythia):
     fProcess(kPyMb),
     fEcms(0.),
     fStrucFunc(kCTEQ5L),
+    fProjectile("p"),
+    fTarget("p"),
     fXJet(0.),
     fYJet(0.),
     fNGmax(30),
@@ -93,10 +111,14 @@ AliPythia6::AliPythia6(const AliPythia6& pythia):
     fQuenchingWeights(0)
 {
     // Copy Constructor
+    Int_t i;
+    for (i = 0; i <  501; i++) fDefMDCY[i] = 0;
+    for (i = 0; i < 2001; i++) fDefMDME[i] = 0;
+    for (i = 0; i <    4; i++) fZQuench[i] = 0;
     pythia.Copy(*this);
 }
 
-void AliPythia6::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc)
+void AliPythia6::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc, Int_t /*tune*/)
 {
 // Initialise the process to generate 
     if (!AliPythiaRndm::GetPythiaRandom()) 
@@ -260,7 +282,7 @@ void AliPythia6::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfu
        SetMSUB(94,1);             // double diffraction
        SetMSUB(95,1);             // low pt production
 
-       AtlasTuning_MC09();
+       AtlasTuningMC09();
        break;
 
     case kPyMbWithDirectPhoton:
@@ -405,6 +427,7 @@ void AliPythia6::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfu
     case kPyD0ppMNR:
     case kPyDPlusppMNR:
     case kPyDPlusStrangeppMNR:
+    case kPyLambdacppMNR:
       // Tuning of Pythia parameters aimed to get a resonable agreement
       // between with the NLO calculation by Mangano, Nason, Ridolfi for the
       // c-cbar single inclusive and double differential distributions.
@@ -585,14 +608,17 @@ void AliPythia6::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfu
       // With parton showers on we are generating "Z inclusive process"
       SetMSTP(61,1); //Initial QCD & QED showers on
       SetMSTP(71,1); //Final QCD & QED showers on
-      
+      break;
+      case kPyMBRSingleDiffraction:
+      case kPyMBRDoubleDiffraction:
+      case kPyMBRCentralDiffraction:
       break;  
 
     }
 //
 //  Initialize PYTHIA
     SetMSTP(41,1);   // all resonance decays switched on
-    Initialize("CMS","p","p",fEcms);
+    Initialize("CMS",fProjectile,fTarget,fEcms);
     
 }
 
@@ -673,6 +699,28 @@ void  AliPythia6::SetDecayTable()
     for (i = 1; i < 2001; i++) fDefMDME[i] = GetMDME(i,1);
 }
 
+void  AliPythia6::Pyjoin(Int_t& npart, Int_t *ipart)
+{
+//  Call Pythia join alogorithm to set up a string between
+//  npart partons, given by indices in array ipart[npart]
+//
+    pyjoin(npart, ipart);
+}
+
+void  AliPythia6::Pyshowq(Int_t ip1, Int_t ip2, Double_t qmax)
+{
+//  Call qPythia showering
+//
+    pyshowq(ip1, ip2, qmax);
+}
+
+void AliPythia6::Qpygin0()
+{
+    //position of the hard scattering in the nuclear overlapping area.
+    //just for qpythia.
+    qpygin0();
+}
+
 void  AliPythia6::Pyclus(Int_t& njet)
 {
 //  Call Pythia clustering algorithm
@@ -763,7 +811,7 @@ void  AliPythia6::Quench()
     Double_t px = 0., py = 0., pz = 0., e = 0., m = 0., p = 0., pt = 0., theta = 0., phi = 0.;
     Double_t pxq[4], pyq[4], pzq[4], eq[4], yq[4], mq[4], pq[4], phiq[4], thetaq[4], ptq[4];
     Bool_t  quenched[4];
-    Double_t wjtKick[4];
+    Double_t wjtKick[4] = {0., 0., 0., 0.};
     Int_t nGluon[4];
     Int_t qPdg[4];
     Int_t   imo, kst, pdg;
@@ -827,7 +875,8 @@ void  AliPythia6::Quench()
 
 
        Int_t itype = (qPdg[j] == 21) ? 2 : 1;
-       Double_t eloss = fQuenchingWeights->GetELossRandomKFast(itype, int0[j], int1[j], eq[j]);
+       //      Double_t eloss = fQuenchingWeights->GetELossRandomKFast(itype, int0[j], int1[j], eq[j]);
+       Double_t eloss = fQuenchingWeights->GetELossRandomK(itype, int0[j], int1[j], eq[j]);
 
        if (TMath::Abs(yq[j]) > 2.5 || eq[j] < 10.) {
            fZQuench[j] = 0.;
@@ -1396,7 +1445,7 @@ void AliPythia6::AtlasTuning()
        SetPARP(67,1);             // Regulates Initial State Radiation
 }
 
-void AliPythia6::AtlasTuning_MC09()
+void AliPythia6::AtlasTuningMC09()
 {
     //
     // Configuration for the ATLAS tuning