Corrected library names and paths to macros
[u/mrichter/AliRoot.git] / test / vmctest / production / Config.C
CommitLineData
ba2958c4 1// $Id$
b2b18d9e 2//
ba2958c4 3// Configuration for the Geant4 production 2010
4// By E. Sicking, CERN
b2b18d9e 5//
6
b2b18d9e 7#if !defined(__CINT__) || defined(__MAKECINT__)
8#include <Riostream.h>
3d1b694f 9#include <TRandom.h>
b2b18d9e 10#include <TDatime.h>
11#include <TSystem.h>
12#include <TVirtualMC.h>
13#include <TGeant3TGeo.h>
14#include "STEER/AliRunLoader.h"
15#include "STEER/AliRun.h"
16#include "STEER/AliConfig.h"
17#include "PYTHIA6/AliDecayerPythia.h"
18#include "PYTHIA6/AliGenPythia.h"
19#include "TDPMjet/AliGenDPMjet.h"
20#include "STEER/AliMagFCheb.h"
21#include "STRUCT/AliBODY.h"
22#include "STRUCT/AliMAG.h"
23#include "STRUCT/AliABSOv3.h"
24#include "STRUCT/AliDIPOv3.h"
25#include "STRUCT/AliHALLv3.h"
26#include "STRUCT/AliFRAMEv2.h"
27#include "STRUCT/AliSHILv3.h"
28#include "STRUCT/AliPIPEv3.h"
07787d1d 29#include "ITS/AliITSv11.h"
b2b18d9e 30#include "TPC/AliTPCv2.h"
31#include "TOF/AliTOFv6T0.h"
32#include "HMPID/AliHMPIDv3.h"
047922b1 33#include "ZDC/AliZDCv4.h"
b2b18d9e 34#include "TRD/AliTRDv1.h"
35#include "TRD/AliTRDgeometry.h"
36#include "FMD/AliFMDv1.h"
37#include "MUON/AliMUONv1.h"
38#include "PHOS/AliPHOSv1.h"
39#include "PHOS/AliPHOSSimParam.h"
40#include "PMD/AliPMDv1.h"
41#include "T0/AliT0v1.h"
42#include "EMCAL/AliEMCALv2.h"
43#include "ACORDE/AliACORDEv1.h"
44#include "VZERO/AliVZEROv7.h"
45#endif
46
47
48enum PDC06Proc_t
c462619f 49 {
50 kPythia6, kPythia6D6T, kPythia6ATLAS, kPythia6ATLAS_Flat, kPythiaPerugia0, kPhojet, kRunMax
51 };
b2b18d9e 52
53const char * pprRunName[] = {
c462619f 54 "kPythia6", "kPythia6D6T", "kPythia6ATLAS", "kPythia6ATLAS_Flat", "kPythiaPerugia0", "kPhojet"
b2b18d9e 55};
56
57enum Mag_t
c462619f 58 {
59 kNoField, k5kG, kFieldMax
60 };
b2b18d9e 61
62const char * pprField[] = {
63 "kNoField", "k5kG"
64};
65
66enum PhysicsList_t
c462619f 67 {
2e572f07 68 QGSP_BERT_EMV, CHIPS, QGSP_BERT_CHIPS, QGSP_FTFP_BERT, FTFP_BERT, FTFP_BERT_EMV,
69 QGSP_BERT_EMV_OPTICAL, CHIPS_OPTICAL, QGSP_BERT_CHIPS_OPTICAL, QGSP_FTFP_BERT_OPTICAL, FTFP_BERT_OPTICAL, FTFP_BERT_EMV_OPTICAL, kListMax
c462619f 70 };
b2b18d9e 71
72const char * physicsListName[] = {
2e572f07 73 "QGSP_BERT_EMV", "CHIPS", "QGSP_BERT_CHIPS", "QGSP_FTFP_BERT", "FTFP_BERT", "FTFP_BERT_EMV",
74 "QGSP_BERT_EMV_OPTICAL", "CHIPS_OPTICAL", "QGSP_BERT_CHIPS_OPTICAL", "QGSP_FTFP_BERT_OPTICAL", "FTFP_BERT_OPTICAL", "FTFP_BERT_EMV_OPTICAL",
b2b18d9e 75};
76
6b4f7fc0 77enum PprTrigConf_t
c462619f 78 {
6b4f7fc0 79 kDefaultPPTrig, kDefaultPbPbTrig
c462619f 80 };
6b4f7fc0 81
82const char * pprTrigConfName[] = {
c462619f 83 "p-p","Pb-Pb"
6b4f7fc0 84};
85
b2b18d9e 86//--- Functions ---
87class AliGenPythia;
88AliGenerator *MbPythia();
89AliGenerator *MbPythiaTuneD6T();
90AliGenerator *MbPhojet();
91void ProcessEnvironmentVars();
92
93// Geterator, field, beam energy
c462619f 94static PDC06Proc_t proc = kPhojet;
95static Mag_t mag = k5kG;
96static Float_t energy = 10000; // energy in CMS
97static Int_t runNumber = 0;
6b4f7fc0 98static PprTrigConf_t strig = kDefaultPPTrig; // default pp trigger configuration
c462619f 99static PhysicsList_t physicslist = QGSP_BERT_EMV;
6b4f7fc0 100
b2b18d9e 101//========================//
102// Set Random Number seed //
103//========================//
104TDatime dt;
105static UInt_t seed = dt.Get();
106
107// Comment line
108static TString comment;
109
110void Config()
111{
112
113
114 // Get settings from environment variables
115 ProcessEnvironmentVars();
116
117 gRandom->SetSeed(seed);
118 cerr<<"Seed for random number generation= "<<seed<<endl;
119
120 // Libraries required by geant321
121#if defined(__CINT__)
c462619f 122 gSystem->Load("liblhapdf"); // Parton density functions
123 gSystem->Load("libEGPythia6"); // TGenerator interface
b2b18d9e 124 if (proc == kPythia6 || proc == kPhojet) {
c462619f 125 gSystem->Load("libpythia6"); // Pythia 6.2
b2b18d9e 126 } else {
c462619f 127 gSystem->Load("libpythia6.4.21"); // Pythia 6.4
128 }
129 gSystem->Load("libAliPythia6"); // ALICE specific implementations
130 // gSystem->Load("libgeant321");
b2b18d9e 131#endif
132
c462619f 133 // new TGeant3TGeo("C++ Interface to Geant3");
b2b18d9e 134
135 //=======================================================================
136 // Create the output file
137
138
139 AliRunLoader* rl=0x0;
140
141 cout<<"Config.C: Creating Run Loader ..."<<endl;
142 rl = AliRunLoader::Open("galice.root",
143 AliConfig::GetDefaultEventFolderName(),
144 "recreate");
145 if (rl == 0x0)
146 {
147 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
148 return;
149 }
150 rl->SetCompressionLevel(2);
151 rl->SetNumberOfEventsPerFile(1000);
152 gAlice->SetRunLoader(rl);
153 // gAlice->SetGeometryFromFile("geometry.root");
154 // gAlice->SetGeometryFromCDB();
155
156 // Set the trigger configuration: proton-proton
c462619f 157
6b4f7fc0 158 AliSimulation::Instance()->SetTriggerConfig(pprTrigConfName[strig]);
c462619f 159 cout <<"Trigger configuration is set to "<<pprTrigConfName[strig]<<endl;
160
b2b18d9e 161
b2b18d9e 162 rl->CdGAFile();
163
164 Int_t iABSO = 1;
165 Int_t iACORDE= 0;
166 Int_t iDIPO = 1;
167 Int_t iEMCAL = 1;
168 Int_t iFMD = 1;
169 Int_t iFRAME = 1;
170 Int_t iHALL = 1;
171 Int_t iITS = 1;
172 Int_t iMAG = 1;
173 Int_t iMUON = 1;
174 Int_t iPHOS = 1;
175 Int_t iPIPE = 1;
176 Int_t iPMD = 1;
177 Int_t iHMPID = 1;
178 Int_t iSHIL = 1;
179 Int_t iT0 = 1;
180 Int_t iTOF = 1;
181 Int_t iTPC = 1;
182 Int_t iTRD = 1;
183 Int_t iVZERO = 1;
184 Int_t iZDC = 1;
185
186
c462619f 187 //=================== Alice BODY parameters =============================
188 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
b2b18d9e 189
190
c462619f 191 if (iMAG)
b2b18d9e 192 {
c462619f 193 //=================== MAG parameters ============================
194 // --- Start with Magnet since detector layouts may be depending ---
195 // --- on the selected Magnet dimensions ---
196 AliMAG *MAG = new AliMAG("MAG", "Magnet");
b2b18d9e 197 }
198
199
c462619f 200 if (iABSO)
b2b18d9e 201 {
c462619f 202 //=================== ABSO parameters ============================
203 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
b2b18d9e 204 }
205
c462619f 206 if (iDIPO)
b2b18d9e 207 {
c462619f 208 //=================== DIPO parameters ============================
b2b18d9e 209
c462619f 210 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
b2b18d9e 211 }
212
c462619f 213 if (iHALL)
b2b18d9e 214 {
c462619f 215 //=================== HALL parameters ============================
b2b18d9e 216
c462619f 217 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
b2b18d9e 218 }
219
220
c462619f 221 if (iFRAME)
b2b18d9e 222 {
c462619f 223 //=================== FRAME parameters ============================
b2b18d9e 224
c462619f 225 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
226 FRAME->SetHoles(1);
b2b18d9e 227 }
228
c462619f 229 if (iSHIL)
b2b18d9e 230 {
c462619f 231 //=================== SHIL parameters ============================
b2b18d9e 232
c462619f 233 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
b2b18d9e 234 }
235
236
c462619f 237 if (iPIPE)
b2b18d9e 238 {
c462619f 239 //=================== PIPE parameters ============================
b2b18d9e 240
c462619f 241 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
b2b18d9e 242 }
243
c462619f 244 if (iITS)
b2b18d9e 245 {
c462619f 246 //=================== ITS parameters ============================
b2b18d9e 247
e0956f2a 248 AliITS *ITS = new AliITSv11("ITS","ITS v11");
b2b18d9e 249 }
250
c462619f 251 if (iTPC)
b2b18d9e 252 {
253 //============================ TPC parameters =====================
254
c462619f 255 AliTPC *TPC = new AliTPCv2("TPC", "Default");
256 TPC->SetPrimaryIonisation();// not used with Geant3
b2b18d9e 257 }
258
259
c462619f 260 if (iTOF) {
261 //=================== TOF parameters ============================
b2b18d9e 262
c462619f 263 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
264 }
b2b18d9e 265
266
c462619f 267 if (iHMPID)
b2b18d9e 268 {
c462619f 269 //=================== HMPID parameters ===========================
b2b18d9e 270
c462619f 271 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
b2b18d9e 272
273 }
274
275
c462619f 276 if (iZDC)
b2b18d9e 277 {
c462619f 278 //=================== ZDC parameters ============================
279
047922b1 280 AliZDC *ZDC = new AliZDCv4("ZDC", "normal ZDC");
c462619f 281 //Collimators aperture
282 ZDC->SetVCollSideCAperture(0.85);
283 ZDC->SetVCollSideCCentre(0.);
284 ZDC->SetVCollSideAAperture(0.75);
285 ZDC->SetVCollSideACentre(0.);
286 //Detector position
287 ZDC->SetYZNC(1.6);
288 ZDC->SetYZNA(1.6);
289 ZDC->SetYZPC(1.6);
290 ZDC->SetYZPA(1.6);
b2b18d9e 291 }
292
c462619f 293 if (iTRD)
b2b18d9e 294 {
c462619f 295 //=================== TRD parameters ============================
296
297 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
298 AliTRDgeometry *geoTRD = TRD->GetGeometry();
299 // Partial geometry: modules at 0,1,7,8,9,16,17
300 // starting at 3h in positive direction
301 geoTRD->SetSMstatus(2,0);
302 geoTRD->SetSMstatus(3,0);
303 geoTRD->SetSMstatus(4,0);
304 geoTRD->SetSMstatus(5,0);
305 geoTRD->SetSMstatus(6,0);
306 geoTRD->SetSMstatus(11,0);
307 geoTRD->SetSMstatus(12,0);
308 geoTRD->SetSMstatus(13,0);
309 geoTRD->SetSMstatus(14,0);
310 geoTRD->SetSMstatus(15,0);
311 geoTRD->SetSMstatus(16,0);
b2b18d9e 312 }
313
c462619f 314 if (iFMD)
b2b18d9e 315 {
c462619f 316 //=================== FMD parameters ============================
b2b18d9e 317
c462619f 318 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
319 }
b2b18d9e 320
c462619f 321 if (iMUON)
b2b18d9e 322 {
c462619f 323 //=================== MUON parameters ===========================
324 // New MUONv1 version (geometry defined via builders)
325 AliMUON *MUON = new AliMUONv1("MUON", "default");
326 // activate trigger efficiency by cells
327 MUON->SetTriggerEffCells(1);
b2b18d9e 328 }
329
c462619f 330 if (iPHOS)
b2b18d9e 331 {
c462619f 332 //=================== PHOS parameters ===========================
b2b18d9e 333
c462619f 334 AliPHOS *PHOS = new AliPHOSv1("PHOS", "noCPV_Modules123");
b2b18d9e 335
b2b18d9e 336 }
337
c462619f 338
339 if (iPMD)
b2b18d9e 340 {
c462619f 341 //=================== PMD parameters ============================
b2b18d9e 342
c462619f 343 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
b2b18d9e 344 }
345
c462619f 346 if (iT0)
b2b18d9e 347 {
c462619f 348 //=================== T0 parameters ============================
349 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
b2b18d9e 350 }
351
c462619f 352 if (iEMCAL)
b2b18d9e 353 {
c462619f 354 //=================== EMCAL parameters ============================
b2b18d9e 355
c462619f 356 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_FIRSTYEARV1");
b2b18d9e 357 }
358
c462619f 359 if (iACORDE)
b2b18d9e 360 {
c462619f 361 //=================== ACORDE parameters ============================
b2b18d9e 362
c462619f 363 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
b2b18d9e 364 }
365
c462619f 366 if (iVZERO)
b2b18d9e 367 {
c462619f 368 //=================== ACORDE parameters ============================
b2b18d9e 369
c462619f 370 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
b2b18d9e 371 }
372
373
b2b18d9e 374 // Load Geant4 + Geant4 VMC libraries
375 //
376 if (gClassTable->GetID("TGeant4") == -1) {
ba2958c4 377 TString g4libsMacro = "$G4INSTALL/macro/g4libs.C";
378 //TString g4libsMacro = "$ALICE/geant4_vmc/examples/macro/g4libs.C";
c462619f 379 //Load Geant4 libraries
ba2958c4 380 if (!gInterpreter->IsLoaded(g4libsMacro.Data())) {
381 gROOT->LoadMacro(g4libsMacro.Data());
b2b18d9e 382 gInterpreter->ProcessLine("g4libs()");
383 }
384 }
385
386
387 // Create Geant4 VMC
388 //
389 TGeant4 *geant4 = 0;
390 if ( ! gMC ) {
391 TG4RunConfiguration* runConfiguration=0x0;
392 for (Int_t iList = 0; iList < kListMax; iList++) {
393 if(iList<kListMax/2){
394 if(physicslist == iList){
395 runConfiguration =
396 new TG4RunConfiguration("geomRoot",
397 physicsListName[iList],
398 "specialCuts+stackPopper+stepLimiter",
399 true);
400 }
401 }
402 else if(iList>=kListMax/2){//add "optical" PL to HadronPhysicsList
403 if(physicslist == iList){
404 runConfiguration =
405 new TG4RunConfiguration("geomRoot",
406 Form("%s+optical",physicsListName[iList-kListMax/2]),
407 "specialCuts+stackPopper+stepLimiter",
408 true);
409 }
410 }
411 }
412 geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
413 cout << "Geant4 has been created." << endl;
414 }
415 else {
416 cout << "Monte Carlo has been already created." << endl;
417 }
418
419
420
421 // Customization of Geant4 VMC
422 //
423 geant4->ProcessGeantCommand("/mcVerbose/all 1");
424 geant4->ProcessGeantCommand("/mcVerbose/geometryManager 1");
425 geant4->ProcessGeantCommand("/mcVerbose/opGeometryManager 1");
c462619f 426 geant4->ProcessGeantCommand("/mcTracking/loopVerbose 1");
b2b18d9e 427 geant4->ProcessGeantCommand("/mcPhysics/rangeCuts 0.01 mm");
00d07f41 428 // for Geant4 <= 9.4.p03
429 //geant4->ProcessGeantCommand("/mcPhysics/selectOpProcess Scintillation");
430 //geant4->ProcessGeantCommand("/mcPhysics/setOpProcessActivation false");
431 // for Geant4 >= 9.5
432 geant4->ProcessGeantCommand("/optics_engine/selectOpProcess Scintillation");
433 geant4->ProcessGeantCommand("/optics_engine/setOpProcessUse false");
434 geant4->ProcessGeantCommand("/optics_engine/selectOpProcess OpWLS");
435 geant4->ProcessGeantCommand("/optics_engine/setOpProcessUse false");
436 geant4->ProcessGeantCommand("/optics_engine/selectOpProcess OpMieHG");
437 geant4->ProcessGeantCommand("/optics_engine/setOpProcessUse false");
438
b2b18d9e 439 geant4->ProcessGeantCommand("/mcVerbose/composedPhysicsList 2");
e6918581 440 geant4->ProcessGeantCommand("/mcTracking/skipNeutrino true");
c462619f 441 // geant4->ProcessGeantCommand("/mcDet/setMaxStepInLowDensityMaterials 1 cm");
b2b18d9e 442
443
c462619f 444 //
b2b18d9e 445 //=======================================================================
446 // ************* STEERING parameters FOR ALICE SIMULATION **************
447 // --- Specify event type to be tracked through the ALICE setup
448 // --- All positions are in cm, angles in degrees, and P and E in GeV
449
450
c462619f 451 gMC->SetProcess("DCAY",1);
452 gMC->SetProcess("PAIR",1);
453 gMC->SetProcess("COMP",1);
454 gMC->SetProcess("PHOT",1);
455 gMC->SetProcess("PFIS",0);
456 gMC->SetProcess("DRAY",0);
457 gMC->SetProcess("ANNI",1);
458 gMC->SetProcess("BREM",1);
459 gMC->SetProcess("MUNU",1);
460 gMC->SetProcess("CKOV",1);
461 gMC->SetProcess("HADR",1);
462 gMC->SetProcess("LOSS",2);
463 gMC->SetProcess("MULS",1);
464 gMC->SetProcess("RAYL",1);
b2b18d9e 465
c462619f 466 Float_t cut = 1.e-3; // 1MeV cut by default
467 Float_t tofmax = 1.e10;
b2b18d9e 468
c462619f 469 gMC->SetCut("CUTGAM", cut);
470 gMC->SetCut("CUTELE", cut);
471 gMC->SetCut("CUTNEU", cut);
472 gMC->SetCut("CUTHAD", cut);
473 gMC->SetCut("CUTMUO", cut);
474 gMC->SetCut("BCUTE", cut);
475 gMC->SetCut("BCUTM", cut);
476 gMC->SetCut("DCUTE", cut);
477 gMC->SetCut("DCUTM", cut);
478 gMC->SetCut("PPCUTM", cut);
479 gMC->SetCut("TOFMAX", tofmax);
b2b18d9e 480
481
482
483
484 //======================//
485 // Set External decayer //
486 //======================//
487 TVirtualMCDecayer* decayer = new AliDecayerPythia();
488 decayer->SetForceDecay(kAll);
489 decayer->Init();
490 gMC->SetExternalDecayer(decayer);
491
492 //=========================//
493 // Generator Configuration //
494 //=========================//
495 AliGenerator* gener = 0x0;
496
497 if (proc == kPythia6) {
c462619f 498 gener = MbPythia();
b2b18d9e 499 } else if (proc == kPythia6D6T) {
c462619f 500 gener = MbPythiaTuneD6T();
b2b18d9e 501 } else if (proc == kPythia6ATLAS) {
c462619f 502 gener = MbPythiaTuneATLAS();
503 } else if (proc == kPythiaPerugia0) {
504 gener = MbPythiaTunePerugia0();
b2b18d9e 505 } else if (proc == kPythia6ATLAS_Flat) {
c462619f 506 gener = MbPythiaTuneATLAS_Flat();
b2b18d9e 507 } else if (proc == kPhojet) {
c462619f 508 gener = MbPhojet();
b2b18d9e 509 }
c462619f 510
511
b2b18d9e 512 //
513 //
514 // Size of the interaction diamond
515 // Longitudinal
c462619f 516 Float_t sigmaz = 5.4 / TMath::Sqrt(2.); // [cm]
517 if (energy == 900)
518 //sigmaz = 10.5 / TMath::Sqrt(2.); // [cm]
519 //sigmaz = 3.7;
520 if (energy == 7000)
521 sigmaz = 6.3 / TMath::Sqrt(2.); // [cm]
522
523 //
b2b18d9e 524 // Transverse
c462619f 525
526 // beta*
527 Float_t betast = 10.0; // beta* [m]
528 if (runNumber >= 117048) betast = 2.0;
529 if (runNumber > 122375) betast = 3.5; // starting with fill 1179
530 //
531 //
532 Float_t eps = 5.0e-6; // emittance [m]
b2b18d9e 533 Float_t gamma = energy / 2.0 / 0.938272; // relativistic gamma [1]
534 Float_t sigmaxy = TMath::Sqrt(eps * betast / gamma) / TMath::Sqrt(2.) * 100.; // [cm]
b2b18d9e 535 printf("\n \n Diamond size x-y: %10.3e z: %10.3e\n \n", sigmaxy, sigmaz);
c462619f 536
b2b18d9e 537 gener->SetSigma(sigmaxy, sigmaxy, sigmaz); // Sigma in (X,Y,Z) (cm) on IP position
538 gener->SetVertexSmear(kPerEvent);
539 gener->Init();
540
c462619f 541 printf("\n \n Comment: %s \n \n", comment.Data());
b2b18d9e 542
543
544}
545//
546// PYTHIA
547//
548
549AliGenerator* MbPythia()
550{
c462619f 551 comment = comment.Append(" pp: Pythia low-pt");
552 //
553 // Pythia
554 AliGenPythia* pythia = new AliGenPythia(-1);
555 pythia->SetMomentumRange(0, 999999.);
556 pythia->SetThetaRange(0., 180.);
557 pythia->SetYRange(-12.,12.);
558 pythia->SetPtRange(0,1000.);
559 pythia->SetProcess(kPyMb);
560 pythia->SetEnergyCMS(energy);
b2b18d9e 561
c462619f 562 return pythia;
b2b18d9e 563}
564
565AliGenerator* MbPythiaTuneD6T()
566{
c462619f 567 comment = comment.Append(" pp: Pythia low-pt");
568 //
569 // Pythia
570 AliGenPythia* pythia = new AliGenPythia(-1);
571 pythia->SetMomentumRange(0, 999999.);
572 pythia->SetThetaRange(0., 180.);
573 pythia->SetYRange(-12.,12.);
574 pythia->SetPtRange(0,1000.);
575 pythia->SetProcess(kPyMb);
576 pythia->SetEnergyCMS(energy);
577 // Tune
578 // 109 D6T : Rick Field's CDF Tune D6T (NB: needs CTEQ6L pdfs externally)
579 pythia->SetTune(109); // F I X
580 pythia->SetStrucFunc(kCTEQ6l);
581 //
582 return pythia;
b2b18d9e 583}
584
585AliGenerator* MbPythiaTunePerugia0()
586{
c462619f 587 comment = comment.Append(" pp: Pythia low-pt (Perugia0)");
588 //
589 // Pythia
590 AliGenPythia* pythia = new AliGenPythia(-1);
591 pythia->SetMomentumRange(0, 999999.);
592 pythia->SetThetaRange(0., 180.);
593 pythia->SetYRange(-12.,12.);
594 pythia->SetPtRange(0,1000.);
595 pythia->SetProcess(kPyMb);
596 pythia->SetEnergyCMS(energy);
597 // Tune
598 // 320 Perugia 0
599 pythia->SetTune(320);
600 pythia->UseNewMultipleInteractionsScenario();
601 pythia->SetCrossingAngle(0,0.000280);
602
603 //
604 return pythia;
b2b18d9e 605}
606
c462619f 607
b2b18d9e 608AliGenerator* MbPythiaTuneATLAS()
609{
c462619f 610 comment = comment.Append(" pp: Pythia low-pt");
611 //
612 // Pythia
613 AliGenPythia* pythia = new AliGenPythia(-1);
614 pythia->SetMomentumRange(0, 999999.);
615 pythia->SetThetaRange(0., 180.);
616 pythia->SetYRange(-12.,12.);
617 pythia->SetPtRange(0,1000.);
618 pythia->SetProcess(kPyMb);
619 pythia->SetEnergyCMS(energy);
620 // Tune
621 // C 306 ATLAS-CSC: Arthur Moraes' (new) ATLAS tune (needs CTEQ6L externally)
622 pythia->SetTune(306);
623 pythia->SetStrucFunc(kCTEQ6l);
624 //
625 return pythia;
b2b18d9e 626}
627
628AliGenerator* MbPythiaTuneATLAS_Flat()
629{
c462619f 630 AliGenPythia* pythia = MbPythiaTuneATLAS();
b2b18d9e 631
c462619f 632 comment = comment.Append("; flat multiplicity distribution");
b2b18d9e 633
c462619f 634 // set high multiplicity trigger
635 // this weight achieves a flat multiplicity distribution
636 Double_t cont[] =
637 {0,
638 0.234836, 0.103484, 0.00984802, 0.0199906, 0.0260018, 0.0208481, 0.0101477, 0.00146998, -0.00681513, -0.0114928,
639 -0.0113352, -0.0102012, -0.00895238, -0.00534961, -0.00261648, -0.000819048, 0.00130816, 0.00177978, 0.00373838, 0.00566255,
640 0.00628156, 0.00687458, 0.00668017, 0.00702917, 0.00810848, 0.00876167, 0.00832783, 0.00848518, 0.0107709, 0.0106849,
641 0.00933702, 0.00912525, 0.0106553, 0.0102785, 0.0101756, 0.010962, 0.00957103, 0.00970448, 0.0117133, 0.012271,
642 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113,
643 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113,
644 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113,
645 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113,
646 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113,
647 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113, 0.0113,
648 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
649 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
650 0};
651
652 Double_t err[] =
653 {0,
654 0.00168216, 0.000743548, 0.00103125, 0.00108605, 0.00117101, 0.00124577, 0.00129119, 0.00128341, 0.00121421, 0.00112431,
655 0.00100588, 0.000895078, 0.000790314, 0.000711673, 0.000634547, 0.000589133, 0.000542763, 0.000509552, 0.000487375, 0.000468906,
656 0.000460196, 0.000455806, 0.00044843, 0.000449317, 0.00045007, 0.000458016, 0.000461167, 0.000474742, 0.00050161, 0.00051637,
657 0.000542336, 0.000558854, 0.000599169, 0.000611982, 0.000663855, 0.000696322, 0.000722825, 0.000771686, 0.000838023, 0.000908317,
658 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003,
659 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003,
660 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003,
661 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003,
662 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003,
663 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003, 0.0003,
664 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
665 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
666 0};
667
668 TH1F *weight = new TH1F("newweight","newweight",120,-0.5,119.5);
669
670 weight->SetContent(cont);
671 weight->SetError(err);
b2b18d9e 672
c462619f 673 Int_t limit = weight->GetRandom();
674 pythia->SetTriggerChargedMultiplicity(limit, 1.4);
b2b18d9e 675
c462619f 676 comment = comment.Append(Form("; multiplicity threshold set to %d in |eta| < 1.4", limit));
b2b18d9e 677
c462619f 678 return pythia;
b2b18d9e 679}
680
681AliGenerator* MbPhojet()
682{
c462619f 683 comment = comment.Append(" pp: Pythia low-pt");
684 //
685 // DPMJET
b2b18d9e 686#if defined(__CINT__)
257e1b2b 687 gSystem->Load("libDPMJET"); // Parton density functions
b2b18d9e 688 gSystem->Load("libTDPMjet"); // Parton density functions
689#endif
c462619f 690 AliGenDPMjet* dpmjet = new AliGenDPMjet(-1);
691 dpmjet->SetMomentumRange(0, 999999.);
692 dpmjet->SetThetaRange(0., 180.);
693 dpmjet->SetYRange(-12.,12.);
694 dpmjet->SetPtRange(0,1000.);
695 dpmjet->SetProcess(kDpmMb);
696 dpmjet->SetEnergyCMS(energy);
697 dpmjet->SetCrossingAngle(0,0.000280);
698 return dpmjet;
b2b18d9e 699}
700
701void ProcessEnvironmentVars()
702{
c462619f 703 // Run type
704 if (gSystem->Getenv("CONFIG_RUN_TYPE")) {
705 for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
706 if (strcmp(gSystem->Getenv("CONFIG_RUN_TYPE"), pprRunName[iRun])==0) {
707 proc = (PDC06Proc_t)iRun;
708 cout<<"Run type set to "<<pprRunName[iRun]<<endl;
b2b18d9e 709 }
710 }
c462619f 711 }
b2b18d9e 712
c462619f 713 // Field
714 if (gSystem->Getenv("CONFIG_FIELD")) {
715 for (Int_t iField = 0; iField < kFieldMax; iField++) {
716 if (strcmp(gSystem->Getenv("CONFIG_FIELD"), pprField[iField])==0) {
717 mag = (Mag_t)iField;
718 cout<<"Field set to "<<pprField[iField]<<endl;
b2b18d9e 719 }
720 }
c462619f 721 }
b2b18d9e 722
c462619f 723 // Energy
724 if (gSystem->Getenv("CONFIG_ENERGY")) {
725 energy = atoi(gSystem->Getenv("CONFIG_ENERGY"));
726 cout<<"Energy set to "<<energy<<" GeV"<<endl;
727 }
b2b18d9e 728
c462619f 729 // Random Number seed
730 if (gSystem->Getenv("CONFIG_SEED")) {
731 seed = atoi(gSystem->Getenv("CONFIG_SEED"));
732 }
b2b18d9e 733
c462619f 734 // Run number
735 if (gSystem->Getenv("DC_RUN")) {
736 runNumber = atoi(gSystem->Getenv("DC_RUN"));
737 }
738
739 // Physics lists
740 if (gSystem->Getenv("CONFIG_PHYSICSLIST")) {
741 for (Int_t iList = 0; iList < kListMax; iList++) {
742 if (strcmp(gSystem->Getenv("CONFIG_PHYSICSLIST"), physicsListName[iList])==0){
743 physicslist = (PhysicsList_t)iList;
744 cout<<"Physics list set to "<< physicsListName[iList]<<endl;
b2b18d9e 745 }
746 }
c462619f 747 }
b2b18d9e 748
749}