]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ANALYSIS/macros/train/AddMCGenPythia.C
Update master to aliroot
[u/mrichter/AliRoot.git] / ANALYSIS / macros / train / AddMCGenPythia.C
CommitLineData
703e5e0e 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)
76b640d3 2{
3 //Add Pythia generator: pt-hard bin or min bias
4
4070f709 5 gSystem->Load("liblhapdf");
76b640d3 6
7 AliGenerator *genP = NULL;
b929303d 8 genP = CreatePythia6Gen(e_cms, ptHardMin, ptHardMax, tune,cr,ptWeight);
76b640d3 9
10 return genP;
11}
12
703e5e0e 13AliGenerator* CreatePythia6Gen(Float_t e_cms, Int_t ptHardMin, Int_t ptHardMax, Int_t tune, Int_t cr,Float_t ptWeight) {
76b640d3 14
b0635849 15 gSystem->Load("libpythia6.4.25");
4070f709 16 gSystem->Load("libEGPythia6");
17 gSystem->Load("libAliPythia6");
76b640d3 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.) {
b929303d 32
76b640d3 33 genP->SetProcess(kPyJets);
34 genP->SetPtHard((float)ptHardMin,(float)ptHardMax);
b929303d 35 if(ptWeight>0) genP->SetWeightPower(ptWeight);
76b640d3 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);
54ea8cdd 46 if(cr==0) genP->SetTune(324);
76b640d3 47 }
48 if(tune == 1){ // tune Perugia2010
49 genP->SetTune(327);
54ea8cdd 50 if(cr==0) genP->SetTune(324);
76b640d3 51 }
52 if(tune == 2){ // tune Perugia2011 ('central' Perugia 2011)
53 genP->SetTune(350);
54ea8cdd 54 if(cr==0) genP->SetTune(354);
76b640d3 55 }
54ea8cdd 56 genP->Print();
76b640d3 57 return genP;
58}