]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PYTHIA6/AliPythia6.cxx
new option for tests in alifakedisplay
[u/mrichter/AliRoot.git] / PYTHIA6 / AliPythia6.cxx
index 7039bf76f65e298579baf034ae9e91a9a2aa5346..6c9ff6f8a8374755a335701fa5b2cc37fa159bcd 100644 (file)
@@ -37,6 +37,7 @@ ClassImp(AliPythia6)
 # define pyevnw pyevnw_
 # define pyjoin pyjoin_
 # define qpygin0 qpygin0_
+# define setpowwght setpowwght_
 # define type_of_call
 #else
 # define pyclus PYCLUS
@@ -48,6 +49,7 @@ ClassImp(AliPythia6)
 # define pyevnw PYEVNW
 # define pyjoin PYJOIN
 # define qpygin0 QPYGIN0
+# define setpowwght SETPOWWGHT
 # define type_of_call _stdcall
 #endif
 
@@ -60,6 +62,7 @@ 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();
+extern "C" void type_of_call setpowwght(Double_t &);
 
 
 //_____________________________________________________________________________
@@ -72,6 +75,8 @@ AliPythia6::AliPythia6():
     fProcess(kPyMb),
     fEcms(0.),
     fStrucFunc(kCTEQ5L),
+    fProjectile("p"),
+    fTarget("p"),
     fXJet(0.),
     fYJet(0.),
     fNGmax(30),
@@ -99,6 +104,8 @@ AliPythia6::AliPythia6(const AliPythia6& pythia):
     fProcess(kPyMb),
     fEcms(0.),
     fStrucFunc(kCTEQ5L),
+    fProjectile("p"),
+    fTarget("p"),
     fXJet(0.),
     fYJet(0.),
     fNGmax(30),
@@ -114,7 +121,7 @@ AliPythia6::AliPythia6(const AliPythia6& pythia):
     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()) 
@@ -604,15 +611,50 @@ 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 kPyZgamma:
+      //Inclusive production of Z
+      SetMSEL(0);
+      //f fbar -> Z/gamma
+      SetMSUB(1,1);
+      // Initial/final parton shower on (Pythia default)
+      // 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;  
+      case kPyJetsPWHG:
+      //    N.B.
+      //    ====
+      //    For the case of jet production the following parameter setting
+      //    limits the transverse momentum of secondary scatterings, due
+      //    to multiple parton interactions, to be less than that of the
+      //    primary interaction (see POWHEG Dijet paper arXiv:1012.3380
+      //    [hep-ph] sec. 4.1 and also the PYTHIA Manual).
+      SetMSTP(86,1);
+      //    maximum number of errors before pythia aborts (def=10)
+      SetMSTU(22,10);
+      //    number of warnings printed on the shell
+      SetMSTU(26,20);
+      break;
+      case kPyCharmPWHG:
+      case kPyBeautyPWHG:
+      case kPyWPWHG:
+      //    number of warnings printed on the shell
+      SetMSTU(26,20);
 
     }
 //
 //  Initialize PYTHIA
     SetMSTP(41,1);   // all resonance decays switched on
-    Initialize("CMS","p","p",fEcms);
-    
+    if (process == kPyJetsPWHG || process == kPyCharmPWHG || process == kPyBeautyPWHG || process == kPyWPWHG) {
+      Initialize("USER","","",0.);
+    } else {   
+      Initialize("CMS",fProjectile,fTarget,fEcms);
+    }
 }
 
 Int_t AliPythia6::CheckedLuComp(Int_t kf)
@@ -868,7 +910,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.;
@@ -1468,6 +1511,12 @@ void AliPythia6::AtlasTuningMC09()
     SetPARP(89,1800.);         // [GeV]   Ref. energy
 }
 
+void AliPythia6::SetWeightPower(Double_t pow)
+{
+    setpowwght(pow);
+    SetMSTP(142, 1); // Tell Pythia to use pyevwt to calculate event wghts
+}
+
 void AliPythia6::SetPtHardRange(Float_t ptmin, Float_t ptmax)
 {
     // Set the pt hard range