Adding the light nuclei as requested in Savannah ticket #72834. The second try.
authorbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 21 Sep 2010 15:12:36 +0000 (15:12 +0000)
committerbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 21 Sep 2010 15:12:36 +0000 (15:12 +0000)
STEER/AliPID.cxx
STEER/AliPID.h

index 1579db1..1e63af4 100644 (file)
 #include <TPDGCode.h>
 
 #include "AliLog.h"
+#include "AliPDG.h"
 #include "AliPID.h"
 
 #define M(PID) TDatabasePDG::Instance()->GetParticle(fgkParticleCode[(PID)])->Mass()
 
 ClassImp(AliPID)
 
-const char* AliPID::fgkParticleName[AliPID::kSPECIESN+1] = {
+const char* AliPID::fgkParticleName[AliPID::kSPECIESN+AliPID::kSPECIESLN+1] = {
   "electron",
   "muon",
   "pion",
@@ -60,10 +61,14 @@ const char* AliPID::fgkParticleName[AliPID::kSPECIESN+1] = {
   "neutron",
   "kaon0",
   "eleCon",
+  "deuteron",
+  "triton",
+  "helium-3",
+  "alpha",
   "unknown"
 };
 
-const char* AliPID::fgkParticleShortName[AliPID::kSPECIESN+1] = {
+const char* AliPID::fgkParticleShortName[AliPID::kSPECIESN+AliPID::kSPECIESLN+1] = {
   "e",
   "mu",
   "pi",
@@ -74,10 +79,14 @@ const char* AliPID::fgkParticleShortName[AliPID::kSPECIESN+1] = {
   "n",
   "K0",
   "eleCon",
+  "d",
+  "t",
+  "he3",
+  "alpha",
   "unknown"
 };
 
-const char* AliPID::fgkParticleLatexName[AliPID::kSPECIESN+1] = {
+const char* AliPID::fgkParticleLatexName[AliPID::kSPECIESN+AliPID::kSPECIESLN+1] = {
   "e",
   "#mu",
   "#pi",
@@ -88,10 +97,14 @@ const char* AliPID::fgkParticleLatexName[AliPID::kSPECIESN+1] = {
   "n",
   "K_{0}",
   "eleCon",
+  "d",
+  "t",
+  "he3",
+  "#alpha",
   "unknown"
 };
 
-const Int_t AliPID::fgkParticleCode[AliPID::kSPECIESN+1] = {
+const Int_t AliPID::fgkParticleCode[AliPID::kSPECIESN+AliPID::kSPECIESLN+1] = {
   ::kElectron, 
   ::kMuonMinus, 
   ::kPiPlus, 
@@ -102,11 +115,15 @@ const Int_t AliPID::fgkParticleCode[AliPID::kSPECIESN+1] = {
   ::kNeutron,
   ::kK0,
   ::kElectron,
+  1000010020,
+  1000010030,
+  1000020030,
+  1000020040,
   0
 };
 
-/*const*/ Float_t AliPID::fgkParticleMass[AliPID::kSPECIESN+1] = {
-  0,0,0,0,0,0,0,0,0,0,0
+/*const*/ Float_t AliPID::fgkParticleMass[AliPID::kSPECIESN+AliPID::kSPECIESLN+1] = {
+  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
   /*
   M(kElectron),  // electron
   M(kMuon), // muon
@@ -118,6 +135,10 @@ const Int_t AliPID::fgkParticleCode[AliPID::kSPECIESN+1] = {
   M(kNeutron),   // neutron
   M(kKaon0),        // kaon0
   M(kEleCon),     // electron conversion
+  M(kDeuteron), // deuteron
+  M(kTriton),   // triton
+  M(kHe3),      // he3
+  M(kAlpha),    // alpha
   0.00000        // unknown
   */
 };
@@ -218,9 +239,11 @@ void AliPID::Init()
   // Initialise the masses
   //
   // Initialise only once... 
-  if(!fgkParticleMass[0]) 
-    for (Int_t i = 0; i < kSPECIESN; i++) 
+  if(!fgkParticleMass[0]) {
+    AliPDG::AddParticlesToPdgDataBase();
+    for (Int_t i = 0; i < kSPECIESN + kSPECIESLN; i++) 
       fgkParticleMass[i] = M(i);
+  }
 }
 
 //_____________________________________________________________________________
index 82d3ea1..39cb73a 100644 (file)
@@ -20,7 +20,8 @@ class AliPID : public TObject {
  public:
   enum {
     kSPECIES = 5,    // Number of particle species recognized by the PID
-    kSPECIESN = 10   // Number of charged+neutral particle species recognized by the PHOS/EMCAL PID
+    kSPECIESN = 10,  // Number of charged+neutral particle species recognized by the PHOS/EMCAL PID
+    kSPECIESLN = 4   // Number of light nuclei: deuteron, triton, helium-3 and alpha
   };
   enum EParticleType {
     kElectron = 0, 
@@ -33,7 +34,11 @@ class AliPID : public TObject {
     kNeutron = 7, 
     kKaon0 = 8, 
     kEleCon = 9,
-    kUnknown = 10
+    kDeuteron = 10,
+    kTriton = 11,
+    kHe3 = 12,
+    kAlpha = 13,
+    kUnknown = 14
   };
   static Float_t       ParticleMass(Int_t iType) {
      if(!fgkParticleMass[0]) Init(); 
@@ -80,11 +85,11 @@ class AliPID : public TObject {
   Double_t             fProbDensity[kSPECIESN];    // probability densities
   static Double_t      fgPrior[kSPECIESN];         // a priori probabilities
 
-  static /*const*/ Float_t fgkParticleMass[kSPECIESN+1]; // particle masses
-  static const char*   fgkParticleName[kSPECIESN+1]; // particle names
-  static const char*   fgkParticleShortName[kSPECIESN+1]; // particle names
-  static const char*   fgkParticleLatexName[kSPECIESN+1]; // particle names
-  static const Int_t   fgkParticleCode[kSPECIESN+1]; // particle codes
+  static /*const*/ Float_t fgkParticleMass[kSPECIESN+kSPECIESLN+1]; // particle masses
+  static const char*   fgkParticleName[kSPECIESN+kSPECIESLN+1]; // particle names
+  static const char*   fgkParticleShortName[kSPECIESN+kSPECIESLN+1]; // particle names
+  static const char*   fgkParticleLatexName[kSPECIESN+kSPECIESLN+1]; // particle names
+  static const Int_t   fgkParticleCode[kSPECIESN+kSPECIESLN+1]; // particle codes
 
   ClassDef(AliPID, 2)    // particle id probability densities
 };