From fcd78501d939fce12c9670370bf64c7abc629cd3 Mon Sep 17 00:00:00 2001 From: morsch Date: Tue, 27 Mar 2001 10:53:26 +0000 Subject: [PATCH] Save pythia default decay table at first initialization. Reload at each following Init() call. --- EVGEN/AliDecayerPythia.cxx | 38 +++++++++++++++++--------------------- EVGEN/AliDecayerPythia.h | 6 +++--- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/EVGEN/AliDecayerPythia.cxx b/EVGEN/AliDecayerPythia.cxx index 7d9b99f1e88..2559a4dc81c 100644 --- a/EVGEN/AliDecayerPythia.cxx +++ b/EVGEN/AliDecayerPythia.cxx @@ -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);iGetMDCY(kc,2)+fPythia->GetMDCY(kc,3); i++) { + for (i=fPythia->GetMDCY(kc,2); + iGetMDCY(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() { // diff --git a/EVGEN/AliDecayerPythia.h b/EVGEN/AliDecayerPythia.h index 0a5d6eaf01a..115da86adcb 100644 --- a/EVGEN/AliDecayerPythia.h +++ b/EVGEN/AliDecayerPythia.h @@ -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 -- 2.31.1