Fixes for bug #52499: Field polarities inconsistiency
[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
23 kSPECIESN = 10 // Number of charged+neutral particle species recognized by the PHOS/EMCAL PID
24 };
25 enum EParticleType {
26 kElectron = 0,
27 kMuon = 1,
28 kPion = 2,
29 kKaon = 3,
30 kProton = 4,
31 kPhoton = 5,
32 kPi0 = 6,
33 kNeutron = 7,
34 kKaon0 = 8,
35 kEleCon = 9,
36 kUnknown = 10
37 };
556e635b 38 static Float_t ParticleMass(Int_t iType) {
39 if(!fgkParticleMass[0]) Init();
40 return fgkParticleMass[iType];
41 }
304864ab 42 static const char* ParticleName(Int_t iType)
43 {return fgkParticleName[iType];};
91dbd0dc 44 static const char* ParticleShortName(Int_t iType)
45 {return fgkParticleShortName[iType];};
46 static const char* ParticleLatexName(Int_t iType)
47 {return fgkParticleLatexName[iType];};
304864ab 48 static Int_t ParticleCode(Int_t iType)
49 {return fgkParticleCode[iType];};
50
51 AliPID();
52 AliPID(const Double_t* probDensity, Bool_t charged = kTRUE);
53 AliPID(const Float_t* probDensity, Bool_t charged = kTRUE);
54 AliPID(const AliPID& pid);
55 AliPID& operator = (const AliPID& pid);
56
57 Double_t GetProbability(EParticleType iType,
58 const Double_t* prior) const;
59 Double_t GetProbability(EParticleType iType) const;
60 void GetProbabilities(Double_t* probabilities,
61 const Double_t* prior) const;
62 void GetProbabilities(Double_t* probabilities) const;
63 EParticleType GetMostProbable(const Double_t* prior) const;
64 EParticleType GetMostProbable() const;
65
3088e2dd 66 void SetProbabilities(const Double_t* probabilities,
67 Bool_t charged = kTRUE);
68
304864ab 69 static void SetPriors(const Double_t* prior,
70 Bool_t charged = kTRUE);
71 static void SetPrior(EParticleType iType, Double_t prior);
72
304864ab 73 AliPID& operator *= (const AliPID& pid);
74
75 private:
a9bbb414 76
556e635b 77 static void Init();
a9bbb414 78
304864ab 79 Bool_t fCharged; // flag for charged/neutral
80 Double_t fProbDensity[kSPECIESN]; // probability densities
81 static Double_t fgPrior[kSPECIESN]; // a priori probabilities
82
a9bbb414 83 static /*const*/ Float_t fgkParticleMass[kSPECIESN+1]; // particle masses
304864ab 84 static const char* fgkParticleName[kSPECIESN+1]; // particle names
91dbd0dc 85 static const char* fgkParticleShortName[kSPECIESN+1]; // particle names
86 static const char* fgkParticleLatexName[kSPECIESN+1]; // particle names
304864ab 87 static const Int_t fgkParticleCode[kSPECIESN+1]; // particle codes
88
91dbd0dc 89 ClassDef(AliPID, 2) // particle id probability densities
304864ab 90};
91
92
93AliPID operator * (const AliPID& pid1, const AliPID& pid2);
94
95
96#endif