Changes for #95543: request to commit to trunk: TOF code supporting PID for light...
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliPID.h
CommitLineData
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>
17
18
19class AliPID : public TObject {
20 public:
21 enum {
22 kSPECIES = 5, // Number of particle species recognized by the PID
35f27279 23 kSPECIESN = 10, // Number of charged+neutral particle species recognized by the PHOS/EMCAL PID
24 kSPECIESLN = 4 // Number of light nuclei: deuteron, triton, helium-3 and alpha
304864ab 25 };
26 enum EParticleType {
27 kElectron = 0,
28 kMuon = 1,
29 kPion = 2,
30 kKaon = 3,
31 kProton = 4,
32 kPhoton = 5,
33 kPi0 = 6,
34 kNeutron = 7,
35 kKaon0 = 8,
36 kEleCon = 9,
35f27279 37 kDeuteron = 10,
38 kTriton = 11,
39 kHe3 = 12,
40 kAlpha = 13,
41 kUnknown = 14
304864ab 42 };
556e635b 43 static Float_t ParticleMass(Int_t iType) {
44 if(!fgkParticleMass[0]) Init();
45 return fgkParticleMass[iType];
46 }
67376d1d 47 static Float_t ParticleMassZ(Int_t iType) {
48 if(!fgkParticleMass[0]) Init();
49 return fgkParticleMassZ[iType];
50 }
304864ab 51 static const char* ParticleName(Int_t iType)
52 {return fgkParticleName[iType];};
91dbd0dc 53 static const char* ParticleShortName(Int_t iType)
54 {return fgkParticleShortName[iType];};
55 static const char* ParticleLatexName(Int_t iType)
56 {return fgkParticleLatexName[iType];};
304864ab 57 static Int_t ParticleCode(Int_t iType)
58 {return fgkParticleCode[iType];};
59
60 AliPID();
61 AliPID(const Double_t* probDensity, Bool_t charged = kTRUE);
62 AliPID(const Float_t* probDensity, Bool_t charged = kTRUE);
63 AliPID(const AliPID& pid);
64 AliPID& operator = (const AliPID& pid);
65
66 Double_t GetProbability(EParticleType iType,
67 const Double_t* prior) const;
68 Double_t GetProbability(EParticleType iType) const;
69 void GetProbabilities(Double_t* probabilities,
70 const Double_t* prior) const;
71 void GetProbabilities(Double_t* probabilities) const;
72 EParticleType GetMostProbable(const Double_t* prior) const;
73 EParticleType GetMostProbable() const;
74
3088e2dd 75 void SetProbabilities(const Double_t* probabilities,
76 Bool_t charged = kTRUE);
77
304864ab 78 static void SetPriors(const Double_t* prior,
79 Bool_t charged = kTRUE);
80 static void SetPrior(EParticleType iType, Double_t prior);
81
304864ab 82 AliPID& operator *= (const AliPID& pid);
83
84 private:
a9bbb414 85
556e635b 86 static void Init();
a9bbb414 87
304864ab 88 Bool_t fCharged; // flag for charged/neutral
89 Double_t fProbDensity[kSPECIESN]; // probability densities
90 static Double_t fgPrior[kSPECIESN]; // a priori probabilities
91
35f27279 92 static /*const*/ Float_t fgkParticleMass[kSPECIESN+kSPECIESLN+1]; // particle masses
67376d1d 93 static /*const*/ Float_t fgkParticleMassZ[kSPECIESN+kSPECIESLN+1]; // particle masses/charge
35f27279 94 static const char* fgkParticleName[kSPECIESN+kSPECIESLN+1]; // particle names
95 static const char* fgkParticleShortName[kSPECIESN+kSPECIESLN+1]; // particle names
96 static const char* fgkParticleLatexName[kSPECIESN+kSPECIESLN+1]; // particle names
97 static const Int_t fgkParticleCode[kSPECIESN+kSPECIESLN+1]; // particle codes
304864ab 98
67376d1d 99 ClassDef(AliPID, 3) // particle id probability densities
304864ab 100};
101
102
103AliPID operator * (const AliPID& pid1, const AliPID& pid2);
104
105
106#endif