]> git.uio.no Git - u/mrichter/AliRoot.git/blob - macros/Config_PDC06.C
Now it is possible to select kPyCharmppMNRwmi
[u/mrichter/AliRoot.git] / macros / Config_PDC06.C
1 //
2 // Configuration for the Physics Data Challenge 2006
3 //
4
5 // One can use the configuration macro in compiled mode by
6 // root [0] gSystem->Load("libgeant321");
7 // root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
8 //                   -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
9 // root [0] .x grun.C(1,"Config_PDC06.C++")
10
11 #if !defined(__CINT__) || defined(__MAKECINT__)
12 #include <Riostream.h>
13 #include <TRandom.h>
14 #include <TDatime.h>
15 #include <TSystem.h>
16 #include <TVirtualMC.h>
17 #include <TGeant3TGeo.h>
18 #include "EVGEN/AliGenCocktail.h"
19 #include "EVGEN/AliGenParam.h"
20 #include "EVGEN/AliGenMUONlib.h"
21 #include "STEER/AliRunLoader.h"
22 #include "STEER/AliRun.h"
23 #include "STEER/AliConfig.h"
24 #include "PYTHIA6/AliDecayerPythia.h"
25 #include "PYTHIA6/AliGenPythia.h"
26 #include "STEER/AliMagFMaps.h"
27 #include "STRUCT/AliBODY.h"
28 #include "STRUCT/AliMAG.h"
29 #include "STRUCT/AliABSOv3.h"
30 #include "STRUCT/AliDIPOv3.h"
31 #include "STRUCT/AliHALLv3.h"
32 #include "STRUCT/AliFRAMEv2.h"
33 #include "STRUCT/AliSHILv3.h"
34 #include "STRUCT/AliPIPEv3.h"
35 #include "ITS/AliITSgeom.h"
36 #include "ITS/AliITSv11Hybrid.h"
37 #include "TPC/AliTPCv2.h"
38 #include "TOF/AliTOFv6T0.h"
39 #include "HMPID/AliHMPIDv3.h"
40 #include "ZDC/AliZDCv3.h"
41 #include "TRD/AliTRDv1.h"
42 #include "FMD/AliFMDv1.h"
43 #include "MUON/AliMUONv1.h"
44 #include "PHOS/AliPHOSv1.h"
45 #include "PMD/AliPMDv1.h"
46 #include "T0/AliT0v1.h"
47 #include "EMCAL/AliEMCALv2.h"
48 #include "ACORDE/AliACORDEv1.h"
49 #include "VZERO/AliVZEROv7.h"
50 #endif
51
52
53 enum PDC06Proc_t 
54 {
55 //--- Heavy Flavour Production ---
56   kCharmPbPb5500,  kCharmpPb8800,  kCharmpp14000,  kCharmpp14000wmi,
57   kD0PbPb5500,     kD0pPb8800,     kD0pp14000,
58   kDPlusPbPb5500,  kDPluspPb8800,  kDPluspp14000,
59   kBeautyPbPb5500, kBeautypPb8800, kBeautypp14000, kBeautypp14000wmi, 
60 // -- Pythia Mb
61   kPyMbNoHvq, kPyOmegaPlus, kPyOmegaMinus, kRunMax
62 };
63
64 const char * pprRunName[] = {
65   "kCharmPbPb5500",  "kCharmpPb8800",  "kCharmpp14000",  "kCharmpp14000wmi",
66   "kD0PbPb5500",     "kD0pPb8800",     "kD0pp14000",
67   "kDPlusPbPb5500",  "kDPluspPb8800",  "kDPluspp14000",
68   "kBeautyPbPb5500", "kBeautypPb8800", "kBeautypp14000", "kBeautypp14000wmi", 
69   "kPyMbNoHvq", "kPyOmegaPlus", "kPyOmegaMinus"
70 };
71
72
73 //--- Decay Mode ---
74 enum DecayHvFl_t 
75 {
76   kNature,  kHadr, kSemiEl, kSemiMu
77 };
78 //--- Rapidity Cut ---
79 enum YCut_t
80 {
81   kFull, kBarrel, kMuonArm
82 };
83 //--- Magnetic Field ---
84 enum Mag_t
85 {
86     k2kG, k4kG, k5kG
87 };
88
89 //--- Trigger config ---
90 enum TrigConf_t
91 {
92     kDefaultPPTrig, kDefaultPbPbTrig
93 };
94
95 const char * TrigConfName[] = {
96     "p-p","Pb-Pb"
97 };
98
99 //--- Functions ---
100 class AliGenPythia;
101 AliGenPythia *PythiaHVQ(PDC06Proc_t proc);
102 AliGenerator *MbCocktail();
103 AliGenerator *PyMbTriggered(Int_t pdg);
104 void ProcessEnvironmentVars();
105 void LoadPythia();
106
107 // This part for configuration
108 static PDC06Proc_t   proc     = kPyMbNoHvq;
109 static DecayHvFl_t   decHvFl  = kNature; 
110 static YCut_t        ycut     = kFull;
111 static Mag_t         mag      = k5kG; 
112 static TrigConf_t    trig     = kDefaultPPTrig; // default pp trigger configuration
113 //========================//
114 // Set Random Number seed //
115 //========================//
116 TDatime dt;
117 static UInt_t seed    = dt.Get();
118
119 // nEvts = -1  : you get 1 QQbar pair and all the fragmentation and 
120 //               decay chain
121 // nEvts = N>0 : you get N charm / beauty Hadrons 
122 Int_t nEvts = -1; 
123 // stars = kTRUE : all heavy resonances and their decay stored
124 //       = kFALSE: only final heavy hadrons and their decays stored
125 Bool_t stars = kTRUE;
126
127 // To be used only with kCharmppMNRwmi and kBeautyppMNRwmi
128 // To get a "reasonable" agreement with MNR results, events have to be 
129 // generated with the minimum ptHard set to 2.76 GeV.
130 // To get a "perfect" agreement with MNR results, events have to be 
131 // generated in four ptHard bins with the following relative 
132 // normalizations:
133 //  CHARM
134 // 2.76-3 GeV: 25%
135 //    3-4 GeV: 40%
136 //    4-8 GeV: 29%
137 //     >8 GeV:  6%
138 //  BEAUTY
139 // 2.76-4 GeV:  5% 
140 //    4-6 GeV: 31%
141 //    6-8 GeV: 28%
142 //     >8 GeV: 36%
143 Float_t ptHardMin =  2.76;
144 Float_t ptHardMax = -1.;
145
146
147 // Comment line
148 static TString comment;
149
150 void Config()
151 {
152     
153
154   // Get settings from environment variables
155   ProcessEnvironmentVars();
156   // Load pythia libraries
157   LoadPythia();
158   //
159
160   gRandom->SetSeed(seed);
161   cerr<<"Seed for random number generation= "<<seed<<endl; 
162
163   // libraries required by geant321
164 #if defined(__CINT__)
165   gSystem->Load("libgeant321");
166 #endif
167
168   new TGeant3TGeo("C++ Interface to Geant3");
169
170   if(!AliCDBManager::Instance()->IsDefaultStorageSet()){
171     AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
172     AliCDBManager::Instance()->SetRun(0);
173   }
174
175   //=======================================================================
176   //  Create the output file
177
178    
179   AliRunLoader* rl=0x0;
180
181   cout<<"Config.C: Creating Run Loader ..."<<endl;
182   rl = AliRunLoader::Open("galice.root",
183                           AliConfig::GetDefaultEventFolderName(),
184                           "recreate");
185   if (rl == 0x0)
186     {
187       gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
188       return;
189     }
190   rl->SetCompressionLevel(2);
191   rl->SetNumberOfEventsPerFile(1000);
192   gAlice->SetRunLoader(rl);
193   // gAlice->SetGeometryFromFile("geometry.root");
194   // gAlice->SetGeometryFromCDB();
195   
196   // Set the trigger configuration
197   gAlice->SetTriggerDescriptor(TrigConfName[trig]);
198   cout<<"Trigger configuration is set to  "<<TrigConfName[trig]<<endl;
199
200   //
201   //=======================================================================
202   // ************* STEERING parameters FOR ALICE SIMULATION **************
203   // --- Specify event type to be tracked through the ALICE setup
204   // --- All positions are in cm, angles in degrees, and P and E in GeV
205
206
207     gMC->SetProcess("DCAY",1);
208     gMC->SetProcess("PAIR",1);
209     gMC->SetProcess("COMP",1);
210     gMC->SetProcess("PHOT",1);
211     gMC->SetProcess("PFIS",0);
212     gMC->SetProcess("DRAY",0);
213     gMC->SetProcess("ANNI",1);
214     gMC->SetProcess("BREM",1);
215     gMC->SetProcess("MUNU",1);
216     gMC->SetProcess("CKOV",1);
217     gMC->SetProcess("HADR",1);
218     gMC->SetProcess("LOSS",2);
219     gMC->SetProcess("MULS",1);
220     gMC->SetProcess("RAYL",1);
221
222     Float_t cut = 1.e-3;        // 1MeV cut by default
223     Float_t tofmax = 1.e10;
224
225     gMC->SetCut("CUTGAM", cut);
226     gMC->SetCut("CUTELE", cut);
227     gMC->SetCut("CUTNEU", cut);
228     gMC->SetCut("CUTHAD", cut);
229     gMC->SetCut("CUTMUO", cut);
230     gMC->SetCut("BCUTE",  cut); 
231     gMC->SetCut("BCUTM",  cut); 
232     gMC->SetCut("DCUTE",  cut); 
233     gMC->SetCut("DCUTM",  cut); 
234     gMC->SetCut("PPCUTM", cut);
235     gMC->SetCut("TOFMAX", tofmax); 
236
237
238
239
240   // Set External decayer //
241   //======================//
242   TVirtualMCDecayer* decayer = new AliDecayerPythia();
243   // DECAYS
244   //
245   switch(decHvFl) {
246   case kNature:
247     decayer->SetForceDecay(kAll);
248     break;
249   case kHadr:
250     decayer->SetForceDecay(kHadronicD);
251     break;
252   case kSemiEl:
253     decayer->SetForceDecay(kSemiElectronic);
254     break;
255   case kSemiMu:
256     decayer->SetForceDecay(kSemiMuonic);
257     break;
258   }
259   decayer->Init();
260   gMC->SetExternalDecayer(decayer);
261
262   //=========================//
263   // Generator Configuration //
264   //=========================//
265   AliGenerator* gener = 0x0;
266   
267   if (proc <=   kBeautypp14000wmi) {
268       AliGenPythia *pythia = PythiaHVQ(proc);
269       // FeedDown option
270       pythia->SetFeedDownHigherFamily(kFALSE);
271       // Stack filling option
272       if(!stars) pythia->SetStackFillOpt(AliGenPythia::kParentSelection);
273       // Set Count mode
274       if(nEvts>0) pythia->SetCountMode(AliGenPythia::kCountParents);
275       //
276       // DECAYS
277       //  
278       switch(decHvFl) {
279       case kNature:
280           pythia->SetForceDecay(kAll);
281           break;
282       case kHadr:
283           pythia->SetForceDecay(kHadronicD);
284           break;
285       case kSemiEl:
286           pythia->SetForceDecay(kSemiElectronic);
287           break;
288       case kSemiMu:
289           pythia->SetForceDecay(kSemiMuonic);
290           break;
291       }
292       //
293       // GEOM & KINE CUTS
294       //
295       pythia->SetMomentumRange(0,99999999);
296       pythia->SetPhiRange(0., 360.);
297       pythia->SetThetaRange(0,180);
298       switch(ycut) {
299       case kFull:
300           pythia->SetYRange(-999,999);
301           break;
302       case kBarrel:
303           pythia->SetYRange(-2,2);
304           break;
305       case kMuonArm:
306           pythia->SetYRange(1,6);
307           break;
308       }
309       gener = pythia;
310   } else if (proc == kPyMbNoHvq) {
311       gener = MbCocktail();
312   } else if (proc == kPyOmegaMinus) {
313       gener = PyMbTriggered(3334);
314   } else if (proc == kPyOmegaPlus) {
315       gener = PyMbTriggered(-3334);
316   }
317   
318   
319
320   // PRIMARY VERTEX
321   //
322   gener->SetOrigin(0., 0., 0.);    // vertex position
323   //
324   //
325   // Size of the interaction diamond
326   // Longitudinal
327   Float_t sigmaz  = 7.55 / TMath::Sqrt(2.); // [cm]
328   //
329   // Transverse
330   Float_t betast  = 10;                 // beta* [m]
331   Float_t eps     = 3.75e-6;            // emittance [m]
332   Float_t gamma   = 7000. / 0.938272;   // relativistic gamma [1]
333   Float_t sigmaxy = TMath::Sqrt(eps * betast / gamma) / TMath::Sqrt(2.) * 100.;  // [cm]
334   printf("\n \n Diamond size x-y: %10.3e z: %10.3e\n \n", sigmaxy, sigmaz);
335     
336   gener->SetSigma(sigmaxy, sigmaxy, sigmaz);      // Sigma in (X,Y,Z) (cm) on IP position
337   gener->SetCutVertexZ(3.);        // Truncate at 3 sigma
338   gener->SetVertexSmear(kPerEvent);
339
340   gener->Init();
341
342   // FIELD
343   //    
344   if (mag == k2kG) {
345     comment = comment.Append(" | L3 field 0.2 T");
346   } else if (mag == k4kG) {
347     comment = comment.Append(" | L3 field 0.4 T");
348   } else if (mag == k5kG) {
349     comment = comment.Append(" | L3 field 0.5 T");
350   }
351   printf("\n \n Comment: %s \n \n", comment.Data());
352     
353   AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
354   field->SetL3ConstField(0); //Using const. field in the barrel
355   rl->CdGAFile();
356   gAlice->SetField(field);    
357
358
359
360   Int_t iABSO  = 1;
361   Int_t iACORDE   = 0;
362   Int_t iDIPO  = 1;
363   Int_t iEMCAL = 1;
364   Int_t iFMD   = 1;
365   Int_t iFRAME = 1;
366   Int_t iHALL  = 1;
367   Int_t iITS   = 1;
368   Int_t iMAG   = 1;
369   Int_t iMUON  = 1;
370   Int_t iPHOS  = 1;
371   Int_t iPIPE  = 1;
372   Int_t iPMD   = 1;
373   Int_t iHMPID  = 1;
374   Int_t iSHIL  = 1;
375   Int_t iT0 = 1;
376   Int_t iTOF   = 1;
377   Int_t iTPC   = 1;
378   Int_t iTRD   = 1;
379   Int_t iVZERO = 1;
380   Int_t iZDC   = 1;
381   
382
383     //=================== Alice BODY parameters =============================
384     AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
385
386
387     if (iMAG)
388     {
389         //=================== MAG parameters ============================
390         // --- Start with Magnet since detector layouts may be depending ---
391         // --- on the selected Magnet dimensions ---
392         AliMAG *MAG = new AliMAG("MAG", "Magnet");
393     }
394
395
396     if (iABSO)
397     {
398         //=================== ABSO parameters ============================
399         AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
400     }
401
402     if (iDIPO)
403     {
404         //=================== DIPO parameters ============================
405
406         AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
407     }
408
409     if (iHALL)
410     {
411         //=================== HALL parameters ============================
412
413         AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
414     }
415
416
417     if (iFRAME)
418     {
419         //=================== FRAME parameters ============================
420
421         AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
422         FRAME->SetHoles(1);
423     }
424
425     if (iSHIL)
426     {
427         //=================== SHIL parameters ============================
428
429         AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
430     }
431
432
433     if (iPIPE)
434     {
435         //=================== PIPE parameters ============================
436
437         AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
438     }
439  
440     if (iITS)
441     {
442         //=================== ITS parameters ============================
443
444         AliITS *ITS  = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
445     }
446
447     if (iTPC)
448     {
449       //============================ TPC parameters =====================
450         AliTPC *TPC = new AliTPCv2("TPC", "Default");
451     }
452
453
454     if (iTOF) {
455         //=================== TOF parameters ============================
456         AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
457     }
458
459
460     if (iHMPID)
461     {
462         //=================== HMPID parameters ===========================
463         AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
464
465     }
466
467
468     if (iZDC)
469     {
470         //=================== ZDC parameters ============================
471
472         AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
473     }
474
475     if (iTRD)
476     {
477         //=================== TRD parameters ============================
478
479         AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
480         AliTRDgeometry *geoTRD = TRD->GetGeometry();
481         // Partial geometry: modules at 2,3,4,6,11,12,14,15
482         // starting at 6h in positive direction
483         geoTRD->SetSMstatus(0,0);
484         geoTRD->SetSMstatus(1,0);
485         geoTRD->SetSMstatus(5,0);
486         geoTRD->SetSMstatus(7,0);
487         geoTRD->SetSMstatus(8,0);
488         geoTRD->SetSMstatus(9,0);
489         geoTRD->SetSMstatus(10,0);
490         geoTRD->SetSMstatus(13,0);
491         geoTRD->SetSMstatus(16,0);
492         geoTRD->SetSMstatus(17,0);
493     }
494
495     if (iFMD)
496     {
497         //=================== FMD parameters ============================
498         AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
499    }
500
501     if (iMUON)
502     {
503         //=================== MUON parameters ===========================
504         // New MUONv1 version (geometry defined via builders)
505         AliMUON *MUON = new AliMUONv1("MUON", "default");
506     }
507     //=================== PHOS parameters ===========================
508
509     if (iPHOS)
510     {
511         AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
512     }
513
514
515     if (iPMD)
516     {
517         //=================== PMD parameters ============================
518         AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
519     }
520
521     if (iT0)
522     {
523         //=================== T0 parameters ============================
524         AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
525     }
526
527     if (iEMCAL)
528     {
529         //=================== EMCAL parameters ============================
530         AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE");
531     }
532
533      if (iACORDE)
534     {
535         //=================== ACORDE parameters ============================
536         AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
537     }
538
539      if (iVZERO)
540     {
541         //=================== ACORDE parameters ============================
542         AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
543     }
544 }
545 //
546 //           PYTHIA
547 //
548 AliGenPythia *PythiaHVQ(PDC06Proc_t proc) {
549 //*******************************************************************//
550 // Configuration file for charm / beauty generation with PYTHIA      //
551 //                                                                   //
552 // The parameters have been tuned in order to reproduce the inclusive//
553 // heavy quark pt distribution given by the NLO pQCD calculation by  //
554 // Mangano, Nason and Ridolfi.                                       //
555 //                                                                   //
556 // For details and for the NORMALIZATION of the yields see:          //
557 //   N.Carrer and A.Dainese,                                         //
558 //   "Charm and beauty production at the LHC",                       //
559 //   ALICE-INT-2003-019, [arXiv:hep-ph/0311225];                     //
560 //   PPR Chapter 6.6, CERN/LHCC 2005-030 (2005).                     //
561 //*******************************************************************//
562   AliGenPythia * gener = 0x0;
563
564   switch(proc) {
565   case kCharmPbPb5500:
566       comment = comment.Append(" Charm in Pb-Pb at 5.5 TeV");
567       gener = new AliGenPythia(nEvts);
568       gener->SetProcess(kPyCharmPbPbMNR);
569       gener->SetStrucFunc(kCTEQ4L);
570       gener->SetPtHard(2.1,-1.0);
571       gener->SetEnergyCMS(5500.);
572       gener->SetNuclei(208,208);
573       break;
574   case kCharmpPb8800:
575       comment = comment.Append(" Charm in p-Pb at 8.8 TeV");
576       gener = new AliGenPythia(nEvts);
577       gener->SetProcess(kPyCharmpPbMNR);
578       gener->SetStrucFunc(kCTEQ4L);
579       gener->SetPtHard(2.1,-1.0);
580       gener->SetEnergyCMS(8800.);
581       gener->SetProjectile("P",1,1);
582       gener->SetTarget("Pb",208,82);
583       break;
584   case kCharmpp14000:
585       comment = comment.Append(" Charm in pp at 14 TeV");
586       gener = new AliGenPythia(nEvts);
587       gener->SetProcess(kPyCharmppMNR);
588       gener->SetStrucFunc(kCTEQ4L);
589       gener->SetPtHard(2.1,-1.0);
590       gener->SetEnergyCMS(14000.);
591       break;
592   case kCharmpp14000wmi:
593       comment = comment.Append(" Charm in pp at 14 TeV with mult. interactions");
594       gener = new AliGenPythia(-1);
595       gener->SetProcess(kPyCharmppMNRwmi);
596       gener->SetStrucFunc(kCTEQ5L);
597       gener->SetPtHard(ptHardMin,ptHardMax);
598       gener->SetEnergyCMS(14000.);
599       break;
600   case kD0PbPb5500:
601       comment = comment.Append(" D0 in Pb-Pb at 5.5 TeV");
602       gener = new AliGenPythia(nEvts);
603       gener->SetProcess(kPyD0PbPbMNR);
604       gener->SetStrucFunc(kCTEQ4L);
605       gener->SetPtHard(2.1,-1.0);
606       gener->SetEnergyCMS(5500.);
607       gener->SetNuclei(208,208);
608       break;
609   case kD0pPb8800:
610       comment = comment.Append(" D0 in p-Pb at 8.8 TeV");
611       gener = new AliGenPythia(nEvts);
612       gener->SetProcess(kPyD0pPbMNR);
613       gener->SetStrucFunc(kCTEQ4L);
614       gener->SetPtHard(2.1,-1.0);
615       gener->SetEnergyCMS(8800.);
616       gener->SetProjectile("P",1,1);
617       gener->SetTarget("Pb",208,82);
618       break;
619   case kD0pp14000:
620       comment = comment.Append(" D0 in pp at 14 TeV");
621       gener = new AliGenPythia(nEvts);
622       gener->SetProcess(kPyD0ppMNR);
623       gener->SetStrucFunc(kCTEQ4L);
624       gener->SetPtHard(2.1,-1.0);
625       gener->SetEnergyCMS(14000.);
626       break;
627   case kDPlusPbPb5500:
628       comment = comment.Append(" DPlus in Pb-Pb at 5.5 TeV");
629       gener = new AliGenPythia(nEvts);
630       gener->SetProcess(kPyDPlusPbPbMNR);
631       gener->SetStrucFunc(kCTEQ4L);
632       gener->SetPtHard(2.1,-1.0);
633       gener->SetEnergyCMS(5500.);
634       gener->SetNuclei(208,208);
635       break;
636   case kDPluspPb8800:
637       comment = comment.Append(" DPlus in p-Pb at 8.8 TeV");
638       gener = new AliGenPythia(nEvts);
639       gener->SetProcess(kPyDPluspPbMNR);
640       gener->SetStrucFunc(kCTEQ4L);
641       gener->SetPtHard(2.1,-1.0);
642       gener->SetEnergyCMS(8800.);
643       gener->SetProjectile("P",1,1);
644       gener->SetTarget("Pb",208,82);
645       break;
646   case kDPluspp14000:
647       comment = comment.Append(" DPlus in pp at 14 TeV");
648       gener = new AliGenPythia(nEvts);
649       gener->SetProcess(kPyDPlusppMNR);
650       gener->SetStrucFunc(kCTEQ4L);
651       gener->SetPtHard(2.1,-1.0);
652       gener->SetEnergyCMS(14000.);
653       break;
654   case kBeautyPbPb5500:
655       comment = comment.Append(" Beauty in Pb-Pb at 5.5 TeV");
656       gener = new AliGenPythia(nEvts);
657       gener->SetProcess(kPyBeautyPbPbMNR);
658       gener->SetStrucFunc(kCTEQ4L);
659       gener->SetPtHard(2.75,-1.0);
660       gener->SetEnergyCMS(5500.);
661       gener->SetNuclei(208,208);
662       break;
663   case kBeautypPb8800:
664       comment = comment.Append(" Beauty in p-Pb at 8.8 TeV");
665       gener = new AliGenPythia(nEvts);
666       gener->SetProcess(kPyBeautypPbMNR);
667       gener->SetStrucFunc(kCTEQ4L);
668       gener->SetPtHard(2.75,-1.0);
669       gener->SetEnergyCMS(8800.);
670       gener->SetProjectile("P",1,1);
671       gener->SetTarget("Pb",208,82);
672       break;
673   case kBeautypp14000:
674       comment = comment.Append(" Beauty in pp at 14 TeV");
675       gener = new AliGenPythia(nEvts);
676       gener->SetProcess(kPyBeautyppMNR);
677       gener->SetStrucFunc(kCTEQ4L);
678       gener->SetPtHard(2.75,-1.0);
679       gener->SetEnergyCMS(14000.);
680       break;
681   case kBeautypp14000wmi:
682       comment = comment.Append(" Beauty in pp at 14 TeV with mult. interactions");
683       gener = new AliGenPythia(-1);
684       gener->SetProcess(kPyBeautyppMNRwmi);
685       gener->SetStrucFunc(kCTEQ5L);
686       gener->SetPtHard(ptHardMin,ptHardMax);
687       gener->SetEnergyCMS(14000.);
688       break;
689   }
690
691   return gener;
692 }
693
694 AliGenerator* MbCocktail()
695 {
696       comment = comment.Append(" pp at 14 TeV: Pythia low-pt, no heavy quarks + J/Psi from parameterisation");
697       AliGenCocktail * gener = new AliGenCocktail();
698       gener->UsePerEventRates();
699  
700 //
701 //    Pythia
702       AliGenPythia* pythia = new AliGenPythia(-1); 
703       pythia->SetMomentumRange(0, 999999.);
704       pythia->SetThetaRange(0., 180.);
705       pythia->SetYRange(-12.,12.);
706       pythia->SetPtRange(0,1000.);
707       pythia->SetProcess(kPyMb);
708       pythia->SetEnergyCMS(14000.);
709       pythia->SwitchHFOff();
710       
711 //
712 //   J/Psi parameterisation
713
714       AliGenParam* jpsi = new AliGenParam(1, AliGenMUONlib::kJpsi, "CDF scaled", "Jpsi");
715       jpsi->SetPtRange(0.,100.);
716       jpsi->SetYRange(-8., 8.);
717       jpsi->SetPhiRange(0., 360.);
718       jpsi->SetForceDecay(kAll);
719 //
720 //
721       gener->AddGenerator(jpsi,   "J/Psi", 8.e-4);              
722       gener->AddGenerator(pythia, "Pythia", 1.);
723
724       
725       return gener;
726 }
727
728 AliGenerator* PyMbTriggered(Int_t pdg)
729 {
730     AliGenPythia* pythia = new AliGenPythia(-1); 
731     pythia->SetMomentumRange(0, 999999.);
732     pythia->SetThetaRange(0., 180.);
733     pythia->SetYRange(-12.,12.);
734     pythia->SetPtRange(0,1000.);
735     pythia->SetProcess(kPyMb);
736     pythia->SetEnergyCMS(14000.);
737     pythia->SetTriggerParticle(pdg, 0.9);
738     return pythia;
739 }
740
741 void ProcessEnvironmentVars()
742 {
743     // Run type
744     if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
745       for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
746         if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
747           proc = (PDC06Proc_t)iRun;
748           cout<<"Run type set to "<<pprRunName[iRun]<<endl;
749         }
750       }
751     }
752
753     // Random Number seed
754     if (gSystem->Getenv("CONFIG_SEED")) {
755       seed = atoi(gSystem->Getenv("CONFIG_SEED"));
756     }
757 }
758
759
760
761 void LoadPythia()
762 {
763     // Load Pythia related libraries
764     gSystem->Load("liblhapdf.so");      // Parton density functions
765     gSystem->Load("libEGPythia6.so");   // TGenerator interface
766     gSystem->Load("libpythia6.so");     // Pythia
767     gSystem->Load("libAliPythia6.so");  // ALICE specific implementations
768 }