1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 #include "AliPythia.h"
19 #include "AliPythiaRndm.h"
24 # define pyclus pyclus_
25 # define pycell pycell_
28 # define pyclus PYCLUS
29 # define pycell PYCELL
30 # define type_of_call _stdcall
33 extern "C" void type_of_call pyclus(Int_t & );
34 extern "C" void type_of_call pycell(Int_t & );
36 //_____________________________________________________________________________
38 AliPythia* AliPythia::fgAliPythia=NULL;
40 AliPythia::AliPythia()
42 // Default Constructor
45 if (!AliPythiaRndm::GetPythiaRandom())
46 AliPythiaRndm::SetPythiaRandom(GetRandom());
50 void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc)
52 // Initialise the process to generate
53 if (!AliPythiaRndm::GetPythiaRandom())
54 AliPythiaRndm::SetPythiaRandom(GetRandom());
58 fStrucFunc = strucfunc;
60 SetMDCY(Pycomp(111),1,0);
61 // select structure function
63 SetMSTP(51,strucfunc);
65 // Pythia initialisation for selected processes//
69 for (Int_t i=1; i<= 200; i++) {
72 // select charm production
110 case kPyCharmUnforced:
119 case kPyBeautyUnforced:
129 // Minimum Bias pp-Collisions
132 // select Pythia min. bias model
134 SetMSUB(92,1); // single diffraction AB-->XB
135 SetMSUB(93,1); // single diffraction AB-->AX
136 SetMSUB(94,1); // double diffraction
137 SetMSUB(95,1); // low pt production
138 SetMSTP(81,1); // multiple interactions switched on
139 SetMSTP(82,3); // model with varying impact param. & a single Gaussian
140 SetPARP(82,3.47); // set value pT_0 for turn-off of the cross section of
141 // multiple interaction at a reference energy = 14000 GeV
142 SetPARP(89,14000.); // reference energy for the above parameter
143 SetPARP(90,0.174); // set exponent for energy dependence of pT_0
145 // Minimum Bias pp-Collisions
148 // select Pythia min. bias model
150 SetMSUB(95,1); // low pt production
151 SetMSTP(81,1); // multiple interactions switched on
152 SetMSTP(82,3); // model with varying impact param. & a single Gaussian
153 SetPARP(82,3.47); // set value pT_0 for turn-off of the cross section of
154 // multiple interaction at a reference energy = 14000 GeV
155 SetPARP(89,14000.); // reference energy for the above parameter
156 SetPARP(90,0.174); // set exponent for energy dependence of pT_0
168 case kPyCharmPbPbMNR:
170 // Tuning of Pythia parameters aimed to get a resonable agreement
171 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
172 // c-cbar single inclusive and double differential distributions.
173 // This parameter settings are meant to work with Pb-Pb collisions
174 // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
175 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
176 // has to be set to 2.1GeV. Example in ConfigCharmPPR.C.
181 // No multiple interactions
186 // Initial/final parton shower on (Pythia default)
208 // Tuning of Pythia parameters aimed to get a resonable agreement
209 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
210 // c-cbar single inclusive and double differential distributions.
211 // This parameter settings are meant to work with p-Pb collisions
212 // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
213 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
214 // has to be set to 2.1GeV. Example in ConfigCharmPPR.C.
219 // No multiple interactions
224 // Initial/final parton shower on (Pythia default)
246 // Tuning of Pythia parameters aimed to get a resonable agreement
247 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
248 // c-cbar single inclusive and double differential distributions.
249 // This parameter settings are meant to work with pp collisions
250 // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
251 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
252 // has to be set to 2.1GeV. Example in ConfigCharmPPR.C.
257 // No multiple interactions
262 // Initial/final parton shower on (Pythia default)
282 case kPyBeautyPbPbMNR:
283 // Tuning of Pythia parameters aimed to get a resonable agreement
284 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
285 // b-bbar single inclusive and double differential distributions.
286 // This parameter settings are meant to work with Pb-Pb collisions
287 // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
288 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
289 // has to be set to 2.75GeV. Example in ConfigBeautyPPR.C.
294 // No multiple interactions
299 // Initial/final parton shower on (Pythia default)
321 case kPyBeautypPbMNR:
322 // Tuning of Pythia parameters aimed to get a resonable agreement
323 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
324 // b-bbar single inclusive and double differential distributions.
325 // This parameter settings are meant to work with p-Pb collisions
326 // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
327 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
328 // has to be set to 2.75GeV. Example in ConfigBeautyPPR.C.
333 // No multiple interactions
338 // Initial/final parton shower on (Pythia default)
361 // Tuning of Pythia parameters aimed to get a resonable agreement
362 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
363 // b-bbar single inclusive and double differential distributions.
364 // This parameter settings are meant to work with pp collisions
365 // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
366 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
367 // has to be set to 2.75GeV. Example in ConfigBeautyPPR.C.
372 // No multiple interactions
377 // Initial/final parton shower on (Pythia default)
402 SetMSTP(41,1); // all resonance decays switched on
404 Initialize("CMS","p","p",fEcms);
408 Int_t AliPythia::CheckedLuComp(Int_t kf)
410 // Check Lund particle code (for debugging)
412 printf("\n Lucomp kf,kc %d %d",kf,kc);
416 void AliPythia::SetNuclei(Int_t a1, Int_t a2)
418 // Treat protons as inside nuclei with mass numbers a1 and a2
419 // The MSTP array in the PYPARS common block is used to enable and
420 // select the nuclear structure functions.
421 // MSTP(52) : (D=1) choice of proton and nuclear structure-function library
422 // =1: internal PYTHIA acording to MSTP(51)
423 // =2: PDFLIB proton s.f., with MSTP(51) = 1000xNGROUP+NSET
424 // If the following mass number both not equal zero, nuclear corrections of the stf are used.
425 // MSTP(192) : Mass number of nucleus side 1
426 // MSTP(193) : Mass number of nucleus side 2
433 AliPythia* AliPythia::Instance()
435 // Set random number generator
439 fgAliPythia = new AliPythia();
444 void AliPythia::PrintParticles()
446 // Print list of particl properties
448 char* name = new char[16];
449 for (Int_t kf=0; kf<1000000; kf++) {
450 for (Int_t c = 1; c > -2; c-=2) {
451 Int_t kc = Pycomp(c*kf);
453 Float_t mass = GetPMAS(kc,1);
454 Float_t width = GetPMAS(kc,2);
455 Float_t tau = GetPMAS(kc,4);
461 printf("\n mass, width, tau: %6d %s %10.3f %10.3e %10.3e",
462 c*kf, name, mass, width, tau);
466 printf("\n Number of particles %d \n \n", np);
469 void AliPythia::ResetDecayTable()
471 // Set default values for pythia decay switches
473 for (i = 1; i < 501; i++) SetMDCY(i,1,fDefMDCY[i]);
474 for (i = 1; i < 2001; i++) SetMDME(i,1,fDefMDME[i]);
477 void AliPythia::SetDecayTable()
479 // Set default values for pythia decay switches
482 for (i = 1; i < 501; i++) fDefMDCY[i] = GetMDCY(i,1);
483 for (i = 1; i < 2001; i++) fDefMDME[i] = GetMDME(i,1);
486 void AliPythia::Pyclus(Int_t& njet)
488 // Call Pythia clustering algorithm
493 void AliPythia::Pycell(Int_t& njet)
495 // Call Pythia jet reconstruction algorithm