AliITSpList.h Increased array size from 5 to 10. Set new version number from
[u/mrichter/AliRoot.git] / EVGEN / AliPythia.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/*
17$Log$
bdc9d08a 18Revision 1.18 2002/02/07 10:43:06 morsch
19Tuned pp-min.bias settings (M.Monteno, R.Ugoccioni and N.Carrer)
20
2afdd95f 21Revision 1.17 2001/12/19 15:40:43 morsch
22For kPyJets enforce simple jet topology, i.e no initial or final state
23gluon radiation and no primordial pT.
24
5ceb826f 25Revision 1.16 2001/10/12 11:13:59 morsch
26Missing break statements added (thanks to Nicola Carrer)
27
02c16581 28Revision 1.15 2001/03/27 10:54:50 morsch
29Add ResetDecayTable() and SsetDecayTable() methods.
30
14ee1cd0 31Revision 1.14 2001/03/09 13:03:40 morsch
32Process_t and Struc_Func_t moved to AliPythia.h
33
f1a48a38 34Revision 1.13 2000/12/18 08:55:35 morsch
35Make AliPythia dependent generartors work with new scheme of random number generation
36
3356c022 37Revision 1.12 2000/11/30 07:12:50 alibrary
38Introducing new Rndm and QA classes
39
65fb704d 40Revision 1.11 2000/10/20 06:30:06 fca
41Use version 0 to avoid streamer generation
42
3be3dfc7 43Revision 1.10 2000/10/06 14:18:44 morsch
44Upper cut of prim. pT distribution set to 5. GeV
45
e8d05e6c 46Revision 1.9 2000/09/18 10:41:35 morsch
47Add possibility to use nuclear structure functions from PDF library V8.
48
811826d8 49Revision 1.8 2000/09/06 14:26:24 morsch
50Decayer functionality of AliPythia has been moved to AliDecayerPythia.
51Class is now a singleton.
52
95b811fe 53Revision 1.7 2000/06/09 20:34:50 morsch
54All coding rule violations except RS3 corrected
55
f87cfe57 56Revision 1.6 1999/11/09 07:38:48 fca
57Changes for compatibility with version 2.23 of ROOT
58
084c1b4a 59Revision 1.5 1999/11/03 17:43:20 fca
60New version from G.Martinez & A.Morsch
61
886b6f73 62Revision 1.4 1999/09/29 09:24:14 fca
63Introduction of the Copyright and cvs Log
64
4c039060 65*/
66
75c6d54e 67
fe4da5cc 68#include "AliPythia.h"
f87cfe57 69
fe4da5cc 70ClassImp(AliPythia)
71
fe4da5cc 72//_____________________________________________________________________________
73
95b811fe 74AliPythia* AliPythia::fgAliPythia=NULL;
fe4da5cc 75
75c6d54e 76AliPythia::AliPythia()
77{
95b811fe 78// Default Constructor
3356c022 79//
80// Set random number
81 if (!sRandom) sRandom=fRandom;
14ee1cd0 82
fe4da5cc 83}
84
85void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc)
86{
f87cfe57 87// Initialise the process to generate
fe4da5cc 88 fProcess = process;
89 fEcms = energy;
90 fStrucFunc = strucfunc;
91// don't decay p0
95b811fe 92 SetMDCY(Pycomp(111),1,0);
fe4da5cc 93// select structure function
94 SetMSTP(52,2);
95 SetMSTP(51,strucfunc);
96//
97// Pythia initialisation for selected processes//
98//
99// Make MSEL clean
100//
101 for (Int_t i=1; i<= 200; i++) {
102 SetMSUB(i,0);
103 }
104// select charm production
105 switch (process)
106 {
f1a48a38 107 case kPyCharm:
fe4da5cc 108 SetMSEL(4);
109//
110// heavy quark masses
111
112 SetPMAS(4,1,1.2);
5ceb826f 113 SetMSTU(16,2);
fe4da5cc 114//
115// primordial pT
116 SetMSTP(91,1);
e8d05e6c 117 SetPARP(91,1.);
118 SetPARP(93,5.);
fe4da5cc 119//
120 break;
f1a48a38 121 case kPyBeauty:
fe4da5cc 122 SetMSEL(5);
123 SetPMAS(5,1,4.75);
5ceb826f 124 SetMSTU(16,2);
fe4da5cc 125 break;
f1a48a38 126 case kPyJpsi:
fe4da5cc 127 SetMSEL(0);
128// gg->J/Psi g
129 SetMSUB(86,1);
130 break;
f1a48a38 131 case kPyJpsiChi:
fe4da5cc 132 SetMSEL(0);
133// gg->J/Psi g
134 SetMSUB(86,1);
135// gg-> chi_0c g
136 SetMSUB(87,1);
137// gg-> chi_1c g
138 SetMSUB(88,1);
139// gg-> chi_2c g
140 SetMSUB(89,1);
02c16581 141 break;
f1a48a38 142 case kPyCharmUnforced:
fe4da5cc 143 SetMSEL(0);
144// gq->qg
145 SetMSUB(28,1);
146// gg->qq
147 SetMSUB(53,1);
148// gg->gg
149 SetMSUB(68,1);
02c16581 150 break;
f1a48a38 151 case kPyBeautyUnforced:
fe4da5cc 152 SetMSEL(0);
153// gq->qg
154 SetMSUB(28,1);
155// gg->qq
156 SetMSUB(53,1);
157// gg->gg
158 SetMSUB(68,1);
159 break;
f1a48a38 160 case kPyMb:
75c6d54e 161// Minimum Bias pp-Collisions
162//
75c6d54e 163//
164// select Pythia min. bias model
14ee1cd0 165 SetMSEL(0);
2afdd95f 166 SetMSUB(92,1); // single diffraction AB-->XB
167 SetMSUB(93,1); // single diffraction AB-->AX
168 SetMSUB(94,1); // double diffraction
169 SetMSUB(95,1); // low pt production
170 SetMSTP(81,1); // multiple interactions switched on
171 SetMSTP(82,3); // model with varying impact param. & a single Gaussian
172 SetPARP(82,3.47); // set value pT_0 for turn-off of the cross section of
173 // multiple interaction at a reference energy = 14000 GeV
174 SetPARP(89,14000.); // reference energy for the above parameter
175 SetPARP(90,0.174); // set exponent for energy dependence of pT_0
f1a48a38 176 break;
177 case kPyJets:
178 SetMSEL(1);
5ceb826f 179// no initial state radiation
180 SetMSTP(61,0);
181// no final state radiation
182 SetMSTP(71,0);
183// no primordial pT
184 SetMSTP(91,0);
185// SetMSTP(111,0);
186 SetMSTU(16,1);
187 SetMSTJ(1,1);
188
f1a48a38 189 break;
190 case kPyDirectGamma:
191 SetMSEL(10);
192 break;
fe4da5cc 193 }
194//
195// Initialize PYTHIA
2afdd95f 196 SetMSTP(41,1); // all resonance decays switched on
75c6d54e 197
95b811fe 198 Initialize("CMS","p","p",fEcms);
14ee1cd0 199
fe4da5cc 200}
201
95b811fe 202Int_t AliPythia::CheckedLuComp(Int_t kf)
fe4da5cc 203{
95b811fe 204// Check Lund particle code (for debugging)
205 Int_t kc=Pycomp(kf);
206 printf("\n Lucomp kf,kc %d %d",kf,kc);
207 return kc;
fe4da5cc 208}
209
811826d8 210void AliPythia::SetNuclei(Int_t a1, Int_t a2)
211{
212// Treat protons as inside nuclei with mass numbers a1 and a2
213// The MSTP array in the PYPARS common block is used to enable and
214// select the nuclear structure functions.
215// MSTP(52) : (D=1) choice of proton and nuclear structure-function library
216// =1: internal PYTHIA acording to MSTP(51)
217// =2: PDFLIB proton s.f., with MSTP(51) = 1000xNGROUP+NSET
bdc9d08a 218// If the following mass number both not equal zero, nuclear corrections of the stf are used.
811826d8 219// MSTP(192) : Mass number of nucleus side 1
220// MSTP(193) : Mass number of nucleus side 2
bdc9d08a 221 SetMSTP(52,2);
811826d8 222 SetMSTP(192, a1);
223 SetMSTP(193, a2);
224}
225
226
95b811fe 227AliPythia* AliPythia::Instance()
3356c022 228{
229// Set random number generator
95b811fe 230 if (fgAliPythia) {
231 return fgAliPythia;
232 } else {
233 fgAliPythia = new AliPythia();
234 return fgAliPythia;
fe4da5cc 235 }
fe4da5cc 236}
fe4da5cc 237
14ee1cd0 238void AliPythia::PrintParticles()
239{
240// Print list of particl properties
241 Int_t np = 0;
242
243 for (Int_t kf=0; kf<1000000; kf++) {
244 for (Int_t c = 1; c > -2; c-=2) {
245
246 Int_t kc = Pycomp(c*kf);
247 if (kc) {
248 Float_t mass = GetPMAS(kc,1);
249 Float_t width = GetPMAS(kc,2);
250 Float_t tau = GetPMAS(kc,4);
251
252 char* name = new char[8];
253 Pyname(kf,name);
254
255 np++;
256
257 printf("\n mass, width, tau: %6d %s %10.3f %10.3e %10.3e",
258 c*kf, name, mass, width, tau);
259 }
260 }
261 }
262 printf("\n Number of particles %d \n \n", np);
263}
264
265void AliPythia::ResetDecayTable()
266{
267// Set default values for pythia decay switches
268 Int_t i;
269 for (i = 1; i < 501; i++) SetMDCY(i,1,fDefMDCY[i]);
270 for (i = 1; i < 2001; i++) SetMDME(i,1,fDefMDME[i]);
271}
272
273void AliPythia::SetDecayTable()
274{
275// Set default values for pythia decay switches
276//
277 Int_t i;
278 for (i = 1; i < 501; i++) fDefMDCY[i] = GetMDCY(i,1);
279 for (i = 1; i < 2001; i++) fDefMDME[i] = GetMDME(i,1);
280}
fe4da5cc 281
282
3356c022 283#ifndef WIN32
284#define pyr pyr_
285#define pyrset pyrset_
286#define pyrget pyrget_
287#else
288#define pyr PYR
289#define pyrset PYRSET
290#define pyrget PYRGET
291#endif
292
293extern "C" {
294 Double_t pyr(Int_t*) {return sRandom->Rndm();}
295 void pyrset(Int_t*,Int_t*) {}
296 void pyrget(Int_t*,Int_t*) {}
297}
298
fe4da5cc 299
300
301