Removal
[u/mrichter/AliRoot.git] / macros / Config_PythiaHeavyFlavours.C
CommitLineData
6ccd5a72 1//*******************************************************************//
2// Configuration file for charm / beauty generation with PYTHIA //
3// //
4// The parameters have been tuned in order to reproduce the inclusive//
5// heavy quark pt distribution given by the NLO pQCD calculation by //
6// Mangano, Nason and Ridolfi. //
7// //
8// For details and for the NORMALIZATION of the yields see: //
9// - "Charm and beauty production at the LHC", ALICE note submitted //
10// and available at: http://www.pd.infn.it/alipd/Docs.html //
11// - Current version of the ALICE PPR (Chapter 6.5) //
12// at: http://alice.web.cern.ch/Alice/ppr/web/CurrentVersion.html //
13//*******************************************************************//
14
15//--- Heavy Flavour Production ---
16enum ProcessHvFl_t
17{
18 kCharmPbPb5500, kCharmpPb8800, kCharmpp14000,
19 kD0PbPb5500, kD0pPb8800, kD0pp14000,
20 kBeautyPbPb5500, kBeautypPb8800, kBeautypp14000
21};
22//--- Decay Mode ---
23enum DecayHvFl_t
24{
25 kNature, kHadr, kSemiEl, kSemiMu
26};
27//--- Rapidity Cut ---
28enum YCut_t
29{
30 kFull, kBarrel, kMuonArm
31};
32//--- Magnetic Field ---
33enum Mag_t
34{
35 k2kG, k4kG, k5kG
36};
37
38// This part for configuration
39static ProcessHvFl_t procHvFl = kCharmPbPb5500;
40static DecayHvFl_t decHvFl = kNature;
41static YCut_t ycut = kFull;
42static Mag_t mag = k4kG;
43// nEvts = -1 : you get 1 QQbar pair and all the fragmentation and
44// decay chain
45// nEvts = N>0 : you get N charm / beauty Hadrons
46Int_t nEvts = -1;
47// stars = kTRUE : all heavy resonances and their decay stored
48// = kFALSE: only final heavy hadrons and their decays stored
49Bool_t stars = kTRUE;
50
51
52// Comment line
53static TString comment;
54
55void Config()
56{
57
58 //========================//
59 // Set Random Number seed //
60 //========================//
61 TDatime dt;
62 UInt_t curtime=dt.Get();
63 UInt_t procid=gSystem->GetPid();
64 UInt_t seed=curtime-procid;
65
66 gRandom->SetSeed(12345);
67 cerr<<"Seed for random number generation= "<<seed<<endl;
68
69 // libraries required by geant321
70 gSystem->Load("libgeant321");
71
72 new TGeant3("C++ Interface to Geant3");
73
74 //=======================================================================
75 // Create the output file
76 TFile *rootfile = new TFile("galice.root","recreate");
77 rootfile->SetCompressionLevel(2);
6ccd5a72 78 //
79 //=======================================================================
80 // ************* STEERING parameters FOR ALICE SIMULATION **************
81 // --- Specify event type to be tracked through the ALICE setup
82 // --- All positions are in cm, angles in degrees, and P and E in GeV
6a3df6c9 83
84
85 gMC->SetProcess("DCAY",1);
86 gMC->SetProcess("PAIR",1);
87 gMC->SetProcess("COMP",1);
88 gMC->SetProcess("PHOT",1);
89 gMC->SetProcess("PFIS",0);
90 gMC->SetProcess("DRAY",0);
91 gMC->SetProcess("ANNI",1);
92 gMC->SetProcess("BREM",1);
93 gMC->SetProcess("MUNU",1);
94 gMC->SetProcess("CKOV",1);
95 gMC->SetProcess("HADR",1);
96 gMC->SetProcess("LOSS",2);
97 gMC->SetProcess("MULS",1);
98 gMC->SetProcess("RAYL",1);
99
100 Float_t cut = 1.e-3; // 1MeV cut by default
101 Float_t tofmax = 1.e10;
102
103 gMC->SetCut("CUTGAM", cut);
104 gMC->SetCut("CUTELE", cut);
105 gMC->SetCut("CUTNEU", cut);
106 gMC->SetCut("CUTHAD", cut);
107 gMC->SetCut("CUTMUO", cut);
108 gMC->SetCut("BCUTE", cut);
109 gMC->SetCut("BCUTM", cut);
110 gMC->SetCut("DCUTE", cut);
111 gMC->SetCut("DCUTM", cut);
112 gMC->SetCut("PPCUTM", cut);
113 gMC->SetCut("TOFMAX", tofmax);
114
115
116
117
6ccd5a72 118 // Set External decayer //
119 //======================//
120 TVirtualMCDecayer* decayer = new AliDecayerPythia();
121 // DECAYS
122 //
123 switch(decHvFl) {
124 case kNature:
125 decayer->SetForceDecay(kAll);
126 break;
127 case kHadr:
128 decayer->SetForceDecay(kHadronicD);
129 break;
130 case kSemiEl:
131 decayer->SetForceDecay(kSemiElectronic);
132 break;
133 case kSemiMu:
134 decayer->SetForceDecay(kSemiMuonic);
135 break;
136 }
137 decayer->Init();
138 gMC->SetExternalDecayer(decayer);
139
140 //=========================//
141 // Generator Configuration //
142 //=========================//
143 AliGenPythia *pythia = PythiaHVQ(procHvFl);
144 // FeedDown option
145 pythia->SetFeedDownHigherFamily(kFALSE);
146 // Stack filling option
147 if(!stars) pythia->SetStackFillOpt(AliGenPythia::kParentSelection);
148 // Set Count mode
149 if(nEvts>0) pythia->SetCountMode(AliGenPythia::kCountParents);
150 // DECAYS
151 //
152 switch(decHvFl) {
153 case kNature:
154 pythia->SetForceDecay(kAll);
155 break;
156 case kHadr:
157 pythia->SetForceDecay(kHadronicD);
158 break;
159 case kSemiEl:
160 pythia->SetForceDecay(kSemiElectronic);
161 break;
162 case kSemiMu:
163 pythia->SetForceDecay(kSemiMuonic);
164 break;
165 }
166 // GEOM & KINE CUTS
167 //
168 pythia->SetMomentumRange(0,99999999);
0ac28de4 169 pythia->SetPhiRange(0., 360.);
6ccd5a72 170 pythia->SetThetaRange(0,180);
171 switch(ycut) {
172 case kFull:
173 pythia->SetYRange(-999,999);
174 break;
175 case kBarrel:
176 pythia->SetYRange(-2,2);
177 break;
178 case kMuonArm:
179 pythia->SetYRange(1,6);
180 break;
181 }
182
183 // PRIMARY VERTEX
184 //
185 pythia->SetOrigin(0, 0, 0); // vertex position
186 pythia->SetSigma(0, 0, 5.3); // Sigma in (X,Y,Z) (cm) on IP position
187 pythia->SetCutVertexZ(1.); // Truncate at 1 sigma
188 pythia->SetVertexSmear(kPerEvent);
189
190
191
192 pythia->SetTrackingFlag(0);
193 // Specify GEANT tracking limits (Rmax, Zmax)
194 //gAlice->TrackingLimits(90.,1.0e10);
195
196
197 pythia->Init();
198
199 // FIELD
200 //
201 if (mag == k2kG) {
202 comment = comment.Append(" | L3 field 0.2 T");
203 } else if (mag == k4kG) {
204 comment = comment.Append(" | L3 field 0.4 T");
205 } else if (mag == k5kG) {
206 comment = comment.Append(" | L3 field 0.5 T");
207 }
208 printf("\n \n Comment: %s \n \n", (char*) comment);
209
210 AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 2, 1., 10., mag);
211 rootfile->cd();
212 gAlice->SetField(field);
213
214
215 // By default all ALICE is switched off
216 Int_t iABSO=0;
217 Int_t iCRT=0;
218 Int_t iDIPO=0;
219 Int_t iFMD=0;
220 Int_t iFRAME=0;
221 Int_t iHALL=0;
222 Int_t iITS=0;
223 Int_t iMAG=0;
224 Int_t iMUON=0;
225 Int_t iPHOS=0;
226 Int_t iPIPE=0;
227 Int_t iPMD=0;
228 Int_t iRICH=0;
229 Int_t iSHIL=0;
230 Int_t iSTART=0;
231 Int_t iTOF=0;
232 Int_t iTPC=0;
233 Int_t iTRD=0;
234 Int_t iZDC=0;
235
236 //=================== Alice BODY parameters =============================
237 AliBODY *BODY = new AliBODY("BODY","Alice envelop");
238
239 if(iMAG) {
240 //=================== MAG parameters ============================
241 // --- Start with Magnet since detector layouts may be depending ---
242 // --- on the selected Magnet dimensions ---
243 AliMAG *MAG = new AliMAG("MAG","Magnet");
244 }
245
246
247 if(iABSO) {
248 //=================== ABSO parameters ============================
249 AliABSO *ABSO = new AliABSOv0("ABSO","Muon Absorber");
250 }
251
252 if(iDIPO) {
253 //=================== DIPO parameters ============================
254
255 AliDIPO *DIPO = new AliDIPOv2("DIPO","Dipole version 2");
256 }
257
258 if(iHALL) {
259 //=================== HALL parameters ============================
260
261 AliHALL *HALL = new AliHALL("HALL","Alice Hall");
262 }
263
264
265 if(iFRAME) {
266 //=================== FRAME parameters ============================
267
268 AliFRAME *FRAME = new AliFRAMEv2("FRAME","Space Frame");
269
270 }
271
272 if(iSHIL) {
273 //=================== SHIL parameters ============================
274
275 AliSHIL *SHIL = new AliSHILv2("SHIL","Shielding");
276 }
277
278
279 if(iPIPE) {
280 //=================== PIPE parameters ============================
281
282 AliPIPE *PIPE = new AliPIPEv0("PIPE","Beam Pipe");
283 }
284
285
286 if(iITS) {
287
288//=================== ITS parameters ============================
289 //
290 // As the innermost detector in ALICE, the Inner Tracking System "impacts" on
291 // almost all other detectors. This involves the fact that the ITS geometry
292 // still has several options to be followed in parallel in order to determine
293 // the best set-up which minimizes the induced background. All the geometries
294 // available to date are described in the following. Read carefully the comments
295 // and use the default version (the only one uncommented) unless you are making
296 // comparisons and you know what you are doing. In this case just uncomment the
297 // ITS geometry you want to use and run Aliroot.
298 //
299 // Detailed geometries:
300 //
301 //
302 //AliITS *ITS = new AliITSv5symm("ITS","Updated ITS TDR detailed version with symmetric services");
303 //
304 //AliITS *ITS = new AliITSv5asymm("ITS","Updates ITS TDR detailed version with asymmetric services");
305 //
306 AliITSvPPRasymm *ITS = new AliITSvPPRasymm("ITS","New ITS PPR detailed version with asymmetric services");
307 ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
308 ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
309 ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRasymm2.det"); // don't touch this parameter if you're not an ITS developer
310 ITS->SetThicknessDet1(200.); // detector thickness on layer 1 must be in the range [150,300]
311 ITS->SetThicknessDet2(200.); // detector thickness on layer 2 must be in the range [150,300]
312 ITS->SetThicknessChip1(200.); // chip thickness on layer 1 must be in the range [100,300]
313 ITS->SetThicknessChip2(200.); // chip thickness on layer 2 must be in the range [100,300]
314 ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
315 ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
316 //
317 //AliITSvPPRsymm *ITS = new AliITSvPPRsymm("ITS","New ITS PPR detailed version with symmetric services");
318 //ITS->SetMinorVersion(2); // don't touch this parameter if you're not an ITS developer
319 //ITS->SetReadDet(kFALSE); // don't touch this parameter if you're not an ITS developer
320 //ITS->SetWriteDet("$ALICE_ROOT/ITS/ITSgeometry_vPPRsymm2.det"); // don't touch this parameter if you're not an ITS developer
321 //ITS->SetThicknessDet1(300.); // detector thickness on layer 1 must be in the range [150,300]
322 //ITS->SetThicknessDet2(300.); // detector thickness on layer 2 must be in the range [150,300]
323 //ITS->SetThicknessChip1(300.); // chip thickness on layer 1 must be in the range [100,300]
324 //ITS->SetThicknessChip2(300.); // chip thickness on layer 2 must be in the range [100,300]
325 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
326 //ITS->SetCoolingFluid(1); // 1 --> water ; 0 --> freon
327 //
328 //
329 // Coarse geometries (warning: no hits are produced with these coarse geometries and they unuseful
330 // for reconstruction !):
331 //
332 //
333 //AliITSvPPRcoarseasymm *ITS = new AliITSvPPRcoarseasymm("ITS","New ITS PPR coarse version with asymmetric services");
334 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
335 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
336 //
337 //AliITS *ITS = new AliITSvPPRcoarsesymm("ITS","New ITS PPR coarse version with symmetric services");
338 //ITS->SetRails(1); // 1 --> rails in ; 0 --> rails out
339 //ITS->SetSupportMaterial(0); // 0 --> Copper ; 1 --> Aluminum ; 2 --> Carbon
340 //
341 //
342 //
343 // Geant3 <-> EUCLID conversion
344 // ============================
345 //
346 // SetEUCLID is a flag to output (=1) or not to output (=0) both geometry and
347 // media to two ASCII files (called by default ITSgeometry.euc and
348 // ITSgeometry.tme) in a format understandable to the CAD system EUCLID.
349 // The default (=0) means that you dont want to use this facility.
350 //
351 ITS->SetEUCLID(0);
352 }
353
354
355 if(iTPC) {
356 //============================ TPC parameters ================================
357 // --- This allows the user to specify sectors for the SLOW (TPC geometry 2)
358 // --- Simulator. SecAL (SecAU) <0 means that ALL lower (upper)
359 // --- sectors are specified, any value other than that requires at least one
360 // --- sector (lower or upper)to be specified!
361 // --- Reminder: sectors 1-24 are lower sectors (1-12 -> z>0, 13-24 -> z<0)
362 // --- sectors 25-72 are the upper ones (25-48 -> z>0, 49-72 -> z<0)
363 // --- SecLows - number of lower sectors specified (up to 6)
364 // --- SecUps - number of upper sectors specified (up to 12)
365 // --- Sens - sensitive strips for the Slow Simulator !!!
366 // --- This does NOT work if all S or L-sectors are specified, i.e.
367 // --- if SecAL or SecAU < 0
368 //
369 //
370 //-----------------------------------------------------------------------------
371
372 // gROOT->LoadMacro("SetTPCParam.C");
373 // AliTPCParam *param = SetTPCParam();
374 AliTPC *TPC = new AliTPCv2("TPC","Default");
375 // All sectors included
376 TPC->SetSecAL(-1);
377 TPC->SetSecAU(-1);
378
379 }
380
381
382 if(iTOF) {
383 //=================== TOF parameters ============================
384 AliTOF *TOF = new AliTOFv2("TOF","normal TOF");
385 }
386
387 if(iRICH) {
388 //=================== RICH parameters ===========================
389 AliRICH *RICH = new AliRICHv1("RICH","normal RICH");
390
391 }
392
393
394 if(iZDC) {
395 //=================== ZDC parameters ============================
396
397 AliZDC *ZDC = new AliZDCv1("ZDC","normal ZDC");
398 }
399
400 if(iCRT) {
401 //=================== CRT parameters ============================
402
403 AliCRT *CRT = new AliCRTv1("CRT","normal CRT");
404 }
405
406 if(iTRD) {
407 //=================== TRD parameters ============================
408
409 AliTRD *TRD = new AliTRDv1("TRD","TRD slow simulator");
410
411 // Select the gas mixture (0: 97% Xe + 3% isobutane, 1: 90% Xe + 10% CO2)
412 TRD->SetGasMix(1);
413
414 // With hole in front of PHOS
415 TRD->SetPHOShole();
416 // With hole in front of RICH
417 TRD->SetRICHhole();
418 // Switch on TR
419 AliTRDsim *TRDsim = TRD->CreateTR();
420 }
421
422 if(iFMD) {
423 //=================== FMD parameters ============================
424
425 AliFMD *FMD = new AliFMDv0("FMD","normal FMD");
426 }
427
428 if(iMUON) {
429 //=================== MUON parameters ===========================
430 AliMUON *MUON = new AliMUONv1("MUON","default");
431 }
432
433 //=================== PHOS parameters ===========================
434
435 if(iPHOS) {
436 AliPHOS *PHOS = new AliPHOSv1("PHOS","GPS2");
437 }
438
439
440 //=================== CRT parameters ===========================
441
442 if(iCRT) {
443 AliCRT *CRT = new AliCRTv1("CRT","Normal CRTGPS2");
444 }
445
446
447 if(iPMD) {
448 //=================== PMD parameters ============================
449
450 AliPMD *PMD = new AliPMDv1("PMD","normal PMD");
451 PMD->SetPAR(1., 1., 0.8, 0.02);
452 PMD->SetIN(6., 18., -580., 27., 27.);
453 PMD->SetGEO(0.0, 0.2, 4.);
454 PMD->SetPadSize(0.8, 1.0, 1.0, 1.5);
455
456 }
457
458 if(iSTART) {
459 //=================== START parameters ============================
460 AliSTART *START = new AliSTARTv1("START","START Detector");
461 }
462
463
464}
465//
466// PYTHIA
467//
468AliGenPythia *PythiaHVQ(ProcessHvFl_t proc) {
469
470 switch(proc) {
471 case kCharmPbPb5500:
472 comment = comment.Append(" Charm in Pb-Pb at 5.5 TeV");
473 AliGenPythia *gener = new AliGenPythia(nEvts);
474 gener->SetProcess(kPyCharmPbPbMNR);
475 gener->SetStrucFunc(kCTEQ4L);
476 gener->SetPtHard(2.1,-1.0);
477 gener->SetEnergyCMS(5500.);
478 gener->SetNuclei(208,208);
479 break;
480 case kCharmpPb8800:
481 comment = comment.Append(" Charm in p-Pb at 8.8 TeV");
482 AliGenPythia *gener = new AliGenPythia(nEvts);
483 gener->SetProcess(kPyCharmpPbMNR);
484 gener->SetStrucFunc(kCTEQ4L);
485 gener->SetPtHard(2.1,-1.0);
486 gener->SetEnergyCMS(8800.);
487 gener->SetProjectile("P",1,1);
488 gener->SetTarget("Pb",208,82);
489 break;
490 case kCharmpp14000:
491 comment = comment.Append(" Charm in pp at 14 TeV");
492 AliGenPythia *gener = new AliGenPythia(nEvts);
493 gener->SetProcess(kPyCharmppMNR);
494 gener->SetStrucFunc(kCTEQ4L);
495 gener->SetPtHard(2.1,-1.0);
496 gener->SetEnergyCMS(14000.);
497 break;
498 case kD0PbPb5500:
499 comment = comment.Append(" D0 in Pb-Pb at 5.5 TeV");
500 AliGenPythia *gener = new AliGenPythia(nEvts);
501 gener->SetProcess(kPyD0PbPbMNR);
502 gener->SetStrucFunc(kCTEQ4L);
503 gener->SetPtHard(2.1,-1.0);
504 gener->SetEnergyCMS(5500.);
505 gener->SetNuclei(208,208);
506 break;
507 case kD0pPb8800:
508 comment = comment.Append(" D0 in p-Pb at 8.8 TeV");
509 AliGenPythia *gener = new AliGenPythia(nEvts);
510 gener->SetProcess(kPyD0pPbMNR);
511 gener->SetStrucFunc(kCTEQ4L);
512 gener->SetPtHard(2.1,-1.0);
513 gener->SetEnergyCMS(8800.);
514 gener->SetProjectile("P",1,1);
515 gener->SetTarget("Pb",208,82);
516 break;
517 case kD0pp14000:
518 comment = comment.Append(" D0 in pp at 14 TeV");
519 AliGenPythia *gener = new AliGenPythia(nEvts);
520 gener->SetProcess(kPyD0ppMNR);
521 gener->SetStrucFunc(kCTEQ4L);
522 gener->SetPtHard(2.1,-1.0);
523 gener->SetEnergyCMS(14000.);
524 break;
525 case kBeautyPbPb5500:
526 comment = comment.Append(" Beauty in Pb-Pb at 5.5 TeV");
527 AliGenPythia *gener = new AliGenPythia(nEvts);
528 gener->SetProcess(kPyBeautyPbPbMNR);
529 gener->SetStrucFunc(kCTEQ4L);
530 gener->SetPtHard(2.75,-1.0);
531 gener->SetEnergyCMS(5500.);
532 gener->SetNuclei(208,208);
533 break;
534 case kBeautypPb8800:
535 comment = comment.Append(" Beauty in p-Pb at 8.8 TeV");
536 AliGenPythia *gener = new AliGenPythia(nEvts);
537 gener->SetProcess(kPyBeautypPbMNR);
538 gener->SetStrucFunc(kCTEQ4L);
539 gener->SetPtHard(2.75,-1.0);
540 gener->SetEnergyCMS(8800.);
541 gener->SetProjectile("P",1,1);
542 gener->SetTarget("Pb",208,82);
543 break;
544 case kBeautypp14000:
545 comment = comment.Append(" Beauty in pp at 14 TeV");
546 AliGenPythia *gener = new AliGenPythia(nEvts);
547 gener->SetProcess(kPyBeautyppMNR);
548 gener->SetStrucFunc(kCTEQ4L);
549 gener->SetPtHard(2.75,-1.0);
550 gener->SetEnergyCMS(14000.);
551 break;
552 }
553
554 return gener;
555}
556
557
558
559
560