]>
Commit | Line | Data |
---|---|---|
304864ab | 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 | ||
7 | /////////////////////////////////////////////////////////////////////////////// | |
8 | /// // | |
9 | /// particle id probability densities // | |
10 | /// // | |
11 | /////////////////////////////////////////////////////////////////////////////// | |
12 | ||
13 | /* $Id$ */ | |
14 | ||
15 | ||
16 | #include <TObject.h> | |
00a38d07 | 17 | #include <TMath.h> |
304864ab | 18 | |
19 | class AliPID : public TObject { | |
20 | public: | |
21 | enum { | |
00a38d07 | 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 | |
304864ab | 25 | }; |
26 | enum EParticleType { | |
27 | kElectron = 0, | |
28 | kMuon = 1, | |
29 | kPion = 2, | |
30 | kKaon = 3, | |
31 | kProton = 4, | |
00a38d07 | 32 | |
33 | kDeuteron = 5, | |
34 | kTriton = 6, | |
35 | kHe3 = 7, | |
36 | kAlpha = 8, | |
37 | ||
38 | kPhoton = 9, | |
39 | kPi0 = 10, | |
40 | kNeutron = 11, | |
41 | kKaon0 = 12, | |
42 | kEleCon = 13, | |
43 | ||
35f27279 | 44 | kUnknown = 14 |
304864ab | 45 | }; |
00a38d07 | 46 | |
1d26da6d | 47 | static Int_t ParticleCharge(Int_t iType) { |
48 | if(!fgkParticleMass[0]) Init(); | |
49 | return fgkParticleCharge[iType]; | |
50 | } | |
556e635b | 51 | static Float_t ParticleMass(Int_t iType) { |
52 | if(!fgkParticleMass[0]) Init(); | |
53 | return fgkParticleMass[iType]; | |
54 | } | |
67376d1d | 55 | static Float_t ParticleMassZ(Int_t iType) { |
56 | if(!fgkParticleMass[0]) Init(); | |
57 | return fgkParticleMassZ[iType]; | |
58 | } | |
304864ab | 59 | static const char* ParticleName(Int_t iType) |
60 | {return fgkParticleName[iType];}; | |
91dbd0dc | 61 | static const char* ParticleShortName(Int_t iType) |
62 | {return fgkParticleShortName[iType];}; | |
63 | static const char* ParticleLatexName(Int_t iType) | |
64 | {return fgkParticleLatexName[iType];}; | |
304864ab | 65 | static Int_t ParticleCode(Int_t iType) |
66 | {return fgkParticleCode[iType];}; | |
67 | ||
68 | AliPID(); | |
69 | AliPID(const Double_t* probDensity, Bool_t charged = kTRUE); | |
70 | AliPID(const Float_t* probDensity, Bool_t charged = kTRUE); | |
71 | AliPID(const AliPID& pid); | |
72 | AliPID& operator = (const AliPID& pid); | |
73 | ||
74 | Double_t GetProbability(EParticleType iType, | |
75 | const Double_t* prior) const; | |
76 | Double_t GetProbability(EParticleType iType) const; | |
77 | void GetProbabilities(Double_t* probabilities, | |
78 | const Double_t* prior) const; | |
79 | void GetProbabilities(Double_t* probabilities) const; | |
80 | EParticleType GetMostProbable(const Double_t* prior) const; | |
81 | EParticleType GetMostProbable() const; | |
82 | ||
3088e2dd | 83 | void SetProbabilities(const Double_t* probabilities, |
84 | Bool_t charged = kTRUE); | |
85 | ||
304864ab | 86 | static void SetPriors(const Double_t* prior, |
87 | Bool_t charged = kTRUE); | |
88 | static void SetPrior(EParticleType iType, Double_t prior); | |
89 | ||
304864ab | 90 | AliPID& operator *= (const AliPID& pid); |
91 | ||
92 | private: | |
a9bbb414 | 93 | |
556e635b | 94 | static void Init(); |
a9bbb414 | 95 | |
00a38d07 | 96 | Bool_t fCharged; // flag for charged/neutral |
97 | Double_t fProbDensity[kSPECIESCN]; // probability densities | |
98 | static Double_t fgPrior[kSPECIESCN]; // a priori probabilities | |
304864ab | 99 | |
00a38d07 | 100 | static /*const*/ Float_t fgkParticleMass[kSPECIESCN+1]; // particle masses |
101 | static /*const*/ Float_t fgkParticleMassZ[kSPECIESCN+1]; // particle masses/charge | |
1d26da6d | 102 | static /*const*/ Char_t fgkParticleCharge[kSPECIESCN+1]; // particle charge (in e units!) |
00a38d07 | 103 | static const char* fgkParticleName[kSPECIESCN+1]; // particle names |
104 | static const char* fgkParticleShortName[kSPECIESCN+1]; // particle names | |
105 | static const char* fgkParticleLatexName[kSPECIESCN+1]; // particle names | |
106 | static const Int_t fgkParticleCode[kSPECIESCN+1]; // particle codes | |
304864ab | 107 | |
1d26da6d | 108 | ClassDef(AliPID, 4) // particle id probability densities |
304864ab | 109 | }; |
110 | ||
111 | ||
112 | AliPID operator * (const AliPID& pid1, const AliPID& pid2); | |
113 | ||
114 | ||
115 | #endif |