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.15 2001/03/27 10:54:50 morsch
19 Add ResetDecayTable() and SsetDecayTable() methods.
21 Revision 1.14 2001/03/09 13:03:40 morsch
22 Process_t and Struc_Func_t moved to AliPythia.h
24 Revision 1.13 2000/12/18 08:55:35 morsch
25 Make AliPythia dependent generartors work with new scheme of random number generation
27 Revision 1.12 2000/11/30 07:12:50 alibrary
28 Introducing new Rndm and QA classes
30 Revision 1.11 2000/10/20 06:30:06 fca
31 Use version 0 to avoid streamer generation
33 Revision 1.10 2000/10/06 14:18:44 morsch
34 Upper cut of prim. pT distribution set to 5. GeV
36 Revision 1.9 2000/09/18 10:41:35 morsch
37 Add possibility to use nuclear structure functions from PDF library V8.
39 Revision 1.8 2000/09/06 14:26:24 morsch
40 Decayer functionality of AliPythia has been moved to AliDecayerPythia.
41 Class is now a singleton.
43 Revision 1.7 2000/06/09 20:34:50 morsch
44 All coding rule violations except RS3 corrected
46 Revision 1.6 1999/11/09 07:38:48 fca
47 Changes for compatibility with version 2.23 of ROOT
49 Revision 1.5 1999/11/03 17:43:20 fca
50 New version from G.Martinez & A.Morsch
52 Revision 1.4 1999/09/29 09:24:14 fca
53 Introduction of the Copyright and cvs Log
58 #include "AliPythia.h"
62 //_____________________________________________________________________________
64 AliPythia* AliPythia::fgAliPythia=NULL;
66 AliPythia::AliPythia()
68 // Default Constructor
71 if (!sRandom) sRandom=fRandom;
75 void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc)
77 // Initialise the process to generate
80 fStrucFunc = strucfunc;
82 SetMDCY(Pycomp(111),1,0);
83 // select structure function
85 SetMSTP(51,strucfunc);
87 // Pythia initialisation for selected processes//
91 for (Int_t i=1; i<= 200; i++) {
94 // select charm production
100 // heavy quark masses
131 case kPyCharmUnforced:
140 case kPyBeautyUnforced:
150 // Minimum Bias pp-Collisions
152 // Tuning of parameters descibed in G. Ciapetti and A. Di Ciaccio
153 // Proc. of the LHC Workshop, Aachen 1990, Vol. II p. 155
155 // select Pythia min. bias model
161 // Multiple interactions switched on
164 // Low-pT cut-off for hard scattering
166 // model for subsequent non-hardest interaction
167 // 90% gg->gg 10% gg->qq
169 // 90% of gluon interactions have minimum string length
183 Initialize("CMS","p","p",fEcms);
187 Int_t AliPythia::CheckedLuComp(Int_t kf)
189 // Check Lund particle code (for debugging)
191 printf("\n Lucomp kf,kc %d %d",kf,kc);
195 void AliPythia::SetNuclei(Int_t a1, Int_t a2)
197 // Treat protons as inside nuclei with mass numbers a1 and a2
198 // The MSTP array in the PYPARS common block is used to enable and
199 // select the nuclear structure functions.
200 // MSTP(52) : (D=1) choice of proton and nuclear structure-function library
201 // =1: internal PYTHIA acording to MSTP(51)
202 // =2: PDFLIB proton s.f., with MSTP(51) = 1000xNGROUP+NSET
203 // =3: PDFLIB proton s.f. with nuclar correction:
204 // MSTP( 51) = 1000xNPGROUP+NPSET
205 // MSTP(151) = 1000xNAGROUP+NASET
206 // MSTP(192) : Mass number of nucleus side 1
207 // MSTP(193) : Mass number of nucleus side 2
216 AliPythia* AliPythia::Instance()
218 // Set random number generator
222 fgAliPythia = new AliPythia();
227 void AliPythia::PrintParticles()
229 // Print list of particl properties
232 for (Int_t kf=0; kf<1000000; kf++) {
233 for (Int_t c = 1; c > -2; c-=2) {
235 Int_t kc = Pycomp(c*kf);
237 Float_t mass = GetPMAS(kc,1);
238 Float_t width = GetPMAS(kc,2);
239 Float_t tau = GetPMAS(kc,4);
241 char* name = new char[8];
246 printf("\n mass, width, tau: %6d %s %10.3f %10.3e %10.3e",
247 c*kf, name, mass, width, tau);
251 printf("\n Number of particles %d \n \n", np);
254 void AliPythia::ResetDecayTable()
256 // Set default values for pythia decay switches
258 for (i = 1; i < 501; i++) SetMDCY(i,1,fDefMDCY[i]);
259 for (i = 1; i < 2001; i++) SetMDME(i,1,fDefMDME[i]);
262 void AliPythia::SetDecayTable()
264 // Set default values for pythia decay switches
267 for (i = 1; i < 501; i++) fDefMDCY[i] = GetMDCY(i,1);
268 for (i = 1; i < 2001; i++) fDefMDME[i] = GetMDME(i,1);
274 #define pyrset pyrset_
275 #define pyrget pyrget_
278 #define pyrset PYRSET
279 #define pyrget PYRGET
283 Double_t pyr(Int_t*) {return sRandom->Rndm();}
284 void pyrset(Int_t*,Int_t*) {}
285 void pyrget(Int_t*,Int_t*) {}