AliRoot Core  edcc906 (edcc906)
AliPID.h
Go to the documentation of this file.
1 #ifndef ALIPID_H
2 #define ALIPID_H
3 
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice */
6 
12 
13 /* $Id$ */
14 
15 
16 #include <TObject.h>
17 #include <TMath.h>
18 
19 class AliPID : public TObject {
20  public:
21  enum {
22  kSPECIES = 5, // Number of default particle species recognized by the PID
23  kSPECIESC = 9, // Number of default particles + light nuclei recognized by the PID
24  kSPECIESCN = 14, // Number of charged+neutral particle species recognized by the PHOS/EMCAL PID
25  kCharges = 3 // Number of possible charge options for TRD Parameters
26  };
28  kElectron = 0,
29  kMuon = 1,
30  kPion = 2,
31  kKaon = 3,
32  kProton = 4,
33 
34  kDeuteron = 5,
35  kTriton = 6,
36  kHe3 = 7,
37  kAlpha = 8,
38 
39  kPhoton = 9,
40  kPi0 = 10,
41  kNeutron = 11,
42  kKaon0 = 12,
43  kEleCon = 13,
44 
45  kUnknown = 14
46  };
48  kNoCharge = 0,
51  };
52  static Int_t ParticleCharge(Int_t iType) {
53  if(!fgkParticleMass[0]) Init();
54  return fgkParticleCharge[iType];
55  }
56  static Float_t ParticleMass(Int_t iType) {
57  if(!fgkParticleMass[0]) Init();
58  return fgkParticleMass[iType];
59  }
60  static Float_t ParticleMassZ(Int_t iType) {
61  if(!fgkParticleMass[0]) Init();
62  return fgkParticleMassZ[iType];
63  }
64  static const char* ParticleName(Int_t iType)
65  {return fgkParticleName[iType];};
66  static const char* ParticleShortName(Int_t iType)
67  {return fgkParticleShortName[iType];};
68  static const char* ParticleLatexName(Int_t iType)
69  {return fgkParticleLatexName[iType];};
70  static Int_t ParticleCode(Int_t iType)
71  {return fgkParticleCode[iType];};
72 
73  AliPID();
74  AliPID(const Double_t* probDensity, Bool_t charged = kTRUE);
75  AliPID(const Float_t* probDensity, Bool_t charged = kTRUE);
76  AliPID(const AliPID& pid);
77  AliPID& operator = (const AliPID& pid);
78 
79  Double_t GetProbability(EParticleType iType,
80  const Double_t* prior) const;
81  Double_t GetProbability(EParticleType iType) const;
82  void GetProbabilities(Double_t* probabilities,
83  const Double_t* prior) const;
84  void GetProbabilities(Double_t* probabilities) const;
85  EParticleType GetMostProbable(const Double_t* prior) const;
87 
88  void SetProbabilities(const Double_t* probabilities,
89  Bool_t charged = kTRUE);
90 
91  static void SetPriors(const Double_t* prior,
92  Bool_t charged = kTRUE);
93  static void SetPrior(EParticleType iType, Double_t prior);
94 
95  AliPID& operator *= (const AliPID& pid);
96 
97  private:
98 
99  static void Init();
100 
101  Bool_t fCharged; // flag for charged/neutral
102  Double_t fProbDensity[kSPECIESCN]; // probability densities
103  static Double_t fgPrior[kSPECIESCN]; // a priori probabilities
104 
105  static /*const*/ Float_t fgkParticleMass[kSPECIESCN+1]; // particle masses
106  static /*const*/ Float_t fgkParticleMassZ[kSPECIESCN+1]; // particle masses/charge
107  static /*const*/ Char_t fgkParticleCharge[kSPECIESCN+1]; // particle charge (in e units!)
108  static const char* fgkParticleName[kSPECIESCN+1]; // particle names
109  static const char* fgkParticleShortName[kSPECIESCN+1]; // particle names
110  static const char* fgkParticleLatexName[kSPECIESCN+1]; // particle names
111  static const Int_t fgkParticleCode[kSPECIESCN+1]; // particle codes
112 
113  ClassDef(AliPID, 5) // particle id probability densities
114 };
115 
116 
117 AliPID operator * (const AliPID& pid1, const AliPID& pid2);
118 
119 
120 #endif
static void SetPrior(EParticleType iType, Double_t prior)
Definition: AliPID.cxx:412
AliTPCcalibPID * pid
Definition: CalibPID.C:69
static void SetPriors(const Double_t *prior, Bool_t charged=kTRUE)
Definition: AliPID.cxx:386
static const char * ParticleLatexName(Int_t iType)
Definition: AliPID.h:68
static Float_t fgkParticleMassZ[kSPECIESCN+1]
Definition: AliPID.h:106
Double_t fProbDensity[kSPECIESCN]
Definition: AliPID.h:102
static void Init()
Definition: AliPID.cxx:271
static Float_t ParticleMass(Int_t iType)
Definition: AliPID.h:56
EParticleType
Definition: AliPID.h:27
void SetProbabilities(const Double_t *probabilities, Bool_t charged=kTRUE)
Definition: AliPID.cxx:244
void GetProbabilities(Double_t *probabilities, const Double_t *prior) const
Definition: AliPID.cxx:323
Bool_t fCharged
Definition: AliPID.h:101
static const char * ParticleShortName(Int_t iType)
Definition: AliPID.h:66
static Char_t fgkParticleCharge[kSPECIESCN+1]
Definition: AliPID.h:107
static const Int_t fgkParticleCode[kSPECIESCN+1]
Definition: AliPID.h:111
Definition: AliPID.h:19
static Float_t fgkParticleMass[kSPECIESCN+1]
Definition: AliPID.h:105
static Int_t ParticleCharge(Int_t iType)
Definition: AliPID.h:52
AliPID & operator*=(const AliPID &pid)
Definition: AliPID.cxx:427
EParticleType GetMostProbable() const
Definition: AliPID.cxx:376
static Double_t fgPrior[kSPECIESCN]
Definition: AliPID.h:103
static const char * fgkParticleName[kSPECIESCN+1]
Definition: AliPID.h:108
static Int_t ParticleCode(Int_t iType)
Definition: AliPID.h:70
AliPID()
Definition: AliPID.cxx:183
static const char * fgkParticleShortName[kSPECIESCN+1]
Definition: AliPID.h:109
static Float_t ParticleMassZ(Int_t iType)
Definition: AliPID.h:60
static const char * fgkParticleLatexName[kSPECIESCN+1]
Definition: AliPID.h:110
AliPID & operator=(const AliPID &pid)
Definition: AliPID.cxx:257
eTRDparticleCharge
Definition: AliPID.h:47
Double_t GetProbability(EParticleType iType, const Double_t *prior) const
Definition: AliPID.cxx:294
static const char * ParticleName(Int_t iType)
Definition: AliPID.h:64
AliPID operator*(const AliPID &pid1, const AliPID &pid2)
Definition: AliPID.cxx:438