Dummy kCTEQ6ll added.
[u/mrichter/AliRoot.git] / PYTHIA6 / AliPythia.cxx
CommitLineData
6b435cde 1
8d2cd130 2/**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
7 * *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
16
7cdba479 17/* $Id$ */
8d2cd130 18
19#include "AliPythia.h"
7cdba479 20#include "AliPythiaRndm.h"
0f482ae4 21#include "../FASTSIM/AliFastGlauber.h"
22#include "../FASTSIM/AliQuenchingWeights.h"
23#include "TVector3.h"
8d2cd130 24
25ClassImp(AliPythia)
26
27#ifndef WIN32
28# define pyclus pyclus_
29# define pycell pycell_
452af8c7 30# define pyshow pyshow_
31# define pyrobo pyrobo_
992f2843 32# define pyquen pyquen_
16a82508 33# define pyevnw pyevnw_
8d2cd130 34# define type_of_call
35#else
36# define pyclus PYCLUS
37# define pycell PYCELL
452af8c7 38# define pyrobo PYROBO
992f2843 39# define pyquen PYQUEN
16a82508 40# define pyevnw PYEVNW
8d2cd130 41# define type_of_call _stdcall
42#endif
43
44extern "C" void type_of_call pyclus(Int_t & );
45extern "C" void type_of_call pycell(Int_t & );
452af8c7 46extern "C" void type_of_call pyshow(Int_t &, Int_t &, Double_t &);
47extern "C" void type_of_call pyrobo(Int_t &, Int_t &, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &);
992f2843 48extern "C" void type_of_call pyquen(Double_t &, Int_t &, Double_t &);
0a2cfc0a 49extern "C" void type_of_call pyevnw(){;}
8d2cd130 50
51//_____________________________________________________________________________
52
53AliPythia* AliPythia::fgAliPythia=NULL;
54
e8a8adcd 55AliPythia::AliPythia():
56 fProcess(kPyMb),
57 fEcms(0.),
58 fStrucFunc(kCTEQ5L),
59 fXJet(0.),
60 fYJet(0.),
61 fGlauber(0),
62 fQuenchingWeights(0)
8d2cd130 63{
64// Default Constructor
65//
66// Set random number
7cdba479 67 if (!AliPythiaRndm::GetPythiaRandom())
68 AliPythiaRndm::SetPythiaRandom(GetRandom());
0f482ae4 69 fGlauber = 0;
70 fQuenchingWeights = 0;
8d2cd130 71}
72
e8a8adcd 73AliPythia::AliPythia(const AliPythia& pythia):
6b435cde 74 TPythia6(pythia),
75 AliRndm(pythia),
e8a8adcd 76 fProcess(kPyMb),
77 fEcms(0.),
78 fStrucFunc(kCTEQ5L),
79 fXJet(0.),
80 fYJet(0.),
81 fGlauber(0),
82 fQuenchingWeights(0)
83{
84 // Copy Constructor
85 pythia.Copy(*this);
86}
87
8d2cd130 88void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc)
89{
90// Initialise the process to generate
7cdba479 91 if (!AliPythiaRndm::GetPythiaRandom())
92 AliPythiaRndm::SetPythiaRandom(GetRandom());
8d2cd130 93
94 fProcess = process;
95 fEcms = energy;
96 fStrucFunc = strucfunc;
1d5b1b20 97//...Switch off decay of pi0, K0S, Lambda, Sigma+-, Xi0-, Omega-.
98 SetMDCY(Pycomp(111) ,1,0);
99 SetMDCY(Pycomp(310) ,1,0);
100 SetMDCY(Pycomp(3122),1,0);
101 SetMDCY(Pycomp(3112),1,0);
102 SetMDCY(Pycomp(3212),1,0);
103 SetMDCY(Pycomp(3222),1,0);
104 SetMDCY(Pycomp(3312),1,0);
105 SetMDCY(Pycomp(3322),1,0);
106 SetMDCY(Pycomp(3334),1,0);
1c50ec12 107 // Select structure function
8d2cd130 108 SetMSTP(52,2);
109 SetMSTP(51,strucfunc);
1c50ec12 110 // Particles produced in string fragmentation point directly to either of the two endpoints
111 // of the string (depending in the side they were generated from).
112 SetMSTU(16,2);
113
8d2cd130 114//
115// Pythia initialisation for selected processes//
116//
117// Make MSEL clean
118//
119 for (Int_t i=1; i<= 200; i++) {
120 SetMSUB(i,0);
121 }
122// select charm production
123 switch (process)
124 {
65f2626c 125 case kPyOldUEQ2ordered: //Old underlying events with Q2 ordered QCD processes
126// Multiple interactions on.
127 SetMSTP(81,1);
128// Double Gaussian matter distribution.
129 SetMSTP(82,4);
130 SetPARP(83,0.5);
131 SetPARP(84,0.4);
132// pT0.
133 SetPARP(82,2.0);
134// Reference energy for pT0 and energy rescaling pace.
135 SetPARP(89,1800);
136 SetPARP(90,0.25);
137// String drawing almost completely minimizes string length.
138 SetPARP(85,0.9);
139 SetPARP(86,0.95);
140// ISR and FSR activity.
141 SetPARP(67,4);
142 SetPARP(71,4);
143// Lambda_FSR scale.
144 SetPARJ(81,0.29);
145 break;
146 case kPyOldUEQ2ordered2:
147// Old underlying events with Q2 ordered QCD processes
148// Multiple interactions on.
149 SetMSTP(81,1);
150// Double Gaussian matter distribution.
151 SetMSTP(82,4);
152 SetPARP(83,0.5);
153 SetPARP(84,0.4);
154// pT0.
155 SetPARP(82,2.0);
156// Reference energy for pT0 and energy rescaling pace.
157 SetPARP(89,1800);
158 SetPARP(90,0.16); // here is the difference with kPyOldUEQ2ordered
159// String drawing almost completely minimizes string length.
160 SetPARP(85,0.9);
161 SetPARP(86,0.95);
162// ISR and FSR activity.
163 SetPARP(67,4);
164 SetPARP(71,4);
165// Lambda_FSR scale.
166 SetPARJ(81,0.29);
167 break;
168 case kPyOldPopcorn:
169// Old production mechanism: Old Popcorn
170 SetMSEL(1);
171 SetMSTJ(12,3);
172// (D=2) Like MSTJ(12)=2 but added prod ofthe 1er rank baryon
173 SetMSTP(88,2);
174// (D=1)see can be used to form baryons (BARYON JUNCTION)
175 SetMSTJ(1,1);
e0e89f40 176 AtlasTuning();
65f2626c 177 break;
8d2cd130 178 case kPyCharm:
179 SetMSEL(4);
8d2cd130 180// heavy quark masses
181
182 SetPMAS(4,1,1.2);
8d2cd130 183//
184// primordial pT
185 SetMSTP(91,1);
186 SetPARP(91,1.);
187 SetPARP(93,5.);
188//
189 break;
190 case kPyBeauty:
191 SetMSEL(5);
192 SetPMAS(5,1,4.75);
8d2cd130 193 break;
194 case kPyJpsi:
195 SetMSEL(0);
196// gg->J/Psi g
197 SetMSUB(86,1);
198 break;
199 case kPyJpsiChi:
200 SetMSEL(0);
201// gg->J/Psi g
202 SetMSUB(86,1);
203// gg-> chi_0c g
204 SetMSUB(87,1);
205// gg-> chi_1c g
206 SetMSUB(88,1);
207// gg-> chi_2c g
208 SetMSUB(89,1);
209 break;
210 case kPyCharmUnforced:
211 SetMSEL(0);
212// gq->qg
213 SetMSUB(28,1);
214// gg->qq
215 SetMSUB(53,1);
216// gg->gg
217 SetMSUB(68,1);
218 break;
219 case kPyBeautyUnforced:
220 SetMSEL(0);
221// gq->qg
222 SetMSUB(28,1);
223// gg->qq
224 SetMSUB(53,1);
225// gg->gg
226 SetMSUB(68,1);
227 break;
228 case kPyMb:
229// Minimum Bias pp-Collisions
230//
231//
232// select Pythia min. bias model
233 SetMSEL(0);
511db649 234 SetMSUB(92,1); // single diffraction AB-->XB
235 SetMSUB(93,1); // single diffraction AB-->AX
236 SetMSUB(94,1); // double diffraction
237 SetMSUB(95,1); // low pt production
238
e0e89f40 239 AtlasTuning();
511db649 240 break;
8d2cd130 241 case kPyMbNonDiffr:
242// Minimum Bias pp-Collisions
243//
244//
245// select Pythia min. bias model
246 SetMSEL(0);
511db649 247 SetMSUB(95,1); // low pt production
0f482ae4 248
e0e89f40 249 AtlasTuning();
8d2cd130 250 break;
d7de4a67 251 case kPyMbMSEL1:
252 ConfigHeavyFlavor();
253// Intrinsic <kT^2>
254 SetMSTP(91,1);// Width (1=gaussian) primordial kT dist. inside hadrons
255 SetPARP(91,1.); // <kT^2> = PARP(91,1.)^2
256 SetPARP(93,5.); // Upper cut-off
257// Set Q-quark mass
258 SetPMAS(4,1,1.2); // Charm quark mass
259 SetPMAS(5,1,4.78); // Beauty quark mass
260 SetPARP(71,4.); // Defaut value
261// Atlas Tuning
262 AtlasTuning();
263 break;
8d2cd130 264 case kPyJets:
265//
266// QCD Jets
267//
268 SetMSEL(1);
65f2626c 269 // Pythia Tune A (CDF)
270 //
271 SetPARP(67,4.); // Regulates Initial State Radiation
272 SetMSTP(82,4); // Double Gaussian Model
273 SetPARP(82,2.0); // [GeV] PT_min at Ref. energy
274 SetPARP(84,0.4); // Core radius
275 SetPARP(85,0.90) ; // Regulates gluon prod. mechanism
276 SetPARP(86,0.95); // Regulates gluon prod. mechanism
277 SetPARP(89,1800.); // [GeV] Ref. energy
278 SetPARP(90,0.25); // 2*epsilon (exponent in power law)
279 break;
8d2cd130 280 case kPyDirectGamma:
281 SetMSEL(10);
282 break;
adf4d898 283 case kPyCharmPbPbMNR:
284 case kPyD0PbPbMNR:
90d7b703 285 case kPyDPlusPbPbMNR:
e0e89f40 286 case kPyDPlusStrangePbPbMNR:
90d7b703 287 // Tuning of Pythia parameters aimed to get a resonable agreement
288 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
289 // c-cbar single inclusive and double differential distributions.
290 // This parameter settings are meant to work with Pb-Pb collisions
291 // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
292 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
293 // has to be set to 2.1GeV. Example in ConfigCharmPPR.C.
3dc3ec94 294 ConfigHeavyFlavor();
90d7b703 295 // Intrinsic <kT>
296 SetMSTP(91,1);
297 SetPARP(91,1.304);
298 SetPARP(93,6.52);
90d7b703 299 // Set c-quark mass
300 SetPMAS(4,1,1.2);
90d7b703 301 break;
adf4d898 302 case kPyCharmpPbMNR:
303 case kPyD0pPbMNR:
90d7b703 304 case kPyDPluspPbMNR:
e0e89f40 305 case kPyDPlusStrangepPbMNR:
90d7b703 306 // Tuning of Pythia parameters aimed to get a resonable agreement
307 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
308 // c-cbar single inclusive and double differential distributions.
309 // This parameter settings are meant to work with p-Pb collisions
310 // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
311 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
312 // has to be set to 2.1GeV. Example in ConfigCharmPPR.C.
3dc3ec94 313 ConfigHeavyFlavor();
90d7b703 314 // Intrinsic <kT>
3dc3ec94 315 SetMSTP(91,1);
316 SetPARP(91,1.16);
317 SetPARP(93,5.8);
318
90d7b703 319 // Set c-quark mass
3dc3ec94 320 SetPMAS(4,1,1.2);
90d7b703 321 break;
adf4d898 322 case kPyCharmppMNR:
323 case kPyD0ppMNR:
90d7b703 324 case kPyDPlusppMNR:
e0e89f40 325 case kPyDPlusStrangeppMNR:
90d7b703 326 // Tuning of Pythia parameters aimed to get a resonable agreement
327 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
328 // c-cbar single inclusive and double differential distributions.
329 // This parameter settings are meant to work with pp collisions
330 // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
331 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
332 // has to be set to 2.1GeV. Example in ConfigCharmPPR.C.
3dc3ec94 333 ConfigHeavyFlavor();
90d7b703 334 // Intrinsic <kT^2>
3dc3ec94 335 SetMSTP(91,1);
336 SetPARP(91,1.);
337 SetPARP(93,5.);
338
90d7b703 339 // Set c-quark mass
3dc3ec94 340 SetPMAS(4,1,1.2);
90d7b703 341 break;
e0e89f40 342 case kPyCharmppMNRwmi:
343 // Tuning of Pythia parameters aimed to get a resonable agreement
344 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
345 // c-cbar single inclusive and double differential distributions.
346 // This parameter settings are meant to work with pp collisions
347 // and with kCTEQ5L PDFs.
348 // Added multiple interactions according to ATLAS tune settings.
349 // To get a "reasonable" agreement with MNR results, events have to be
350 // generated with the minimum ptHard (AliGenPythia::SetPtHard)
351 // set to 2.76 GeV.
352 // To get a "perfect" agreement with MNR results, events have to be
353 // generated in four ptHard bins with the following relative
354 // normalizations:
355 // 2.76-3 GeV: 25%
356 // 3-4 GeV: 40%
357 // 4-8 GeV: 29%
358 // >8 GeV: 6%
359 ConfigHeavyFlavor();
360 // Intrinsic <kT^2>
361 SetMSTP(91,1);
362 SetPARP(91,1.);
363 SetPARP(93,5.);
364
365 // Set c-quark mass
366 SetPMAS(4,1,1.2);
367 AtlasTuning();
368 break;
adf4d898 369 case kPyBeautyPbPbMNR:
8d2cd130 370 // Tuning of Pythia parameters aimed to get a resonable agreement
371 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
372 // b-bbar single inclusive and double differential distributions.
373 // This parameter settings are meant to work with Pb-Pb collisions
374 // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
375 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
376 // has to be set to 2.75GeV. Example in ConfigBeautyPPR.C.
3dc3ec94 377 ConfigHeavyFlavor();
8d2cd130 378 // QCD scales
3dc3ec94 379 SetPARP(67,1.0);
380 SetPARP(71,1.0);
adf4d898 381 // Intrinsic <kT>
3dc3ec94 382 SetMSTP(91,1);
383 SetPARP(91,2.035);
384 SetPARP(93,10.17);
8d2cd130 385 // Set b-quark mass
3dc3ec94 386 SetPMAS(5,1,4.75);
8d2cd130 387 break;
adf4d898 388 case kPyBeautypPbMNR:
389 // Tuning of Pythia parameters aimed to get a resonable agreement
390 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
391 // b-bbar single inclusive and double differential distributions.
392 // This parameter settings are meant to work with p-Pb collisions
393 // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
394 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
395 // has to be set to 2.75GeV. Example in ConfigBeautyPPR.C.
3dc3ec94 396 ConfigHeavyFlavor();
adf4d898 397 // QCD scales
3dc3ec94 398 SetPARP(67,1.0);
399 SetPARP(71,1.0);
adf4d898 400 // Intrinsic <kT>
3dc3ec94 401 SetMSTP(91,1);
402 SetPARP(91,1.60);
403 SetPARP(93,8.00);
adf4d898 404 // Set b-quark mass
3dc3ec94 405 SetPMAS(5,1,4.75);
adf4d898 406 break;
407 case kPyBeautyppMNR:
408 // Tuning of Pythia parameters aimed to get a resonable agreement
409 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
410 // b-bbar single inclusive and double differential distributions.
411 // This parameter settings are meant to work with pp collisions
412 // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
413 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
414 // has to be set to 2.75GeV. Example in ConfigBeautyPPR.C.
3dc3ec94 415 ConfigHeavyFlavor();
adf4d898 416 // QCD scales
3dc3ec94 417 SetPARP(67,1.0);
418 SetPARP(71,1.0);
419
420 // Intrinsic <kT>
421 SetMSTP(91,1);
422 SetPARP(91,1.);
423 SetPARP(93,5.);
424
425 // Set b-quark mass
426 SetPMAS(5,1,4.75);
adf4d898 427 break;
e0e89f40 428 case kPyBeautyppMNRwmi:
429 // Tuning of Pythia parameters aimed to get a resonable agreement
430 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
431 // b-bbar single inclusive and double differential distributions.
432 // This parameter settings are meant to work with pp collisions
433 // and with kCTEQ5L PDFs.
434 // Added multiple interactions according to ATLAS tune settings.
435 // To get a "reasonable" agreement with MNR results, events have to be
436 // generated with the minimum ptHard (AliGenPythia::SetPtHard)
437 // set to 2.76 GeV.
438 // To get a "perfect" agreement with MNR results, events have to be
439 // generated in four ptHard bins with the following relative
440 // normalizations:
441 // 2.76-4 GeV: 5%
442 // 4-6 GeV: 31%
443 // 6-8 GeV: 28%
444 // >8 GeV: 36%
445 ConfigHeavyFlavor();
446 // QCD scales
447 SetPARP(67,1.0);
448 SetPARP(71,1.0);
449
450 // Intrinsic <kT>
451 SetMSTP(91,1);
452 SetPARP(91,1.);
453 SetPARP(93,5.);
454
455 // Set b-quark mass
456 SetPMAS(5,1,4.75);
457
458 AtlasTuning();
459 break;
589380c6 460 case kPyW:
461
462 //Inclusive production of W+/-
463 SetMSEL(0);
464 //f fbar -> W+
465 SetMSUB(2,1);
466 // //f fbar -> g W+
467 // SetMSUB(16,1);
468 // //f fbar -> gamma W+
469 // SetMSUB(20,1);
470 // //f g -> f W+
471 // SetMSUB(31,1);
472 // //f gamma -> f W+
473 // SetMSUB(36,1);
474
475 // Initial/final parton shower on (Pythia default)
476 // With parton showers on we are generating "W inclusive process"
477 SetMSTP(61,1); //Initial QCD & QED showers on
478 SetMSTP(71,1); //Final QCD & QED showers on
479
480 break;
0f6ee828 481
482 case kPyZ:
483
484 //Inclusive production of Z
485 SetMSEL(0);
486 //f fbar -> Z/gamma
487 SetMSUB(1,1);
488
489 // // f fbar -> g Z/gamma
490 // SetMSUB(15,1);
491 // // f fbar -> gamma Z/gamma
492 // SetMSUB(19,1);
493 // // f g -> f Z/gamma
494 // SetMSUB(30,1);
495 // // f gamma -> f Z/gamma
496 // SetMSUB(35,1);
497
498 //only Z included, not gamma
499 SetMSTP(43,2);
500
501 // Initial/final parton shower on (Pythia default)
502 // With parton showers on we are generating "Z inclusive process"
503 SetMSTP(61,1); //Initial QCD & QED showers on
504 SetMSTP(71,1); //Final QCD & QED showers on
505
506 break;
507
8d2cd130 508 }
509//
510// Initialize PYTHIA
511 SetMSTP(41,1); // all resonance decays switched on
512
513 Initialize("CMS","p","p",fEcms);
514
515}
516
517Int_t AliPythia::CheckedLuComp(Int_t kf)
518{
519// Check Lund particle code (for debugging)
520 Int_t kc=Pycomp(kf);
521 printf("\n Lucomp kf,kc %d %d",kf,kc);
522 return kc;
523}
524
525void AliPythia::SetNuclei(Int_t a1, Int_t a2)
526{
527// Treat protons as inside nuclei with mass numbers a1 and a2
528// The MSTP array in the PYPARS common block is used to enable and
529// select the nuclear structure functions.
530// MSTP(52) : (D=1) choice of proton and nuclear structure-function library
531// =1: internal PYTHIA acording to MSTP(51)
532// =2: PDFLIB proton s.f., with MSTP(51) = 1000xNGROUP+NSET
533// If the following mass number both not equal zero, nuclear corrections of the stf are used.
534// MSTP(192) : Mass number of nucleus side 1
535// MSTP(193) : Mass number of nucleus side 2
536 SetMSTP(52,2);
537 SetMSTP(192, a1);
538 SetMSTP(193, a2);
539}
540
541
542AliPythia* AliPythia::Instance()
543{
544// Set random number generator
545 if (fgAliPythia) {
546 return fgAliPythia;
547 } else {
548 fgAliPythia = new AliPythia();
549 return fgAliPythia;
550 }
551}
552
553void AliPythia::PrintParticles()
554{
555// Print list of particl properties
556 Int_t np = 0;
c31f1d37 557 char* name = new char[16];
8d2cd130 558 for (Int_t kf=0; kf<1000000; kf++) {
559 for (Int_t c = 1; c > -2; c-=2) {
8d2cd130 560 Int_t kc = Pycomp(c*kf);
561 if (kc) {
562 Float_t mass = GetPMAS(kc,1);
563 Float_t width = GetPMAS(kc,2);
564 Float_t tau = GetPMAS(kc,4);
c31f1d37 565
8d2cd130 566 Pyname(kf,name);
567
568 np++;
569
570 printf("\n mass, width, tau: %6d %s %10.3f %10.3e %10.3e",
571 c*kf, name, mass, width, tau);
572 }
573 }
574 }
575 printf("\n Number of particles %d \n \n", np);
576}
577
578void AliPythia::ResetDecayTable()
579{
580// Set default values for pythia decay switches
581 Int_t i;
582 for (i = 1; i < 501; i++) SetMDCY(i,1,fDefMDCY[i]);
583 for (i = 1; i < 2001; i++) SetMDME(i,1,fDefMDME[i]);
584}
585
586void AliPythia::SetDecayTable()
587{
588// Set default values for pythia decay switches
589//
590 Int_t i;
591 for (i = 1; i < 501; i++) fDefMDCY[i] = GetMDCY(i,1);
592 for (i = 1; i < 2001; i++) fDefMDME[i] = GetMDME(i,1);
593}
594
595void AliPythia::Pyclus(Int_t& njet)
596{
597// Call Pythia clustering algorithm
598//
599 pyclus(njet);
600}
601
602void AliPythia::Pycell(Int_t& njet)
603{
604// Call Pythia jet reconstruction algorithm
605//
606 pycell(njet);
607}
608
452af8c7 609void AliPythia::Pyshow(Int_t ip1, Int_t ip2, Double_t qmax)
610{
611// Call Pythia jet reconstruction algorithm
612//
452af8c7 613 pyshow(ip1, ip2, qmax);
614}
615
616void AliPythia::Pyrobo(Int_t imi, Int_t ima, Double_t the, Double_t phi, Double_t bex, Double_t bey, Double_t bez)
617{
618 pyrobo(imi, ima, the, phi, bex, bey, bez);
619}
620
621
622
86b6ad68 623void AliPythia::InitQuenching(Float_t cMin, Float_t cMax, Float_t k, Int_t iECMethod)
0f482ae4 624{
625// Initializes
626// (1) The quenching model using quenching weights according to C. Salgado and U. Wiedemann
627// (2) The nuclear geometry using the Glauber Model
628//
6b435cde 629
0f482ae4 630 fGlauber = new AliFastGlauber();
631 fGlauber->Init(2);
632 fGlauber->SetCentralityClass(cMin, cMax);
633
634 fQuenchingWeights = new AliQuenchingWeights();
635 fQuenchingWeights->InitMult();
86b6ad68 636 fQuenchingWeights->SetK(k);
0f482ae4 637 fQuenchingWeights->SetECMethod(AliQuenchingWeights::kECMethod(iECMethod));
0f482ae4 638}
639
640
452af8c7 641void AliPythia::Quench()
642{
643//
644//
645// Simple Jet Quenching routine:
646// =============================
647// The jet formed by all final state partons radiated by the parton created
0f482ae4 648// in the hard collisions is quenched by a factor (1-z) using light cone variables in
649// the initial parton reference frame:
452af8c7 650// (E + p_z)new = (1-z) (E + p_z)old
651//
0f482ae4 652//
653//
654//
452af8c7 655// The lost momentum is first balanced by one gluon with virtuality > 0.
656// Subsequently the gluon splits to yield two gluons with E = p.
657//
0f482ae4 658//
659//
4e383037 660 static Float_t eMean = 0.;
661 static Int_t icall = 0;
0f482ae4 662
c2c598a3 663 Double_t p0[4][5];
664 Double_t p1[4][5];
665 Double_t p2[4][5];
666 Int_t klast[4] = {-1, -1, -1, -1};
452af8c7 667
668 Int_t numpart = fPyjets->N;
86b6ad68 669 Double_t px = 0., py = 0., pz = 0., e = 0., m = 0., p = 0., pt = 0., theta = 0., phi = 0.;
c2c598a3 670 Double_t pxq[4], pyq[4], pzq[4], eq[4], yq[4], mq[4], pq[4], phiq[4], thetaq[4], ptq[4];
671 Bool_t quenched[4];
b280c4cc 672 Double_t wjtKick[4];
c2c598a3 673 Int_t nGluon[4];
86b6ad68 674 Int_t qPdg[4];
0f482ae4 675 Int_t imo, kst, pdg;
b280c4cc 676
511db649 677//
c2c598a3 678// Sore information about Primary partons
679//
680// j =
681// 0, 1 partons from hard scattering
682// 2, 3 partons from initial state radiation
683//
684 for (Int_t i = 2; i <= 7; i++) {
685 Int_t j = 0;
686 // Skip gluons that participate in hard scattering
687 if (i == 4 || i == 5) continue;
688 // Gluons from hard Scattering
689 if (i == 6 || i == 7) {
690 j = i - 6;
691 pxq[j] = fPyjets->P[0][i];
692 pyq[j] = fPyjets->P[1][i];
693 pzq[j] = fPyjets->P[2][i];
694 eq[j] = fPyjets->P[3][i];
695 mq[j] = fPyjets->P[4][i];
696 } else {
697 // Gluons from initial state radiation
698 //
699 // Obtain 4-momentum vector from difference between original parton and parton after gluon
700 // radiation. Energy is calculated independently because initial state radition does not
701 // conserve strictly momentum and energy for each partonic system independently.
702 //
703 // Not very clean. Should be improved !
704 //
705 //
706 j = i;
707 pxq[j] = fPyjets->P[0][i] - fPyjets->P[0][i+2];
708 pyq[j] = fPyjets->P[1][i] - fPyjets->P[1][i+2];
709 pzq[j] = fPyjets->P[2][i] - fPyjets->P[2][i+2];
710 mq[j] = fPyjets->P[4][i];
711 eq[j] = TMath::Sqrt(pxq[j] * pxq[j] + pyq[j] * pyq[j] + pzq[j] * pzq[j] + mq[j] * mq[j]);
712 }
713//
714// Calculate some kinematic variables
511db649 715//
4e383037 716 yq[j] = 0.5 * TMath::Log((eq[j] + pzq[j] + 1.e-14) / (eq[j] - pzq[j] + 1.e-14));
0f482ae4 717 pq[j] = TMath::Sqrt(pxq[j] * pxq[j] + pyq[j] * pyq[j] + pzq[j] * pzq[j]);
718 phiq[j] = TMath::Pi()+TMath::ATan2(-pyq[j], -pxq[j]);
719 ptq[j] = TMath::Sqrt(pxq[j] * pxq[j] + pyq[j] * pyq[j]);
720 thetaq[j] = TMath::ATan2(ptq[j], pzq[j]);
86b6ad68 721 qPdg[j] = fPyjets->K[1][i];
722 }
723
724 Double_t int0[4];
725 Double_t int1[4];
86b6ad68 726
b280c4cc 727 fGlauber->GetI0I1ForPythiaAndXY(4, phiq, int0, int1, fXJet, fYJet, 15.);
728
86b6ad68 729 for (Int_t j = 0; j < 4; j++) {
c2c598a3 730 //
731 // Quench only central jets and with E > 10.
732 //
86b6ad68 733
734
735 Int_t itype = (qPdg[j] == 21) ? 2 : 1;
736 Double_t eloss = fQuenchingWeights->GetELossRandomKFast(itype, int0[j], int1[j], eq[j]);
737
c2c598a3 738 if (TMath::Abs(yq[j]) > 2.5 || eq[j] < 10.) {
b280c4cc 739 fZQuench[j] = 0.;
0f482ae4 740 } else {
c2c598a3 741 if (eq[j] > 40. && TMath::Abs(yq[j]) < 0.5) {
4e383037 742 icall ++;
743 eMean += eloss;
744 }
0f482ae4 745 //
746 // Extra pt
86b6ad68 747 Double_t l = fQuenchingWeights->CalcLk(int0[j], int1[j]);
748 wjtKick[j] = TMath::Sqrt(l * fQuenchingWeights->CalcQk(int0[j], int1[j]));
0f482ae4 749 //
750 // Fractional energy loss
b280c4cc 751 fZQuench[j] = eloss / eq[j];
0f482ae4 752 //
753 // Avoid complete loss
754 //
6b435cde 755 if (fZQuench[j] == 1.) fZQuench[j] = 0.97;
0f482ae4 756 //
757 // Some debug printing
86b6ad68 758
759
bf9bb016 760// printf("Initial parton # %3d, Type %3d Energy %10.3f Phi %10.3f Length %10.3f Loss %10.3f Kick %10.3f Mean: %10.3f %10.3f\n",
761// j, itype, eq[j], phiq[j], l, eloss, wjtKick[j], eMean / Float_t(icall+1), yq[j]);
4e383037 762
b280c4cc 763// fZQuench[j] = 0.8;
764// while (fZQuench[j] >= 0.95) fZQuench[j] = gRandom->Exp(0.2);
0f482ae4 765 }
4e383037 766
b280c4cc 767 quenched[j] = (fZQuench[j] > 0.01);
4e383037 768 } // primary partons
c2c598a3 769
b280c4cc 770
771
6e90ad26 772 Double_t pNew[1000][4];
773 Int_t kNew[1000];
774 Int_t icount = 0;
b280c4cc 775 Double_t zquench[4];
776
6e90ad26 777//
4e383037 778// System Loop
c2c598a3 779 for (Int_t isys = 0; isys < 4; isys++) {
6e90ad26 780// Skip to next system if not quenched.
4e383037 781 if (!quenched[isys]) continue;
782
b280c4cc 783 nGluon[isys] = 1 + Int_t(fZQuench[isys] / (1. - fZQuench[isys]));
6b435cde 784 if (nGluon[isys] > 30) nGluon[isys] = 30;
b280c4cc 785 zquench[isys] = 1. - TMath::Power(1. - fZQuench[isys], 1./Double_t(nGluon[isys]));
4e383037 786 wjtKick[isys] = wjtKick[isys] / TMath::Sqrt(Double_t(nGluon[isys]));
0f482ae4 787
4e383037 788
789
790 Int_t igMin = -1;
791 Int_t igMax = -1;
792 Double_t pg[4] = {0., 0., 0., 0.};
793
794//
795// Loop on radiation events
796
797 for (Int_t iglu = 0; iglu < nGluon[isys]; iglu++) {
6e90ad26 798 while (1) {
799 icount = 0;
800 for (Int_t k = 0; k < 4; k++)
801 {
802 p0[isys][k] = 0.;
803 p1[isys][k] = 0.;
804 p2[isys][k] = 0.;
805 }
806// Loop over partons
807 for (Int_t i = 0; i < numpart; i++)
808 {
809 imo = fPyjets->K[2][i];
810 kst = fPyjets->K[0][i];
811 pdg = fPyjets->K[1][i];
812
813
814
0f482ae4 815// Quarks and gluons only
6e90ad26 816 if (pdg != 21 && TMath::Abs(pdg) > 6) continue;
0f482ae4 817// Particles from hard scattering only
c2c598a3 818
6e90ad26 819 if (imo > 8 && imo < 1000) imo = fPyjets->K[2][imo - 1];
c2c598a3 820 Int_t imom = imo % 1000;
821 if ((isys == 0 || isys == 1) && ((imom != (isys + 7)))) continue;
822 if ((isys == 2 || isys == 3) && ((imom != (isys + 1)))) continue;
823
6e90ad26 824
0f482ae4 825// Skip comment lines
6e90ad26 826 if (kst != 1 && kst != 2) continue;
0f482ae4 827//
828// Parton kinematic
6e90ad26 829 px = fPyjets->P[0][i];
830 py = fPyjets->P[1][i];
831 pz = fPyjets->P[2][i];
832 e = fPyjets->P[3][i];
833 m = fPyjets->P[4][i];
834 pt = TMath::Sqrt(px * px + py * py);
835 p = TMath::Sqrt(px * px + py * py + pz * pz);
836 phi = TMath::Pi() + TMath::ATan2(-py, -px);
837 theta = TMath::ATan2(pt, pz);
838
0f482ae4 839//
c2c598a3 840// Save 4-momentum sum for balancing
841 Int_t index = isys;
6e90ad26 842
843 p0[index][0] += px;
844 p0[index][1] += py;
845 p0[index][2] += pz;
846 p0[index][3] += e;
6e90ad26 847
848 klast[index] = i;
849
0f482ae4 850//
851// Fractional energy loss
b280c4cc 852 Double_t z = zquench[index];
4e383037 853
c2c598a3 854
4e383037 855// Don't fully quench radiated gluons
856//
857 if (imo > 1000) {
858// This small factor makes sure that the gluons are not too close in phase space to avoid recombination
859//
860
c2c598a3 861 z = 0.02;
4e383037 862 }
c2c598a3 863// printf("z: %d %f\n", imo, z);
864
4e383037 865
866//
6e90ad26 867
868 //
869 //
870 // Transform into frame in which initial parton is along z-axis
871 //
872 TVector3 v(px, py, pz);
873 v.RotateZ(-phiq[index]); v.RotateY(-thetaq[index]);
874 Double_t pxs = v.X(); Double_t pys = v.Y(); Double_t pl = v.Z();
875
876 Double_t jt = TMath::Sqrt(pxs * pxs + pys * pys);
877 Double_t mt2 = jt * jt + m * m;
878 Double_t zmax = 1.;
879 //
880 // Kinematic limit on z
881 //
4e383037 882 if (m > 0.) zmax = 1. - m / TMath::Sqrt(m * m + jt * jt);
6e90ad26 883 //
884 // Change light-cone kinematics rel. to initial parton
885 //
886 Double_t eppzOld = e + pl;
887 Double_t empzOld = e - pl;
888
889 Double_t eppzNew = (1. - z) * eppzOld;
890 Double_t empzNew = empzOld - mt2 * z / eppzOld;
891 Double_t eNew = 0.5 * (eppzNew + empzNew);
892 Double_t plNew = 0.5 * (eppzNew - empzNew);
893
894 Double_t jtNew;
895 //
896 // if mt very small (or sometimes even < 0 for numerical reasons) set it to 0
897 Double_t mt2New = eppzNew * empzNew;
898 if (mt2New < 1.e-8) mt2New = 0.;
4e383037 899 if (z < zmax) {
900 if (m * m > mt2New) {
901 //
902 // This should not happen
903 //
904 Fatal("Quench()", "This should never happen %e %e %e!", m, eppzNew, empzNew);
905 jtNew = 0;
906 } else {
907 jtNew = TMath::Sqrt(mt2New - m * m);
908 }
6e90ad26 909 } else {
4e383037 910 // If pT is to small (probably a leading massive particle) we scale only the energy
911 // This can cause negative masses of the radiated gluon
912 // Let's hope for the best ...
913 jtNew = jt;
914 eNew = TMath::Sqrt(plNew * plNew + mt2);
915
6e90ad26 916 }
6e90ad26 917 //
918 // Calculate new px, py
919 //
920 Double_t pxNew = jtNew / jt * pxs;
921 Double_t pyNew = jtNew / jt * pys;
922
923// Double_t dpx = pxs - pxNew;
924// Double_t dpy = pys - pyNew;
925// Double_t dpz = pl - plNew;
926// Double_t de = e - eNew;
927// Double_t dmass2 = de * de - dpx * dpx - dpy * dpy - dpz * dpz;
928// printf("New mass (1) %e %e %e %e %e %e %e \n", dmass2, jt, jtNew, pl, plNew, e, eNew);
929// printf("New mass (2) %e %e \n", pxNew, pyNew);
930 //
931 // Rotate back
932 //
933 TVector3 w(pxNew, pyNew, plNew);
934 w.RotateY(thetaq[index]); w.RotateZ(phiq[index]);
935 pxNew = w.X(); pyNew = w.Y(); plNew = w.Z();
936
937 p1[index][0] += pxNew;
938 p1[index][1] += pyNew;
939 p1[index][2] += plNew;
940 p1[index][3] += eNew;
941 //
942 // Updated 4-momentum vectors
943 //
944 pNew[icount][0] = pxNew;
945 pNew[icount][1] = pyNew;
946 pNew[icount][2] = plNew;
947 pNew[icount][3] = eNew;
948 kNew[icount] = i;
949 icount++;
950 } // parton loop
0f482ae4 951 //
6e90ad26 952 // Check if there was phase-space for quenching
0f482ae4 953 //
0f482ae4 954
6e90ad26 955 if (icount == 0) quenched[isys] = kFALSE;
956 if (!quenched[isys]) break;
957
958 for (Int_t j = 0; j < 4; j++)
959 {
960 p2[isys][j] = p0[isys][j] - p1[isys][j];
961 }
962 p2[isys][4] = p2[isys][3] * p2[isys][3] - p2[isys][0] * p2[isys][0] - p2[isys][1] * p2[isys][1] - p2[isys][2] * p2[isys][2];
6e90ad26 963 if (p2[isys][4] > 0.) {
964 p2[isys][4] = TMath::Sqrt(p2[isys][4]);
965 break;
966 } else {
b280c4cc 967 printf("Warning negative mass squared in system %d %f ! \n", isys, zquench[isys]);
4e383037 968 printf("4-Momentum: %10.3e %10.3e %10.3e %10.3e %10.3e \n", p2[isys][0], p2[isys][1], p2[isys][2], p2[isys][3], p2[isys][4]);
6e90ad26 969 if (p2[isys][4] < -0.01) {
4e383037 970 printf("Negative mass squared !\n");
971 // Here we have to put the gluon back to mass shell
972 // This will lead to a small energy imbalance
973 p2[isys][4] = 0.;
974 p2[isys][3] = TMath::Sqrt(p2[isys][0] * p2[isys][0] + p2[isys][1] * p2[isys][1] + p2[isys][2] * p2[isys][2]);
975 break;
6e90ad26 976 } else {
977 p2[isys][4] = 0.;
978 break;
979 }
980 }
6e90ad26 981 /*
6e90ad26 982 zHeavy *= 0.98;
983 printf("zHeavy lowered to %f\n", zHeavy);
984 if (zHeavy < 0.01) {
985 printf("No success ! \n");
986 icount = 0;
987 quenched[isys] = kFALSE;
988 break;
989 }
4e383037 990 */
991 } // iteration on z (while)
992
6e90ad26 993// Update event record
994 for (Int_t k = 0; k < icount; k++) {
995// printf("%6d %6d %10.3e %10.3e %10.3e %10.3e\n", k, kNew[k], pNew[k][0],pNew[k][1], pNew[k][2], pNew[k][3] );
996 fPyjets->P[0][kNew[k]] = pNew[k][0];
997 fPyjets->P[1][kNew[k]] = pNew[k][1];
998 fPyjets->P[2][kNew[k]] = pNew[k][2];
999 fPyjets->P[3][kNew[k]] = pNew[k][3];
0f482ae4 1000 }
4e383037 1001 //
1002 // Add the gluons
1003 //
1004 Int_t ish = 0;
1837e95c 1005 Int_t iGlu;
4e383037 1006 if (!quenched[isys]) continue;
0f482ae4 1007//
1008// Last parton from shower i
4e383037 1009 Int_t in = klast[isys];
0f482ae4 1010//
1011// Continue if no parton in shower i selected
1012 if (in == -1) continue;
1013//
1014// If this is the second initial parton and it is behind the first move pointer by previous ish
4e383037 1015 if (isys == 1 && klast[1] > klast[0]) in += ish;
0f482ae4 1016//
1017// Starting index
452af8c7 1018
4e383037 1019// jmin = in - 1;
0f482ae4 1020// How many additional gluons will be generated
1021 ish = 1;
4e383037 1022 if (p2[isys][4] > 0.05) ish = 2;
0f482ae4 1023//
1024// Position of gluons
4e383037 1025 iGlu = numpart;
1026 if (iglu == 0) igMin = iGlu;
1027 igMax = iGlu;
0f482ae4 1028 numpart += ish;
1029 (fPyjets->N) += ish;
4e383037 1030
0f482ae4 1031 if (ish == 1) {
4e383037 1032 fPyjets->P[0][iGlu] = p2[isys][0];
1033 fPyjets->P[1][iGlu] = p2[isys][1];
1034 fPyjets->P[2][iGlu] = p2[isys][2];
1035 fPyjets->P[3][iGlu] = p2[isys][3];
1036 fPyjets->P[4][iGlu] = p2[isys][4];
0f482ae4 1037
4e383037 1038 fPyjets->K[0][iGlu] = 1;
1039 if (iglu == nGluon[isys] - 1) fPyjets->K[0][iGlu] = 1;
0f482ae4 1040 fPyjets->K[1][iGlu] = 21;
4e383037 1041 fPyjets->K[2][iGlu] = fPyjets->K[2][in] + 1000;
0f482ae4 1042 fPyjets->K[3][iGlu] = -1;
1043 fPyjets->K[4][iGlu] = -1;
4e383037 1044
1045 pg[0] += p2[isys][0];
1046 pg[1] += p2[isys][1];
1047 pg[2] += p2[isys][2];
1048 pg[3] += p2[isys][3];
0f482ae4 1049 } else {
1050 //
1051 // Split gluon in rest frame.
1052 //
4e383037 1053 Double_t bx = p2[isys][0] / p2[isys][3];
1054 Double_t by = p2[isys][1] / p2[isys][3];
1055 Double_t bz = p2[isys][2] / p2[isys][3];
1056 Double_t pst = p2[isys][4] / 2.;
0f482ae4 1057 //
1058 // Isotropic decay ????
1059 Double_t cost = 2. * gRandom->Rndm() - 1.;
1060 Double_t sint = TMath::Sqrt(1. - cost * cost);
1061 Double_t phi = 2. * TMath::Pi() * gRandom->Rndm();
1062
1063 Double_t pz1 = pst * cost;
1064 Double_t pz2 = -pst * cost;
1065 Double_t pt1 = pst * sint;
1066 Double_t pt2 = -pst * sint;
1067 Double_t px1 = pt1 * TMath::Cos(phi);
1068 Double_t py1 = pt1 * TMath::Sin(phi);
1069 Double_t px2 = pt2 * TMath::Cos(phi);
1070 Double_t py2 = pt2 * TMath::Sin(phi);
1071
1072 fPyjets->P[0][iGlu] = px1;
1073 fPyjets->P[1][iGlu] = py1;
1074 fPyjets->P[2][iGlu] = pz1;
1075 fPyjets->P[3][iGlu] = pst;
1076 fPyjets->P[4][iGlu] = 0.;
1077
4e383037 1078 fPyjets->K[0][iGlu] = 1 ;
0f482ae4 1079 fPyjets->K[1][iGlu] = 21;
4e383037 1080 fPyjets->K[2][iGlu] = fPyjets->K[2][in] + 1000;
0f482ae4 1081 fPyjets->K[3][iGlu] = -1;
1082 fPyjets->K[4][iGlu] = -1;
1083
1084 fPyjets->P[0][iGlu+1] = px2;
1085 fPyjets->P[1][iGlu+1] = py2;
1086 fPyjets->P[2][iGlu+1] = pz2;
1087 fPyjets->P[3][iGlu+1] = pst;
1088 fPyjets->P[4][iGlu+1] = 0.;
1089
4e383037 1090 fPyjets->K[0][iGlu+1] = 1;
1091 if (iglu == nGluon[isys] - 1) fPyjets->K[0][iGlu+1] = 1;
0f482ae4 1092 fPyjets->K[1][iGlu+1] = 21;
4e383037 1093 fPyjets->K[2][iGlu+1] = fPyjets->K[2][in] + 1000;
0f482ae4 1094 fPyjets->K[3][iGlu+1] = -1;
1095 fPyjets->K[4][iGlu+1] = -1;
1096 SetMSTU(1,0);
1097 SetMSTU(2,0);
1098 //
1099 // Boost back
1100 //
1101 Pyrobo(iGlu + 1, iGlu + 2, 0., 0., bx, by, bz);
1102 }
4e383037 1103/*
1104 for (Int_t ig = iGlu; ig < iGlu+ish; ig++) {
1105 Double_t px, py, pz;
1106 px = fPyjets->P[0][ig];
1107 py = fPyjets->P[1][ig];
1108 pz = fPyjets->P[2][ig];
1109 TVector3 v(px, py, pz);
1110 v.RotateZ(-phiq[isys]);
1111 v.RotateY(-thetaq[isys]);
1112 Double_t pxs = v.X(); Double_t pys = v.Y(); Double_t pzs = v.Z();
1113 Double_t r = AliPythiaRndm::GetPythiaRandom()->Rndm();
1114 Double_t jtKick = 0.3 * TMath::Sqrt(-TMath::Log(r));
1115 if (ish == 2) jtKick = wjtKick[i] * TMath::Sqrt(-TMath::Log(r)) / TMath::Sqrt(2.);
1116 Double_t phiKick = 2. * TMath::Pi() * AliPythiaRndm::GetPythiaRandom()->Rndm();
1117 pxs += jtKick * TMath::Cos(phiKick);
1118 pys += jtKick * TMath::Sin(phiKick);
1119 TVector3 w(pxs, pys, pzs);
1120 w.RotateY(thetaq[isys]);
1121 w.RotateZ(phiq[isys]);
1122 fPyjets->P[0][ig] = w.X();
1123 fPyjets->P[1][ig] = w.Y();
1124 fPyjets->P[2][ig] = w.Z();
1125 fPyjets->P[2][ig] = w.Mag();
1126 }
1127*/
1128 } // kGluon
1129
6e90ad26 1130
4e383037 1131 // Check energy conservation
0f482ae4 1132 Double_t pxs = 0.;
1133 Double_t pys = 0.;
1134 Double_t pzs = 0.;
1135 Double_t es = 14000.;
1136
1137 for (Int_t i = 0; i < numpart; i++)
1138 {
1139 kst = fPyjets->K[0][i];
1140 if (kst != 1 && kst != 2) continue;
1141 pxs += fPyjets->P[0][i];
1142 pys += fPyjets->P[1][i];
1143 pzs += fPyjets->P[2][i];
1144 es -= fPyjets->P[3][i];
1145 }
1146 if (TMath::Abs(pxs) > 1.e-2 ||
1147 TMath::Abs(pys) > 1.e-2 ||
1148 TMath::Abs(pzs) > 1.e-1) {
1149 printf("%e %e %e %e\n", pxs, pys, pzs, es);
4e383037 1150// Fatal("Quench()", "4-Momentum non-conservation");
452af8c7 1151 }
4e383037 1152
1153 } // end quenching loop (systems)
6e90ad26 1154// Clean-up
0f482ae4 1155 for (Int_t i = 0; i < numpart; i++)
1156 {
4e383037 1157 imo = fPyjets->K[2][i];
1158 if (imo > 1000) {
1159 fPyjets->K[2][i] = fPyjets->K[2][i] % 1000;
1160 }
0f482ae4 1161 }
4e383037 1162// this->Pylist(1);
0f482ae4 1163} // end quench
90d7b703 1164
992f2843 1165
1166void AliPythia::Pyquen(Double_t a, Int_t ibf, Double_t b)
1167{
1168 // Igor Lokthine's quenching routine
1169 pyquen(a, ibf, b);
1170}
b280c4cc 1171
16a82508 1172void AliPythia::Pyevnw()
1173{
1174 // New multiple interaction scenario
1175 pyevnw();
1176}
1177
b280c4cc 1178void AliPythia::GetQuenchingParameters(Double_t& xp, Double_t& yp, Double_t z[4])
1179{
1180 // Return event specific quenching parameters
1181 xp = fXJet;
1182 yp = fYJet;
1183 for (Int_t i = 0; i < 4; i++) z[i] = fZQuench[i];
1184
1185}
1186
3dc3ec94 1187void AliPythia::ConfigHeavyFlavor()
1188{
1189 //
1190 // Default configuration for Heavy Flavor production
1191 //
1192 // All QCD processes
1193 //
1194 SetMSEL(1);
1195
1196 // No multiple interactions
1197 SetMSTP(81,0);
3dc3ec94 1198 // Initial/final parton shower on (Pythia default)
1199 SetMSTP(61,1);
1200 SetMSTP(71,1);
1201
1202 // 2nd order alpha_s
1203 SetMSTP(2,2);
1204
1205 // QCD scales
1206 SetMSTP(32,2);
1207 SetPARP(34,1.0);
1208}
e0e89f40 1209
1210void AliPythia::AtlasTuning()
1211{
1212 //
1213 // Configuration for the ATLAS tuning
1214 SetMSTP(51, kCTEQ5L); // CTEQ5L pdf
1215 SetMSTP(81,1); // Multiple Interactions ON
1216 SetMSTP(82,4); // Double Gaussian Model
1217 SetPARP(82,1.8); // [GeV] PT_min at Ref. energy
1218 SetPARP(89,1000.); // [GeV] Ref. energy
1219 SetPARP(90,0.16); // 2*epsilon (exponent in power law)
1220 SetPARP(83,0.5); // Core density in proton matter distribution (def.value)
1221 SetPARP(84,0.5); // Core radius
1222 SetPARP(85,0.33); // Regulates gluon prod. mechanism
1223 SetPARP(86,0.66); // Regulates gluon prod. mechanism
1224 SetPARP(67,1); // Regulates Initial State Radiation
1225}
e8a8adcd 1226
1227AliPythia& AliPythia::operator=(const AliPythia& rhs)
1228{
1229// Assignment operator
1230 rhs.Copy(*this);
1231 return *this;
1232}
1233
1234 void AliPythia::Copy(TObject&) const
1235{
1236 //
1237 // Copy
1238 //
1239 Fatal("Copy","Not implemented!\n");
1240}