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.5 1999/11/03 17:43:20 fca
19 New version from G.Martinez & A.Morsch
21 Revision 1.4 1999/09/29 09:24:14 fca
22 Introduction of the Copyright and cvs Log
27 #include "AliPythia.h"
32 # define lu1ent lu1ent_
35 # define lu1ent LU1ENT
36 # define type_of_call _stdcall
39 extern "C" void type_of_call
40 lu1ent(Int_t&, Int_t&, Float_t&, Float_t&, Float_t&);
44 //_____________________________________________________________________________
46 Int_t AliPythia::fgInit=0;
48 AliPythia::AliPythia()
50 for (Int_t i=0; i<501; i++) {
56 void AliPythia::Lu1Ent(Int_t flag, Int_t idpart,
57 Float_t mom, Float_t theta,Float_t phi)
59 printf("%d %d %f %f %f\n",flag, idpart, mom, theta, phi);
60 lu1ent(flag, idpart, mom, theta, phi);
63 void AliPythia::DecayParticle(Int_t idpart,
64 Float_t mom, Float_t theta,Float_t phi)
66 Lu1Ent(0, idpart, mom, theta, phi);
70 void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc)
74 fStrucFunc = strucfunc;
76 SetMDCY(Lucomp(111),1,0);
77 // select structure function
79 SetMSTP(51,strucfunc);
81 // Pythia initialisation for selected processes//
85 for (Int_t i=1; i<= 200; i++) {
88 // select charm production
132 case beauty_unforced:
142 // Minimum Bias pp-Collisions
144 // Tuning of parameters descibed in G. Ciapetti and A. Di Ciaccio
145 // Proc. of the LHC Workshop, Aachen 1990, Vol. II p. 155
147 // select Pythia min. bias model
153 // Multiple interactions switched on
156 // Low-pT cut-off for hard scattering
158 // model for subsequent non-hardest interaction
159 // 90% gg->gg 10% gg->qq
161 // 90% of gluon interactions have minimum string length
166 Initialize("CMS","p","p",fEcms);
169 Int_t AliPythia::CountProducts(Int_t channel, Int_t particle)
172 for (Int_t i=1; i<=5; i++) {
173 if (TMath::Abs(GetKFDP(channel,i)) == particle) np++;
178 void AliPythia::AllowAllDecays()
181 for (i=1; i<= 2000; i++) {
185 for (i=0; i<501; i++){
190 void AliPythia::ForceParticleDecay(Int_t particle, Int_t product, Int_t mult)
193 // force decay of particle into products with multiplicity mult
195 Int_t kc=Lucomp(particle);
197 Int_t ifirst=GetMDCY(kc,2);
198 Int_t ilast=ifirst+GetMDCY(kc,3)-1;
201 // Loop over decay channels
202 for (Int_t channel=ifirst; channel<=ilast;channel++) {
203 if (CountProducts(channel,product) >= mult) {
204 SetMDME(channel,1,1);
206 SetMDME(channel,1,0);
207 fBraPart[kc]-=GetBRAT(channel);
212 void AliPythia::ForceDecay(Decay_t decay)
224 if (fProcess==charm || fProcess == charm_unforced) {
225 ForceParticleDecay( 411,13,1); // D+/-
226 ForceParticleDecay( 421,13,1); // D0
227 ForceParticleDecay( 431,13,1); // D_s
228 ForceParticleDecay( 4122,13,1); // Lambda_c
230 if (fProcess==beauty || fProcess == beauty_unforced) {
231 ForceParticleDecay( 511,13,1); // B0
232 ForceParticleDecay( 521,13,1); // B+/-
233 ForceParticleDecay( 531,13,1); // B_s
234 ForceParticleDecay( 5122,13,1); // Lambda_b
238 ForceParticleDecay( 41,13,2); // phi
239 ForceParticleDecay( 443,13,2); // J/Psi
240 ForceParticleDecay(30443,13,2); // Psi'
241 ForceParticleDecay( 553,13,2); // Upsilon
242 ForceParticleDecay(30553,13,2); // Upsilon'
246 ForceParticleDecay( 411,11,1); // D+/-
247 ForceParticleDecay( 421,11,1); // D0
248 ForceParticleDecay( 431,11,1); // D_s
249 ForceParticleDecay( 4122,11,1); // Lambda_c
251 ForceParticleDecay( 511,11,1); // B0
252 ForceParticleDecay( 521,11,1); // B+/-
253 ForceParticleDecay( 531,11,1); // B_s
254 ForceParticleDecay( 5122,11,1); // Lambda_b
258 ForceParticleDecay( 41,11,2); // phi
259 ForceParticleDecay( 443,11,2); // J/Psi
260 ForceParticleDecay(30443,11,2); // Psi'
261 ForceParticleDecay( 553,11,2); // Upsilon
262 ForceParticleDecay(30553,11,2); // Upsilon'
265 ForceParticleDecay( 511,443,1); // B0
266 ForceParticleDecay( 521,443,1); // B+/-
267 ForceParticleDecay( 531,443,1); // B_s
268 ForceParticleDecay( 5122,443,1); // Lambda_b
269 ForceParticleDecay( 443,13,2); // J/Psi
272 ForceParticleDecay( 511,30443,1); // B0
273 ForceParticleDecay( 521,30443,1); // B+/-
274 ForceParticleDecay( 531,30443,1); // B_s
275 ForceParticleDecay( 5122,30443,1); // Lambda_b
276 ForceParticleDecay(30443,13,2); // Psi'
278 case b_jpsi_dielectron:
279 ForceParticleDecay( 511,443,1); // B0
280 ForceParticleDecay( 521,443,1); // B+/-
281 ForceParticleDecay( 531,443,1); // B_s
282 ForceParticleDecay( 5122,443,1); // Lambda_b
283 ForceParticleDecay( 443,11,2); // J/Psi
285 case b_psip_dielectron:
286 ForceParticleDecay( 511,30443,1); // B0
287 ForceParticleDecay( 521,30443,1); // B+/-
288 ForceParticleDecay( 531,30443,1); // B_s
289 ForceParticleDecay( 5122,30443,1); // Lambda_b
290 ForceParticleDecay(30443,11,2); // Psi'
293 ForceParticleDecay(211,13,1); // pi->mu
296 ForceParticleDecay(321,13,1); // K->mu
305 void AliPythia::DefineParticles()
315 // Some particles cloned for rare decays
317 // phi-> mu+mu- and phi -> e+e-
318 // clone the original phi
323 SetKCHG(nkc,i,GetKCHG(kc,i));
327 SetPMAS(nkc,i,GetPMAS(kc,i));
329 SetCHAF(nkc,GetCHAF(kc));
340 SetBRAT(993,2.99e-4);
359 // phi clone for dilepton decay-channel
363 gMC->Gspart(113,"Phi",3,mass,0,tlife);
370 gMC->Gspart(114,"J/Psi",3,mass,0,tlife);
377 gMC->Gspart(115,"Psi'",3,mass,0,tlife);
384 gMC->Gspart(116,"Upsilon",3,mass,0,tlife);
391 gMC->Gspart(117,"Upsilon'",3,mass,0,tlife);
398 gMC->Gspart(118,"Upsilon''",3,mass,0,tlife);
408 gMC->Gspart(119,"D^+",3,mass, 1,tlife);
409 gMC->Gspart(120,"D^-",3,mass,-1,tlife);
416 gMC->Gspart(121,"D^0",3,mass,0,tlife);
417 gMC->Gspart(122,"D^0bar",3,mass,0,tlife);
424 gMC->Gspart(123,"D_s^+",3,mass, 1,tlife);
425 gMC->Gspart(124,"D_s^-",3,mass,-1,tlife);
432 gMC->Gspart(125,"Lambda_c+",3,mass, 1,tlife);
433 gMC->Gspart(126,"Lambda_c-",3,mass,-1,tlife);
442 gMC->Gspart(127,"B^0",3,mass, 0,tlife);
443 gMC->Gspart(128,"B^0bar",3,mass, 0,tlife);
450 gMC->Gspart(129,"B^+",3,mass, 1,tlife);
451 gMC->Gspart(130,"B^-",3,mass,-1,tlife);
458 gMC->Gspart(131,"B_s",3,mass, 0,tlife);
459 gMC->Gspart(132,"B_s^bar",3,mass,0,tlife);
466 gMC->Gspart(133,"Lambda_b",3,mass, 0,tlife);
467 gMC->Gspart(134,"Lambda_b^bar",3,mass,0,tlife);
471 // set up correspondance between standard GEANT particle codes
474 kc=Lucomp(22); // gamma
478 kc=Lucomp(11); // positron
482 kc=Lucomp(12); // neutrino
486 kc=Lucomp(13); // muon
490 kc=Lucomp(111); // pi0
494 kc=Lucomp(211); // pi+
498 kc=Lucomp(130); // K0 short
502 kc=Lucomp(321); // K+/-
506 kc=Lucomp(2112); // neutron/anti-neutron
510 kc=Lucomp(2212); // proton/anti-proton
514 kc=Lucomp(310); // K0 short
518 kc=Lucomp(221); // eta
522 kc=Lucomp(3122); // lambda
526 kc=Lucomp(3222); // sigma+/antisigma+
530 kc=Lucomp(3212); // sigma0/antisigma0
534 kc=Lucomp(3112); // sigma-/antisigma-
538 kc=Lucomp(3322); // xsi0-/antixsi0
542 kc=Lucomp(3312); // xsi-/antixsi+
546 kc=Lucomp(3334); // omega/antiomega
553 Int_t AliPythia::GetGeantCode(Int_t kf)
555 Int_t kc=Lucomp(TMath::Abs(kf));
556 return (kf > 0) ? fGPCode[kc][0] : fGPCode[kc][1];
559 Float_t AliPythia::GetBraPart(Int_t kf)
561 Int_t kc=Lucomp(TMath::Abs(kf));