]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/Tools/AliHelperPID.h
typo
[u/mrichter/AliRoot.git] / PWG / Tools / AliHelperPID.h
CommitLineData
32e49607 1#ifndef ALIHELPERPID_H
2#define ALIHELPERPID_H
3
4class AliAODEvent;
5class AliVEvent;
6class TH1F;
7class TH2F;
8class TList;
9class AliVTrack;
10class AliVParticle;
11class AliStack;
12class TParticle;
13class AliPIDResponse;
d2062f6b 14class AliPIDCombined;
32e49607 15
16#include "TNamed.h"
17
18namespace AliHelperPIDNameSpace {
19
20 enum PIDType_t
21 {
146b538e 22 kNSigmaTPC = 0,
32e49607 23 kNSigmaTOF,
24 kNSigmaTPCTOF, // squared sum
d2062f6b 25 kBayes
32e49607 26 };
27
d2062f6b 28 const Int_t kNSigmaPIDType=kNSigmaTPCTOF;//number of Nsigma PID types
32e49607 29
30 enum AliHelperDetectorType_t
31 {
d2062f6b 32 kITS = 0,
33 kTPC,
32e49607 34 kTOF,
35 kNDetectors
36 };
37
38
39 enum AliHelperParticleSpecies_t
40 {
146b538e 41 kSpPion = 0,
32e49607 42 kSpKaon,
43 kSpProton,
44 kNSpecies,
45 kSpUndefined=999
46 }; // Particle species used in plotting
47
48
49 enum AliHelperCharge_t
50 {
146b538e 51 kChPos = 0,
32e49607 52 kChNeg,
53 kNCharge
54 };
55}
56
57using namespace AliHelperPIDNameSpace;
58
59class AliHelperPID : public TNamed
60{
61 public:
62
63 AliHelperPID();
64 virtual ~AliHelperPID() {}
65
66 //MC or data
67 Bool_t GetisMC(){return fisMC;}
68 void SetisMC(Bool_t mc){fisMC=mc;}
69 //PID Type
70 void SetPIDType(PIDType_t PIDType) { fPIDType = PIDType; }
71 PIDType_t GetPIDType() {return fPIDType; }
72 //NSigma cut
73 void SetNSigmaCut(Double_t nsigma) { fNSigmaPID = nsigma; }
74 Double_t GetNSigmaCut() {return fNSigmaPID; }
75 //TOF PID
76 void SetfRequestTOFPID(Bool_t tof){fRequestTOFPID=tof;}//fRequestTOFPID
77 Bool_t GetfRequestTOFPID(){return fRequestTOFPID;}//fRequestTOFPID
b46d749a 78 void SetfRemoveTracksT0Fill(Bool_t tof){fRemoveTracksT0Fill=tof;}//fRemoveTracksT0Fill
79 Bool_t GetfRemoveTracksT0Fill(){return fRemoveTracksT0Fill;}//fRemoveTracksT0Fill
5838bc91 80 //Exclusive NSIgma
81 void SetfUseExclusiveNSigma(Bool_t nsigEx){fUseExclusiveNSigma=nsigEx;}//fUseExclusiveNSigma
82 Bool_t GetfUseExclusiveNSigma(){return fUseExclusiveNSigma;}//fUseExclusiveNSigma
32e49607 83 //lower pt fot TOF PID
17d49aca 84 Double_t GetPtTOFPID(){return fPtTOFPID;}
32e49607 85 void SetfPtTOFPID(Double_t pttof){fPtTOFPID=pttof;}
d2062f6b 86 //set PID Combined
87 void SetPIDCombined(AliPIDCombined *obj){fPIDCombined=obj;}
88 AliPIDCombined *GetPIDCombined(){return fPIDCombined;}
89 //set cut on beyesian probability
90 void SetBayesCut(Double_t cut){fBayesCut=cut;}
91 Double_t GetBayesCut(){return fBayesCut;}
92
32e49607 93 //getters of the other data members
94 TList * GetOutputList() {return fOutputList;}//get the TList with histos
146b538e 95 Double_t* GetNSigmas(AliHelperParticleSpecies_t species) {return fnsigmas[species];}//get nsigma[ipart][idet], calculated in CalculateNSigmas(trk)
32e49607 96 Bool_t* GetfHasDoubleCounting() {return fHasDoubleCounting;}//get fHasDoubleCounting[ipart], calculated in GetDoubleCounting(trk)
97 //getter of histo "name" from fOutput
98 TH2F* GetHistogram2D(const char * name);//return histogram "name" from fOutputList
99
100 //PID functions
d2062f6b 101 // User should call ONLY the function GetParticleSpecies and set the PID strategy in the steering macro!
102 Int_t GetParticleSpecies(AliVTrack * trk, Bool_t FIllQAHistos);//calculate the PID according to the slected method.
7d3a3d9b 103 Int_t GetParticleSpecies(AliVParticle * part);
104
d2062f6b 105 Int_t GetIDBayes(AliVTrack * trk, Bool_t FIllQAHistos);//calculate the PID according to bayesian PID
106 UInt_t CalcPIDCombined(const AliVTrack *track,const AliPIDResponse *PIDResponse, Int_t detMask, Double_t* prob) const;
32e49607 107 void CalculateNSigmas(AliVTrack * trk, Bool_t FIllQAHistos);//Calcuate nsigma[ipart][idet], fill NSigma histos
108 Int_t FindMinNSigma(AliVTrack * trk, Bool_t FIllQAHistos);//retun the minimum Nsigma
d2062f6b 109 Bool_t* GetDoubleCounting(AliVTrack * trk, Bool_t FIllQAHistos);//if a particle has double counting set fHasDoubleCounting[ipart]=kTRUE (only for the second or third identity)
110 Bool_t* GetAllCompatibleIdentitiesNSigma(AliVTrack * trk, Bool_t FIllQAHistos);//All the identities are true
32e49607 111 Int_t GetMCParticleSpecie(AliVEvent* event, AliVTrack * trk, Bool_t FIllQAHistos);//calculate the PID according to MC truth
112 void CheckTOF(AliVTrack * trk);//check the TOF matching and set fHasTOFPID
d2062f6b 113 Double_t TOFBetaCalc(AliVTrack *track) const;
7d3a3d9b 114 Double_t GetMass(AliHelperParticleSpecies_t id) const;
32e49607 115 Long64_t Merge(TCollection* list);
116
117 private:
118
119 Bool_t fisMC;
120 PIDType_t fPIDType; // PID type
121 Double_t fNSigmaPID; // number of sigma for PID cut
d2062f6b 122 Double_t fBayesCut; // Cut on Bayesian probability
32e49607 123 AliPIDResponse *fPIDResponse; // ! PID response object
d2062f6b 124 AliPIDCombined *fPIDCombined; // PIDCombined
32e49607 125 TList *fOutputList; // List Histo's
126 Double_t fnsigmas[kNSpecies][kNSigmaPIDType+1]; //nsigma values
127 Bool_t fHasDoubleCounting[kNSpecies];//array with compatible identities
128 Bool_t fRequestTOFPID;//if true returns kSpUndefined if the TOF signal is missing
b46d749a 129 Bool_t fRemoveTracksT0Fill;//if true remove tracks for which only StartTime from To-Fill is available (worst resolution)
5838bc91 130 Bool_t fUseExclusiveNSigma;//if true returns the identity only if no double counting
32e49607 131 Double_t fPtTOFPID; //lower pt bound for the TOF pid
132 Bool_t fHasTOFPID;
133
32e49607 134 AliHelperPID(const AliHelperPID&);
135 AliHelperPID& operator=(const AliHelperPID&);
136
d2062f6b 137 ClassDef(AliHelperPID, 4);
32e49607 138
139};
140#endif
141
142