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