Option kBJpsi added.
[u/mrichter/AliRoot.git] / PYTHIA6 / AliDecayerPythia.cxx
index 28a3c03b4f2f15938fb70eccea732807074411e9..4ac8d197931d437378d7a021587115305e1361a5 100644 (file)
@@ -33,10 +33,12 @@ ClassImp(AliDecayerPythia)
 #ifndef WIN32
 # define py1ent py1ent_
 # define opendecaytable opendecaytable_
+# define closedecaytable closedecaytable_
 # define type_of_call
 #else
 # define lu1ent PY1ENT
 # define opendecaytable OPENDECAYTABLE
+# define closedecaytable CLOSEDECAYTABLE
 # define type_of_call _stdcall
 #endif
 
@@ -46,6 +48,9 @@ extern "C" void type_of_call
 extern "C" void type_of_call 
           opendecaytable(Int_t&);
 
+extern "C" void type_of_call 
+          closedecaytable(Int_t&);
+
 Bool_t AliDecayerPythia::fgInit = kFALSE;
 
 
@@ -119,9 +124,39 @@ void AliDecayerPythia::ForceDecay()
 
 //
 // select mode    
-
+    Int_t products[2];
+    Int_t mult[2];
+    Int_t products1[3];
+    Int_t mult1[3];
+    printf("Forcedecay %d %d \n", decay, kAll);
+    
     switch (decay) 
     {
+    case kHardMuons:
+       products1[0] =     13;
+       products1[1] =    443;
+       products1[2] = 100443;
+       mult1[0] = 1;
+       mult1[1] = 1;
+       mult1[2] = 1;
+       ForceParticleDecay(  511, products1, mult1, 3); 
+       ForceParticleDecay(  521, products1, mult1, 3); 
+       ForceParticleDecay(  531, products1, mult1, 3); 
+       ForceParticleDecay( 5122, products1, mult1, 3); 
+       ForceParticleDecay( 5132, products1, mult1, 3); 
+       ForceParticleDecay( 5232, products1, mult1, 3); 
+       ForceParticleDecay( 5332, products1, mult1, 3); 
+       ForceParticleDecay( 100443, 443, 1);  // Psi'  -> J/Psi X    
+       ForceParticleDecay(    443,  13, 2);  // J/Psi -> mu+ mu-   
+
+       ForceParticleDecay(  411,13,1); // D+/-     
+       ForceParticleDecay(  421,13,1); // D0     
+       ForceParticleDecay(  431,13,1); // D_s     
+       ForceParticleDecay( 4122,13,1); // Lambda_c    
+       ForceParticleDecay( 4132,13,1); // Xsi_c     
+       ForceParticleDecay( 4232,13,1); // Sigma_c 
+       ForceParticleDecay( 4332,13,1); // Omega_c     
+       break;
     case kSemiMuonic:
        ForceParticleDecay(  411,13,1); // D+/-     
        ForceParticleDecay(  421,13,1); // D0     
@@ -143,10 +178,10 @@ void AliDecayerPythia::ForceDecay()
        ForceParticleDecay(  223,13,2); // omega
        ForceParticleDecay(  333,13,2); // phi
        ForceParticleDecay(  443,13,2); // J/Psi
-       ForceParticleDecay(100443,13,2); // Psi'
+       ForceParticleDecay(100443,13,2);// Psi'
        ForceParticleDecay(  553,13,2); // Upsilon
-       ForceParticleDecay(100553,13,2); // Upsilon'
-       ForceParticleDecay(200553,13,2); // Upsilon''
+       ForceParticleDecay(100553,13,2);// Upsilon'
+       ForceParticleDecay(200553,13,2);// Upsilon''
        break;
     case kSemiElectronic:
        ForceParticleDecay(  411,11,1); // D+/-     
@@ -169,17 +204,24 @@ void AliDecayerPythia::ForceDecay()
        ForceParticleDecay(  221,11,2); // eta
        ForceParticleDecay(  223,11,2); // omega
        ForceParticleDecay(  443,11,2); // J/Psi
-       ForceParticleDecay(100443,11,2); // Psi'
+       ForceParticleDecay(100443,11,2);// Psi'
        ForceParticleDecay(  553,11,2); // Upsilon
-       ForceParticleDecay(100553,11,2); // Upsilon'
-       ForceParticleDecay(200553,11,2); // Upsilon''
+       ForceParticleDecay(100553,11,2);// Upsilon'
+       ForceParticleDecay(200553,11,2);// Upsilon''
        break;
     case kBJpsiDiMuon:
-       ForceParticleDecay(  511,443,1); // B0     
-       ForceParticleDecay(  521,443,1); // B+/-     
-       ForceParticleDecay(  531,443,1); // B_s     
-       ForceParticleDecay( 5122,443,1); // Lambda_b
-       ForceParticleDecay(  443,13,2);  // J/Psi    
+
+       products[0] =    443;
+       products[1] = 100443;
+       mult[0] = 1;
+       mult[1] = 1;
+
+       ForceParticleDecay(  511, products, mult, 2); // B0   -> J/Psi (Psi') X   
+       ForceParticleDecay(  521, products, mult, 2); // B+/- -> J/Psi (Psi') X     
+       ForceParticleDecay(  531, products, mult, 2); // B_s  -> J/Psi (Psi') X     
+       ForceParticleDecay( 5122, products, mult, 2); // Lambda_b -> J/Psi (Psi') X 
+       ForceParticleDecay( 100443, 443, 1);          // Psi'  -> J/Psi X    
+       ForceParticleDecay(    443,13,2);             // J/Psi -> mu+ mu-   
        break;
     case kBPsiPrimeDiMuon:
        ForceParticleDecay(  511,30443,1); // B0     
@@ -195,12 +237,18 @@ void AliDecayerPythia::ForceDecay()
        ForceParticleDecay( 5122,443,1); // Lambda_b
        ForceParticleDecay(  443,11,2);  // J/Psi    
        break;
+    case kBJpsi:
+       ForceParticleDecay(  511,443,1); // B0     
+       ForceParticleDecay(  521,443,1); // B+/-     
+       ForceParticleDecay(  531,443,1); // B_s     
+       ForceParticleDecay( 5122,443,1); // Lambda_b
+       break;
     case kBPsiPrimeDiElectron:
        ForceParticleDecay(  511,30443,1); // B0     
        ForceParticleDecay(  521,30443,1); // B+/-     
        ForceParticleDecay(  531,30443,1); // B_s     
        ForceParticleDecay( 5122,30443,1); // Lambda_b 
-       ForceParticleDecay(100443,11,2);    // Psi'   
+       ForceParticleDecay(100443,11,2);   // Psi'   
        break;
     case kPiToMu:
        ForceParticleDecay(211,13,1); // pi->mu     
@@ -292,7 +340,7 @@ void AliDecayerPythia::ForceHadronicD()
 void AliDecayerPythia::ForceParticleDecay(Int_t particle, Int_t product, Int_t mult)
 {
 //
-//  force decay of particle into products with multiplicity mult
+//  Force decay of particle into products with multiplicity mult
 
     Int_t kc=fPythia->Pycomp(particle);
     fPythia->SetMDCY(kc,1,1);
@@ -311,6 +359,32 @@ void AliDecayerPythia::ForceParticleDecay(Int_t particle, Int_t product, Int_t m
     }
 }
 
+void AliDecayerPythia::ForceParticleDecay(Int_t particle, Int_t* products, Int_t* mult, Int_t npart)
+{
+//
+//  Force decay of particle into products with multiplicity mult
+
+    Int_t kc=fPythia->Pycomp(particle);
+    fPythia->SetMDCY(kc,1,1);
+    Int_t ifirst=fPythia->GetMDCY(kc,2);
+    Int_t ilast=ifirst+fPythia->GetMDCY(kc,3)-1;
+    fBraPart[kc] = 1;
+//
+//  Loop over decay channels
+    for (Int_t channel = ifirst; channel <= ilast; channel++) {
+       Int_t nprod = 0;
+       for (Int_t i = 0; i < npart; i++) {
+           nprod += (CountProducts(channel, products[i]) >= mult[i]);
+       }
+       if (nprod) {
+           fPythia->SetMDME(channel,1,1);
+       } else {
+           fPythia->SetMDME(channel,1,0);
+           fBraPart[kc]-=fPythia->GetBRAT(channel);
+       }
+    }
+}
+
 void AliDecayerPythia::DefineParticles()
 {
 //
@@ -422,6 +496,8 @@ void AliDecayerPythia::ReadDecayTable()
     Int_t lun = 15;
     opendecaytable(lun);
     fPythia->Pyupda(3,lun);
+    closedecaytable(lun);
+    
 }
 
 #ifdef never
@@ -445,7 +521,7 @@ void AliDecayerPythia::Streamer(TBuffer &R__b)
 }
 #endif
 
-void AliDecayerPythia::Copy(AliDecayerPythia &decayer) const
+void AliDecayerPythia::Copy(TObject &) const
 {
   //
   // Copy *this onto AliDecayerPythia -- not implemented