]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Consider nuclei as stable particles, add them to pdg table as well (only d,t 3He...
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Aug 2008 16:32:15 +0000 (16:32 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Aug 2008 16:32:15 +0000 (16:32 +0000)
STEER/AliPDG.cxx
STEER/AliPDG.h
STEER/AliStack.cxx

index 70b36681a9c79bb06ba67866fc86afa1e9fb6bd7..41b193935e2478e40edb69ec06da7a012969b5fd 100644 (file)
 
 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,
index b5f62d00395cf0f4edc2e558675c45e81e8b1ea5..397c9f35ffc1afdd6dc82c9fe7a69efe7b9fb09c 100644 (file)
@@ -14,7 +14,7 @@
 class AliPDG : public TObject {
 public:
     static void AddParticlesToPdgDataBase();
- private:
+ private:    
     ClassDef(AliPDG,1)  // PDG database related information
 };
 
index 2f4b0a12e54575294dc53a09bbee2e3ce71af5f5..049b29037f2d5cf384f35ef606c1c4093be5129b 100644 (file)
@@ -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)