]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/PHOSTasks/PHOS_embedding/Config.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / PHOS_embedding / Config.C
1 //
2 // Configuration for the first physics production 2008
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.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 "STEER/AliRunLoader.h"
19 #include "STEER/AliRun.h"
20 #include "STEER/AliConfig.h"
21 #include "PYTHIA6/AliDecayerPythia.h"
22 #include "PYTHIA6/AliGenPythia.h"
23 #include "TDPMjet/AliGenDPMjet.h"
24 #include "STEER/AliMagFCheb.h"
25 #include "STRUCT/AliBODY.h"
26 #include "STRUCT/AliMAG.h"
27 #include "STRUCT/AliABSOv3.h"
28 #include "STRUCT/AliDIPOv3.h"
29 #include "STRUCT/AliHALLv3.h"
30 #include "STRUCT/AliFRAMEv2.h"
31 #include "STRUCT/AliSHILv3.h"
32 #include "STRUCT/AliPIPEv3.h"
33 #include "ITS/AliITSv11Hybrid.h"
34 #include "TPC/AliTPCv2.h"
35 #include "TOF/AliTOFv6T0.h"
36 #include "HMPID/AliHMPIDv3.h"
37 #include "ZDC/AliZDCv3.h"
38 #include "TRD/AliTRDv1.h"
39 #include "TRD/AliTRDgeometry.h"
40 #include "FMD/AliFMDv1.h"
41 #include "MUON/AliMUONv1.h"
42 #include "PHOS/AliPHOSv1.h"
43 #include "PHOS/AliPHOSSimParam.h"
44 #include "PMD/AliPMDv1.h"
45 #include "T0/AliT0v1.h"
46 #include "EMCAL/AliEMCALv2.h"
47 #include "ACORDE/AliACORDEv1.h"
48 #include "VZERO/AliVZEROv7.h"
49 #endif
50
51
52 enum PDC06Proc_t 
53 {
54   kPythia6, kPythia6D6T, kPythia6ATLAS, kPythia6ATLAS_Flat, kPythiaPerugia0, kPhojet, kRunMax
55 };
56
57 const char * pprRunName[] = {
58   "kPythia6", "kPythia6D6T", "kPythia6ATLAS", "kPythia6ATLAS_Flat", "kPythiaPerugia0", "kPhojet" 
59 };
60
61 enum Mag_t
62 {
63   kNoField, k5kG, kFieldMax
64 };
65
66 const char * pprField[] = {
67   "kNoField", "k5kG"
68 };
69
70 //--- Functions ---
71 class AliGenPythia;
72 AliGenerator *MbPythia();
73 AliGenerator *MbPythiaTuneD6T();
74 AliGenerator *MbPhojet();
75 void ProcessEnvironmentVars();
76
77 // Geterator, field, beam energy
78 static PDC06Proc_t   proc     = kPhojet;
79 static Mag_t         mag      = k5kG;
80 static Float_t       energy   = 10000; // energy in CMS
81 static Int_t         runNumber = 0;
82
83 //========================//
84 // Set Random Number seed //
85 //========================//
86 TDatime dt;
87 static UInt_t seed    = dt.Get();
88
89 // Comment line
90 static TString comment;
91
92 void Config()
93 {
94     
95
96   // Get settings from environment variables
97   ProcessEnvironmentVars();
98
99   gRandom->SetSeed(seed);
100   cerr<<"Seed for random number generation= "<<seed<<endl; 
101
102   // Libraries required by geant321
103 #if defined(__CINT__)
104   gSystem->Load("liblhapdf");      // Parton density functions
105   gSystem->Load("libEGPythia6");   // TGenerator interface
106   if (proc == kPythia6 || proc == kPhojet) {
107     gSystem->Load("libpythia6");        // Pythia 6.2
108   } else {
109     gSystem->Load("libpythia6.4.21");   // Pythia 6.4
110   }
111   gSystem->Load("libAliPythia6");  // ALICE specific implementations
112   gSystem->Load("libgeant321");
113 #endif
114
115   new TGeant3TGeo("C++ Interface to Geant3");
116
117   //=======================================================================
118   //  Create the output file
119
120    
121   AliRunLoader* rl=0x0;
122
123   cout<<"Config.C: Creating Run Loader ..."<<endl;
124   rl = AliRunLoader::Open("galice.root",
125                           AliConfig::GetDefaultEventFolderName(),
126                           "recreate");
127   if (rl == 0x0)
128     {
129       gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
130       return;
131     }
132   rl->SetCompressionLevel(2);
133   rl->SetNumberOfEventsPerFile(3000);
134   gAlice->SetRunLoader(rl);
135   // gAlice->SetGeometryFromFile("geometry.root");
136   // gAlice->SetGeometryFromCDB();
137   
138   // Set the trigger configuration: proton-proton
139  // gAlice->SetTriggerDescriptor("p-p");
140
141   //
142   //=======================================================================
143   // ************* STEERING parameters FOR ALICE SIMULATION **************
144   // --- Specify event type to be tracked through the ALICE setup
145   // --- All positions are in cm, angles in degrees, and P and E in GeV
146
147
148     gMC->SetProcess("DCAY",1);
149     gMC->SetProcess("PAIR",1);
150     gMC->SetProcess("COMP",1);
151     gMC->SetProcess("PHOT",1);
152     gMC->SetProcess("PFIS",0);
153     gMC->SetProcess("DRAY",0);
154     gMC->SetProcess("ANNI",1);
155     gMC->SetProcess("BREM",1);
156     gMC->SetProcess("MUNU",1);
157     gMC->SetProcess("CKOV",1);
158     gMC->SetProcess("HADR",1);
159     gMC->SetProcess("LOSS",2);
160     gMC->SetProcess("MULS",1);
161     gMC->SetProcess("RAYL",1);
162
163     Float_t cut = 1.e-3;        // 1MeV cut by default
164     Float_t tofmax = 1.e10;
165
166     gMC->SetCut("CUTGAM", cut);
167     gMC->SetCut("CUTELE", cut);
168     gMC->SetCut("CUTNEU", cut);
169     gMC->SetCut("CUTHAD", cut);
170     gMC->SetCut("CUTMUO", cut);
171     gMC->SetCut("BCUTE",  cut); 
172     gMC->SetCut("BCUTM",  cut); 
173     gMC->SetCut("DCUTE",  cut); 
174     gMC->SetCut("DCUTM",  cut); 
175     gMC->SetCut("PPCUTM", cut);
176     gMC->SetCut("TOFMAX", tofmax); 
177
178
179
180
181   //======================//
182   // Set External decayer //
183   //======================//
184   TVirtualMCDecayer* decayer = new AliDecayerPythia();
185   decayer->SetForceDecay(kAll);
186   decayer->Init();
187   gMC->SetExternalDecayer(decayer);
188
189   //=========================//
190   // Generator Configuration //
191   //=========================//
192 /*
193   AliGenerator* gener = 0x0;
194   
195   if (proc == kPythia6) {
196       gener = MbPythia();
197   } else if (proc == kPythia6D6T) {
198       gener = MbPythiaTuneD6T();
199   } else if (proc == kPythia6ATLAS) {
200       gener = MbPythiaTuneATLAS();
201   } else if (proc == kPythiaPerugia0) {
202       gener = MbPythiaTunePerugia0();
203   } else if (proc == kPythia6ATLAS_Flat) {
204       gener = MbPythiaTuneATLAS_Flat();
205   } else if (proc == kPhojet) {
206       gener = MbPhojet();
207   }
208 */  
209
210 printf("Creating Hagedorn generator \n") ;
211    AliGenCocktail *gener  = new AliGenCocktail();
212
213     myIp * my = new myIp(111) ;
214
215
216    AliGenPHOSlib * lib = new AliGenPHOSlib() ;
217    //2pi0
218    AliGenParam *genPHOS = new AliGenParam(1,AliGenPHOSlib::kPion, my->GetPt(AliGenPHOSlib::kPion, ""),
219                                             lib->GetY(AliGenPHOSlib::kPi0Flat),
220                                             my->GetV2(AliGenPHOSlib::kPi0Flat,""),
221                                             my->GetIp(AliGenPHOSlib::kPi0)) ;
222    genPHOS->SetPhiRange(260.,320.) ;
223    genPHOS->SetYRange(-0.125.,0.125) ;
224    genPHOS->SetPtRange(1.,10.) ; 
225 //   genPHOS->SetPtRange(2.,10.) ; 
226    genPHOS->SetForceDecay(kNoDecay);
227    gener->AddGenerator(genPHOS,"PHOS",1.) ;
228
229
230 /*
231 printf("Creating FLAT generator \n") ;
232
233    gener = new AliGenBox(1) ;
234    gener->SetPhiRange(250.,330.) ;
235    gener->SetYRange(-0.15.,0.15) ;
236    gener->SetPtRange(0.5,30.) ;
237    gener->SetPart(111) ;
238
239 */
240   //
241   //
242   // Size of the interaction diamond
243   // Longitudinal
244   Float_t sigmaz  = 5.4 / TMath::Sqrt(2.); // [cm]
245   if (energy == 900)
246     //sigmaz  = 10.5 / TMath::Sqrt(2.); // [cm]
247     //sigmaz = 3.7;
248   if (energy == 7000)
249     sigmaz  = 6.3 / TMath::Sqrt(2.); // [cm]
250   
251   //
252   // Transverse
253   // beta*
254   Float_t betast  = 10.;                 // beta* [m]
255   if (runNumber >= 117048) betast = 2.;
256   printf("beta* for run# %8d is %13.3f", runNumber, betast);
257   //
258   Float_t eps     = 3.75e-6;            // emittance [m]
259   Float_t gamma   = energy / 2.0 / 0.938272;  // relativistic gamma [1]
260   Float_t sigmaxy = TMath::Sqrt(eps * betast / gamma) / TMath::Sqrt(2.) * 100.;  // [cm]
261   printf("\n \n Diamond size x-y: %10.3e z: %10.3e\n \n", sigmaxy, sigmaz);
262     
263   gener->SetSigma(sigmaxy, sigmaxy, sigmaz);      // Sigma in (X,Y,Z) (cm) on IP position
264   gener->SetVertexSmear(kPerEvent);
265   gener->Init();
266
267   printf("\n \n Comment: %s \n \n", comment.Data());
268
269   rl->CdGAFile();
270   
271   Int_t iABSO  = 1;
272   Int_t iACORDE= 0;
273   Int_t iDIPO  = 1;
274   Int_t iEMCAL = 1;
275   Int_t iFMD   = 1;
276   Int_t iFRAME = 1;
277   Int_t iHALL  = 1;
278   Int_t iITS   = 1;
279   Int_t iMAG   = 1;
280   Int_t iMUON  = 1;
281   Int_t iPHOS  = 1;
282   Int_t iPIPE  = 1;
283   Int_t iPMD   = 1;
284   Int_t iHMPID = 1;
285   Int_t iSHIL  = 1;
286   Int_t iT0    = 1;
287   Int_t iTOF   = 1;
288   Int_t iTPC   = 1;
289   Int_t iTRD   = 1;
290   Int_t iVZERO = 1;
291   Int_t iZDC   = 1;
292   
293
294     //=================== Alice BODY parameters =============================
295     AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
296
297
298     if (iMAG)
299     {
300         //=================== MAG parameters ============================
301         // --- Start with Magnet since detector layouts may be depending ---
302         // --- on the selected Magnet dimensions ---
303         AliMAG *MAG = new AliMAG("MAG", "Magnet");
304     }
305
306
307     if (iABSO)
308     {
309         //=================== ABSO parameters ============================
310         AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
311     }
312
313     if (iDIPO)
314     {
315         //=================== DIPO parameters ============================
316
317         AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
318     }
319
320     if (iHALL)
321     {
322         //=================== HALL parameters ============================
323
324         AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
325     }
326
327
328     if (iFRAME)
329     {
330         //=================== FRAME parameters ============================
331
332         AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
333         FRAME->SetHoles(1);
334     }
335
336     if (iSHIL)
337     {
338         //=================== SHIL parameters ============================
339
340         AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
341     }
342
343
344     if (iPIPE)
345     {
346         //=================== PIPE parameters ============================
347
348         AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
349     }
350  
351     if (iITS)
352     {
353         //=================== ITS parameters ============================
354
355        AliITS *ITS  = new AliITSv11("ITS","ITS v11");
356     }
357
358     if (iTPC)
359     {
360       //============================ TPC parameters =====================
361
362         AliTPC *TPC = new AliTPCv2("TPC", "Default");
363     }
364
365
366     if (iTOF) {
367         //=================== TOF parameters ============================
368
369         AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
370     }
371
372
373     if (iHMPID)
374     {
375         //=================== HMPID parameters ===========================
376
377         AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
378
379     }
380
381
382     if (iZDC)
383     {
384         //=================== ZDC parameters ============================
385
386         AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
387     }
388
389     if (iTRD)
390     {
391         //=================== TRD parameters ============================
392
393         AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
394         AliTRDgeometry *geoTRD = TRD->GetGeometry();
395         // Partial geometry: modules at 0,1,7,8,9,16,17
396         // starting at 3h in positive direction
397         geoTRD->SetSMstatus(2,0);
398         geoTRD->SetSMstatus(3,0);
399         geoTRD->SetSMstatus(4,0);
400         geoTRD->SetSMstatus(5,0);
401         geoTRD->SetSMstatus(6,0);
402         geoTRD->SetSMstatus(11,0);
403         geoTRD->SetSMstatus(12,0);
404         geoTRD->SetSMstatus(13,0);
405         geoTRD->SetSMstatus(14,0);
406         geoTRD->SetSMstatus(15,0);
407         geoTRD->SetSMstatus(16,0);
408     }
409
410     if (iFMD)
411     {
412         //=================== FMD parameters ============================
413
414         AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
415    }
416
417     if (iMUON)
418     {
419         //=================== MUON parameters ===========================
420         // New MUONv1 version (geometry defined via builders)
421
422         AliMUON *MUON = new AliMUONv1("MUON", "default");
423         
424         // activate trigger efficiency by cells
425
426         MUON->SetTriggerEffCells(1);     
427
428      }
429
430     if (iPHOS)
431     {
432         //=================== PHOS parameters ===========================
433
434      AliPHOS *PHOS = new AliPHOSv1("PHOS", "noCPV_Modules123");
435
436     }
437
438
439     if (iPMD)
440     {
441         //=================== PMD parameters ============================
442
443         AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
444     }
445
446     if (iT0)
447     {
448         //=================== T0 parameters ============================
449         AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
450     }
451
452     if (iEMCAL)
453     {
454         //=================== EMCAL parameters ============================
455
456         AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_FIRSTYEAR");
457     }
458
459      if (iACORDE)
460     {
461         //=================== ACORDE parameters ============================
462
463         AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
464     }
465
466      if (iVZERO)
467     {
468         //=================== ACORDE parameters ============================
469
470         AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
471     }
472 }
473 //
474 //           PYTHIA
475 //
476
477 AliGenerator* MbPythia()
478 {
479       comment = comment.Append(" pp: Pythia low-pt");
480 //
481 //    Pythia
482       AliGenPythia* pythia = new AliGenPythia(-1); 
483       pythia->SetMomentumRange(0, 999999.);
484       pythia->SetThetaRange(0., 180.);
485       pythia->SetYRange(-12.,12.);
486       pythia->SetPtRange(0,1000.);
487       pythia->SetProcess(kPyMb);
488       pythia->SetEnergyCMS(energy);
489       
490       return pythia;
491 }
492
493 AliGenerator* MbPythiaTuneD6T()
494 {
495       comment = comment.Append(" pp: Pythia low-pt");
496 //
497 //    Pythia
498       AliGenPythia* pythia = new AliGenPythia(-1); 
499       pythia->SetMomentumRange(0, 999999.);
500       pythia->SetThetaRange(0., 180.);
501       pythia->SetYRange(-12.,12.);
502       pythia->SetPtRange(0,1000.);
503       pythia->SetProcess(kPyMb);
504       pythia->SetEnergyCMS(energy);
505 //    Tune
506 //    109     D6T : Rick Field's CDF Tune D6T (NB: needs CTEQ6L pdfs externally)
507       pythia->SetTune(109); // F I X 
508       pythia->SetStrucFunc(kCTEQ6l);
509 //
510       return pythia;
511 }
512
513 AliGenerator* MbPythiaTunePerugia0()
514 {
515       comment = comment.Append(" pp: Pythia low-pt (Perugia0)");
516 //
517 //    Pythia
518       AliGenPythia* pythia = new AliGenPythia(-1); 
519       pythia->SetMomentumRange(0, 999999.);
520       pythia->SetThetaRange(0., 180.);
521       pythia->SetYRange(-12.,12.);
522       pythia->SetPtRange(0,1000.);
523       pythia->SetProcess(kPyMb);
524       pythia->SetEnergyCMS(energy);
525 //    Tune
526 //    320     Perugia 0
527       pythia->SetTune(320); 
528       pythia->UseNewMultipleInteractionsScenario();
529 //
530       return pythia;
531 }
532
533
534 AliGenerator* MbPythiaTuneATLAS()
535 {
536       comment = comment.Append(" pp: Pythia low-pt");
537 //
538 //    Pythia
539       AliGenPythia* pythia = new AliGenPythia(-1); 
540       pythia->SetMomentumRange(0, 999999.);
541       pythia->SetThetaRange(0., 180.);
542       pythia->SetYRange(-12.,12.);
543       pythia->SetPtRange(0,1000.);
544       pythia->SetProcess(kPyMb);
545       pythia->SetEnergyCMS(energy);
546 //    Tune
547 //    C   306 ATLAS-CSC: Arthur Moraes' (new) ATLAS tune (needs CTEQ6L externally)
548       pythia->SetTune(306);
549       pythia->SetStrucFunc(kCTEQ6l);
550 //
551       return pythia;
552 }
553
554 AliGenerator* MbPythiaTuneATLAS_Flat()
555 {
556       AliGenPythia* pythia = MbPythiaTuneATLAS();
557       
558       comment = comment.Append("; flat multiplicity distribution");
559       
560       // set high multiplicity trigger
561       // this weight achieves a flat multiplicity distribution
562       TH1 *weight = new TH1D("weight","weight",201,-0.5,200.5);
563       weight->SetBinContent(1,5.49443);
564       weight->SetBinContent(2,8.770816);
565       weight->SetBinContent(6,0.4568624);
566       weight->SetBinContent(7,0.2919915);
567       weight->SetBinContent(8,0.6674189);
568       weight->SetBinContent(9,0.364737);
569       weight->SetBinContent(10,0.8818444);
570       weight->SetBinContent(11,0.531885);
571       weight->SetBinContent(12,1.035197);
572       weight->SetBinContent(13,0.9394057);
573       weight->SetBinContent(14,0.9643193);
574       weight->SetBinContent(15,0.94543);
575       weight->SetBinContent(16,0.9426507);
576       weight->SetBinContent(17,0.9423649);
577       weight->SetBinContent(18,0.789456);
578       weight->SetBinContent(19,1.149026);
579       weight->SetBinContent(20,1.100491);
580       weight->SetBinContent(21,0.6350525);
581       weight->SetBinContent(22,1.351941);
582       weight->SetBinContent(23,0.03233504);
583       weight->SetBinContent(24,0.9574557);
584       weight->SetBinContent(25,0.868133);
585       weight->SetBinContent(26,1.030998);
586       weight->SetBinContent(27,1.08897);
587       weight->SetBinContent(28,1.251382);
588       weight->SetBinContent(29,0.1391099);
589       weight->SetBinContent(30,1.192876);
590       weight->SetBinContent(31,0.448944);
591       weight->SetBinContent(32,1);
592       weight->SetBinContent(33,1);
593       weight->SetBinContent(34,1);
594       weight->SetBinContent(35,1);
595       weight->SetBinContent(36,0.9999997);
596       weight->SetBinContent(37,0.9999997);
597       weight->SetBinContent(38,0.9999996);
598       weight->SetBinContent(39,0.9999996);
599       weight->SetBinContent(40,0.9999995);
600       weight->SetBinContent(41,0.9999993);
601       weight->SetBinContent(42,1);
602       weight->SetBinContent(43,1);
603       weight->SetBinContent(44,1);
604       weight->SetBinContent(45,1);
605       weight->SetBinContent(46,1);
606       weight->SetBinContent(47,0.9999999);
607       weight->SetBinContent(48,0.9999998);
608       weight->SetBinContent(49,0.9999998);
609       weight->SetBinContent(50,0.9999999);
610       weight->SetBinContent(51,0.9999999);
611       weight->SetBinContent(52,0.9999999);
612       weight->SetBinContent(53,0.9999999);
613       weight->SetBinContent(54,0.9999998);
614       weight->SetBinContent(55,0.9999998);
615       weight->SetBinContent(56,0.9999998);
616       weight->SetBinContent(57,0.9999997);
617       weight->SetBinContent(58,0.9999996);
618       weight->SetBinContent(59,0.9999995);
619       weight->SetBinContent(60,1);
620       weight->SetBinContent(61,1);
621       weight->SetBinContent(62,1);
622       weight->SetBinContent(63,1);
623       weight->SetBinContent(64,1);
624       weight->SetBinContent(65,0.9999999);
625       weight->SetBinContent(66,0.9999998);
626       weight->SetBinContent(67,0.9999998);
627       weight->SetBinContent(68,0.9999999);
628       weight->SetBinContent(69,1);
629       weight->SetBinContent(70,1);
630       weight->SetBinContent(71,0.9999997);
631       weight->SetBinContent(72,0.9999995);
632       weight->SetBinContent(73,0.9999994);
633       weight->SetBinContent(74,1);
634       weight->SetBinContent(75,1);
635       weight->SetBinContent(76,1);
636       weight->SetBinContent(77,1);
637       weight->SetBinContent(78,0.9999999);
638       weight->SetBinContent(79,1);
639       weight->SetBinContent(80,1);
640       weight->SetEntries(526);
641         
642       Int_t limit = weight->GetRandom();
643       pythia->SetTriggerChargedMultiplicity(limit, 1.4);
644       
645       comment = comment.Append(Form("; multiplicity threshold set to %d in |eta| < 1.4", limit));
646
647       return pythia;
648 }
649
650 AliGenerator* MbPhojet()
651 {
652       comment = comment.Append(" pp: Pythia low-pt");
653 //
654 //    DPMJET
655 #if defined(__CINT__)
656   gSystem->Load("libdpmjet");      // Parton density functions
657   gSystem->Load("libTDPMjet");      // Parton density functions
658 #endif
659       AliGenDPMjet* dpmjet = new AliGenDPMjet(-1); 
660       dpmjet->SetMomentumRange(0, 999999.);
661       dpmjet->SetThetaRange(0., 180.);
662       dpmjet->SetYRange(-12.,12.);
663       dpmjet->SetPtRange(0,1000.);
664       dpmjet->SetProcess(kDpmMb);
665       dpmjet->SetEnergyCMS(energy);
666
667       return dpmjet;
668 }
669
670 void ProcessEnvironmentVars()
671 {
672     // Run type
673     if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
674       for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
675         if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
676           proc = (PDC06Proc_t)iRun;
677           cout<<"Run type set to "<<pprRunName[iRun]<<endl;
678         }
679       }
680     }
681
682     // Field
683     if (gSystem->Getenv("CONFIG_FIELD")) {
684       for (Int_t iField = 0; iField < kFieldMax; iField++) {
685         if (strcmp(gSystem->Getenv("CONFIG_FIELD"), pprField[iField])==0) {
686           mag = (Mag_t)iField;
687           cout<<"Field set to "<<pprField[iField]<<endl;
688         }
689       }
690     }
691
692     // Energy
693     if (gSystem->Getenv("CONFIG_ENERGY")) {
694       energy = atoi(gSystem->Getenv("CONFIG_ENERGY"));
695       cout<<"Energy set to "<<energy<<" GeV"<<endl;
696     }
697
698     // Random Number seed
699     if (gSystem->Getenv("CONFIG_SEED")) {
700       seed = atoi(gSystem->Getenv("CONFIG_SEED"));
701     }
702
703     // Run number
704     if (gSystem->Getenv("DC_RUN")) {
705       runNumber = atoi(gSystem->Getenv("DC_RUN"));
706     }
707 }