]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Save pythia default decay table at first initialization. Reload at each
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Mar 2001 10:53:26 +0000 (10:53 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 27 Mar 2001 10:53:26 +0000 (10:53 +0000)
following Init() call.

EVGEN/AliDecayerPythia.cxx
EVGEN/AliDecayerPythia.h

index 7d9b99f1e88de1c6bc10a28a827a2a1ddd0fa058..2559a4dc81c7016a45c549d917b4091385e275ae 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+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)
 
@@ -54,29 +57,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 +119,6 @@ void AliDecayerPythia::ForceDecay()
 // Force a particle decay mode
     Decay_t decay=fDecay;
     
-//
-// Make clean
-// AllowAllDecays();
 //
 // select mode    
 
@@ -294,21 +305,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()
 {
 //
index 0a5d6eaf01aa676f7eaf48b4d3ce54bc6ce41978..115da86adcb10841e923a33d65c8eed147181589 100644 (file)
@@ -38,7 +38,6 @@ public AliDecayer
     Int_t    CountProducts(Int_t channel, Int_t particle);
     void     ForceParticleDecay(Int_t particle, Int_t product, Int_t mult);
     void     ForceHadronicD();    
-    void     AllowAllDecays();
     Float_t  GetBraPart(Int_t kf);
 
     AliDecayerPythia(const AliDecayerPythia &decayer) {;}
@@ -49,8 +48,9 @@ public AliDecayer
  private:
     AliPythia*  fPythia;          //  ! Pointer to AliPythia
     Decay_t     fDecay;           //  Forced decay mode
-    Float_t     fBraPart[501];    //  Branching ratios
-
+    Float_t     fBraPart[501];    //  ! Branching ratios
+    static Bool_t fgInit;         //  ! initialization flag 
+    
     ClassDef(AliDecayerPythia,1)  // AliDecayer implementation using Pythia  
 };
 #endif