]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/Tools/AliHelperPID.h
exclusive sigmas (Leonardo)
[u/mrichter/AliRoot.git] / PWG / Tools / AliHelperPID.h
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   //Exclusive NSIgma
76   void SetfUseExclusiveNSigma(Bool_t nsigEx){fUseExclusiveNSigma=nsigEx;}//fUseExclusiveNSigma
77   Bool_t GetfUseExclusiveNSigma(){return   fUseExclusiveNSigma;}//fUseExclusiveNSigma
78   //lower pt fot TOF PID
79   Double_t SetPtTOFPID(){return   fPtTOFPID;}
80   void SetfPtTOFPID(Double_t pttof){fPtTOFPID=pttof;}
81   //getters of the other data members
82   TList * GetOutputList() {return fOutputList;}//get the TList with histos
83   Double_t* GetNSigmas() {return *fnsigmas;}//get nsigma[ipart][idet], calculated in CalculateNSigmas(trk)
84   Bool_t* GetfHasDoubleCounting() {return fHasDoubleCounting;}//get fHasDoubleCounting[ipart], calculated in GetDoubleCounting(trk)
85   //getter of histo "name" from fOutput
86   TH2F* GetHistogram2D(const char * name);//return histogram "name" from fOutputList
87   
88   //PID functions
89   Int_t GetParticleSpecies(AliVTrack * trk, Bool_t FIllQAHistos);//calculate the PID according to the minimum sigma
90   void CalculateNSigmas(AliVTrack * trk, Bool_t FIllQAHistos);//Calcuate nsigma[ipart][idet], fill NSigma histos
91   Int_t FindMinNSigma(AliVTrack * trk, Bool_t FIllQAHistos);//retun the minimum Nsigma
92   Bool_t* GetDoubleCounting(AliVTrack * trk, Bool_t FIllQAHistos);//if a particle has double counting set fHasDoubleCounting[ipart]=kTRUE
93   Int_t GetMCParticleSpecie(AliVEvent* event, AliVTrack * trk, Bool_t FIllQAHistos);//calculate the PID according to MC truth
94   void CheckTOF(AliVTrack * trk);//check the TOF matching and set fHasTOFPID
95   Long64_t Merge(TCollection* list);
96   
97  private:
98   
99   Bool_t fisMC;
100   PIDType_t fPIDType; // PID type
101   Double_t fNSigmaPID; // number of sigma for PID cut
102   AliPIDResponse   *fPIDResponse;     // ! PID response object
103   TList     *fOutputList;  // List Histo's
104   Double_t fnsigmas[kNSpecies][kNSigmaPIDType+1]; //nsigma values
105   Bool_t fHasDoubleCounting[kNSpecies];//array with compatible identities
106   Bool_t fRequestTOFPID;//if true returns kSpUndefined if the TOF signal is missing
107   Bool_t fUseExclusiveNSigma;//if true returns the identity only if no double counting
108   Double_t fPtTOFPID; //lower pt bound for the TOF pid
109   Bool_t fHasTOFPID;
110   
111   
112   AliHelperPID(const AliHelperPID&);
113   AliHelperPID& operator=(const AliHelperPID&);
114   
115   ClassDef(AliHelperPID, 2);
116   
117 };
118 #endif
119
120