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