]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EVGEN/AliDecayerPythia.cxx
A pointer was set to zero in the default constructor to avoid memory management problems
[u/mrichter/AliRoot.git] / EVGEN / AliDecayerPythia.cxx
index 7d9b99f1e88de1c6bc10a28a827a2a1ddd0fa058..6ecf0722814cc45f693a078d58d436dbd06fc7ee 100644 (file)
 
 /*
 $Log$
+Revision 1.7  2001/04/12 07:23:28  morsch
+Reactivate forcing option for dimuon and dielectron decay channels of phi (333).
+
+Revision 1.6  2001/03/27 10:53:26  morsch
+Save pythia default decay table at first initialization. Reload at each
+following Init() call.
+
+Revision 1.5  2001/03/09 13:04:06  morsch
+Decay_t moved to AliDecayer.h
+
 Revision 1.4  2001/01/30 09:23:11  hristov
 Streamers removed (R.Brun)
 
@@ -40,6 +50,7 @@ Realisation of AliDecayer using Pythia6
 #include "AliDecayerPythia.h"
 #include "AliPythia.h"
 #include <TLorentzVector.h>
+#include <TClonesArray.h>
 
 ClassImp(AliDecayerPythia)
 
@@ -54,29 +65,40 @@ ClassImp(AliDecayerPythia)
 extern "C" void type_of_call 
           py1ent(Int_t&, Int_t&, Double_t&, Double_t&, Double_t&);
 
+Bool_t AliDecayerPythia::fgInit = kFALSE;
+
 
 AliDecayerPythia::AliDecayerPythia()
 {
 // Default Constructor
     fPythia=AliPythia::Instance();
-    for (Int_t i=0; i< 501; i++) fBraPart[i]=1;
+    for (Int_t i=0; i< 501; i++) fBraPart[i]= 1.;
 }
 
 void AliDecayerPythia::Init()
 {
 // Initialisation
 //
+    if (!fgInit) {
+       fgInit = kTRUE;
+       fPythia->SetDecayTable();
+    }
+
 // Switch on heavy flavor decays
+    
     Int_t kc, i, j;
     Int_t heavy[8] = {411, 421, 431, 4122, 511, 521, 531, 5122};
-    
+    fPythia->ResetDecayTable();
     for (j=0; j < 8; j++) {
        kc=fPythia->Pycomp(heavy[j]);
        fPythia->SetMDCY(kc,1,1);
-       for (i=fPythia->GetMDCY(kc,2);i<fPythia->GetMDCY(kc,2)+fPythia->GetMDCY(kc,3); i++) {
+       for (i=fPythia->GetMDCY(kc,2); 
+            i<fPythia->GetMDCY(kc,2)+fPythia->GetMDCY(kc,3); 
+            i++) {
            fPythia->SetMDME(i,1,1);
        }
     }
+
     ForceDecay();
 }
 
@@ -105,9 +127,6 @@ void AliDecayerPythia::ForceDecay()
 // Force a particle decay mode
     Decay_t decay=fDecay;
     
-//
-// Make clean
-// AllowAllDecays();
 //
 // select mode    
 
@@ -124,7 +143,7 @@ void AliDecayerPythia::ForceDecay()
        ForceParticleDecay( 5122,13,1); // Lambda_b    
     break;
     case kDiMuon:
-//     ForceParticleDecay(   41,13,2); // phi
+       ForceParticleDecay(  333,13,2); // phi
        ForceParticleDecay(  443,13,2); // J/Psi
        ForceParticleDecay(20443,13,2); // Psi'
        ForceParticleDecay(  553,13,2); // Upsilon
@@ -145,7 +164,7 @@ void AliDecayerPythia::ForceDecay()
        break;
     case kDiElectron:
 
-       ForceParticleDecay(   41,11,2); // phi
+       ForceParticleDecay(  333,11,2); // phi
        ForceParticleDecay(  443,11,2); // J/Psi
        ForceParticleDecay(30443,11,2); // Psi'
        ForceParticleDecay(  553,11,2); // Upsilon
@@ -294,21 +313,6 @@ void AliDecayerPythia::ForceParticleDecay(Int_t particle, Int_t product, Int_t m
     }
 }
 
-
-void AliDecayerPythia::AllowAllDecays()
-{
-// Reset decay flags
-    Int_t i;
-    for (i=1; i<= 2000; i++) {
-       fPythia->SetMDME(i,1,1);
-    }
-//
-    for (i=0; i<501; i++){
-       fBraPart[i]=1;
-    }
-}
-
-
 void AliDecayerPythia::DefineParticles()
 {
 //
@@ -376,6 +380,13 @@ Float_t  AliDecayerPythia::GetPartialBranchingRatio(Int_t kf)
     return fBraPart[kc];
 }
 
+Float_t  AliDecayerPythia::GetLifetime(Int_t kf)
+{
+// Get branching ratio
+    Int_t kc=fPythia->Pycomp(TMath::Abs(kf));
+    return fPythia->GetPMAS(kc,4)*3.3333e-12;
+}
+
 #ifdef never
 void AliDecayerPythia::Streamer(TBuffer &R__b)
 {