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