Do it the pythia8 way.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 11 Dec 2008 16:39:26 +0000 (16:39 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 11 Dec 2008 16:39:26 +0000 (16:39 +0000)
PYTHIA8/AliDecayerPythia8.cxx
PYTHIA8/AliDecayerPythia8.h

index c3eff97..b8c7590 100644 (file)
@@ -35,7 +35,7 @@ AliDecayerPythia8::AliDecayerPythia8():
 
 void AliDecayerPythia8::ForceDecay()
 {
-  // 
+// 
 // Force a particle decay mode
 // Switch heavy flavour production off if requested
     if (!fHeavyFlavour) SwitchOffHeavyFlavour();
@@ -47,200 +47,414 @@ void AliDecayerPythia8::ForceDecay()
 
 //
 // select mode    
-    Int_t products[2];
-    Int_t mult[2];
-    Int_t products1[3];
-    Int_t mult1[3];
-    
     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     
+
+       TPythia8::Instance()->ReadString("511:onMode = off");
+       TPythia8::Instance()->ReadString("511:onIfAny = 13 443 100443");
+
+       TPythia8::Instance()->ReadString("521:onMode = off");
+       TPythia8::Instance()->ReadString("521:onIfAny = 13 443 100443");
+
+       TPythia8::Instance()->ReadString("531:onMode = off");
+       TPythia8::Instance()->ReadString("531:onIfAny = 13 443 100443");
+
+       TPythia8::Instance()->ReadString("5122:onMode = off");
+       TPythia8::Instance()->ReadString("5122:onIfAny = 13 443 100443");
+
+       TPythia8::Instance()->ReadString("5132:onMode = off");
+       TPythia8::Instance()->ReadString("5132:onIfAny = 13 443 100443");
+
+       TPythia8::Instance()->ReadString("5232:onMode = off");
+       TPythia8::Instance()->ReadString("5232:onIfAny = 13 443 100443");
+
+       TPythia8::Instance()->ReadString("5332:onMode = off");
+       TPythia8::Instance()->ReadString("5332:onIfAny = 13 443 100443");
+
+       TPythia8::Instance()->ReadString("100443:onMode = off");
+       TPythia8::Instance()->ReadString("100443:onIfAny = 443");
+
+       TPythia8::Instance()->ReadString("443:onMode = off");
+       TPythia8::Instance()->ReadString("443:onIfAll = 13 13");
+
+       TPythia8::Instance()->ReadString("411:onMode = off");
+       TPythia8::Instance()->ReadString("411:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("421:onMode = off");
+       TPythia8::Instance()->ReadString("421:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("431:onMode = off");
+       TPythia8::Instance()->ReadString("431:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("4122:onMode = off");
+       TPythia8::Instance()->ReadString("4122:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("4132:onMode = off");
+       TPythia8::Instance()->ReadString("4132:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("4232:onMode = off");
+       TPythia8::Instance()->ReadString("4232:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("4332:onMode = off");
+       TPythia8::Instance()->ReadString("4332:onIfAll = 13");
+
        break;
    case kChiToJpsiGammaToMuonMuon:
-       products[0] =    443;
-       products[1] =     22;
-       mult[0] = 1;
-       mult[1] = 1;
-       ForceParticleDecay( 20443, products, mult, 2);   // Chi_1c  -> J/Psi  Gamma
-       ForceParticleDecay(   445, products, mult, 2);   // Chi_2c  -> J/Psi  Gamma
-       ForceParticleDecay(   443, 13, 2);               // J/Psi -> mu+ mu-
+// Chi_1c  -> J/Psi  Gamma
+       TPythia8::Instance()->ReadString("20443:onMode = off");
+       TPythia8::Instance()->ReadString("20443:onIfAll = 443 22");
+// Chi_2c  -> J/Psi  Gamma
+       TPythia8::Instance()->ReadString("445:onMode = off");
+       TPythia8::Instance()->ReadString("445:onIfAll = 443 22");
+// J/Psi -> mu+ mu-
+       TPythia8::Instance()->ReadString("443:onMode = off");
+       TPythia8::Instance()->ReadString("443:onIfAll = 13 13");
        break;
     case kChiToJpsiGammaToElectronElectron:
-       products[0] =    443;
-       products[1] =     22;
-       mult[0] = 1;
-       mult[1] = 1;
-       ForceParticleDecay( 20443, products, mult, 2);   // Chi_1c  -> J/Psi  Gamma
-       ForceParticleDecay(   445, products, mult, 2);   // Chi_2c  -> J/Psi  Gamma
-       ForceParticleDecay(   443, 11, 2);               // J/Psi -> e+ e-
+// Chi_1c  -> J/Psi  Gamma
+       TPythia8::Instance()->ReadString("20443:onMode = off");
+       TPythia8::Instance()->ReadString("20443:onIfAll = 443 22");
+// Chi_2c  -> J/Psi  Gamma
+       TPythia8::Instance()->ReadString("445:onMode = off");
+       TPythia8::Instance()->ReadString("445:onIfAll = 443 22");
+// J/Psi -> e+ e-
+       TPythia8::Instance()->ReadString("443:onMode = off");
+       TPythia8::Instance()->ReadString("443:onIfAll = 11 11");
        break;
 
     case kBSemiMuonic:
-       ForceParticleDecay(  511,13,1); // B0     
-       ForceParticleDecay(  521,13,1); // B+/-     
-       ForceParticleDecay(  531,13,1); // B_s     
-       ForceParticleDecay( 5122,13,1); // Lambda_b    
-       ForceParticleDecay( 5132,13,1); // Xsi_b    
-       ForceParticleDecay( 5232,13,1); // Sigma_b    
-       ForceParticleDecay( 5332,13,1); // Omega_b    
+       TPythia8::Instance()->ReadString("511:onMode = off");
+       TPythia8::Instance()->ReadString("511:onIfAny = 13");
+
+       TPythia8::Instance()->ReadString("521:onMode = off");
+       TPythia8::Instance()->ReadString("521:onIfAny = 13");
+
+       TPythia8::Instance()->ReadString("531:onMode = off");
+       TPythia8::Instance()->ReadString("531:onIfAny = 13");
+
+       TPythia8::Instance()->ReadString("5122:onMode = off");
+       TPythia8::Instance()->ReadString("5122:onIfAny = 13");
+
+       TPythia8::Instance()->ReadString("5132:onMode = off");
+       TPythia8::Instance()->ReadString("5132:onIfAny = 13");
+
+       TPythia8::Instance()->ReadString("5232:onMode = off");
+       TPythia8::Instance()->ReadString("5232:onIfAny = 13");
+
+       TPythia8::Instance()->ReadString("5332:onMode = off");
+       TPythia8::Instance()->ReadString("5332:onIfAny = 13");
        break;
     case kSemiMuonic:
-       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     
-       ForceParticleDecay(  511,13,1); // B0     
-       ForceParticleDecay(  521,13,1); // B+/-     
-       ForceParticleDecay(  531,13,1); // B_s     
-       ForceParticleDecay( 5122,13,1); // Lambda_b    
-       ForceParticleDecay( 5132,13,1); // Xsi_b    
-       ForceParticleDecay( 5232,13,1); // Sigma_b    
-       ForceParticleDecay( 5332,13,1); // Omega_b    
+       TPythia8::Instance()->ReadString("411:onMode = off");
+       TPythia8::Instance()->ReadString("411:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("421:onMode = off");
+       TPythia8::Instance()->ReadString("421:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("431:onMode = off");
+       TPythia8::Instance()->ReadString("431:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("4122:onMode = off");
+       TPythia8::Instance()->ReadString("4122:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("4132:onMode = off");
+       TPythia8::Instance()->ReadString("4132:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("4232:onMode = off");
+       TPythia8::Instance()->ReadString("4232:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("4332:onMode = off");
+       TPythia8::Instance()->ReadString("4332:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("511:onMode = off");
+       TPythia8::Instance()->ReadString("511:onIfAny = 13");
+
+       TPythia8::Instance()->ReadString("521:onMode = off");
+       TPythia8::Instance()->ReadString("521:onIfAny = 13");
+
+       TPythia8::Instance()->ReadString("531:onMode = off");
+       TPythia8::Instance()->ReadString("531:onIfAny = 13");
+
+       TPythia8::Instance()->ReadString("5122:onMode = off");
+       TPythia8::Instance()->ReadString("5122:onIfAny = 13");
+
+       TPythia8::Instance()->ReadString("5132:onMode = off");
+       TPythia8::Instance()->ReadString("5132:onIfAny = 13");
+
+       TPythia8::Instance()->ReadString("5232:onMode = off");
+       TPythia8::Instance()->ReadString("5232:onIfAny = 13");
+
+       TPythia8::Instance()->ReadString("5332:onMode = off");
+       TPythia8::Instance()->ReadString("5332:onIfAny = 13");
+
        break;
     case kDiMuon:
-       ForceParticleDecay(  113,13,2); // rho
-       ForceParticleDecay(  221,13,2); // eta
-       ForceParticleDecay(  223,13,2); // omega
-       ForceParticleDecay(  333,13,2); // phi
-       ForceParticleDecay(  443,13,2); // J/Psi
-       ForceParticleDecay(100443,13,2);// Psi'
-       ForceParticleDecay(  553,13,2); // Upsilon
-       ForceParticleDecay(100553,13,2);// Upsilon'
-       ForceParticleDecay(200553,13,2);// Upsilon''
+       // Rho
+       TPythia8::Instance()->ReadString("113:onMode = off");
+       TPythia8::Instance()->ReadString("113:onIfAll = 13 13");
+       // Eta
+       TPythia8::Instance()->ReadString("221:onMode = off");
+       TPythia8::Instance()->ReadString("221:onIfAll = 13 13");
+       // omega
+       TPythia8::Instance()->ReadString("223:onMode = off");
+       TPythia8::Instance()->ReadString("223:onIfAll = 13 13");
+       // phi
+       TPythia8::Instance()->ReadString("333:onMode = off");
+       TPythia8::Instance()->ReadString("333:onIfAll = 13 13");
+       // J/Psi
+       TPythia8::Instance()->ReadString("443:onMode = off");
+       TPythia8::Instance()->ReadString("443:onIfAll = 13 13");
+       // Psi'
+       TPythia8::Instance()->ReadString("100443:onMode = off");
+       TPythia8::Instance()->ReadString("100443:onIfAll = 13 13");
+       // Ups
+       TPythia8::Instance()->ReadString("553:onMode = off");
+       TPythia8::Instance()->ReadString("553:onIfAll = 13 13");
+       // Ups'
+       TPythia8::Instance()->ReadString("100553:onMode = off");
+       TPythia8::Instance()->ReadString("100553:onIfAll = 13 13");
+       // Ups''
+       TPythia8::Instance()->ReadString("200553:onMode = off");
+       TPythia8::Instance()->ReadString("200553:onIfAll = 13 13");
        break;
     case kBSemiElectronic:
-       ForceParticleDecay(  511,11,1); // B0     
-       ForceParticleDecay(  521,11,1); // B+/-     
-       ForceParticleDecay(  531,11,1); // B_s     
-       ForceParticleDecay( 5122,11,1); // Lambda_b     
-       ForceParticleDecay( 5132,11,1); // Xsi_b    
-       ForceParticleDecay( 5232,11,1); // Sigma_b    
-       ForceParticleDecay( 5332,11,1); // Omega_b    
+       TPythia8::Instance()->ReadString("511:onMode = off");
+       TPythia8::Instance()->ReadString("511:onIfAny = 11");
+
+       TPythia8::Instance()->ReadString("521:onMode = off");
+       TPythia8::Instance()->ReadString("521:onIfAny = 11");
+
+       TPythia8::Instance()->ReadString("531:onMode = off");
+       TPythia8::Instance()->ReadString("531:onIfAny = 11");
+
+       TPythia8::Instance()->ReadString("5122:onMode = off");
+       TPythia8::Instance()->ReadString("5122:onIfAny = 11");
+
+       TPythia8::Instance()->ReadString("5132:onMode = off");
+       TPythia8::Instance()->ReadString("5132:onIfAny = 11");
+
+       TPythia8::Instance()->ReadString("5232:onMode = off");
+       TPythia8::Instance()->ReadString("5232:onIfAny = 11");
+
+       TPythia8::Instance()->ReadString("5332:onMode = off");
+       TPythia8::Instance()->ReadString("5332:onIfAny = 11");
        break;
     case kSemiElectronic:
-       ForceParticleDecay(  411,11,1); // D+/-     
-       ForceParticleDecay(  421,11,1); // D0     
-       ForceParticleDecay(  431,11,1); // D_s     
-       ForceParticleDecay( 4122,11,1); // Lambda_c     
-       ForceParticleDecay( 4132,11,1); // Xsi_c     
-       ForceParticleDecay( 4232,11,1); // Sigma_c 
-       ForceParticleDecay( 4332,11,1); // Omega_c     
-       ForceParticleDecay(  511,11,1); // B0     
-       ForceParticleDecay(  521,11,1); // B+/-     
-       ForceParticleDecay(  531,11,1); // B_s     
-       ForceParticleDecay( 5122,11,1); // Lambda_b     
-       ForceParticleDecay( 5132,11,1); // Xsi_b    
-       ForceParticleDecay( 5232,11,1); // Sigma_b    
-       ForceParticleDecay( 5332,11,1); // Omega_b    
+       TPythia8::Instance()->ReadString("411:onMode = off");
+       TPythia8::Instance()->ReadString("411:onIfAll = 11");
+
+       TPythia8::Instance()->ReadString("421:onMode = off");
+       TPythia8::Instance()->ReadString("421:onIfAll = 11");
+
+       TPythia8::Instance()->ReadString("431:onMode = off");
+       TPythia8::Instance()->ReadString("431:onIfAll = 11");
+
+       TPythia8::Instance()->ReadString("4122:onMode = off");
+       TPythia8::Instance()->ReadString("4122:onIfAll = 11");
+
+       TPythia8::Instance()->ReadString("4132:onMode = off");
+       TPythia8::Instance()->ReadString("4132:onIfAll = 11");
+
+       TPythia8::Instance()->ReadString("4232:onMode = off");
+       TPythia8::Instance()->ReadString("4232:onIfAll = 11");
+
+       TPythia8::Instance()->ReadString("4332:onMode = off");
+       TPythia8::Instance()->ReadString("4332:onIfAll = 11");
+
+       TPythia8::Instance()->ReadString("511:onMode = off");
+       TPythia8::Instance()->ReadString("511:onIfAny = 11");
+
+       TPythia8::Instance()->ReadString("521:onMode = off");
+       TPythia8::Instance()->ReadString("521:onIfAny = 11");
+
+       TPythia8::Instance()->ReadString("531:onMode = off");
+       TPythia8::Instance()->ReadString("531:onIfAny = 11");
+
+       TPythia8::Instance()->ReadString("5122:onMode = off");
+       TPythia8::Instance()->ReadString("5122:onIfAny = 11");
+
+       TPythia8::Instance()->ReadString("5132:onMode = off");
+       TPythia8::Instance()->ReadString("5132:onIfAny = 11");
+
+       TPythia8::Instance()->ReadString("5232:onMode = off");
+       TPythia8::Instance()->ReadString("5232:onIfAny = 11");
+
+       TPythia8::Instance()->ReadString("5332:onMode = off");
+       TPythia8::Instance()->ReadString("5332:onIfAny = 11");
        break;
     case kDiElectron:
-       ForceParticleDecay(  113,11,2); // rho
-       ForceParticleDecay(  333,11,2); // phi
-       ForceParticleDecay(  221,11,2); // eta
-       ForceParticleDecay(  223,11,2); // omega
-       ForceParticleDecay(  443,11,2); // J/Psi
-       ForceParticleDecay(100443,11,2);// Psi'
-       ForceParticleDecay(  553,11,2); // Upsilon
-       ForceParticleDecay(100553,11,2);// Upsilon'
-       ForceParticleDecay(200553,11,2);// Upsilon''
+       // Rho
+       TPythia8::Instance()->ReadString("113:onMode = off");
+       TPythia8::Instance()->ReadString("113:onIfAll = 11 11");
+       // Eta
+       TPythia8::Instance()->ReadString("221:onMode = off");
+       TPythia8::Instance()->ReadString("221:onIfAll = 11 11");
+       // omega
+       TPythia8::Instance()->ReadString("223:onMode = off");
+       TPythia8::Instance()->ReadString("223:onIfAll = 11 11");
+       // phi
+       TPythia8::Instance()->ReadString("333:onMode = off");
+       TPythia8::Instance()->ReadString("333:onIfAll = 11 11");
+       // J/Psi
+       TPythia8::Instance()->ReadString("443:onMode = off");
+       TPythia8::Instance()->ReadString("443:onIfAll = 11 11");
+       // Psi'
+       TPythia8::Instance()->ReadString("100443:onMode = off");
+       TPythia8::Instance()->ReadString("100443:onIfAll = 11 11");
+       // Ups
+       TPythia8::Instance()->ReadString("553:onMode = off");
+       TPythia8::Instance()->ReadString("553:onIfAll = 11 11");
+       // Ups'
+       TPythia8::Instance()->ReadString("100553:onMode = off");
+       TPythia8::Instance()->ReadString("100553:onIfAll = 11 11");
+       // Ups''
+       TPythia8::Instance()->ReadString("200553:onMode = off");
+       TPythia8::Instance()->ReadString("200553:onIfAll = 11 11");
        break;
     case kBJpsiDiMuon:
-
-       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-   
+// B0   -> J/Psi (Psi') X   
+       TPythia8::Instance()->ReadString("511:onMode = off");
+       TPythia8::Instance()->ReadString("511:onIfAny = 443 100443");
+// B+/-   -> J/Psi (Psi') X   
+       TPythia8::Instance()->ReadString("521:onMode = off");
+       TPythia8::Instance()->ReadString("521:onIfAny = 443 100443");
+// B_s   -> J/Psi (Psi') X   
+       TPythia8::Instance()->ReadString("531:onMode = off");
+       TPythia8::Instance()->ReadString("531:onIfAny = 443 100443");
+// Lambda_b -> J/Psi (Psi') X   
+       TPythia8::Instance()->ReadString("5122:onMode = off");
+       TPythia8::Instance()->ReadString("5122:onIfAny = 443 100443");
+//
+       // J/Psi
+       TPythia8::Instance()->ReadString("443:onMode = off");
+       TPythia8::Instance()->ReadString("443:onIfAll = 13 13");
+       // Psi'
+       TPythia8::Instance()->ReadString("100443:onMode = off");
+       TPythia8::Instance()->ReadString("100443:onIfAll = 13 13");
        break;
     case kBPsiPrimeDiMuon:
-       ForceParticleDecay(  511,100443,1); // B0     
-       ForceParticleDecay(  521,100443,1); // B+/-     
-       ForceParticleDecay(  531,100443,1); // B_s     
-       ForceParticleDecay( 5122,100443,1); // Lambda_b 
-       ForceParticleDecay(100443,13,2);    // Psi'   
+// B0   -> Psi' X   
+       TPythia8::Instance()->ReadString("511:onMode = off");
+       TPythia8::Instance()->ReadString("511:onIfAny = 100443");
+// B+/-   -> Psi' X   
+       TPythia8::Instance()->ReadString("521:onMode = off");
+       TPythia8::Instance()->ReadString("521:onIfAny = 100443");
+// B_s   -> Psi'  X   
+       TPythia8::Instance()->ReadString("531:onMode = off");
+       TPythia8::Instance()->ReadString("531:onIfAny = 100443");
+// Lambda_b -> Psi' X   
+       TPythia8::Instance()->ReadString("5122:onMode = off");
+       TPythia8::Instance()->ReadString("5122:onIfAny = 100443");
+//
+       // Psi' -> mu+ mu-
+       TPythia8::Instance()->ReadString("100443:onMode = off");
+       TPythia8::Instance()->ReadString("100443:onIfAll = 13 13");
        break;
     case kBJpsiDiElectron:
-       ForceParticleDecay(  511,443,1); // B0     
-       ForceParticleDecay(  521,443,1); // B+/-     
-       ForceParticleDecay(  531,443,1); // B_s     
-       ForceParticleDecay( 5122,443,1); // Lambda_b
-       ForceParticleDecay(  443,11,2);  // J/Psi    
+// B0   -> Psi X   
+       TPythia8::Instance()->ReadString("511:onMode = off");
+       TPythia8::Instance()->ReadString("511:onIfAny = 443");
+// B+/-   -> Psi X   
+       TPythia8::Instance()->ReadString("521:onMode = off");
+       TPythia8::Instance()->ReadString("521:onIfAny = 443");
+// B_s   -> Psi  X   
+       TPythia8::Instance()->ReadString("531:onMode = off");
+       TPythia8::Instance()->ReadString("531:onIfAny = 443");
+// Lambda_b -> Psi X   
+       TPythia8::Instance()->ReadString("5122:onMode = off");
+       TPythia8::Instance()->ReadString("5122:onIfAny = 443");
+//
+       // Psi -> mu+ mu-
+       TPythia8::Instance()->ReadString("443:onMode = off");
+       TPythia8::Instance()->ReadString("443:onIfAll = 11 11");
+
        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
+// B0   -> Psi X   
+       TPythia8::Instance()->ReadString("511:onMode = off");
+       TPythia8::Instance()->ReadString("511:onIfAny = 443");
+// B+/-   -> Psi X   
+       TPythia8::Instance()->ReadString("521:onMode = off");
+       TPythia8::Instance()->ReadString("521:onIfAny = 443");
+// B_s   -> Psi  X   
+       TPythia8::Instance()->ReadString("531:onMode = off");
+       TPythia8::Instance()->ReadString("531:onIfAny = 443");
+// Lambda_b -> Psi X   
+       TPythia8::Instance()->ReadString("5122:onMode = off");
+       TPythia8::Instance()->ReadString("5122:onIfAny = 443");
        break;
     case kBPsiPrimeDiElectron:
-       ForceParticleDecay(  511,100443,1); // B0     
-       ForceParticleDecay(  521,100443,1); // B+/-     
-       ForceParticleDecay(  531,100443,1); // B_s     
-       ForceParticleDecay( 5122,100443,1); // Lambda_b 
-       ForceParticleDecay(100443,11,2);   // Psi'   
+// B0   -> Psi' X   
+       TPythia8::Instance()->ReadString("511:onMode = off");
+       TPythia8::Instance()->ReadString("511:onIfAny = 100443");
+// B+/-   -> Psi' X   
+       TPythia8::Instance()->ReadString("521:onMode = off");
+       TPythia8::Instance()->ReadString("521:onIfAny = 100443");
+// B_s   -> Psi'  X   
+       TPythia8::Instance()->ReadString("531:onMode = off");
+       TPythia8::Instance()->ReadString("531:onIfAny = 100443");
+// Lambda_b -> Psi' X   
+       TPythia8::Instance()->ReadString("5122:onMode = off");
+       TPythia8::Instance()->ReadString("5122:onIfAny = 100443");
+//
+       // Psi' -> mu+ mu-
+       TPythia8::Instance()->ReadString("100443:onMode = off");
+       TPythia8::Instance()->ReadString("100443:onIfAll = 11 11");
        break;
     case kPiToMu:
-       ForceParticleDecay(211,13,1); // pi->mu     
+       TPythia8::Instance()->ReadString("211:onMode = off");
+       TPythia8::Instance()->ReadString("211:onIfAny = 13");
        break;
     case kKaToMu:
-       ForceParticleDecay(321,13,1); // K->mu     
+       TPythia8::Instance()->ReadString("321:onMode = off");
+       TPythia8::Instance()->ReadString("321:onIfAny = 13");
        break;
     case kAllMuonic:
-       ForceParticleDecay(211,13,1); // pi->mu
-       ForceParticleDecay(321,13,1); // K->mu    
+       TPythia8::Instance()->ReadString("211:onMode = off");
+       TPythia8::Instance()->ReadString("211:onIfAny = 13");
+       TPythia8::Instance()->ReadString("321:onMode = off");
+       TPythia8::Instance()->ReadString("321:onIfAny = 13");
        break;
     case kWToMuon:
-        ForceParticleDecay(  24, 13,1); // W -> mu
+       TPythia8::Instance()->ReadString("24:onMode = off");
+       TPythia8::Instance()->ReadString("24:onIfAny = 13");
        break;
     case kWToCharm:
-        ForceParticleDecay(   24, 4,1); // W -> c
+       TPythia8::Instance()->ReadString("24:onMode = off");
+       TPythia8::Instance()->ReadString("24:onIfAny = 4");
        break;
     case kWToCharmToMuon:
-        ForceParticleDecay(   24, 4,1); // W -> c
-       ForceParticleDecay(  411,13,1); // D+/- -> mu
-       ForceParticleDecay(  421,13,1); // D0  -> mu
-       ForceParticleDecay(  431,13,1); // D_s  -> mu
-       ForceParticleDecay( 4122,13,1); // Lambda_c
-       ForceParticleDecay( 4132,13,1); // Xsi_c
-       ForceParticleDecay( 4232,13,1); // Sigma_c
-       ForceParticleDecay( 4332,13,1); // Omega_c
+       TPythia8::Instance()->ReadString("24:onMode = off");
+       TPythia8::Instance()->ReadString("24:onIfAny = 4");
+       TPythia8::Instance()->ReadString("411:onMode = off");
+       TPythia8::Instance()->ReadString("411:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("421:onMode = off");
+       TPythia8::Instance()->ReadString("421:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("431:onMode = off");
+       TPythia8::Instance()->ReadString("431:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("4122:onMode = off");
+       TPythia8::Instance()->ReadString("4122:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("4132:onMode = off");
+       TPythia8::Instance()->ReadString("4132:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("4232:onMode = off");
+       TPythia8::Instance()->ReadString("4232:onIfAll = 13");
+
+       TPythia8::Instance()->ReadString("4332:onMode = off");
+       TPythia8::Instance()->ReadString("4332:onIfAll = 13");
        break;
     case kZDiMuon:
-        ForceParticleDecay(  23, 13,2); // Z -> mu+ mu-
+       TPythia8::Instance()->ReadString("23:onMode = off");
+       TPythia8::Instance()->ReadString("23:onIfAll = 13 13");
        break;
     case kZDiElectron:
-        ForceParticleDecay(  23, 11,2); // Z -> e+ e-
+       TPythia8::Instance()->ReadString("23:onMode = off");
+       TPythia8::Instance()->ReadString("23:onIfAll = 11 11");
        break;
     case kHadronicD:
        ForceHadronicD(1);
@@ -249,10 +463,12 @@ void AliDecayerPythia8::ForceDecay()
        ForceHadronicD(0);
        break;
     case kPhiKK:
-       ForceParticleDecay(333,321,2); // Phi->K+K-
+       TPythia8::Instance()->ReadString("333:onMode = off");
+       TPythia8::Instance()->ReadString("333:onIfAll = 321 321");
        break;
     case kOmega:
-//     ForceOmega();
+       TPythia8::Instance()->ReadString("3334:onMode = off");
+       TPythia8::Instance()->ReadString("3334:onIfAll = 3122 321 ");
     case kAll:
        break;
     case kNoDecay:
@@ -280,7 +496,7 @@ Float_t AliDecayerPythia8::GetPartialBranchingRatio(Int_t ipart)
 //  Loop over decay channels
     for (Int_t ic = 0; ic < nc; ic++) {
        Pythia8::DecayChannel& decCh = decays[ic];
-       for (Int_t i = 1; i <= decCh.multiplicity(); i++) {
+       for (Int_t i = 0; i < decCh.multiplicity(); i++) {
            br += decCh.bRatio();
        }
     }
@@ -288,74 +504,6 @@ Float_t AliDecayerPythia8::GetPartialBranchingRatio(Int_t ipart)
 }
 
 
-Int_t AliDecayerPythia8::CountProducts(Pythia8::DecayChannel& channel , Int_t particle)
-{
-// Count decay products of a given type
-    Int_t np = 0;
-    for (Int_t i = 1; i <= channel.multiplicity(); i++) {
-       if (TMath::Abs(channel.product(i)) == particle) np++;
-    }
-    return np;
-}
-
-
-
-void AliDecayerPythia8::ForceParticleDecay(Int_t particle, Int_t product, Int_t mult)
-{
-//
-//  Force decay of particle into products with multiplicity mult
-
-    Pythia8::Pythia* thePythia       = TPythia8::Instance()->Pythia8();
-    Pythia8::ParticleDataTable table = thePythia->particleData;
-    Pythia8::ParticleDataEntry* pd   = table.particleDataPtr(particle);
-    pd->setMayDecay(true);
-    Pythia8::DecayTable  decays      = pd->decay;
-    
-    
-    Int_t nc = decays.size();
-//
-//  Loop over decay channels
-    for (Int_t ic = 0; ic < nc; ic++) {
-       Pythia8::DecayChannel& decCh = decays[ic];
-       if (CountProducts(decCh, product) >= mult) {
-           decCh.onMode(1);
-       } else {
-           decCh.onMode(0);
-       }
-    }
-}
-
-void AliDecayerPythia8::ForceParticleDecay(Int_t particle, Int_t* products, Int_t* mult, Int_t npart)
-{
-//
-//  Force decay of particle into products with multiplicity mult
-
-    Pythia8::Pythia* thePythia       = TPythia8::Instance()->Pythia8();
-    Pythia8::ParticleDataTable table = thePythia->particleData;
-    Pythia8::ParticleDataEntry* pd   = table.particleDataPtr(particle);
-    pd->setMayDecay(true);
-    Pythia8::DecayTable decays       = pd->decay;
-    
-    Int_t nc = decays.size();
-//
-//  Loop over decay channels
-    for (Int_t ic = 0; ic < nc; ic++) {
-       Int_t nprod = 0;
-       Pythia8::DecayChannel& decCh = decays[ic];
-
-       for (Int_t i = 0; i < npart; i++) {
-           nprod += (CountProducts(decCh, products[i]) >= mult[i]);
-       }
-       
-       if (nprod) {
-           decCh.onMode(1);
-       } else {
-           decCh.onMode(0);
-       }
-    }
-}
-
-
 Float_t AliDecayerPythia8::GetLifetime(Int_t kf)
 {
     // Return lifetime of particle
@@ -383,97 +531,41 @@ void AliDecayerPythia8::ForceHadronicD(Int_t optUse4Bodies)
 //
 // Force golden D decay modes
 //
-    const Int_t kNHadrons = 5;
-    Int_t hadron[kNHadrons] = {411,  421, 431, 4112, 4122};
-
-    // for D+ -> K0* (-> K- pi+) pi+
-    Int_t iKstar0    =  313;
-    Int_t iKstarbar0 = -313;
-    Int_t products[2] = {kKPlus, kPiMinus}, mult[2] = {1, 1};
-    ForceParticleDecay(iKstar0, products, mult, 2);
+    TPythia8::Instance()->ReadString("313:onMode = off");
+    TPythia8::Instance()->ReadString("313:onIfAll = 321 211");
     // for Ds -> Phi pi+
-    Int_t iPhi = 333;
-    ForceParticleDecay(iPhi, kKPlus, 2); // Phi->K+K-
+    TPythia8::Instance()->ReadString("333:onMode = off");
+    TPythia8::Instance()->ReadString("333:onIfAll = 321 321");
     // for D0 -> rho0 pi+ k-
-    Int_t iRho0=113;
-    ForceParticleDecay(iRho0, kPiPlus, 2); // Rho0->pi+pi-
+    TPythia8::Instance()->ReadString("113:onMode = off");
+    TPythia8::Instance()->ReadString("113:onIfAll = 211 211");
     // for Lambda_c -> Delta++ K-
-    Int_t iDeltaPP = 2224;
-    Int_t productsD[2] = {kProton, kPiPlus}, multD[2] = {1, 1};
-    ForceParticleDecay(iDeltaPP, productsD, multD, 2);
-
-
-    Int_t decayP1[kNHadrons][4] = 
-       { 
-           {kKMinus, kPiPlus,    kPiPlus, 0},
-           {kKMinus, kPiPlus,    0      , 0},
-           {kKPlus , iKstarbar0, 0      , 0},
-           {-1     , -1        , -1     , -1},
-           {kProton, iKstarbar0, 0      , 0}
-       };
-    Int_t decayP2[kNHadrons][4] = 
-       { 
-           {iKstarbar0, kPiPlus, 0      , 0},
-           {kKMinus   , kPiPlus, kPiPlus, kPiMinus},
-           {iPhi      , kPiPlus, 0      , 0},
-           {-1        , -1     , -1     , -1},
-           {iDeltaPP  , kKMinus, 0      , 0}
-       };
-    Int_t decayP3[kNHadrons][4] = 
-       { 
-           {-1        , -1     , -1      , -1},
-           {kKMinus   , kPiPlus, iRho0   , 0 },
-           {-1        , -1     , -1      , -1},
-           {-1        , -1     , -1      , -1},
-           {kProton   , kKMinus, kPiPlus , 0}
-       };
-    if(optUse4Bodies==0){
-       for(Int_t iDau=0;iDau<4;iDau++){
-           decayP2[1][iDau]=-1;
-           decayP3[1][iDau]=-1;
-       }
-    }  
+    TPythia8::Instance()->ReadString("2224:onMode = off");
+    TPythia8::Instance()->ReadString("2224:onIfAll = 2212 211");
 
 
-    Pythia8::Pythia* thePythia       = TPythia8::Instance()->Pythia8();
-    Pythia8::ParticleDataTable table = thePythia->particleData;
+    TPythia8::Instance()->ReadString("411:onMode = off");
+    TPythia8::Instance()->ReadString("421:onMode = off");
+    TPythia8::Instance()->ReadString("431:onMode = off");
+    TPythia8::Instance()->ReadString("4112:onMode = off");
+    TPythia8::Instance()->ReadString("4122:onMode = off");
+
+    TPythia8::Instance()->ReadString("411:onIfMatch = 321 211 211");
+    TPythia8::Instance()->ReadString("411:onIfMatch = 313 211");
+
+    TPythia8::Instance()->ReadString("421:onIfMatch = 321 211");
+    if (optUse4Bodies) {
+       TPythia8::Instance()->ReadString("421:onIfMatch = 321 211 211 211");
+       TPythia8::Instance()->ReadString("421:onIfMatch = 321 211 113");
+    }
     
-    for (Int_t ihadron = 0; ihadron < kNHadrons; ihadron++)
-    {
-       Pythia8::ParticleDataEntry* pd   = table.particleDataPtr(hadron[ihadron]);
-       pd->setMayDecay(true);
-       Pythia8::DecayTable  decays      = pd->decay;
-       
-       
-       for (Int_t ic = 0; ic < decays.size(); ic++) {
-           Pythia8::DecayChannel& decCh = decays[ic];
-           if ((
-                   decCh.product(0) == decayP1[ihadron][0] &&
-                   decCh.product(1) == decayP1[ihadron][1] &&
-                   decCh.product(2) == decayP1[ihadron][2] &&
-                   decCh.product(3) == decayP1[ihadron][3] &&
-                   decCh.product(4) == 0
-                   ) 
-               || (
-                   decCh.product(0) == decayP2[ihadron][0] &&
-                   decCh.product(1) == decayP2[ihadron][1] &&
-                   decCh.product(2) == decayP2[ihadron][2] &&
-                   decCh.product(3) == decayP2[ihadron][3] &&
-                   decCh.product(4) == 0
-                   ) 
-               || (
-                   decCh.product(0) == decayP3[ihadron][0] &&
-                   decCh.product(1) == decayP3[ihadron][1] &&
-                   decCh.product(2) == decayP3[ihadron][2] &&
-                   decCh.product(3) == decayP3[ihadron][3] &&
-                   decCh.product(4) == 0
-                   ))
-           {
-               decCh.onMode(1);
-           } else {
-               decCh.onMode(0);
-           } // selected channel ?
-       } // decay channels
-    } // hadrons
+    TPythia8::Instance()->ReadString("431:onIfMatch = 321 313");
+    TPythia8::Instance()->ReadString("431:onIfMatch = 333 211");
+    TPythia8::Instance()->ReadString("431:onIfMatch = 321 313");
+
+    TPythia8::Instance()->ReadString("4122:onIfMatch = 2212 313");
+    TPythia8::Instance()->ReadString("4122:onIfMatch = 2224 321");
+    TPythia8::Instance()->ReadString("4122:onIfMatch = 2212 321 211");
+
 }
 
index 54c9708..4741ce0 100644 (file)
@@ -23,9 +23,6 @@ class AliDecayerPythia8 : public TPythia8Decayer {
   virtual void    HeavyFlavourOff() {fHeavyFlavour = kFALSE;}
   virtual Float_t GetLifetime(Int_t kf);
  private:
-  Int_t    CountProducts(Pythia8::DecayChannel& decCh, Int_t particle);
-  void     ForceParticleDecay(Int_t particle, Int_t product, Int_t mult);
-  void     ForceParticleDecay(Int_t particle, Int_t* products, Int_t* mult, Int_t npart);
   void     SwitchOffHeavyFlavour();
   void     ForceHadronicD(Int_t optUser4Bodies = 1);
  protected: