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