From f3069e25a66d07cec3702f384e979d4a5d6a0469 Mon Sep 17 00:00:00 2001 From: kleinb Date: Tue, 12 Aug 2008 16:32:15 +0000 Subject: [PATCH] Consider nuclei as stable particles, add them to pdg table as well (only d,t 3He, and 4He) --- STEER/AliPDG.cxx | 82 +++++++++++++++++++++++++++++++--------------- STEER/AliPDG.h | 2 +- STEER/AliStack.cxx | 65 +++++++++++++++++++----------------- 3 files changed, 91 insertions(+), 58 deletions(-) diff --git a/STEER/AliPDG.cxx b/STEER/AliPDG.cxx index 70b36681a9c..41b193935e2 100644 --- a/STEER/AliPDG.cxx +++ b/STEER/AliPDG.cxx @@ -26,24 +26,35 @@ ClassImp(AliPDG) - void AliPDG::AddParticlesToPdgDataBase() + + +void AliPDG::AddParticlesToPdgDataBase() { // // Add particles to the PDG data base +// + + static Bool_t bAdded = kFALSE; + // Check if already called + if(bAdded)return; + bAdded = true; + + TDatabasePDG *pdgDB = TDatabasePDG::Instance(); + const Int_t kspe=50000000; - TDatabasePDG *pdgDB = TDatabasePDG::Instance(); - const Int_t kspe=50000000; -/* - const Int_t kion=10000000; + // PDG nuclear states are 10-digit numbers + // 10LZZZAAAI e.g. deuteron is + // 1000010020 + const Int_t kion=1000000000; + + const Double_t kAu2Gev=0.9314943228; + const Double_t khSlash = 1.0545726663e-27; + const Double_t kErg2Gev = 1/1.6021773349e-3; + const Double_t khShGev = khSlash*kErg2Gev; + const Double_t kYear2Sec = 3600*24*365.25; - const Double_t kAu2Gev=0.9314943228; - const Double_t khSlash = 1.0545726663e-27; - const Double_t kErg2Gev = 1/1.6021773349e-3; - const Double_t khShGev = khSlash*kErg2Gev; - const Double_t kYear2Sec = 3600*24*365.25; -*/ // // Bottom mesons // mass and life-time from PDG @@ -67,7 +78,7 @@ ClassImp(AliPDG) pdgDB->AddParticle("p_diffr+","p_diffr+",0,kTRUE, 0,1,"QCD diffr. state",9902210); -// Some particles produced by HERWIG + // Some particles produced by HERWIG pdgDB->AddParticle("rho3(1690)0","rho(1690)0", 1.69, kTRUE, 0, 0,"rho", 117); pdgDB->AddParticle("pion2(1670)0","pion2(1670)0", 1.67, kTRUE, @@ -75,21 +86,38 @@ ClassImp(AliPDG) pdgDB->AddParticle("omega(1650)","omega(1650)", 1.65, kTRUE, 0, 0,"pion", 30223); -// Done by default now from Pythia6 table! -// -// -// Ions -// -/* - pdgDB->AddParticle("Deuteron","Deuteron",2*kAu2Gev+8.071e-3,kTRUE, - 0,1,"Ion",kion+10020); - pdgDB->AddParticle("Triton","Triton",3*kAu2Gev+14.931e-3,kFALSE, - khShGev/(12.33*kYear2Sec),1,"Ion",kion+10030); - pdgDB->AddParticle("Alpha","Alpha",4*kAu2Gev+2.424e-3,kTRUE, - khShGev/(12.33*kYear2Sec),2,"Ion",kion+20040); - pdgDB->AddParticle("HE3","HE3",3*kAu2Gev+14.931e-3,kFALSE, - 0,2,"Ion",kion+20030); -*/ + // IONS + // + // Done by default now from Pythia6 table + // Needed for other generators + // So check if already defined + + + Int_t ionCode = kion+10020; + if(!pdgDB->GetParticle(ionCode)){ + pdgDB->AddParticle("Deuteron","Deuteron",2*kAu2Gev+8.071e-3,kTRUE, + 0,1,"Ion",ionCode); + } + + ionCode = kion+10030; + if(!pdgDB->GetParticle(ionCode)){ + pdgDB->AddParticle("Triton","Triton",3*kAu2Gev+14.931e-3,kFALSE, + khShGev/(12.33*kYear2Sec),1,"Ion",ionCode); + } + + ionCode = kion+20030; + if(!pdgDB->GetParticle(ionCode)){ + pdgDB->AddParticle("HE3","HE3",3*kAu2Gev+14.931e-3,kFALSE, + 0,2,"Ion",ionCode); + } + + ionCode = kion+20040; + if(!pdgDB->GetParticle(ionCode)){ + pdgDB->AddParticle("Alpha","Alpha",4*kAu2Gev+2.424e-3,kTRUE, + khShGev/(12.33*kYear2Sec),2,"Ion",ionCode); + } + + // Special particles // pdgDB->AddParticle("Cherenkov","Cherenkov",0,kFALSE, diff --git a/STEER/AliPDG.h b/STEER/AliPDG.h index b5f62d00395..397c9f35ffc 100644 --- a/STEER/AliPDG.h +++ b/STEER/AliPDG.h @@ -14,7 +14,7 @@ class AliPDG : public TObject { public: static void AddParticlesToPdgDataBase(); - private: + private: ClassDef(AliPDG,1) // PDG database related information }; diff --git a/STEER/AliStack.cxx b/STEER/AliStack.cxx index 2f4b0a12e54..049b29037f2 100644 --- a/STEER/AliStack.cxx +++ b/STEER/AliStack.cxx @@ -938,39 +938,44 @@ Bool_t AliStack::GetEvent() Bool_t AliStack::IsStable(Int_t pdg) const { -// -// Decide whether particle (pdg) is stable -// + // + // Decide whether particle (pdg) is stable + // + + + // All ions/nucleons are considered as stable + // Nuclear code is 10LZZZAAAI + if(pdg>1000000000)return kTRUE; - const Int_t kNstable = 14; - Int_t i; - - Int_t pdgStable[kNstable] = { - kGamma, // Photon - kElectron, // Electron - kMuonPlus, // Muon - kPiPlus, // Pion - kKPlus, // Kaon - kProton, // Proton - kNeutron, // Neutron - kLambda0, // Lambda_0 - kSigmaMinus, // Sigma Minus - kSigma0, // Sigma_0 - kSigmaPlus, // Sigma Plus - 3312, // Xsi Minus - 3322, // Xsi - 3334, // Omega - }; + const Int_t kNstable = 14; + Int_t i; + + Int_t pdgStable[kNstable] = { + kGamma, // Photon + kElectron, // Electron + kMuonPlus, // Muon + kPiPlus, // Pion + kKPlus, // Kaon + kProton, // Proton + kNeutron, // Neutron + kLambda0, // Lambda_0 + kSigmaMinus, // Sigma Minus + kSigma0, // Sigma_0 + kSigmaPlus, // Sigma Plus + 3312, // Xsi Minus + 3322, // Xsi + 3334, // Omega + }; - Bool_t isStable = kFALSE; - for (i = 0; i < kNstable; i++) { - if (pdg == TMath::Abs(pdgStable[i])) { - isStable = kTRUE; - break; - } + Bool_t isStable = kFALSE; + for (i = 0; i < kNstable; i++) { + if (pdg == TMath::Abs(pdgStable[i])) { + isStable = kTRUE; + break; } - - return isStable; + } + + return isStable; } Bool_t AliStack::IsPhysicalPrimary(Int_t index) -- 2.43.0