Corrected calculation of partial branching ratios.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Mar 2009 11:29:46 +0000 (11:29 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 6 Mar 2009 11:29:46 +0000 (11:29 +0000)
PYTHIA6/AliDecayerPythia.cxx

index a433adc..f0eb649 100644 (file)
@@ -495,9 +495,12 @@ void AliDecayerPythia::ForceHadronicD(Int_t optUse4Bodies)
   for (Int_t ihadron = 0; ihadron < kNHadrons; ihadron++)
     {
       Int_t kc = fPythia->Pycomp(hadron[ihadron]);     
-      fPythia->SetMDCY(kc,1,1);        
       Int_t ifirst = fPythia->GetMDCY(kc,2);
       Int_t ilast  = ifirst + fPythia->GetMDCY(kc,3)-1;
+      Float_t norm  = 0.;
+      for (channel=ifirst; channel<=ilast;channel++) norm+=fPythia->GetBRAT(channel);
+      fBraPart[kc] = norm;
+      fPythia->SetMDCY(kc,1,1);        
 
       for (channel = ifirst; channel <= ilast; channel++) {
        if ((
@@ -539,6 +542,7 @@ void AliDecayerPythia::ForceHadronicD(Int_t optUse4Bodies)
            fBraPart[kc] -= fPythia->GetBRAT(channel);
          } // selected channel ?
       } // decay channels
+      if (norm > 0) fBraPart[kc] /= norm;
     } // hadrons
 }
 
@@ -553,7 +557,9 @@ void AliDecayerPythia::ForceParticleDecay(Int_t particle, Int_t product, Int_t m
     fPythia->SetMDCY(kc,1,1);
     Int_t ifirst=fPythia->GetMDCY(kc,2);
     Int_t ilast=ifirst+fPythia->GetMDCY(kc,3)-1;
-    fBraPart[kc] = 1;
+    Float_t norm = 0.;
+    for (Int_t channel=ifirst; channel<=ilast;channel++) norm+=fPythia->GetBRAT(channel);
+    fBraPart[kc] = norm;
 //
 //  Loop over decay channels
     for (Int_t channel=ifirst; channel<=ilast;channel++) {
@@ -561,9 +567,10 @@ void AliDecayerPythia::ForceParticleDecay(Int_t particle, Int_t product, Int_t m
            fPythia->SetMDME(channel,1,1);
        } else {
            fPythia->SetMDME(channel,1,0);
-           fBraPart[kc]-=fPythia->GetBRAT(channel);
+           fBraPart[kc] -= fPythia->GetBRAT(channel);
        }
     }
+    if (norm > 0.) fBraPart[kc] /= norm;
 }
 
 void AliDecayerPythia::ForceParticleDecay(Int_t particle, Int_t* products, Int_t* mult, Int_t npart)
@@ -575,7 +582,9 @@ void AliDecayerPythia::ForceParticleDecay(Int_t particle, Int_t* products, Int_t
     fPythia->SetMDCY(kc,1,1);
     Int_t ifirst=fPythia->GetMDCY(kc,2);
     Int_t ilast=ifirst+fPythia->GetMDCY(kc,3)-1;
-    fBraPart[kc] = 1;
+    Float_t norm = 0.;
+    for (Int_t channel=ifirst; channel<=ilast;channel++) norm+=fPythia->GetBRAT(channel);
+    fBraPart[kc] = norm;
 //
 //  Loop over decay channels
     for (Int_t channel = ifirst; channel <= ilast; channel++) {
@@ -587,9 +596,10 @@ void AliDecayerPythia::ForceParticleDecay(Int_t particle, Int_t* products, Int_t
            fPythia->SetMDME(channel,1,1);
        } else {
            fPythia->SetMDME(channel,1,0);
-           fBraPart[kc]-=fPythia->GetBRAT(channel);
+           fBraPart[kc] -= fPythia->GetBRAT(channel);
        }
     }
+    if (norm > 0.) fBraPart[kc] /= norm;
 }
 
 void AliDecayerPythia::DefineParticles()