- enum constants for paramterisation type (particle family) moved to AliGen*lib.h
[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$
3356c022 18Revision 1.12 2000/11/30 07:12:50 alibrary
19Introducing new Rndm and QA classes
20
65fb704d 21Revision 1.11 2000/10/20 06:30:06 fca
22Use version 0 to avoid streamer generation
23
3be3dfc7 24Revision 1.10 2000/10/06 14:18:44 morsch
25Upper cut of prim. pT distribution set to 5. GeV
26
e8d05e6c 27Revision 1.9 2000/09/18 10:41:35 morsch
28Add possibility to use nuclear structure functions from PDF library V8.
29
811826d8 30Revision 1.8 2000/09/06 14:26:24 morsch
31Decayer functionality of AliPythia has been moved to AliDecayerPythia.
32Class is now a singleton.
33
95b811fe 34Revision 1.7 2000/06/09 20:34:50 morsch
35All coding rule violations except RS3 corrected
36
f87cfe57 37Revision 1.6 1999/11/09 07:38:48 fca
38Changes for compatibility with version 2.23 of ROOT
39
084c1b4a 40Revision 1.5 1999/11/03 17:43:20 fca
41New version from G.Martinez & A.Morsch
42
886b6f73 43Revision 1.4 1999/09/29 09:24:14 fca
44Introduction of the Copyright and cvs Log
45
4c039060 46*/
47
75c6d54e 48
fe4da5cc 49#include "AliPythia.h"
f87cfe57 50
fe4da5cc 51ClassImp(AliPythia)
52
fe4da5cc 53//_____________________________________________________________________________
54
95b811fe 55AliPythia* AliPythia::fgAliPythia=NULL;
fe4da5cc 56
75c6d54e 57AliPythia::AliPythia()
58{
95b811fe 59// Default Constructor
3356c022 60//
61// Set random number
62 if (!sRandom) sRandom=fRandom;
fe4da5cc 63}
64
65void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc)
66{
f87cfe57 67// Initialise the process to generate
fe4da5cc 68 fProcess = process;
69 fEcms = energy;
70 fStrucFunc = strucfunc;
71// don't decay p0
95b811fe 72 SetMDCY(Pycomp(111),1,0);
fe4da5cc 73// select structure function
74 SetMSTP(52,2);
75 SetMSTP(51,strucfunc);
76//
77// Pythia initialisation for selected processes//
78//
79// Make MSEL clean
80//
81 for (Int_t i=1; i<= 200; i++) {
82 SetMSUB(i,0);
83 }
84// select charm production
85 switch (process)
86 {
87 case charm:
88 SetMSEL(4);
89//
90// heavy quark masses
91
92 SetPMAS(4,1,1.2);
93
94//
95// primordial pT
96 SetMSTP(91,1);
e8d05e6c 97 SetPARP(91,1.);
98 SetPARP(93,5.);
fe4da5cc 99//
100 break;
101 case beauty:
102 SetMSEL(5);
103 SetPMAS(5,1,4.75);
104 break;
105 case jpsi:
106 SetMSEL(0);
107// gg->J/Psi g
108 SetMSUB(86,1);
109 break;
110 case jpsi_chi:
111 SetMSEL(0);
112// gg->J/Psi g
113 SetMSUB(86,1);
114// gg-> chi_0c g
115 SetMSUB(87,1);
116// gg-> chi_1c g
117 SetMSUB(88,1);
118// gg-> chi_2c g
119 SetMSUB(89,1);
120 case charm_unforced:
121 SetMSEL(0);
122// gq->qg
123 SetMSUB(28,1);
124// gg->qq
125 SetMSUB(53,1);
126// gg->gg
127 SetMSUB(68,1);
128 case beauty_unforced:
129 SetMSEL(0);
130// gq->qg
131 SetMSUB(28,1);
132// gg->qq
133 SetMSUB(53,1);
134// gg->gg
135 SetMSUB(68,1);
136 break;
75c6d54e 137 case mb:
138// Minimum Bias pp-Collisions
139//
140// Tuning of parameters descibed in G. Ciapetti and A. Di Ciaccio
141// Proc. of the LHC Workshop, Aachen 1990, Vol. II p. 155
142//
143// select Pythia min. bias model
144 SetMSEL(2);
145 SetMSUB(92,1);
146 SetMSUB(93,1);
147 SetMSUB(94,1);
148 SetMSUB(95,1);
149// Multiple interactions switched on
150 SetMSTP(81,1);
151 SetMSTP(82,1);
152// Low-pT cut-off for hard scattering
153 SetPARP(81,1.9);
154// model for subsequent non-hardest interaction
155// 90% gg->gg 10% gg->qq
156 SetPARP(86,0.9);
157// 90% of gluon interactions have minimum string length
158 SetPARP(85,0.9);
fe4da5cc 159 }
160//
161// Initialize PYTHIA
95b811fe 162 SetMSTP(41,1);
75c6d54e 163
95b811fe 164 Initialize("CMS","p","p",fEcms);
fe4da5cc 165}
166
95b811fe 167Int_t AliPythia::CheckedLuComp(Int_t kf)
fe4da5cc 168{
95b811fe 169// Check Lund particle code (for debugging)
170 Int_t kc=Pycomp(kf);
171 printf("\n Lucomp kf,kc %d %d",kf,kc);
172 return kc;
fe4da5cc 173}
174
811826d8 175void AliPythia::SetNuclei(Int_t a1, Int_t a2)
176{
177// Treat protons as inside nuclei with mass numbers a1 and a2
178// The MSTP array in the PYPARS common block is used to enable and
179// select the nuclear structure functions.
180// MSTP(52) : (D=1) choice of proton and nuclear structure-function library
181// =1: internal PYTHIA acording to MSTP(51)
182// =2: PDFLIB proton s.f., with MSTP(51) = 1000xNGROUP+NSET
183// =3: PDFLIB proton s.f. with nuclar correction:
184// MSTP( 51) = 1000xNPGROUP+NPSET
185// MSTP(151) = 1000xNAGROUP+NASET
186// MSTP(192) : Mass number of nucleus side 1
187// MSTP(193) : Mass number of nucleus side 2
188
189 SetMSTP(52,3);
190 SetMSTP(191, 1001);
191 SetMSTP(192, a1);
192 SetMSTP(193, a2);
193}
194
195
95b811fe 196AliPythia* AliPythia::Instance()
3356c022 197{
198// Set random number generator
95b811fe 199 if (fgAliPythia) {
200 return fgAliPythia;
201 } else {
202 fgAliPythia = new AliPythia();
203 return fgAliPythia;
fe4da5cc 204 }
fe4da5cc 205}
fe4da5cc 206
207
208
3356c022 209#ifndef WIN32
210#define pyr pyr_
211#define pyrset pyrset_
212#define pyrget pyrget_
213#else
214#define pyr PYR
215#define pyrset PYRSET
216#define pyrget PYRGET
217#endif
218
219extern "C" {
220 Double_t pyr(Int_t*) {return sRandom->Rndm();}
221 void pyrset(Int_t*,Int_t*) {}
222 void pyrget(Int_t*,Int_t*) {}
223}
224
fe4da5cc 225
226
227