Using AliMagWrapCheb
[u/mrichter/AliRoot.git] / test / QA / Config.C
CommitLineData
478d5b53 1//
2// Configuration for the Physics Data Challenge 2007
3//
4//
5// Assuming inel = 70 mb (PPR v.1, p.64)
6//
7// 84.98% of MSEL=0 events (including diffractive) with
8// QQbar switched off (these events will include injected J/psi) => kPyMbNoHvq
9//
10// 14.14% of MSEL=1 events with ccbar (in 4 subsamples) => kCharmpp14000wmi
11// bin 1 25% (3.535%): 2.76 < pthard < 3 GeV/c
12// bin 2 40% (5.656%): 3 < pthard < 4 GeV/c
13// bin 3 29% (4.101%): 4 < pthard < 8 GeV/c
14// bin 4 6% (0.848%): pthard > 8 GeV/c
15//
16// 0.73% of MSEL=1 events with bbbar (in 4 subsamples) => kBeautypp14000wmi
17// bin 1 5% (0.037%): 2.76 < pthard < 4 GeV/c
18// bin 2 31% (0.226%): 4 < pthard < 6 GeV/c
19// bin 3 28% (0.204%): 6 < pthard < 8 GeV/c
20// bin 4 36% (0.263%): pthard >8 GeV/c
21//
22// 0.075% of MSEL=0 events with QQbar switched off and 1 Omega- => kPyOmegaMinus
23// 0.075% of MSEL=0 events with QQbar switched off and 1 OmegaBar+ => kPyOmegaPlus
24
25// One can use the configuration macro in compiled mode by
26// root [0] gSystem->Load("libgeant321");
27// root [0] gSystem->SetIncludePath("-I$ROOTSYS/include -I$ALICE_ROOT/include\
28// -I$ALICE_ROOT -I$ALICE/geant3/TGeant3");
29// root [0] .x grun.C(1,"Config_PDC07.C++")
30
31#if !defined(__CINT__) || defined(__MAKECINT__)
32#include <Riostream.h>
33#include <TRandom.h>
34#include <TDatime.h>
35#include <TSystem.h>
36#include <TVirtualMC.h>
37#include <TGeant3TGeo.h>
38#include "EVGEN/AliGenCocktail.h"
39#include "EVGEN/AliGenParam.h"
40#include "EVGEN/AliGenMUONlib.h"
41#include "STEER/AliRunLoader.h"
42#include "STEER/AliRun.h"
43#include "STEER/AliConfig.h"
44#include "PYTHIA6/AliDecayerPythia.h"
45#include "PYTHIA6/AliGenPythia.h"
cd33bb3e 46#include "STEER/AliMagWrapCheb.h"
478d5b53 47#include "STRUCT/AliBODY.h"
48#include "STRUCT/AliMAG.h"
49#include "STRUCT/AliABSOv3.h"
50#include "STRUCT/AliDIPOv3.h"
51#include "STRUCT/AliHALLv3.h"
52#include "STRUCT/AliFRAMEv2.h"
53#include "STRUCT/AliSHILv3.h"
54#include "STRUCT/AliPIPEv3.h"
55#include "ITS/AliITSgeom.h"
56#include "ITS/AliITSvPPRasymmFMD.h"
57#include "TPC/AliTPCv2.h"
58#include "TOF/AliTOFv6T0.h"
840d7854 59#include "HMPID/AliHMPIDv3.h"
478d5b53 60#include "ZDC/AliZDCv3.h"
61#include "TRD/AliTRDv1.h"
62#include "FMD/AliFMDv1.h"
63#include "MUON/AliMUONv1.h"
64#include "PHOS/AliPHOSv1.h"
65#include "PMD/AliPMDv1.h"
66#include "T0/AliT0v1.h"
67#include "EMCAL/AliEMCALv2.h"
f7882672 68#include "ACORDE/AliACORDEv1.h"
478d5b53 69#include "VZERO/AliVZEROv7.h"
70#endif
71
72
73enum PDC07Proc_t
74{
75//--- Heavy Flavour Production ---
76 kCharmPbPb5500, kCharmpPb8800, kCharmpp14000, kCharmpp14000wmi,
77 kD0PbPb5500, kD0pPb8800, kD0pp14000,
78 kDPlusPbPb5500, kDPluspPb8800, kDPluspp14000,
79 kBeautyPbPb5500, kBeautypPb8800, kBeautypp14000, kBeautypp14000wmi,
80// -- Pythia Mb
81 kPyMbNoHvq, kPyOmegaPlus, kPyOmegaMinus, kPyJetJet,
82 kPyGammaJetPHOS, kPyJetJetPHOS, kPyJetJetPHOSv2, kPyGammaBremsPHOS,
83 kPyGammaJetEMCAL, kPyJetJetEMCAL, kPyGammaBremsEMCAL, kRunMax
84};
85
86const char * pprRunName[] = {
87 "kCharmPbPb5500", "kCharmpPb8800", "kCharmpp14000", "kCharmpp14000wmi",
88 "kD0PbPb5500", "kD0pPb8800", "kD0pp14000",
89 "kDPlusPbPb5500", "kDPluspPb8800", "kDPluspp14000",
90 "kBeautyPbPb5500", "kBeautypPb8800", "kBeautypp14000", "kBeautypp14000wmi",
91 "kPyMbNoHvq", "kPyOmegaPlus", "kPyOmegaMinus", "kPyJetJet",
92 "kPyGammaJetPHOS", "kPyJetJetPHOS", "kPyJetJetPHOSv2", "kPyGammaBremsPHOS",
93 "kPyGammaJetEMCAL", "kPyJetJetEMCAL", "kPyGammaBremsEMCAL"
94};
95
96
97//--- Decay Mode ---
98enum DecayHvFl_t
99{
100 kNature, kHadr, kSemiEl, kSemiMu
101};
102//--- Magnetic Field ---
103enum Mag_t
104{
105 k2kG, k4kG, k5kG
106};
107
108//--- Trigger config ---
109enum TrigConf_t
110{
111 kDefaultPPTrig, kDefaultPbPbTrig
112};
113
114const char * TrigConfName[] = {
115 "p-p","Pb-Pb"
116};
117
118Float_t eCMS=5500;
119PDC07Proc_t proc = kPyJetJetEMCAL;
120
121enum PprGeo_t
122 {
123 kHoles, kNoHoles
124 };
125
126static PprGeo_t geo = kHoles;
127class AliGenPythia ;
128//--- Functions ---
129AliGenPythia *PythiaHard(PDC07Proc_t );
130AliGenPythia *PythiaHVQ(PDC07Proc_t );
131AliGenerator *MbCocktail();
132AliGenerator *PyMbTriggered(Int_t pdg);
133void ProcessEnvironmentVars();
134
135// This part for configuration
136static DecayHvFl_t decHvFl = kNature;
137static Mag_t mag = k5kG;
138static TrigConf_t trig = kDefaultPPTrig; // default pp trigger configuration
139static Int_t runNumber= 0;
140static Int_t eventNumber= 0;
141//========================//
142// Set Random Number seed //
143//========================//
144TDatime dt;
145static UInt_t seed = dt.Get();
146
147// nEvts = -1 : you get 1 QQbar pair and all the fragmentation and
148// decay chain
149// nEvts = N>0 : you get N charm / beauty Hadrons
150Int_t nEvts = -1;
151// stars = kTRUE : all heavy resonances and their decay stored
152// = kFALSE: only final heavy hadrons and their decays stored
153Bool_t stars = kTRUE;
154
155// To be used only with kCharmpp14000wmi and kBeautypp14000wmi
156// To get a "reasonable" agreement with MNR results, events have to be
157// generated with the minimum ptHard set to 2.76 GeV.
158// To get a "perfect" agreement with MNR results, events have to be
159// generated in four ptHard bins with the following relative
160// normalizations:
161// CHARM
162// 2.76-3 GeV: 25%
163// 3-4 GeV: 40%
164// 4-8 GeV: 29%
165// >8 GeV: 6%
166// BEAUTY
167// 2.76-4 GeV: 5%
168// 4-6 GeV: 31%
169// 6-8 GeV: 28%
170// >8 GeV: 36%
171
172Float_t ptHardMin = 10.;
173Float_t ptHardMax = 20.;
174Float_t ptGammaPi0Min = 1.;
175Int_t iquenching = 0;
176Float_t qhat = 20.;
177
178// Comment line
179static TString comment;
180
181void Config()
182{
3380c1d9 183 // Get settings from environment variables
478d5b53 184 ProcessEnvironmentVars();
185
186 // libraries required by geant321
187#if defined(__CINT__)
419b7909 188 gSystem->Load("liblhapdf.so"); // Parton density functions
189 gSystem->Load("libpythia6.so"); // Pythia
190 gSystem->Load("libgeant321");
191 gSystem->Load("libEG");
192 gSystem->Load("libEGPythia6.so"); // TGenerator interface
193 gSystem->Load("libAliPythia6.so"); // ALICE specific implementations
478d5b53 194#endif
478d5b53 195 new TGeant3TGeo("C++ Interface to Geant3");
196
197 // Output every 100 tracks
198 ((TGeant3*)gMC)->SetSWIT(4,100);
199
200 //=======================================================================
201 // Run loader
202 AliRunLoader* rl=0x0;
203 rl = AliRunLoader::Open("galice.root",
204 AliConfig::GetDefaultEventFolderName(),
205 "recreate");
206 if (rl == 0x0)
207 {
208 gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
209 return;
210 }
211 rl->SetCompressionLevel(2);
212 rl->SetNumberOfEventsPerFile(1000);
213 gAlice->SetRunLoader(rl);
214
215 // Run number
216 //gAlice->SetRunNumber(runNumber);
217
218 // Set the trigger configuration
219 gAlice->SetTriggerDescriptor(TrigConfName[trig]);
220 cout<<"Trigger configuration is set to "<<TrigConfName[trig]<<endl;
221
222 //
223 //=======================================================================
224 // ************* STEERING parameters FOR ALICE SIMULATION **************
225 // --- Specify event type to be tracked through the ALICE setup
226 // --- All positions are in cm, angles in degrees, and P and E in GeV
227
228
229 gMC->SetProcess("DCAY",1);
230 gMC->SetProcess("PAIR",1);
231 gMC->SetProcess("COMP",1);
232 gMC->SetProcess("PHOT",1);
233 gMC->SetProcess("PFIS",0);
234 gMC->SetProcess("DRAY",0);
235 gMC->SetProcess("ANNI",1);
236 gMC->SetProcess("BREM",1);
237 gMC->SetProcess("MUNU",1);
238 gMC->SetProcess("CKOV",1);
239 gMC->SetProcess("HADR",1);
240 gMC->SetProcess("LOSS",2);
241 gMC->SetProcess("MULS",1);
242 gMC->SetProcess("RAYL",1);
243
244 Float_t cut = 1.e-3; // 1MeV cut by default
245 Float_t tofmax = 1.e10;
246
247 gMC->SetCut("CUTGAM", cut);
248 gMC->SetCut("CUTELE", cut);
249 gMC->SetCut("CUTNEU", cut);
250 gMC->SetCut("CUTHAD", cut);
251 gMC->SetCut("CUTMUO", cut);
252 gMC->SetCut("BCUTE", cut);
253 gMC->SetCut("BCUTM", cut);
254 gMC->SetCut("DCUTE", cut);
255 gMC->SetCut("DCUTM", cut);
256 gMC->SetCut("PPCUTM", cut);
257 gMC->SetCut("TOFMAX", tofmax);
258
259 //======================//
260 // Set External decayer //
261 //======================//
262 TVirtualMCDecayer* decayer = new AliDecayerPythia();
263 // DECAYS
264 //
265 switch(decHvFl) {
266 case kNature:
267 decayer->SetForceDecay(kAll);
268 break;
269 case kHadr:
270 decayer->SetForceDecay(kHadronicD);
271 break;
272 case kSemiEl:
273 decayer->SetForceDecay(kSemiElectronic);
274 break;
275 case kSemiMu:
276 decayer->SetForceDecay(kSemiMuonic);
277 break;
278 }
279 decayer->Init();
280 gMC->SetExternalDecayer(decayer);
281 if(proc == kPyJetJetPHOSv2) // in this case we decay the pi0
282 decayer->SetForceDecay(kNeutralPion);
283
284 //=========================//
285 // Generator Configuration //
286 //=========================//
287 AliGenPythia* gener = 0x0;
288
289 if (proc <= kBeautypp14000wmi) {
290 AliGenPythia *pythia = PythiaHVQ(proc);
291 // FeedDown option
292 pythia->SetFeedDownHigherFamily(kFALSE);
293 // Stack filling option
294 if(!stars) pythia->SetStackFillOpt(AliGenPythia::kParentSelection);
295 // Set Count mode
296 if(nEvts>0) pythia->SetCountMode(AliGenPythia::kCountParents);
297 //
298 // DECAYS
299 //
300 switch(decHvFl) {
301 case kNature:
302 pythia->SetForceDecay(kAll);
303 break;
304 case kHadr:
305 pythia->SetForceDecay(kHadronicD);
306 break;
307 case kSemiEl:
308 pythia->SetForceDecay(kSemiElectronic);
309 break;
310 case kSemiMu:
311 pythia->SetForceDecay(kSemiMuonic);
312 break;
313 }
314 //
315 // GEOM & KINE CUTS
316 //
317 pythia->SetMomentumRange(0,99999999);
318 pythia->SetPhiRange(0., 360.);
319 pythia->SetThetaRange(0,180);
320 switch(ycut) {
321 case kFull:
322 pythia->SetYRange(-999,999);
323 break;
324 case kBarrel:
325 pythia->SetYRange(-2,2);
326 break;
327 case kMuonArm:
328 pythia->SetYRange(1,6);
329 break;
330 }
331 gener = pythia;
332 } else if (proc == kPyMbNoHvq) {
333 gener = MbCocktail();
334 } else if (proc == kPyOmegaMinus) {
335 gener = PyMbTriggered(3334);
336 } else if (proc == kPyOmegaPlus) {
337 gener = PyMbTriggered(-3334);
338 } else if (proc <= kPyGammaBremsEMCAL) {
339 AliGenPythia *pythia = PythiaHard(proc);
340 // FeedDown option
341 pythia->SetFeedDownHigherFamily(kFALSE);
342 // Set Count mode
343 if(nEvts>0) pythia->SetCountMode(AliGenPythia::kCountParents);
344
345 //
346 // GEOM & KINE CUTS
347 //
348 pythia->SetMomentumRange(0,99999999);
349 // pythia->SetJetEtaRange(-1.5, 1.5);// Final state kinematic cuts
350 // pythia->SetJetPhiRange(0., 360.);
351 // pythia->SetThetaRange(45,135);
352
353 if(proc == kPyJetJetPHOSv2)
3380c1d9 354 pythia->SetForceDecay(kNeutralPion);
355 else
356 pythia->SetForceDecay(kAll);
357
358 pythia->SetPycellParameters(2., 274, 432, 0., 4., 5., 1.0);
478d5b53 359 pythia->SetPtKick(5); // set the intrinsic kt to 5 GeV/c
360 gener = pythia;
3380c1d9 361 }
478d5b53 362
363
364 // PRIMARY VERTEX
365
366 gener->SetOrigin(0., 0., 0.); // vertex position
367
368 // Size of the interaction diamond
369 // Longitudinal
370 Float_t sigmaz = 7.55 / TMath::Sqrt(2.); // [cm]
371
372 // Transverse
373 Float_t betast = 10; // beta* [m]
374 Float_t eps = 3.75e-6; // emittance [m]
375 Float_t gamma = 7000. / 0.938272; // relativistic gamma [1]
376 Float_t sigmaxy = TMath::Sqrt(eps * betast / gamma) / TMath::Sqrt(2.) * 100.; // [cm]
377 printf("\n \n Diamond size x-y: %10.3e z: %10.3e\n \n", sigmaxy, sigmaz);
378
379 gener->SetSigma(sigmaxy, sigmaxy, sigmaz); // Sigma in (X,Y,Z) (cm) on IP position
380 gener->SetCutVertexZ(3.); // Truncate at 3 sigma
381 gener->SetVertexSmear(kPerEvent);
382
383 gener->Init();
384
385 //Quenching
386 gener->SetQuench(iquenching);
387 if(iquenching == 1){
388 Float_t k = 6e5*(qhat/1.7) ; //qhat=1.7, k = 6e5, default value
389 AliPythia::Instance()->InitQuenching(0.,0.1,k,0,0.95,6);
390
3380c1d9 391 }
478d5b53 392 // FIELD
393
394 if (mag == k2kG) {
395 comment = comment.Append(" | L3 field 0.2 T");
396 } else if (mag == k4kG) {
397 comment = comment.Append(" | L3 field 0.4 T");
398 } else if (mag == k5kG) {
399 comment = comment.Append(" | L3 field 0.5 T");
400 }
401 printf("\n \n Comment: %s \n \n", comment.Data());
402
cd33bb3e 403 AliMagWrapCheb* field = new AliMagWrapCheb("Maps","Maps", 2, 1., 10., mag);
478d5b53 404 rl->CdGAFile();
405 gAlice->SetField(field);
406
407
408
409 Int_t iABSO = 1;
95e77a9e 410 Int_t iACORDE= 1;
478d5b53 411 Int_t iDIPO = 1;
412 Int_t iEMCAL = 1;
f479d4aa 413 Int_t iFMD = 1;
478d5b53 414 Int_t iFRAME = 1;
415 Int_t iHALL = 1;
416 Int_t iITS = 1;
417 Int_t iMAG = 1;
f479d4aa 418 Int_t iMUON = 1;
478d5b53 419 Int_t iPHOS = 1;
420 Int_t iPIPE = 1;
421 Int_t iPMD = 1;
422 Int_t iHMPID = 1;
423 Int_t iSHIL = 1;
424 Int_t iT0 = 1;
425 Int_t iTOF = 1;
426 Int_t iTPC = 1;
427 Int_t iTRD = 1;
428 Int_t iVZERO = 1;
429 Int_t iZDC = 1;
430
431
432 //=================== Alice BODY parameters =============================
433 AliBODY *BODY = new AliBODY("BODY", "Alice envelop");
434
435
436 if (iMAG)
437 {
438 //=================== MAG parameters ============================
439 // --- Start with Magnet since detector layouts may be depending ---
440 // --- on the selected Magnet dimensions ---
441 AliMAG *MAG = new AliMAG("MAG", "Magnet");
442 }
3380c1d9 443//
444//
478d5b53 445 if (iABSO)
446 {
447 //=================== ABSO parameters ============================
448 AliABSO *ABSO = new AliABSOv3("ABSO", "Muon Absorber");
449 }
450
451 if (iDIPO)
452 {
453 //=================== DIPO parameters ============================
454
455 AliDIPO *DIPO = new AliDIPOv3("DIPO", "Dipole version 3");
456 }
457
458 if (iHALL)
459 {
460 //=================== HALL parameters ============================
461
462 AliHALL *HALL = new AliHALLv3("HALL", "Alice Hall");
463 }
464
465
466 if (iFRAME)
467 {
468 //=================== FRAME parameters ============================
469
470 AliFRAMEv2 *FRAME = new AliFRAMEv2("FRAME", "Space Frame");
471 if (geo == kHoles) FRAME->SetHoles(1);
472 else FRAME->SetHoles(0);
473
474 }
475
476 if (iSHIL)
477 {
478 //=================== SHIL parameters ============================
479
480 AliSHIL *SHIL = new AliSHILv3("SHIL", "Shielding Version 3");
481 }
482
483
484 if (iPIPE)
485 {
486 //=================== PIPE parameters ============================
487
488 AliPIPE *PIPE = new AliPIPEv3("PIPE", "Beam Pipe");
489 }
490
491 if(iITS) {
492
493 //=================== ITS parameters ============================
494 //
0bfe1765 495
496 AliITS *ITS = new AliITSv11Hybrid("ITS","ITS v11Hybrid");
478d5b53 497 }
498
0bfe1765 499
478d5b53 500 if (iTPC)
501 {
502 //============================ TPC parameters =====================
503 AliTPC *TPC = new AliTPCv2("TPC", "Default");
504 }
505
506
507 if (iTOF) {
508 //=================== TOF parameters ============================
509 AliTOF *TOF = new AliTOFv6T0("TOF", "normal TOF");
510 }
511
512
513 if (iHMPID)
514 {
515 //=================== HMPID parameters ===========================
840d7854 516 AliHMPID *HMPID = new AliHMPIDv3("HMPID", "normal HMPID");
478d5b53 517
518 }
519
520
521 if (iZDC)
522 {
523 //=================== ZDC parameters ============================
524
525 AliZDC *ZDC = new AliZDCv3("ZDC", "normal ZDC");
526 }
527
3380c1d9 528 if (iTRD)
478d5b53 529 {
530 //=================== TRD parameters ============================
3380c1d9 531
478d5b53 532 AliTRD *TRD = new AliTRDv1("TRD", "TRD slow simulator");
3380c1d9 533 AliTRDgeometry *geoTRD = TRD->GetGeometry();
478d5b53 534 }
535
536 if (iFMD)
537 {
538 //=================== FMD parameters ============================
539 AliFMD *FMD = new AliFMDv1("FMD", "normal FMD");
540 }
541
542 if (iMUON)
543 {
544 //=================== MUON parameters ===========================
545 // New MUONv1 version (geometry defined via builders)
546 AliMUON *MUON = new AliMUONv1("MUON", "default");
547 }
548 //=================== PHOS parameters ===========================
549
550 if (iPHOS)
551 {
552 AliPHOS *PHOS = new AliPHOSv1("PHOS", "IHEP");
553 }
554
555
556 if (iPMD)
557 {
558 //=================== PMD parameters ============================
559 AliPMD *PMD = new AliPMDv1("PMD", "normal PMD");
560 }
561
562 if (iT0)
563 {
564 //=================== T0 parameters ============================
565 AliT0 *T0 = new AliT0v1("T0", "T0 Detector");
566 }
567
568 if (iEMCAL)
569 {
570 //=================== EMCAL parameters ============================
8224b11d 571 AliEMCAL *EMCAL = new AliEMCALv2("EMCAL", "EMCAL_COMPLETE scTh=0.176 pbTh=0.144");
478d5b53 572 }
573
574 if (iACORDE)
575 {
576 //=================== CRT parameters ============================
3380c1d9 577 AliACORDE *ACORDE = new AliACORDEv1("ACORDE", "normal ACORDE");
478d5b53 578 }
579
580 if (iVZERO)
581 {
582 //=================== CRT parameters ============================
583 AliVZERO *VZERO = new AliVZEROv7("VZERO", "normal VZERO");
584 }
585}
586
587// PYTHIA
588
589AliGenPythia *PythiaHVQ(PDC07Proc_t proc) {
590//*******************************************************************//
591// Configuration file for charm / beauty generation with PYTHIA //
592// //
593// The parameters have been tuned in order to reproduce the inclusive//
594// heavy quark pt distribution given by the NLO pQCD calculation by //
595// Mangano, Nason and Ridolfi. //
596// //
597// For details and for the NORMALIZATION of the yields see: //
598// N.Carrer and A.Dainese, //
599// "Charm and beauty production at the LHC", //
600// ALICE-INT-2003-019, [arXiv:hep-ph/0311225]; //
601// PPR Chapter 6.6, CERN/LHCC 2005-030 (2005). //
602//*******************************************************************//
603 AliGenPythia * gener = 0x0;
604
605 switch(proc) {
606 case kCharmPbPb5500:
607 comment = comment.Append(" Charm in Pb-Pb at 5.5 TeV");
608 gener = new AliGenPythia(nEvts);
609 gener->SetProcess(kPyCharmPbPbMNR);
610 gener->SetStrucFunc(kCTEQ4L);
611 gener->SetPtHard(2.1,-1.0);
612 gener->SetEnergyCMS(5500.);
613 gener->SetNuclei(208,208);
614 break;
615 case kCharmpPb8800:
616 comment = comment.Append(" Charm in p-Pb at 8.8 TeV");
617 gener = new AliGenPythia(nEvts);
618 gener->SetProcess(kPyCharmpPbMNR);
619 gener->SetStrucFunc(kCTEQ4L);
620 gener->SetPtHard(2.1,-1.0);
621 gener->SetEnergyCMS(8800.);
622 gener->SetProjectile("P",1,1);
623 gener->SetTarget("Pb",208,82);
624 break;
625 case kCharmpp14000:
626 comment = comment.Append(" Charm in pp at 14 TeV");
627 gener = new AliGenPythia(nEvts);
628 gener->SetProcess(kPyCharmppMNR);
629 gener->SetStrucFunc(kCTEQ4L);
630 gener->SetPtHard(2.1,-1.0);
631 gener->SetEnergyCMS(14000.);
632 break;
633 case kCharmpp14000wmi:
634 comment = comment.Append(" Charm in pp at 14 TeV with mult. interactions");
635 gener = new AliGenPythia(-1);
636 gener->SetProcess(kPyCharmppMNRwmi);
637 gener->SetStrucFunc(kCTEQ5L);
638 gener->SetPtHard(ptHardMin,ptHardMax);
639 gener->SetEnergyCMS(14000.);
640 break;
641 case kD0PbPb5500:
642 comment = comment.Append(" D0 in Pb-Pb at 5.5 TeV");
643 gener = new AliGenPythia(nEvts);
644 gener->SetProcess(kPyD0PbPbMNR);
645 gener->SetStrucFunc(kCTEQ4L);
646 gener->SetPtHard(2.1,-1.0);
647 gener->SetEnergyCMS(5500.);
648 gener->SetNuclei(208,208);
649 break;
650 case kD0pPb8800:
651 comment = comment.Append(" D0 in p-Pb at 8.8 TeV");
652 gener = new AliGenPythia(nEvts);
653 gener->SetProcess(kPyD0pPbMNR);
654 gener->SetStrucFunc(kCTEQ4L);
655 gener->SetPtHard(2.1,-1.0);
656 gener->SetEnergyCMS(8800.);
657 gener->SetProjectile("P",1,1);
658 gener->SetTarget("Pb",208,82);
659 break;
660 case kD0pp14000:
661 comment = comment.Append(" D0 in pp at 14 TeV");
662 gener = new AliGenPythia(nEvts);
663 gener->SetProcess(kPyD0ppMNR);
664 gener->SetStrucFunc(kCTEQ4L);
665 gener->SetPtHard(2.1,-1.0);
666 gener->SetEnergyCMS(14000.);
667 break;
668 case kDPlusPbPb5500:
669 comment = comment.Append(" DPlus in Pb-Pb at 5.5 TeV");
670 gener = new AliGenPythia(nEvts);
671 gener->SetProcess(kPyDPlusPbPbMNR);
672 gener->SetStrucFunc(kCTEQ4L);
673 gener->SetPtHard(2.1,-1.0);
674 gener->SetEnergyCMS(5500.);
675 gener->SetNuclei(208,208);
676 break;
677 case kDPluspPb8800:
678 comment = comment.Append(" DPlus in p-Pb at 8.8 TeV");
679 gener = new AliGenPythia(nEvts);
680 gener->SetProcess(kPyDPluspPbMNR);
681 gener->SetStrucFunc(kCTEQ4L);
682 gener->SetPtHard(2.1,-1.0);
683 gener->SetEnergyCMS(8800.);
684 gener->SetProjectile("P",1,1);
685 gener->SetTarget("Pb",208,82);
686 break;
687 case kDPluspp14000:
688 comment = comment.Append(" DPlus in pp at 14 TeV");
689 gener = new AliGenPythia(nEvts);
690 gener->SetProcess(kPyDPlusppMNR);
691 gener->SetStrucFunc(kCTEQ4L);
692 gener->SetPtHard(2.1,-1.0);
693 gener->SetEnergyCMS(14000.);
694 break;
695 case kBeautyPbPb5500:
696 comment = comment.Append(" Beauty in Pb-Pb at 5.5 TeV");
697 gener = new AliGenPythia(nEvts);
698 gener->SetProcess(kPyBeautyPbPbMNR);
699 gener->SetStrucFunc(kCTEQ4L);
700 gener->SetPtHard(2.75,-1.0);
701 gener->SetEnergyCMS(5500.);
702 gener->SetNuclei(208,208);
703 break;
704 case kBeautypPb8800:
705 comment = comment.Append(" Beauty in p-Pb at 8.8 TeV");
706 gener = new AliGenPythia(nEvts);
707 gener->SetProcess(kPyBeautypPbMNR);
708 gener->SetStrucFunc(kCTEQ4L);
709 gener->SetPtHard(2.75,-1.0);
710 gener->SetEnergyCMS(8800.);
711 gener->SetProjectile("P",1,1);
712 gener->SetTarget("Pb",208,82);
713 break;
714 case kBeautypp14000:
715 comment = comment.Append(" Beauty in pp at 14 TeV");
716 gener = new AliGenPythia(nEvts);
717 gener->SetProcess(kPyBeautyppMNR);
718 gener->SetStrucFunc(kCTEQ4L);
719 gener->SetPtHard(2.75,-1.0);
720 gener->SetEnergyCMS(14000.);
721 break;
722 case kBeautypp14000wmi:
723 comment = comment.Append(" Beauty in pp at 14 TeV with mult. interactions");
724 gener = new AliGenPythia(-1);
725 gener->SetProcess(kPyBeautyppMNRwmi);
726 gener->SetStrucFunc(kCTEQ5L);
727 gener->SetPtHard(ptHardMin,ptHardMax);
728 gener->SetEnergyCMS(14000.);
729 break;
730 }
731
732 return gener;
733}
734
735AliGenPythia *PythiaHard(PDC07Proc_t proc) {
736//*******************************************************************//
737// Configuration file for hard QCD processes generation with PYTHIA //
738// //
739//*******************************************************************//
740 AliGenPythia * gener = 0x0;
741
742 switch(proc) {
743
744 case kPyJetJet:
745 comment = comment.Append(" pp->jet + jet over at 14 TeV, no restriction");
746 AliGenPythia * gener = new AliGenPythia(nEvts);
747 gener->SetEnergyCMS(eCMS);// Centre of mass energy
748 gener->SetProcess(kPyJets);// Process type
749 gener->SetJetEtaRange(-1.5, 1.5);// Final state kinematic cuts
750 gener->SetJetPhiRange(0., 360.);
751 gener->SetJetEtRange(10., 1000.);
752 gener->SetPtHard(ptHardMin, ptHardMax);// Pt transfer of the hard scattering
753 gener->SetStrucFunc(kCTEQ4L);
754
755 return gener;
756
757 case kPyGammaJetPHOS:
758 comment = comment.Append(" pp->jet + gamma over PHOS");
759 gener = new AliGenPythia(nEvts);
760 gener->SetEnergyCMS(eCMS);
761 gener->SetProcess(kPyDirectGamma);
762 gener->SetStrucFunc(kCTEQ4L);
763 gener->SetPtHard(ptHardMin,ptHardMax);
764 //gener->SetYHard(-1.0,1.0);
765 gener->SetGammaEtaRange(-0.13,0.13);
766 gener->SetGammaPhiRange(218.,322.);//Over 5 modules +-2 deg
767 break;
768 case kPyJetJetPHOS:
769 comment = comment.Append(" pp->jet + jet over PHOS");
770 gener = new AliGenPythia(nEvts);
771 gener->SetEnergyCMS(eCMS);
772 gener->SetProcess(kPyJets);
773 gener->SetStrucFunc(kCTEQ4L);
774 gener->SetPtHard(ptHardMin,ptHardMax);
775 //gener->SetYHard(-1.0,1.0);
776 gener->SetJetEtaRange(-1.,1.);
777 gener->SetJetPhiRange(200.,340.);
778 gener->SetPi0InPHOS(kTRUE);
779 gener->SetFragPhotonOrPi0MinPt(ptGammaPi0Min);
780
781 printf("\n \n Event generator: Minimum pT of particle in calorimeter %f \n \n", ptGammaPi0Min);
782 break;
783 case kPyGammaBremsPHOS:
784 comment = comment.Append(" pp->jet + jet+bremsphoton over PHOS at 14 TeV");
785 gener = new AliGenPythia(nEvts);
786 gener->SetEnergyCMS(eCMS);
787 gener->SetProcess(kPyJets);
788 gener->SetStrucFunc(kCTEQ4L);
789 gener->SetPtHard(ptHardMin,ptHardMax);
790 //gener->SetYHard(-1.0,1.0);
791 gener->SetJetEtaRange(-1.,1.);
792 gener->SetJetPhiRange(200.,340.);
793 gener->SetFragPhotonInPHOS(kTRUE);
794 gener->SetFragPhotonOrPi0MinPt(ptGammaPi0Min);
795 printf("\n \n Event generator: Minimum pT of particle in calorimeter %f \n \n", ptGammaPi0Min);
796 break;
797 case kPyJetJetPHOSv2:
798 comment = comment.Append(" pp->jet + jet over PHOS version2 ");
799 gener = new AliGenPythia(nEvts);
800 gener->SetEnergyCMS(eCMS);
801 gener->SetProcess(kPyJets);
802 gener->SetStrucFunc(kCTEQ4L);
803 gener->SetPtHard(ptHardMin,ptHardMax);
804 //gener->SetYHard(-1.0,1.0);
805 gener->SetJetEtaRange(-1.,1.);
806 gener->SetJetPhiRange(200.,340.);
807 //gener->SetPi0InPHOS(kTRUE);
808 gener->SetPhotonInPHOSeta(kTRUE);
809 gener->SetPhotonMinPt(ptGammaPi0Min);
810 gener->SetForceDecay(kAll);
811 break;
812 case kPyGammaJetEMCAL:
813 comment = comment.Append(" pp->jet + gamma over EMCAL at 14 TeV");
814 gener = new AliGenPythia(nEvts);
815 gener->SetEnergyCMS(eCMS);
816 gener->SetProcess(kPyDirectGamma);
817 gener->SetStrucFunc(kCTEQ4L);
818 gener->SetPtHard(ptHardMin,ptHardMax);
819 //gener->SetYHard(-1.0,1.0);
820 gener->SetGammaEtaRange(-0.71,0.71);
821 gener->SetGammaPhiRange(78.,192.);//Over 6 supermodules +-2 deg
822 break;
823 case kPyJetJetEMCAL:
824 comment = comment.Append(" pp->jet + jet over EMCAL at 14 TeV");
825 gener = new AliGenPythia(nEvts);
826 gener->SetEnergyCMS(eCMS);
827 gener->SetProcess(kPyJets);
828 gener->SetStrucFunc(kCTEQ4L);
829 gener->SetPtHard(ptHardMin,ptHardMax);
830 //gener->SetYHard(-1.0,1.0);
831 gener->SetJetEtaRange(-1,1);
832 gener->SetJetPhiRange(60.,210.);
833 gener->SetPi0InEMCAL(kTRUE);
834 gener->SetFragPhotonOrPi0MinPt(ptGammaPi0Min);
835 printf("\n \n Event generator: Minimum pT of particle in calorimeter %f \n \n", ptGammaPi0Min);
836 break;
837 case kPyGammaBremsEMCAL:
838 comment = comment.Append(" pp->jet + jet+bremsphoton over EMCAL at 14 TeV");
839 gener = new AliGenPythia(nEvts);
840 gener->SetEnergyCMS(eCMS);
841 gener->SetProcess(kPyJets);
842 gener->SetStrucFunc(kCTEQ4L);
843 gener->SetPtHard(ptHardMin,ptHardMax);
844 //gener->SetYHard(-1.0,1.0);
845 gener->SetJetEtaRange(-1,1);
846 gener->SetJetPhiRange(60.,210.); //Over 2 uncovered PHOS modules
847 gener->SetFragPhotonInEMCAL(kTRUE);
848 gener->SetFragPhotonOrPi0MinPt(ptGammaPi0Min);
849
850 printf("\n \n Event generator: Minimum pT of particle in calorimeter %f \n \n", ptGammaPi0Min);
851 break;
852
853 }
854
855 return gener;
856}
857
858AliGenerator* MbCocktail()
859{
860 comment = comment.Append(" pp at 14 TeV: Pythia low-pt, no heavy quarks + J/Psi from parameterisation");
861 AliGenCocktail * gener = new AliGenCocktail();
862 gener->UsePerEventRates();
863
864// Pythia
865
866 AliGenPythia* pythia = new AliGenPythia(-1);
867 pythia->SetMomentumRange(0, 999999.);
868 pythia->SetThetaRange(0., 180.);
869 pythia->SetYRange(-12.,12.);
870 pythia->SetPtRange(0,1000.);
871 pythia->SetProcess(kPyMb);
872 pythia->SetEnergyCMS(14000.);
873 pythia->SwitchHFOff();
874
875// J/Psi parameterisation
876
877 AliGenParam* jpsi = new AliGenParam(1, AliGenMUONlib::kJpsi, "CDF scaled", "Jpsi");
878 jpsi->SetPtRange(0.,100.);
879 jpsi->SetYRange(-8., 8.);
880 jpsi->SetPhiRange(0., 360.);
881 jpsi->SetForceDecay(kAll);
882
883 gener->AddGenerator(pythia, "Pythia", 1.);
884 gener->AddGenerator(jpsi, "J/Psi", 8.e-4);
885
886 return gener;
887}
888
889AliGenerator* PyMbTriggered(Int_t pdg)
890{
891 AliGenPythia* pythia = new AliGenPythia(-1);
892 pythia->SetMomentumRange(0, 999999.);
893 pythia->SetThetaRange(0., 180.);
894 pythia->SetYRange(-12.,12.);
895 pythia->SetPtRange(0,1000.);
896 pythia->SetProcess(kPyMb);
897 pythia->SetEnergyCMS(14000.);
898 pythia->SetTriggerParticle(pdg, 0.9);
899 return pythia;
900}
901
902void ProcessEnvironmentVars()
903{
904 cout << "######################################" << endl;
905 cout << "## Processing environment variables ##" << endl;
906 cout << "######################################" << endl;
907
908 // Run Number
909 if (gSystem->Getenv("DC_RUN")) {
910 runNumber = atoi(gSystem->Getenv("DC_RUN"));
911 }
912 //cout<<"Run number "<<runNumber<<endl;
913
914 // Event Number
915 if (gSystem->Getenv("DC_EVENT")) {
916 eventNumber = atoi(gSystem->Getenv("DC_EVENT"));
917 }
918 //cout<<"Event number "<<eventNumber<<endl;
919
920 // Random Number seed
921 if (gSystem->Getenv("CONFIG_SEED")) {
922 seed = atoi(gSystem->Getenv("CONFIG_SEED"));
923 }
924 else if(gSystem->Getenv("DC_EVENT") && gSystem->Getenv("DC_RUN")){
925 seed = runNumber * 100000 + eventNumber;
926 }
927
928 gRandom->SetSeed(seed);
929
930 cout<<"////////////////////////////////////////////////////////////////////////////////////"<<endl;
931 cout<<"Seed for random number generation= "<< seed<<" "<< gRandom->GetSeed()<<endl;
932 cout<<"////////////////////////////////////////////////////////////////////////////////////"<<endl;
933
934 // Run type
935 if (gSystem->Getenv("DC_RUN_TYPE")) {
936 cout<<"run type "<<gSystem->Getenv("DC_RUN_TYPE")<<endl;
937 for (Int_t iRun = 0; iRun < kRunMax; iRun++) {
938 if (strcmp(gSystem->Getenv("DC_RUN_TYPE"), pprRunName[iRun])==0) {
939 proc = (PDC07Proc_t)iRun;
940 }
941 }
942 }
943 else
944 cout << "Environment variable DC_RUN_TYPE is not defined" << endl;
945
946 if (gSystem->Getenv("ECMS"))
947 eCMS = atof(gSystem->Getenv("ECMS"));
948 if (gSystem->Getenv("PTHARDMIN"))
949 ptHardMin = atof(gSystem->Getenv("PTHARDMIN"));
950 if (gSystem->Getenv("PTHARDMAX"))
951 ptHardMax = atof(gSystem->Getenv("PTHARDMAX"));
952 if (gSystem->Getenv("PTGAMMAPI0MIN"))
953 ptGammaPi0Min = atof(gSystem->Getenv("PTGAMMAPI0MIN"));
954 if (gSystem->Getenv("QUENCHING"))
955 iquenching = atof(gSystem->Getenv("QUENCHING"));
956 if (gSystem->Getenv("QHAT"))
957 qhat = atof(gSystem->Getenv("QHAT"));
958
959 cout<<">> Run type set to "<<pprRunName[proc]<<endl;
960 cout<<">> Collision energy set to "<<eCMS <<endl;
961 cout<<">> ptHard limits: "<<ptHardMin<<" to " <<ptHardMax<<" GeV"<<endl;
962 cout<<">> pt gamma/pi0 threshold "<< ptGammaPi0Min<<" GeV "<<endl;
963 cout<<">> quenching on? "<< iquenching<<" qhat "<<qhat<<endl;
964
965 cout << "######################################" << endl;
966 cout << "######################################" << endl;
967}