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