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 Revision 1.21 2002/03/25 14:46:16 morsch
19 Case kPyD0PbMNR added (N. Carrer).
21 Revision 1.20 2002/03/03 13:48:50 morsch
22 Option kPyCharmPbMNR added. Produce charm pairs in agreement with MNR
23 NLO calculations (Nicola Carrer).
25 Revision 1.19 2002/02/20 08:52:20 morsch
26 Correct documentation of SetNuclei method.
28 Revision 1.18 2002/02/07 10:43:06 morsch
29 Tuned pp-min.bias settings (M.Monteno, R.Ugoccioni and N.Carrer)
31 Revision 1.17 2001/12/19 15:40:43 morsch
32 For kPyJets enforce simple jet topology, i.e no initial or final state
33 gluon radiation and no primordial pT.
35 Revision 1.16 2001/10/12 11:13:59 morsch
36 Missing break statements added (thanks to Nicola Carrer)
38 Revision 1.15 2001/03/27 10:54:50 morsch
39 Add ResetDecayTable() and SsetDecayTable() methods.
41 Revision 1.14 2001/03/09 13:03:40 morsch
42 Process_t and Struc_Func_t moved to AliPythia.h
44 Revision 1.13 2000/12/18 08:55:35 morsch
45 Make AliPythia dependent generartors work with new scheme of random number generation
47 Revision 1.12 2000/11/30 07:12:50 alibrary
48 Introducing new Rndm and QA classes
50 Revision 1.11 2000/10/20 06:30:06 fca
51 Use version 0 to avoid streamer generation
53 Revision 1.10 2000/10/06 14:18:44 morsch
54 Upper cut of prim. pT distribution set to 5. GeV
56 Revision 1.9 2000/09/18 10:41:35 morsch
57 Add possibility to use nuclear structure functions from PDF library V8.
59 Revision 1.8 2000/09/06 14:26:24 morsch
60 Decayer functionality of AliPythia has been moved to AliDecayerPythia.
61 Class is now a singleton.
63 Revision 1.7 2000/06/09 20:34:50 morsch
64 All coding rule violations except RS3 corrected
66 Revision 1.6 1999/11/09 07:38:48 fca
67 Changes for compatibility with version 2.23 of ROOT
69 Revision 1.5 1999/11/03 17:43:20 fca
70 New version from G.Martinez & A.Morsch
72 Revision 1.4 1999/09/29 09:24:14 fca
73 Introduction of the Copyright and cvs Log
78 #include "AliPythia.h"
82 //_____________________________________________________________________________
84 AliPythia* AliPythia::fgAliPythia=NULL;
86 AliPythia::AliPythia()
88 // Default Constructor
91 if (!sRandom) sRandom=fRandom;
95 void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc)
97 // Initialise the process to generate
100 fStrucFunc = strucfunc;
102 SetMDCY(Pycomp(111),1,0);
103 // select structure function
105 SetMSTP(51,strucfunc);
107 // Pythia initialisation for selected processes//
111 for (Int_t i=1; i<= 200; i++) {
114 // select charm production
120 // heavy quark masses
152 case kPyCharmUnforced:
161 case kPyBeautyUnforced:
171 // Minimum Bias pp-Collisions
174 // select Pythia min. bias model
176 SetMSUB(92,1); // single diffraction AB-->XB
177 SetMSUB(93,1); // single diffraction AB-->AX
178 SetMSUB(94,1); // double diffraction
179 SetMSUB(95,1); // low pt production
180 SetMSTP(81,1); // multiple interactions switched on
181 SetMSTP(82,3); // model with varying impact param. & a single Gaussian
182 SetPARP(82,3.47); // set value pT_0 for turn-off of the cross section of
183 // multiple interaction at a reference energy = 14000 GeV
184 SetPARP(89,14000.); // reference energy for the above parameter
185 SetPARP(90,0.174); // set exponent for energy dependence of pT_0
189 // no initial state radiation
191 // no final state radiation
205 // Tuning of Pythia parameters aimed to get a resonable agreement
206 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
207 // c-cbar single inclusive and double differential distributions.
208 // This parameter settings are meant to work with Pb-Pb collisions
209 // (AliGenPythia::SetNuclei) and with kCTEQ_4L PDFs.
210 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
211 // has to be set to 2.1GeV. Example in ConfigCharmPPR.C.
216 // No multiple interactions
221 // Initial/final parton shower on (Pythia default)
242 // Tuning of Pythia parameters aimed to get a resonable agreement
243 // between with the NLO calculation by Mangano, Nason, Ridolfi for the
244 // b-bbar single inclusive and double differential distributions.
245 // This parameter settings are meant to work with Pb-Pb collisions
246 // (AliGenPythia::SetNuclei) and with kCTEQ4L PDFs.
247 // To get a good agreement the minimum ptHard (AliGenPythia::SetPtHard)
248 // has to be set to 2.75GeV. Example in ConfigBeautyPPR.C.
253 // No multiple interactions
258 // Initial/final parton shower on (Pythia default)
283 SetMSTP(41,1); // all resonance decays switched on
285 Initialize("CMS","p","p",fEcms);
289 Int_t AliPythia::CheckedLuComp(Int_t kf)
291 // Check Lund particle code (for debugging)
293 printf("\n Lucomp kf,kc %d %d",kf,kc);
297 void AliPythia::SetNuclei(Int_t a1, Int_t a2)
299 // Treat protons as inside nuclei with mass numbers a1 and a2
300 // The MSTP array in the PYPARS common block is used to enable and
301 // select the nuclear structure functions.
302 // MSTP(52) : (D=1) choice of proton and nuclear structure-function library
303 // =1: internal PYTHIA acording to MSTP(51)
304 // =2: PDFLIB proton s.f., with MSTP(51) = 1000xNGROUP+NSET
305 // If the following mass number both not equal zero, nuclear corrections of the stf are used.
306 // MSTP(192) : Mass number of nucleus side 1
307 // MSTP(193) : Mass number of nucleus side 2
314 AliPythia* AliPythia::Instance()
316 // Set random number generator
320 fgAliPythia = new AliPythia();
325 void AliPythia::PrintParticles()
327 // Print list of particl properties
330 for (Int_t kf=0; kf<1000000; kf++) {
331 for (Int_t c = 1; c > -2; c-=2) {
333 Int_t kc = Pycomp(c*kf);
335 Float_t mass = GetPMAS(kc,1);
336 Float_t width = GetPMAS(kc,2);
337 Float_t tau = GetPMAS(kc,4);
339 char* name = new char[8];
344 printf("\n mass, width, tau: %6d %s %10.3f %10.3e %10.3e",
345 c*kf, name, mass, width, tau);
349 printf("\n Number of particles %d \n \n", np);
352 void AliPythia::ResetDecayTable()
354 // Set default values for pythia decay switches
356 for (i = 1; i < 501; i++) SetMDCY(i,1,fDefMDCY[i]);
357 for (i = 1; i < 2001; i++) SetMDME(i,1,fDefMDME[i]);
360 void AliPythia::SetDecayTable()
362 // Set default values for pythia decay switches
365 for (i = 1; i < 501; i++) fDefMDCY[i] = GetMDCY(i,1);
366 for (i = 1; i < 2001; i++) fDefMDME[i] = GetMDME(i,1);
372 #define pyrset pyrset_
373 #define pyrget pyrget_
376 #define pyrset PYRSET
377 #define pyrget PYRGET
381 Double_t pyr(Int_t*) {return sRandom->Rndm();}
382 void pyrset(Int_t*,Int_t*) {}
383 void pyrget(Int_t*,Int_t*) {}