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.14 2001/03/09 13:03:40 morsch
19 Process_t and Struc_Func_t moved to AliPythia.h
21 Revision 1.13 2000/12/18 08:55:35 morsch
22 Make AliPythia dependent generartors work with new scheme of random number generation
24 Revision 1.12 2000/11/30 07:12:50 alibrary
25 Introducing new Rndm and QA classes
27 Revision 1.11 2000/10/20 06:30:06 fca
28 Use version 0 to avoid streamer generation
30 Revision 1.10 2000/10/06 14:18:44 morsch
31 Upper cut of prim. pT distribution set to 5. GeV
33 Revision 1.9 2000/09/18 10:41:35 morsch
34 Add possibility to use nuclear structure functions from PDF library V8.
36 Revision 1.8 2000/09/06 14:26:24 morsch
37 Decayer functionality of AliPythia has been moved to AliDecayerPythia.
38 Class is now a singleton.
40 Revision 1.7 2000/06/09 20:34:50 morsch
41 All coding rule violations except RS3 corrected
43 Revision 1.6 1999/11/09 07:38:48 fca
44 Changes for compatibility with version 2.23 of ROOT
46 Revision 1.5 1999/11/03 17:43:20 fca
47 New version from G.Martinez & A.Morsch
49 Revision 1.4 1999/09/29 09:24:14 fca
50 Introduction of the Copyright and cvs Log
55 #include "AliPythia.h"
59 //_____________________________________________________________________________
61 AliPythia* AliPythia::fgAliPythia=NULL;
63 AliPythia::AliPythia()
65 // Default Constructor
68 if (!sRandom) sRandom=fRandom;
72 void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc)
74 // Initialise the process to generate
77 fStrucFunc = strucfunc;
79 SetMDCY(Pycomp(111),1,0);
80 // select structure function
82 SetMSTP(51,strucfunc);
84 // Pythia initialisation for selected processes//
88 for (Int_t i=1; i<= 200; i++) {
91 // select charm production
127 case kPyCharmUnforced:
135 case kPyBeautyUnforced:
145 // Minimum Bias pp-Collisions
147 // Tuning of parameters descibed in G. Ciapetti and A. Di Ciaccio
148 // Proc. of the LHC Workshop, Aachen 1990, Vol. II p. 155
150 // select Pythia min. bias model
156 // Multiple interactions switched on
159 // Low-pT cut-off for hard scattering
161 // model for subsequent non-hardest interaction
162 // 90% gg->gg 10% gg->qq
164 // 90% of gluon interactions have minimum string length
178 Initialize("CMS","p","p",fEcms);
182 Int_t AliPythia::CheckedLuComp(Int_t kf)
184 // Check Lund particle code (for debugging)
186 printf("\n Lucomp kf,kc %d %d",kf,kc);
190 void AliPythia::SetNuclei(Int_t a1, Int_t a2)
192 // Treat protons as inside nuclei with mass numbers a1 and a2
193 // The MSTP array in the PYPARS common block is used to enable and
194 // select the nuclear structure functions.
195 // MSTP(52) : (D=1) choice of proton and nuclear structure-function library
196 // =1: internal PYTHIA acording to MSTP(51)
197 // =2: PDFLIB proton s.f., with MSTP(51) = 1000xNGROUP+NSET
198 // =3: PDFLIB proton s.f. with nuclar correction:
199 // MSTP( 51) = 1000xNPGROUP+NPSET
200 // MSTP(151) = 1000xNAGROUP+NASET
201 // MSTP(192) : Mass number of nucleus side 1
202 // MSTP(193) : Mass number of nucleus side 2
211 AliPythia* AliPythia::Instance()
213 // Set random number generator
217 fgAliPythia = new AliPythia();
222 void AliPythia::PrintParticles()
224 // Print list of particl properties
227 for (Int_t kf=0; kf<1000000; kf++) {
228 for (Int_t c = 1; c > -2; c-=2) {
230 Int_t kc = Pycomp(c*kf);
232 Float_t mass = GetPMAS(kc,1);
233 Float_t width = GetPMAS(kc,2);
234 Float_t tau = GetPMAS(kc,4);
236 char* name = new char[8];
241 printf("\n mass, width, tau: %6d %s %10.3f %10.3e %10.3e",
242 c*kf, name, mass, width, tau);
246 printf("\n Number of particles %d \n \n", np);
249 void AliPythia::ResetDecayTable()
251 // Set default values for pythia decay switches
253 for (i = 1; i < 501; i++) SetMDCY(i,1,fDefMDCY[i]);
254 for (i = 1; i < 2001; i++) SetMDME(i,1,fDefMDME[i]);
257 void AliPythia::SetDecayTable()
259 // Set default values for pythia decay switches
262 for (i = 1; i < 501; i++) fDefMDCY[i] = GetMDCY(i,1);
263 for (i = 1; i < 2001; i++) fDefMDME[i] = GetMDME(i,1);
269 #define pyrset pyrset_
270 #define pyrget pyrget_
273 #define pyrset PYRSET
274 #define pyrget PYRGET
278 Double_t pyr(Int_t*) {return sRandom->Rndm();}
279 void pyrset(Int_t*,Int_t*) {}
280 void pyrget(Int_t*,Int_t*) {}