]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/macros/train/AddMCGenPythia.C
Fix in physics selection OADB
[u/mrichter/AliRoot.git] / ANALYSIS / macros / train / AddMCGenPythia.C
1 AliGenerator* AddMCGenPythia(Float_t e_cms = 2760., Double_t ptHardMin = 0., Double_t ptHardMax = 1., Int_t tune = 2,Int_t cr=1) 
2 {
3   //Add Pythia generator: pt-hard bin or min bias
4
5   gSystem->Load("liblhapdf.so");
6  
7   AliGenerator *genP = NULL;
8   genP = CreatePythia6Gen(e_cms, ptHardMin, ptHardMax, tune,cr);
9   
10   return genP;
11 }
12
13 AliGenerator* CreatePythia6Gen(Float_t e_cms, Int_t ptHardMin, Int_t ptHardMax, Int_t tune, Int_t cr) {
14     
15   gSystem->Load("libpythia6.4.25.so");
16   gSystem->Load("libEGPythia6.so");
17   gSystem->Load("libAliPythia6.so");
18
19   AliGenPythia* genP = new AliGenPythia(1);
20
21   //   vertex position and smearing 
22   genP->SetVertexSmear(kPerEvent);
23
24   // structure function
25   // use kCTEQ5l for Perugia tunes 
26   // except for tunes: Perugia * (325, MRSTLO*), Perugia 6 (326, CTEQ6L),  
27   // Perugia 11 M (355, MRST LO**), Perugia 11 C (356, CTEQ6L1) 
28   genP->SetStrucFunc(kCTEQ5L); 
29
30   //   charm, beauty, charm_unforced, beauty_unforced, jpsi, jpsi_chi, mb
31   if(ptHardMin>0.) {
32     genP->SetProcess(kPyJets);
33     genP->SetPtHard((float)ptHardMin,(float)ptHardMax);
34   } else
35     genP->SetProcess(kPyMb); // Minimum Bias  
36
37   //   Centre of mass energy 
38   genP->SetEnergyCMS(e_cms); // in GeV
39     
40   genP->UseNewMultipleInteractionsScenario(); // for all Pythia versions >= 6.3
41
42   if(tune == 0){ // tune Perugia0
43     genP->SetTune(320);
44     if(cr==0) genP->SetTune(324);
45   }
46   if(tune == 1){ // tune Perugia2010
47     genP->SetTune(327);
48     if(cr==0) genP->SetTune(324);
49   } 
50   if(tune == 2){ // tune Perugia2011 ('central' Perugia 2011)
51     genP->SetTune(350);
52     if(cr==0) genP->SetTune(354);
53   }
54   genP->Print();
55   return genP;
56 }