7 # define lu1ent lu1ent_
10 # define lu1ent LU1ENT
11 # define type_of_call _stdcall
14 extern "C" void type_of_call
15 lu1ent(Int_t&, Int_t&, Float_t&, Float_t&, Float_t&);
19 //_____________________________________________________________________________
21 Int_t AliPythia::fgInit=0;
23 AliPythia::AliPythia()
25 for (Int_t i=0; i<501; i++) {
31 void AliPythia::Lu1Ent(Int_t flag, Int_t idpart,
32 Float_t mom, Float_t theta,Float_t phi)
34 printf("%d %d %f %f %f\n",flag, idpart, mom, theta, phi);
35 lu1ent(flag, idpart, mom, theta, phi);
38 void AliPythia::DecayParticle(Int_t idpart,
39 Float_t mom, Float_t theta,Float_t phi)
41 Lu1Ent(0, idpart, mom, theta, phi);
45 void AliPythia::ProcInit(Process_t process, Float_t energy, StrucFunc_t strucfunc)
49 fStrucFunc = strucfunc;
51 SetMDCY(LuComp(111),1,0);
52 // select structure function
54 SetMSTP(51,strucfunc);
56 // Pythia initialisation for selected processes//
60 for (Int_t i=1; i<= 200; i++) {
63 // select charm production
107 case beauty_unforced:
117 // Minimum Bias pp-Collisions
119 // Tuning of parameters descibed in G. Ciapetti and A. Di Ciaccio
120 // Proc. of the LHC Workshop, Aachen 1990, Vol. II p. 155
122 // select Pythia min. bias model
128 // Multiple interactions switched on
131 // Low-pT cut-off for hard scattering
133 // model for subsequent non-hardest interaction
134 // 90% gg->gg 10% gg->qq
136 // 90% of gluon interactions have minimum string length
141 Initialize("CMS","p","p",fEcms);
144 Int_t AliPythia::CountProducts(Int_t channel, Int_t particle)
147 for (Int_t i=1; i<=5; i++) {
148 if (TMath::Abs(GetKFDP(channel,i)) == particle) np++;
153 void AliPythia::AllowAllDecays()
156 for (i=1; i<= 2000; i++) {
160 for (i=0; i<501; i++){
165 void AliPythia::ForceParticleDecay(Int_t particle, Int_t product, Int_t mult)
168 // force decay of particle into products with multiplicity mult
170 Int_t kc=LuComp(particle);
172 Int_t ifirst=GetMDCY(kc,2);
173 Int_t ilast=ifirst+GetMDCY(kc,3)-1;
176 // Loop over decay channels
177 for (Int_t channel=ifirst; channel<=ilast;channel++) {
178 if (CountProducts(channel,product) >= mult) {
179 SetMDME(channel,1,1);
181 SetMDME(channel,1,0);
182 fBraPart[kc]-=GetBRAT(channel);
187 void AliPythia::ForceDecay(Decay_t decay)
199 if (fProcess==charm || fProcess == charm_unforced) {
200 ForceParticleDecay( 411,13,1); // D+/-
201 ForceParticleDecay( 421,13,1); // D0
202 ForceParticleDecay( 431,13,1); // D_s
203 ForceParticleDecay( 4122,13,1); // Lambda_c
205 if (fProcess==beauty || fProcess == beauty_unforced) {
206 ForceParticleDecay( 511,13,1); // B0
207 ForceParticleDecay( 521,13,1); // B+/-
208 ForceParticleDecay( 531,13,1); // B_s
209 ForceParticleDecay( 5122,13,1); // Lambda_b
213 ForceParticleDecay( 41,13,2); // phi
214 ForceParticleDecay( 443,13,2); // J/Psi
215 ForceParticleDecay(30443,13,2); // Psi'
216 ForceParticleDecay( 553,13,2); // Upsilon
217 ForceParticleDecay(30553,13,2); // Upsilon'
221 ForceParticleDecay( 411,11,1); // D+/-
222 ForceParticleDecay( 421,11,1); // D0
223 ForceParticleDecay( 431,11,1); // D_s
224 ForceParticleDecay( 4122,11,1); // Lambda_c
226 ForceParticleDecay( 511,11,1); // B0
227 ForceParticleDecay( 521,11,1); // B+/-
228 ForceParticleDecay( 531,11,1); // B_s
229 ForceParticleDecay( 5122,11,1); // Lambda_b
233 ForceParticleDecay( 41,11,2); // phi
234 ForceParticleDecay( 443,11,2); // J/Psi
235 ForceParticleDecay(30443,11,2); // Psi'
236 ForceParticleDecay( 553,11,2); // Upsilon
237 ForceParticleDecay(30553,11,2); // Upsilon'
240 ForceParticleDecay( 511,443,1); // B0
241 ForceParticleDecay( 521,443,1); // B+/-
242 ForceParticleDecay( 531,443,1); // B_s
243 ForceParticleDecay( 5122,443,1); // Lambda_b
244 ForceParticleDecay( 443,13,2); // J/Psi
247 ForceParticleDecay( 511,30443,1); // B0
248 ForceParticleDecay( 521,30443,1); // B+/-
249 ForceParticleDecay( 531,30443,1); // B_s
250 ForceParticleDecay( 5122,30443,1); // Lambda_b
251 ForceParticleDecay(30443,13,2); // Psi'
253 case b_jpsi_dielectron:
254 ForceParticleDecay( 511,443,1); // B0
255 ForceParticleDecay( 521,443,1); // B+/-
256 ForceParticleDecay( 531,443,1); // B_s
257 ForceParticleDecay( 5122,443,1); // Lambda_b
258 ForceParticleDecay( 443,11,2); // J/Psi
260 case b_psip_dielectron:
261 ForceParticleDecay( 511,30443,1); // B0
262 ForceParticleDecay( 521,30443,1); // B+/-
263 ForceParticleDecay( 531,30443,1); // B_s
264 ForceParticleDecay( 5122,30443,1); // Lambda_b
265 ForceParticleDecay(30443,11,2); // Psi'
268 ForceParticleDecay(211,13,1); // pi->mu
271 ForceParticleDecay(321,13,1); // K->mu
277 void AliPythia::DefineParticles()
287 // Some particles cloned for rare decays
289 // phi-> mu+mu- and phi -> e+e-
290 // clone the original phi
295 SetKCHG(nkc,i,GetKCHG(kc,i));
299 SetPMAS(nkc,i,GetPMAS(kc,i));
301 SetCHAF(nkc,GetCHAF(kc));
312 SetBRAT(993,2.99e-4);
331 // phi clone for dilepton decay-channel
335 gMC->Gspart(113,"Phi",3,mass,0,tlife);
342 gMC->Gspart(114,"J/Psi",3,mass,0,tlife);
349 gMC->Gspart(115,"Psi'",3,mass,0,tlife);
356 gMC->Gspart(116,"Upsilon",3,mass,0,tlife);
363 gMC->Gspart(117,"Upsilon'",3,mass,0,tlife);
370 gMC->Gspart(118,"Upsilon''",3,mass,0,tlife);
380 gMC->Gspart(119,"D^+",3,mass, 1,tlife);
381 gMC->Gspart(120,"D^-",3,mass,-1,tlife);
388 gMC->Gspart(121,"D^0",3,mass,0,tlife);
389 gMC->Gspart(122,"D^0bar",3,mass,0,tlife);
396 gMC->Gspart(123,"D_s^+",3,mass, 1,tlife);
397 gMC->Gspart(124,"D_s^-",3,mass,-1,tlife);
404 gMC->Gspart(125,"Lambda_c+",3,mass, 1,tlife);
405 gMC->Gspart(126,"Lambda_c-",3,mass,-1,tlife);
414 gMC->Gspart(127,"B^0",3,mass, 0,tlife);
415 gMC->Gspart(128,"B^0bar",3,mass, 0,tlife);
422 gMC->Gspart(129,"B^+",3,mass, 1,tlife);
423 gMC->Gspart(130,"B^-",3,mass,-1,tlife);
430 gMC->Gspart(131,"B_s",3,mass, 0,tlife);
431 gMC->Gspart(132,"B_s^bar",3,mass,0,tlife);
438 gMC->Gspart(133,"Lambda_b",3,mass, 0,tlife);
439 gMC->Gspart(134,"Lambda_b^bar",3,mass,0,tlife);
443 // set up correspondance between standard GEANT particle codes
446 kc=LuComp(22); // gamma
450 kc=LuComp(11); // positron
454 kc=LuComp(12); // neutrino
458 kc=LuComp(13); // muon
462 kc=LuComp(111); // pi0
466 kc=LuComp(211); // pi+
470 kc=LuComp(130); // K0 short
474 kc=LuComp(321); // K+/-
478 kc=LuComp(2112); // neutron/anti-neutron
482 kc=LuComp(2212); // proton/anti-proton
486 kc=LuComp(310); // K0 short
490 kc=LuComp(221); // eta
494 kc=LuComp(3122); // lambda
498 kc=LuComp(3222); // sigma+/antisigma+
502 kc=LuComp(3212); // sigma0/antisigma0
506 kc=LuComp(3112); // sigma-/antisigma-
510 kc=LuComp(3322); // xsi0-/antixsi0
514 kc=LuComp(3312); // xsi-/antixsi+
518 kc=LuComp(3334); // omega/antiomega
525 Int_t AliPythia::GetGeantCode(Int_t kf)
527 Int_t kc=LuComp(TMath::Abs(kf));
528 return (kf > 0) ? fGPCode[kc][0] : fGPCode[kc][1];
531 Float_t AliPythia::GetBraPart(Int_t kf)
533 Int_t kc=LuComp(TMath::Abs(kf));