]>
Commit | Line | Data |
---|---|---|
32e49607 | 1 | #ifndef ALIHELPERPID_H |
2 | #define ALIHELPERPID_H | |
3 | ||
4 | class AliAODEvent; | |
5 | class AliVEvent; | |
6 | class TH1F; | |
7 | class TH2F; | |
8 | class TList; | |
9 | class AliVTrack; | |
10 | class AliVParticle; | |
11 | class AliStack; | |
12 | class TParticle; | |
13 | class AliPIDResponse; | |
14 | ||
15 | #include "TNamed.h" | |
16 | ||
17 | namespace AliHelperPIDNameSpace { | |
18 | ||
19 | enum PIDType_t | |
20 | { | |
21 | kNSigmaTPC, | |
22 | kNSigmaTOF, | |
23 | kNSigmaTPCTOF, // squared sum | |
24 | kNSigmaPIDType=kNSigmaTPCTOF | |
25 | }; | |
26 | ||
27 | ||
28 | enum AliHelperDetectorType_t | |
29 | { | |
30 | kTPC, | |
31 | kTOF, | |
32 | kNDetectors | |
33 | }; | |
34 | ||
35 | ||
36 | enum AliHelperParticleSpecies_t | |
37 | { | |
38 | kSpPion, | |
39 | kSpKaon, | |
40 | kSpProton, | |
41 | kNSpecies, | |
42 | kSpUndefined=999 | |
43 | }; // Particle species used in plotting | |
44 | ||
45 | ||
46 | enum AliHelperCharge_t | |
47 | { | |
48 | kChPos, | |
49 | kChNeg, | |
50 | kNCharge | |
51 | }; | |
52 | } | |
53 | ||
54 | using namespace AliHelperPIDNameSpace; | |
55 | ||
56 | class 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 | |
75 | //lower pt fot TOF PID | |
76 | Double_t SetPtTOFPID(){return fPtTOFPID;} | |
77 | void SetfPtTOFPID(Double_t pttof){fPtTOFPID=pttof;} | |
78 | //getters of the other data members | |
79 | TList * GetOutputList() {return fOutputList;}//get the TList with histos | |
80 | Double_t* GetNSigmas() {return *fnsigmas;}//get nsigma[ipart][idet], calculated in CalculateNSigmas(trk) | |
81 | Bool_t* GetfHasDoubleCounting() {return fHasDoubleCounting;}//get fHasDoubleCounting[ipart], calculated in GetDoubleCounting(trk) | |
82 | //getter of histo "name" from fOutput | |
83 | TH2F* GetHistogram2D(const char * name);//return histogram "name" from fOutputList | |
84 | ||
85 | //PID functions | |
86 | Int_t GetParticleSpecies(AliVTrack * trk, Bool_t FIllQAHistos);//calculate the PID according to the minimum sigma | |
87 | void CalculateNSigmas(AliVTrack * trk, Bool_t FIllQAHistos);//Calcuate nsigma[ipart][idet], fill NSigma histos | |
88 | Int_t FindMinNSigma(AliVTrack * trk, Bool_t FIllQAHistos);//retun the minimum Nsigma | |
89 | Bool_t* GetDoubleCounting(AliVTrack * trk, Bool_t FIllQAHistos);//if a particle has double counting set fHasDoubleCounting[ipart]=kTRUE | |
90 | Int_t GetMCParticleSpecie(AliVEvent* event, AliVTrack * trk, Bool_t FIllQAHistos);//calculate the PID according to MC truth | |
91 | void CheckTOF(AliVTrack * trk);//check the TOF matching and set fHasTOFPID | |
92 | Long64_t Merge(TCollection* list); | |
93 | ||
94 | private: | |
95 | ||
96 | Bool_t fisMC; | |
97 | PIDType_t fPIDType; // PID type | |
98 | Double_t fNSigmaPID; // number of sigma for PID cut | |
99 | AliPIDResponse *fPIDResponse; // ! PID response object | |
100 | TList *fOutputList; // List Histo's | |
101 | Double_t fnsigmas[kNSpecies][kNSigmaPIDType+1]; //nsigma values | |
102 | Bool_t fHasDoubleCounting[kNSpecies];//array with compatible identities | |
103 | Bool_t fRequestTOFPID;//if true returns kSpUndefined if the TOF signal is missing | |
104 | Double_t fPtTOFPID; //lower pt bound for the TOF pid | |
105 | Bool_t fHasTOFPID; | |
106 | ||
107 | ||
108 | AliHelperPID(const AliHelperPID&); | |
109 | AliHelperPID& operator=(const AliHelperPID&); | |
110 | ||
111 | ClassDef(AliHelperPID, 1); | |
112 | ||
113 | }; | |
114 | #endif | |
115 | ||
116 |