]> git.uio.no Git - u/mrichter/AliRoot.git/blob - macros/Config_PDC06.C
d981cbe2aecb79d41c50b5b9fabadb97a93e2473
[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/AliVZEROv6.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(1.);        // Truncate at 1 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   = 1;
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         FRAME->SetHoles(0);
395     }
396
397     if (iSHIL)
398     {
399         //=================== SHIL parameters ============================
400
401         AliSHIL *SHIL = new AliSHILv2("SHIL", "Shielding Version 2");
402     }
403
404
405     if (iPIPE)
406     {
407         //=================== PIPE parameters ============================
408
409         AliPIPE *PIPE = new AliPIPEv0("PIPE", "Beam Pipe");
410     }
411  
412     if(iITS) {
413
414     //=================== ITS parameters ============================
415     //
416     // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
417     // almost all other detectors. This involves the fact that the ITS geometry
418     // still has several options to be followed in parallel in order to determine
419     // the best set-up which minimizes the induced background. All the geometries
420     // available to date are described in the following. Read carefully the comments
421     // and use the default version (the only one uncommented) unless you are making
422     // comparisons and you know what you are doing. In this case just uncomment the
423     // ITS geometry you want to use and run Aliroot.
424     //
425     // Detailed geometries:         
426     //
427     //
428     //AliITS *ITS  = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
429     //
430     //AliITS *ITS  = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
431     //
432         AliITSvPPRasymmFMD *ITS  = new AliITSvPPRasymmFMD("ITS","New ITS PPR detailed version with asymmetric services");
433         ITS->SetMinorVersion(2);  // don't touch this parameter if you're not an ITS developer
434         ITS->SetReadDet(kTRUE);   // don't touch this parameter if you're not an ITS developer
435     //    ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det");  // don't touch this parameter if you're not an ITS developer
436         ITS->SetThicknessDet1(200.);   // detector thickness on layer 1 must be in the range [100,300]
437         ITS->SetThicknessDet2(200.);   // detector thickness on layer 2 must be in the range [100,300]
438         ITS->SetThicknessChip1(200.);  // chip thickness on layer 1 must be in the range [150,300]
439         ITS->SetThicknessChip2(200.);  // chip thickness on layer 2 must be in the range [150,300]
440         ITS->SetRails(0);            // 1 --> rails in ; 0 --> rails out
441         ITS->SetCoolingFluid(1);   // 1 --> water ; 0 --> freon
442
443     // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful 
444     // for reconstruction !):
445     //                                                     
446     //
447     //AliITSvPPRcoarseasymm *ITS  = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
448     //ITS->SetRails(0);                // 1 --> rails in ; 0 --> rails out
449     //ITS->SetSupportMaterial(0);      // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
450     //
451     //AliITS *ITS  = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
452     //ITS->SetRails(0);                // 1 --> rails in ; 0 --> rails out
453     //ITS->SetSupportMaterial(0);      // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
454     //                      
455     //
456     //
457     // Geant3 <-> EUCLID conversion
458     // ============================
459     //
460     // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
461     // media to two ASCII files (called by default ITSgeometry.euc and
462     // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
463     // The default (=0) means that you dont want to use this facility.
464     //
465         ITS->SetEUCLID(0);  
466     }
467
468     if (iTPC)
469     {
470       //============================ TPC parameters =====================
471         AliTPC *TPC = new AliTPCv2("TPC", "Default");
472     }
473
474
475     if (iTOF) {
476         //=================== TOF parameters ============================
477         AliTOF *TOF = new AliTOFv5T0("TOF", "normal TOF");
478     }
479
480
481     if (iRICH)
482     {
483         //=================== RICH parameters ===========================
484         AliRICH *RICH = new AliRICHv1("RICH", "normal RICH");
485
486     }
487
488
489     if (iZDC)
490     {
491         //=================== ZDC parameters ============================
492
493         AliZDC *ZDC = new AliZDCv2("ZDC", "normal ZDC");
494     }
495
496     if (iTRD)
497     {
498         //=================== TRD parameters ============================
499
500         AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
501
502         // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
503         TRD->SetGasMix(1);
504         // Switch on TR
505         AliTRDsim *TRDsim = TRD->CreateTR();
506     }
507
508     if (iFMD)
509     {
510         //=================== FMD parameters ============================
511         AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
512    }
513
514     if (iMUON)
515     {
516         //=================== MUON parameters ===========================
517         // New MUONv1 version (geometry defined via builders)
518         AliMUON *MUON = new AliMUONv1("MUON", "default");
519     }
520     //=================== PHOS parameters ===========================
521
522     if (iPHOS)
523     {
524         AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
525     }
526
527
528     if (iPMD)
529     {
530         //=================== PMD parameters ============================
531         AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
532     }
533
534     if (iSTART)
535     {
536         //=================== START parameters ============================
537         AliSTART *START = new AliSTARTv1("START", "START Detector");
538     }
539
540     if (iEMCAL)
541     {
542         //=================== EMCAL parameters ============================
543         AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "SHISH");
544     }
545
546      if (iCRT)
547     {
548         //=================== CRT parameters ============================
549         AliCRT *CRT = new AliCRTv0("CRT", "normal ACORDE");
550     }
551
552      if (iVZERO)
553     {
554         //=================== CRT parameters ============================
555         AliVZERO *VZERO = new AliVZEROv6("VZERO", "normal VZERO");
556     }
557 }
558 //
559 //           PYTHIA
560 //
561 AliGenPythia *PythiaHVQ(PDC06Proc_t proc) {
562 //*******************************************************************//
563 // Configuration file for charm / beauty generation with PYTHIA      //
564 //                                                                   //
565 // The parameters have been tuned in order to reproduce the inclusive//
566 // heavy quark pt distribution given by the NLO pQCD calculation by  //
567 // Mangano, Nason and Ridolfi.                                       //
568 //                                                                   //
569 // For details and for the NORMALIZATION of the yields see:          //
570 //   N.Carrer and A.Dainese,                                         //
571 //   "Charm and beauty production at the LHC",                       //
572 //   ALICE-INT-2003-019, [arXiv:hep-ph/0311225];                     //
573 //   PPR Chapter 6.6, CERN/LHCC 2005-030 (2005).                     //
574 //*******************************************************************//
575   AliGenPythia * gener = 0x0;
576
577   switch(proc) {
578   case kCharmPbPb5500:
579       comment = comment.Append(" Charm in Pb-Pb at 5.5 TeV");
580       gener = new AliGenPythia(nEvts);
581       gener->SetProcess(kPyCharmPbPbMNR);
582       gener->SetStrucFunc(kCTEQ4L);
583       gener->SetPtHard(2.1,-1.0);
584       gener->SetEnergyCMS(5500.);
585       gener->SetNuclei(208,208);
586       break;
587   case kCharmpPb8800:
588       comment = comment.Append(" Charm in p-Pb at 8.8 TeV");
589       gener = new AliGenPythia(nEvts);
590       gener->SetProcess(kPyCharmpPbMNR);
591       gener->SetStrucFunc(kCTEQ4L);
592       gener->SetPtHard(2.1,-1.0);
593       gener->SetEnergyCMS(8800.);
594       gener->SetProjectile("P",1,1);
595       gener->SetTarget("Pb",208,82);
596       break;
597   case kCharmpp14000:
598       comment = comment.Append(" Charm in pp at 14 TeV");
599       gener = new AliGenPythia(nEvts);
600       gener->SetProcess(kPyCharmppMNR);
601       gener->SetStrucFunc(kCTEQ4L);
602       gener->SetPtHard(2.1,-1.0);
603       gener->SetEnergyCMS(14000.);
604       break;
605   case kCharmpp14000wmi:
606       comment = comment.Append(" Charm in pp at 14 TeV with mult. interactions");
607       gener = new AliGenPythia(-1);
608       gener->SetProcess(kPyCharmppMNRwmi);
609       gener->SetStrucFunc(kCTEQ5L);
610       gener->SetPtHard(ptHardMin,ptHardMax);
611       gener->SetEnergyCMS(14000.);
612       break;
613   case kD0PbPb5500:
614       comment = comment.Append(" D0 in Pb-Pb at 5.5 TeV");
615       gener = new AliGenPythia(nEvts);
616       gener->SetProcess(kPyD0PbPbMNR);
617       gener->SetStrucFunc(kCTEQ4L);
618       gener->SetPtHard(2.1,-1.0);
619       gener->SetEnergyCMS(5500.);
620       gener->SetNuclei(208,208);
621       break;
622   case kD0pPb8800:
623       comment = comment.Append(" D0 in p-Pb at 8.8 TeV");
624       gener = new AliGenPythia(nEvts);
625       gener->SetProcess(kPyD0pPbMNR);
626       gener->SetStrucFunc(kCTEQ4L);
627       gener->SetPtHard(2.1,-1.0);
628       gener->SetEnergyCMS(8800.);
629       gener->SetProjectile("P",1,1);
630       gener->SetTarget("Pb",208,82);
631       break;
632   case kD0pp14000:
633       comment = comment.Append(" D0 in pp at 14 TeV");
634       gener = new AliGenPythia(nEvts);
635       gener->SetProcess(kPyD0ppMNR);
636       gener->SetStrucFunc(kCTEQ4L);
637       gener->SetPtHard(2.1,-1.0);
638       gener->SetEnergyCMS(14000.);
639       break;
640   case kDPlusPbPb5500:
641       comment = comment.Append(" DPlus in Pb-Pb at 5.5 TeV");
642       gener = new AliGenPythia(nEvts);
643       gener->SetProcess(kPyDPlusPbPbMNR);
644       gener->SetStrucFunc(kCTEQ4L);
645       gener->SetPtHard(2.1,-1.0);
646       gener->SetEnergyCMS(5500.);
647       gener->SetNuclei(208,208);
648       break;
649   case kDPluspPb8800:
650       comment = comment.Append(" DPlus in p-Pb at 8.8 TeV");
651       gener = new AliGenPythia(nEvts);
652       gener->SetProcess(kPyDPluspPbMNR);
653       gener->SetStrucFunc(kCTEQ4L);
654       gener->SetPtHard(2.1,-1.0);
655       gener->SetEnergyCMS(8800.);
656       gener->SetProjectile("P",1,1);
657       gener->SetTarget("Pb",208,82);
658       break;
659   case kDPluspp14000:
660       comment = comment.Append(" DPlus in pp at 14 TeV");
661       gener = new AliGenPythia(nEvts);
662       gener->SetProcess(kPyDPlusppMNR);
663       gener->SetStrucFunc(kCTEQ4L);
664       gener->SetPtHard(2.1,-1.0);
665       gener->SetEnergyCMS(14000.);
666       break;
667   case kBeautyPbPb5500:
668       comment = comment.Append(" Beauty in Pb-Pb at 5.5 TeV");
669       gener = new AliGenPythia(nEvts);
670       gener->SetProcess(kPyBeautyPbPbMNR);
671       gener->SetStrucFunc(kCTEQ4L);
672       gener->SetPtHard(2.75,-1.0);
673       gener->SetEnergyCMS(5500.);
674       gener->SetNuclei(208,208);
675       break;
676   case kBeautypPb8800:
677       comment = comment.Append(" Beauty in p-Pb at 8.8 TeV");
678       gener = new AliGenPythia(nEvts);
679       gener->SetProcess(kPyBeautypPbMNR);
680       gener->SetStrucFunc(kCTEQ4L);
681       gener->SetPtHard(2.75,-1.0);
682       gener->SetEnergyCMS(8800.);
683       gener->SetProjectile("P",1,1);
684       gener->SetTarget("Pb",208,82);
685       break;
686   case kBeautypp14000:
687       comment = comment.Append(" Beauty in pp at 14 TeV");
688       gener = new AliGenPythia(nEvts);
689       gener->SetProcess(kPyBeautyppMNR);
690       gener->SetStrucFunc(kCTEQ4L);
691       gener->SetPtHard(2.75,-1.0);
692       gener->SetEnergyCMS(14000.);
693       break;
694   case kBeautypp14000wmi:
695       comment = comment.Append(" Beauty in pp at 14 TeV with mult. interactions");
696       gener = new AliGenPythia(-1);
697       gener->SetProcess(kPyBeautyppMNRwmi);
698       gener->SetStrucFunc(kCTEQ5L);
699       gener->SetPtHard(ptHardMin,ptHardMax);
700       gener->SetEnergyCMS(14000.);
701       break;
702   }
703
704   return gener;
705 }
706
707 AliGenerator* MbCocktail()
708 {
709       comment = comment.Append(" pp at 14 TeV: Pythia low-pt, no heavy quarks + J/Psi from parameterisation");
710       AliGenCocktail * gener = new AliGenCocktail();
711       gener->UsePerEventRates();
712  
713 //
714 //    Pythia
715       AliGenPythia* pythia = new AliGenPythia(-1); 
716       pythia->SetMomentumRange(0, 999999.);
717       pythia->SetThetaRange(0., 180.);
718       pythia->SetYRange(-12.,12.);
719       pythia->SetPtRange(0,1000.);
720       pythia->SetProcess(kPyMb);
721       pythia->SetEnergyCMS(14000.);
722       pythia->SwitchHFOff();
723       
724 //
725 //   J/Psi parameterisation
726
727       AliGenParam* jpsi = new AliGenParam(1, AliGenMUONlib::kJpsi, "CDF scaled", "Jpsi");
728       jpsi->SetPtRange(0.,100.);
729       jpsi->SetYRange(-8., 8.);
730       jpsi->SetPhiRange(0., 360.);
731       jpsi->SetForceDecay(kAll);
732 //
733 //        
734       gener->AddGenerator(pythia, "Pythia", 1.);
735       gener->AddGenerator(jpsi,   "J/Psi", 8.e-4);      
736       
737       return gener;
738 }
739
740 AliGenerator* PyMbTriggered(Int_t pdg)
741 {
742     AliGenPythia* pythia = new AliGenPythia(-1); 
743     pythia->SetMomentumRange(0, 999999.);
744     pythia->SetThetaRange(0., 180.);
745     pythia->SetYRange(-12.,12.);
746     pythia->SetPtRange(0,1000.);
747     pythia->SetProcess(kPyMb);
748     pythia->SetEnergyCMS(14000.);
749     pythia->SetTriggerParticle(pdg, 0.9);
750     return pythia;
751 }
752
753 void ProcessEnvironmentVars()
754 {
755     // Run type
756     if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
757       for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
758         if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
759           proc = (PDC06Proc_t)iRun;
760           cout<<"Run type set to "<<pprRunName[iRun]<<endl;
761         }
762       }
763     }
764
765     // Random Number seed
766     if (gSystem->Getenv("CONFIG_SEED")) {
767       seed = atoi(gSystem->Getenv("CONFIG_SEED"));
768     }
769 }
770
771
772