Corrected protection.
[u/mrichter/AliRoot.git] / STEER / 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 }
304864ab 47 static const char* ParticleName(Int_t iType)
48 {return fgkParticleName[iType];};
91dbd0dc 49 static const char* ParticleShortName(Int_t iType)
50 {return fgkParticleShortName[iType];};
51 static const char* ParticleLatexName(Int_t iType)
52 {return fgkParticleLatexName[iType];};
304864ab 53 static Int_t ParticleCode(Int_t iType)
54 {return fgkParticleCode[iType];};
55
56 AliPID();
57 AliPID(const Double_t* probDensity, Bool_t charged = kTRUE);
58 AliPID(const Float_t* probDensity, Bool_t charged = kTRUE);
59 AliPID(const AliPID& pid);
60 AliPID& operator = (const AliPID& pid);
61
62 Double_t GetProbability(EParticleType iType,
63 const Double_t* prior) const;
64 Double_t GetProbability(EParticleType iType) const;
65 void GetProbabilities(Double_t* probabilities,
66 const Double_t* prior) const;
67 void GetProbabilities(Double_t* probabilities) const;
68 EParticleType GetMostProbable(const Double_t* prior) const;
69 EParticleType GetMostProbable() const;
70
3088e2dd 71 void SetProbabilities(const Double_t* probabilities,
72 Bool_t charged = kTRUE);
73
304864ab 74 static void SetPriors(const Double_t* prior,
75 Bool_t charged = kTRUE);
76 static void SetPrior(EParticleType iType, Double_t prior);
77
304864ab 78 AliPID& operator *= (const AliPID& pid);
79
80 private:
a9bbb414 81
556e635b 82 static void Init();
a9bbb414 83
304864ab 84 Bool_t fCharged; // flag for charged/neutral
85 Double_t fProbDensity[kSPECIESN]; // probability densities
86 static Double_t fgPrior[kSPECIESN]; // a priori probabilities
87
35f27279 88 static /*const*/ Float_t fgkParticleMass[kSPECIESN+kSPECIESLN+1]; // particle masses
89 static const char* fgkParticleName[kSPECIESN+kSPECIESLN+1]; // particle names
90 static const char* fgkParticleShortName[kSPECIESN+kSPECIESLN+1]; // particle names
91 static const char* fgkParticleLatexName[kSPECIESN+kSPECIESLN+1]; // particle names
92 static const Int_t fgkParticleCode[kSPECIESN+kSPECIESLN+1]; // particle codes
304864ab 93
577d7a0f 94 ClassDef(AliPID, 2) // particle id probability densities
304864ab 95};
96
97
98AliPID operator * (const AliPID& pid1, const AliPID& pid2);
99
100
101#endif