]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PYTHIA6/AliPythia.cxx
Implement setters for weighted event generation and pyevwt
[u/mrichter/AliRoot.git] / PYTHIA6 / AliPythia.cxx
index d8a267940827c7d656afbdffa6931eb5e725907c..c51ead2cdea5213fc48637a5e32b08f17c60a7a5 100644 (file)
@@ -13,6 +13,9 @@
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+// Pythia 6 interface used by AliGenPythia
+// Some settings are done by AliGenPythia, others here :)
+//
 /* $Id$ */
 
 #include "AliPythia.h"
@@ -39,6 +42,7 @@ ClassImp(AliPythia)
 # define qpygin0 qpygin0_
 # define pytune  pytune_
 # define py2ent  py2ent_
+# define setpowwght setpowwght_
 # define type_of_call
 #else
 # define pyclus PYCLUS
@@ -50,6 +54,7 @@ ClassImp(AliPythia)
 # define qpygin0 QPYGIN0
 # define pytune  PYTUNE
 # define py2ent  PY2ENT
+# define setpowwght SETPOWWGHT
 # define type_of_call _stdcall
 #endif
 
@@ -62,7 +67,8 @@ extern "C" void type_of_call pyevnw();
 extern "C" void type_of_call pyshowq(Int_t &, Int_t &, Double_t &);
 extern "C" void type_of_call pytune(Int_t &);
 extern "C" void type_of_call py2ent(Int_t &, Int_t&, Int_t&, Double_t&);
-extern "C" void type_of_call qpygin0(); 
+extern "C" void type_of_call qpygin0();
+extern "C" void type_of_call setpowwght(Double_t &);
 //_____________________________________________________________________________
 
 AliPythia* AliPythia::fgAliPythia=NULL;
@@ -376,6 +382,7 @@ void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfun
 //  QCD Jets
 //
        SetMSEL(1);
+
  // Pythia Tune A (CDF)
  //
        if (fItune < 0) {
@@ -829,6 +836,13 @@ void AliPythia::Py2ent(Int_t idx, Int_t pdg1, Int_t pdg2, Double_t p){
   py2ent(idx, pdg1, pdg2, p);
 }
 
+void AliPythia::SetWeightPower(Double_t pow)
+{
+    setpowwght(pow);
+    SetMSTP(142, 1); // Tell Pythia to use pyevwt to calculate event wghts
+    if (GetCKIN(3) <= 0) 
+      AliWarning("Need to set minimum p_T,hard to nonzero value for weighted event generation");
+}
 
 void AliPythia::InitQuenching(Float_t cMin, Float_t cMax, Float_t k, Int_t iECMethod, Float_t zmax, Int_t ngmax)
 {