]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/Tools/AliHelperPID.h
- Next round of coverity fixes (related to "const")
[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;
14
15#include "TNamed.h"
16
17namespace AliHelperPIDNameSpace {
18
19 enum PIDType_t
20 {
146b538e 21 kNSigmaTPC = 0,
32e49607 22 kNSigmaTOF,
23 kNSigmaTPCTOF, // squared sum
24 kNSigmaPIDType=kNSigmaTPCTOF
25 };
26
27
28 enum AliHelperDetectorType_t
29 {
146b538e 30 kTPC = 0,
32e49607 31 kTOF,
32 kNDetectors
33 };
34
35
36 enum AliHelperParticleSpecies_t
37 {
146b538e 38 kSpPion = 0,
32e49607 39 kSpKaon,
40 kSpProton,
41 kNSpecies,
42 kSpUndefined=999
43 }; // Particle species used in plotting
44
45
46 enum AliHelperCharge_t
47 {
146b538e 48 kChPos = 0,
32e49607 49 kChNeg,
50 kNCharge
51 };
52}
53
54using namespace AliHelperPIDNameSpace;
55
56class AliHelperPID : public TNamed
57{
58 public:
59
60 AliHelperPID();
61 virtual ~AliHelperPID() {}
62
63 //MC or data
64 Bool_t GetisMC(){return fisMC;}
65 void SetisMC(Bool_t mc){fisMC=mc;}
66 //PID Type
67 void SetPIDType(PIDType_t PIDType) { fPIDType = PIDType; }
68 PIDType_t GetPIDType() {return fPIDType; }
69 //NSigma cut
70 void SetNSigmaCut(Double_t nsigma) { fNSigmaPID = nsigma; }
71 Double_t GetNSigmaCut() {return fNSigmaPID; }
72 //TOF PID
73 void SetfRequestTOFPID(Bool_t tof){fRequestTOFPID=tof;}//fRequestTOFPID
74 Bool_t GetfRequestTOFPID(){return fRequestTOFPID;}//fRequestTOFPID
b46d749a 75 void SetfRemoveTracksT0Fill(Bool_t tof){fRemoveTracksT0Fill=tof;}//fRemoveTracksT0Fill
76 Bool_t GetfRemoveTracksT0Fill(){return fRemoveTracksT0Fill;}//fRemoveTracksT0Fill
5838bc91 77 //Exclusive NSIgma
78 void SetfUseExclusiveNSigma(Bool_t nsigEx){fUseExclusiveNSigma=nsigEx;}//fUseExclusiveNSigma
79 Bool_t GetfUseExclusiveNSigma(){return fUseExclusiveNSigma;}//fUseExclusiveNSigma
32e49607 80 //lower pt fot TOF PID
81 Double_t SetPtTOFPID(){return fPtTOFPID;}
82 void SetfPtTOFPID(Double_t pttof){fPtTOFPID=pttof;}
83 //getters of the other data members
84 TList * GetOutputList() {return fOutputList;}//get the TList with histos
146b538e 85 Double_t* GetNSigmas(AliHelperParticleSpecies_t species) {return fnsigmas[species];}//get nsigma[ipart][idet], calculated in CalculateNSigmas(trk)
32e49607 86 Bool_t* GetfHasDoubleCounting() {return fHasDoubleCounting;}//get fHasDoubleCounting[ipart], calculated in GetDoubleCounting(trk)
87 //getter of histo "name" from fOutput
88 TH2F* GetHistogram2D(const char * name);//return histogram "name" from fOutputList
89
90 //PID functions
91 Int_t GetParticleSpecies(AliVTrack * trk, Bool_t FIllQAHistos);//calculate the PID according to the minimum sigma
92 void CalculateNSigmas(AliVTrack * trk, Bool_t FIllQAHistos);//Calcuate nsigma[ipart][idet], fill NSigma histos
93 Int_t FindMinNSigma(AliVTrack * trk, Bool_t FIllQAHistos);//retun the minimum Nsigma
94 Bool_t* GetDoubleCounting(AliVTrack * trk, Bool_t FIllQAHistos);//if a particle has double counting set fHasDoubleCounting[ipart]=kTRUE
95 Int_t GetMCParticleSpecie(AliVEvent* event, AliVTrack * trk, Bool_t FIllQAHistos);//calculate the PID according to MC truth
96 void CheckTOF(AliVTrack * trk);//check the TOF matching and set fHasTOFPID
97 Long64_t Merge(TCollection* list);
98
99 private:
100
101 Bool_t fisMC;
102 PIDType_t fPIDType; // PID type
103 Double_t fNSigmaPID; // number of sigma for PID cut
104 AliPIDResponse *fPIDResponse; // ! PID response object
105 TList *fOutputList; // List Histo's
106 Double_t fnsigmas[kNSpecies][kNSigmaPIDType+1]; //nsigma values
107 Bool_t fHasDoubleCounting[kNSpecies];//array with compatible identities
108 Bool_t fRequestTOFPID;//if true returns kSpUndefined if the TOF signal is missing
b46d749a 109 Bool_t fRemoveTracksT0Fill;//if true remove tracks for which only StartTime from To-Fill is available (worst resolution)
5838bc91 110 Bool_t fUseExclusiveNSigma;//if true returns the identity only if no double counting
32e49607 111 Double_t fPtTOFPID; //lower pt bound for the TOF pid
112 Bool_t fHasTOFPID;
113
114
115 AliHelperPID(const AliHelperPID&);
116 AliHelperPID& operator=(const AliHelperPID&);
117
b46d749a 118 ClassDef(AliHelperPID, 3);
32e49607 119
120};
121#endif
122
123