]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - ANALYSIS/macros/train/AddMCGenPythia.C
Update master to aliroot
[u/mrichter/AliRoot.git] / ANALYSIS / macros / train / AddMCGenPythia.C
... / ...
CommitLineData
1AliGenerator* 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)
2{
3 //Add Pythia generator: pt-hard bin or min bias
4
5 gSystem->Load("liblhapdf");
6
7 AliGenerator *genP = NULL;
8 genP = CreatePythia6Gen(e_cms, ptHardMin, ptHardMax, tune,cr,ptWeight);
9
10 return genP;
11}
12
13AliGenerator* CreatePythia6Gen(Float_t e_cms, Int_t ptHardMin, Int_t ptHardMax, Int_t tune, Int_t cr,Float_t ptWeight) {
14
15 gSystem->Load("libpythia6.4.25");
16 gSystem->Load("libEGPythia6");
17 gSystem->Load("libAliPythia6");
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
33 genP->SetProcess(kPyJets);
34 genP->SetPtHard((float)ptHardMin,(float)ptHardMax);
35 if(ptWeight>0) genP->SetWeightPower(ptWeight);
36 } else
37 genP->SetProcess(kPyMb); // Minimum Bias
38
39 // Centre of mass energy
40 genP->SetEnergyCMS(e_cms); // in GeV
41
42 genP->UseNewMultipleInteractionsScenario(); // for all Pythia versions >= 6.3
43
44 if(tune == 0){ // tune Perugia0
45 genP->SetTune(320);
46 if(cr==0) genP->SetTune(324);
47 }
48 if(tune == 1){ // tune Perugia2010
49 genP->SetTune(327);
50 if(cr==0) genP->SetTune(324);
51 }
52 if(tune == 2){ // tune Perugia2011 ('central' Perugia 2011)
53 genP->SetTune(350);
54 if(cr==0) genP->SetTune(354);
55 }
56 genP->Print();
57 return genP;
58}