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.6 1999/11/09 07:38:48 fca
19 Changes for compatibility with version 2.23 of ROOT
21 Revision 1.5 1999/11/03 17:43:20 fca
22 New version from G.Martinez & A.Morsch
24 Revision 1.4 1999/09/29 09:24:14 fca
25 Introduction of the Copyright and cvs Log
30 #include "AliPythia.h"
36 # define lu1ent lu1ent_
39 # define lu1ent LU1ENT
40 # define type_of_call _stdcall
43 extern "C" void type_of_call
44 lu1ent(Int_t&, Int_t&, Float_t&, Float_t&, Float_t&);
48 //_____________________________________________________________________________
50 Int_t AliPythia::fgInit=0;
52 AliPythia::AliPythia()
55 for (Int_t i=0; i<501; i++) {
61 void AliPythia::Lu1Ent(Int_t flag, Int_t idpart,
62 Float_t mom, Float_t theta,Float_t phi)
64 // Wrap of Pythia lu1ent subroutine
65 printf("%d %d %f %f %f\n",flag, idpart, mom, theta, phi);
66 lu1ent(flag, idpart, mom, theta, phi);
69 void AliPythia::DecayParticle(Int_t idpart,
70 Float_t mom, Float_t theta,Float_t phi)
73 Lu1Ent(0, idpart, mom, theta, phi);
77 void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc)
79 // Initialise the process to generate
82 fStrucFunc = strucfunc;
84 SetMDCY(Lucomp(111),1,0);
85 // select structure function
87 SetMSTP(51,strucfunc);
89 // Pythia initialisation for selected processes//
93 for (Int_t i=1; i<= 200; i++) {
96 // select charm production
102 // heavy quark masses
140 case beauty_unforced:
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
174 Initialize("CMS","p","p",fEcms);
177 Int_t AliPythia::CountProducts(Int_t channel, Int_t particle)
179 // Count number of decay products
181 for (Int_t i=1; i<=5; i++) {
182 if (TMath::Abs(GetKFDP(channel,i)) == particle) np++;
187 void AliPythia::AllowAllDecays()
191 for (i=1; i<= 2000; i++) {
195 for (i=0; i<501; i++){
200 void AliPythia::ForceParticleDecay(Int_t particle, Int_t product, Int_t mult)
203 // force decay of particle into products with multiplicity mult
205 Int_t kc=Lucomp(particle);
207 Int_t ifirst=GetMDCY(kc,2);
208 Int_t ilast=ifirst+GetMDCY(kc,3)-1;
211 // Loop over decay channels
212 for (Int_t channel=ifirst; channel<=ilast;channel++) {
213 if (CountProducts(channel,product) >= mult) {
214 SetMDME(channel,1,1);
216 SetMDME(channel,1,0);
217 fBraPart[kc]-=GetBRAT(channel);
222 void AliPythia::ForceDecay(Decay_t decay)
224 // Force a particle decay mode
235 if (fProcess==charm || fProcess == charm_unforced) {
236 ForceParticleDecay( 411,13,1); // D+/-
237 ForceParticleDecay( 421,13,1); // D0
238 ForceParticleDecay( 431,13,1); // D_s
239 ForceParticleDecay( 4122,13,1); // Lambda_c
241 if (fProcess==beauty || fProcess == beauty_unforced) {
242 ForceParticleDecay( 511,13,1); // B0
243 ForceParticleDecay( 521,13,1); // B+/-
244 ForceParticleDecay( 531,13,1); // B_s
245 ForceParticleDecay( 5122,13,1); // Lambda_b
249 ForceParticleDecay( 41,13,2); // phi
250 ForceParticleDecay( 443,13,2); // J/Psi
251 ForceParticleDecay(30443,13,2); // Psi'
252 ForceParticleDecay( 553,13,2); // Upsilon
253 ForceParticleDecay(30553,13,2); // Upsilon'
257 ForceParticleDecay( 411,11,1); // D+/-
258 ForceParticleDecay( 421,11,1); // D0
259 ForceParticleDecay( 431,11,1); // D_s
260 ForceParticleDecay( 4122,11,1); // Lambda_c
262 ForceParticleDecay( 511,11,1); // B0
263 ForceParticleDecay( 521,11,1); // B+/-
264 ForceParticleDecay( 531,11,1); // B_s
265 ForceParticleDecay( 5122,11,1); // Lambda_b
269 ForceParticleDecay( 41,11,2); // phi
270 ForceParticleDecay( 443,11,2); // J/Psi
271 ForceParticleDecay(30443,11,2); // Psi'
272 ForceParticleDecay( 553,11,2); // Upsilon
273 ForceParticleDecay(30553,11,2); // Upsilon'
276 ForceParticleDecay( 511,443,1); // B0
277 ForceParticleDecay( 521,443,1); // B+/-
278 ForceParticleDecay( 531,443,1); // B_s
279 ForceParticleDecay( 5122,443,1); // Lambda_b
280 ForceParticleDecay( 443,13,2); // J/Psi
283 ForceParticleDecay( 511,30443,1); // B0
284 ForceParticleDecay( 521,30443,1); // B+/-
285 ForceParticleDecay( 531,30443,1); // B_s
286 ForceParticleDecay( 5122,30443,1); // Lambda_b
287 ForceParticleDecay(30443,13,2); // Psi'
289 case b_jpsi_dielectron:
290 ForceParticleDecay( 511,443,1); // B0
291 ForceParticleDecay( 521,443,1); // B+/-
292 ForceParticleDecay( 531,443,1); // B_s
293 ForceParticleDecay( 5122,443,1); // Lambda_b
294 ForceParticleDecay( 443,11,2); // J/Psi
296 case b_psip_dielectron:
297 ForceParticleDecay( 511,30443,1); // B0
298 ForceParticleDecay( 521,30443,1); // B+/-
299 ForceParticleDecay( 531,30443,1); // B_s
300 ForceParticleDecay( 5122,30443,1); // Lambda_b
301 ForceParticleDecay(30443,11,2); // Psi'
304 ForceParticleDecay(211,13,1); // pi->mu
307 ForceParticleDecay(321,13,1); // K->mu
316 void AliPythia::DefineParticles()
318 // Define new particles
327 // Some particles cloned for rare decays
329 // phi-> mu+mu- and phi -> e+e-
330 // clone the original phi
335 SetKCHG(nkc,i,GetKCHG(kc,i));
339 SetPMAS(nkc,i,GetPMAS(kc,i));
341 SetCHAF(nkc,GetCHAF(kc));
352 SetBRAT(993,2.99e-4);
371 // phi clone for dilepton decay-channel
375 gMC->Gspart(113,"Phi",3,mass,0,tlife);
382 gMC->Gspart(114,"J/Psi",3,mass,0,tlife);
389 gMC->Gspart(115,"Psi'",3,mass,0,tlife);
396 gMC->Gspart(116,"Upsilon",3,mass,0,tlife);
403 gMC->Gspart(117,"Upsilon'",3,mass,0,tlife);
410 gMC->Gspart(118,"Upsilon''",3,mass,0,tlife);
420 gMC->Gspart(119,"D^+",3,mass, 1,tlife);
421 gMC->Gspart(120,"D^-",3,mass,-1,tlife);
428 gMC->Gspart(121,"D^0",3,mass,0,tlife);
429 gMC->Gspart(122,"D^0bar",3,mass,0,tlife);
436 gMC->Gspart(123,"D_s^+",3,mass, 1,tlife);
437 gMC->Gspart(124,"D_s^-",3,mass,-1,tlife);
444 gMC->Gspart(125,"Lambda_c+",3,mass, 1,tlife);
445 gMC->Gspart(126,"Lambda_c-",3,mass,-1,tlife);
454 gMC->Gspart(127,"B^0",3,mass, 0,tlife);
455 gMC->Gspart(128,"B^0bar",3,mass, 0,tlife);
462 gMC->Gspart(129,"B^+",3,mass, 1,tlife);
463 gMC->Gspart(130,"B^-",3,mass,-1,tlife);
470 gMC->Gspart(131,"B_s",3,mass, 0,tlife);
471 gMC->Gspart(132,"B_s^bar",3,mass,0,tlife);
478 gMC->Gspart(133,"Lambda_b",3,mass, 0,tlife);
479 gMC->Gspart(134,"Lambda_b^bar",3,mass,0,tlife);
483 // set up correspondance between standard GEANT particle codes
486 kc=Lucomp(22); // gamma
490 kc=Lucomp(11); // positron
494 kc=Lucomp(12); // neutrino
498 kc=Lucomp(13); // muon
502 kc=Lucomp(111); // pi0
506 kc=Lucomp(211); // pi+
510 kc=Lucomp(130); // K0 short
514 kc=Lucomp(321); // K+/-
518 kc=Lucomp(2112); // neutron/anti-neutron
522 kc=Lucomp(2212); // proton/anti-proton
526 kc=Lucomp(310); // K0 short
530 kc=Lucomp(221); // eta
534 kc=Lucomp(3122); // lambda
538 kc=Lucomp(3222); // sigma+/antisigma+
542 kc=Lucomp(3212); // sigma0/antisigma0
546 kc=Lucomp(3112); // sigma-/antisigma-
550 kc=Lucomp(3322); // xsi0-/antixsi0
554 kc=Lucomp(3312); // xsi-/antixsi+
558 kc=Lucomp(3334); // omega/antiomega
565 Int_t AliPythia::GetGeantCode(Int_t kf)
568 Int_t kc=Lucomp(TMath::Abs(kf));
569 return (kf > 0) ? fGPCode[kc][0] : fGPCode[kc][1];
572 Float_t AliPythia::GetBraPart(Int_t kf)
574 // Get branching ratio
575 Int_t kc=Lucomp(TMath::Abs(kf));
579 Int_t AliPythia::CheckedLuComp(Int_t kf)
581 // Check Lund particle code (for debugging)
583 printf("\n Lucomp kf,kc %d %d",kf,kc);