]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/macros/train/AddMCGenPythia.C
Pythia Event Weight changes
[u/mrichter/AliRoot.git] / ANALYSIS / macros / train / AddMCGenPythia.C
index 230edd9ef68ff09619c18dc7686fa7dab109d684..262ed33006f24f10f95ef0786401032ce77c0577 100644 (file)
@@ -1,16 +1,16 @@
-AliGenerator* AddMCGenPythia(Float_t e_cms = 2760., Double_t ptHardMin = 0., Double_t ptHardMax = 1., Int_t tune = 2) 
+AliGenerator* AddMCGenPythia(Float_t e_cms = 2760., Double_t ptHardMin = 0., Double_t ptHardMax = 1., Int_t tune = 2,Int_t cr=1,Float_t ptWeight=0
 {
   //Add Pythia generator: pt-hard bin or min bias
 
   gSystem->Load("liblhapdf.so");
  
   AliGenerator *genP = NULL;
-  genP = CreatePythia6Gen(e_cms, ptHardMin, ptHardMax, tune);
+  genP = CreatePythia6Gen(e_cms, ptHardMin, ptHardMax, tune,cr,ptWeight);
   
   return genP;
 }
 
-AliGenerator* CreatePythia6Gen(Float_t e_cms, Int_t ptHardMin, Int_t ptHardMax, Int_t tune) {
+AliGenerator* CreatePythia6Gen(Float_t e_cms, Int_t ptHardMin, Int_t ptHardMax, Int_t tune, Int_t cr,Float_t ptWeight) {
     
   gSystem->Load("libpythia6.4.25.so");
   gSystem->Load("libEGPythia6.so");
@@ -29,8 +29,10 @@ AliGenerator* CreatePythia6Gen(Float_t e_cms, Int_t ptHardMin, Int_t ptHardMax,
 
   //   charm, beauty, charm_unforced, beauty_unforced, jpsi, jpsi_chi, mb
   if(ptHardMin>0.) {
+   
     genP->SetProcess(kPyJets);
     genP->SetPtHard((float)ptHardMin,(float)ptHardMax);
+    if(ptWeight>0) genP->SetWeightPower(ptWeight);
   } else
     genP->SetProcess(kPyMb); // Minimum Bias  
 
@@ -41,12 +43,16 @@ AliGenerator* CreatePythia6Gen(Float_t e_cms, Int_t ptHardMin, Int_t ptHardMax,
 
   if(tune == 0){ // tune Perugia0
     genP->SetTune(320);
+    if(cr==0) genP->SetTune(324);
   }
   if(tune == 1){ // tune Perugia2010
     genP->SetTune(327);
+    if(cr==0) genP->SetTune(324);
   } 
   if(tune == 2){ // tune Perugia2011 ('central' Perugia 2011)
     genP->SetTune(350);
+    if(cr==0) genP->SetTune(354);
   }
+  genP->Print();
   return genP;
 }