]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGPP/pid/AliAnalysisTaskK0sBayes.h
Fix for Coverity defect 21918
[u/mrichter/AliRoot.git] / PWGPP / pid / AliAnalysisTaskK0sBayes.h
1 #ifndef ALIANALYSISTASKK0SBAYES_H
2 #define ALIANALYSISTASKK0SBayes_H
3
4 // ROOT includes
5 #include <TObject.h>
6 #include <TClonesArray.h>
7 #include <TList.h>
8 #include <TProfile.h>
9 #include "AliPIDCombined.h"
10 #include "TF1.h"
11
12 // AliRoot includes
13 #include <AliAnalysisTaskSE.h>
14 #include <AliAODEvent.h>
15 #include "AliPIDperfContainer.h"
16 #include "AliPIDperfCut.h"
17
18 class TH1F;
19 class TH2F;
20 class AliESDtrackCuts;
21
22 class AliAnalysisTaskK0sBayes : public AliAnalysisTaskSE {
23  public:
24   AliAnalysisTaskK0sBayes();
25   AliAnalysisTaskK0sBayes(const char *name);
26
27   virtual ~AliAnalysisTaskK0sBayes();
28
29   virtual void   UserCreateOutputObjects();
30   virtual void   UserExec(Option_t *option);
31   virtual void   Terminate(Option_t *); 
32   
33   Double_t GetVtxCut() { return fVtxCut; }   
34   Double_t GetEtaCut() { return fEtaCut; }     
35   Double_t GetMinPt() { return fMinPt; }   
36
37   virtual void  SetVtxCut(Double_t vtxCut){fVtxCut = vtxCut;}
38   virtual void  SetEtaCut(Double_t etaCut){fEtaCut = etaCut;}
39   virtual void  SetMinPt(Double_t value) {fMinPt = value;}   
40
41   virtual void SetMC(Bool_t flag = kTRUE){fIsMC = flag;};
42   virtual void SetQA(Bool_t flag = kTRUE){fQAsw = flag;};
43
44   void SetTPCclusterN(Int_t ncl){fNcluster=ncl;};
45
46   void SetCorrEP(Bool_t flag=kTRUE) {fToEP = flag;};
47
48   static const Int_t nPtBin = 13;  //! # pt ks bins
49
50   void SetFilterBit(Int_t fb){fFilterBit=fb;};
51   Int_t GetFilterBit() const {return fFilterBit;};
52
53   void SetTypeCollisions(Int_t type){fTypeCol = type;}; // 0=pp, 1=pPb, 2=PbPb
54   Int_t GetTypeCollisions() const {return fTypeCol;}; 
55
56   void SetPIDuserCut(AliPIDperfCut *usercut){fPIDuserCut = usercut;};
57
58  private:
59   AliAnalysisTaskK0sBayes(const AliAnalysisTaskK0sBayes &old); 
60   AliAnalysisTaskK0sBayes& operator=(const AliAnalysisTaskK0sBayes &source); 
61
62   Int_t PassesAODCuts(AliAODv0 *myV0, AliAODEvent *tAOD,Int_t specie);
63   Int_t FindDaugheterIndex(AliAODTrack *trk);
64
65   virtual Float_t GetVertex(AliAODEvent* aod) const;
66   virtual void Analyze(AliAODEvent* aodEvent); 
67   virtual void SelectK0s();
68   virtual Int_t IsChannelValid(Float_t etaAbs);
69
70   Double_t     fVtxCut;             // Vtx cut on z position in cm
71   Double_t     fEtaCut;             // Eta cut used to select particles
72   Double_t     fMinPt;              // Min pt - for histogram limits
73
74   Bool_t fIsMC; // if MC
75   Bool_t fQAsw;   // if QA
76
77   static const Int_t nCentrBin = 9; //! # cenrality bins
78
79   //
80   // Cuts and options
81   //
82
83   Int_t fNcluster;           // Numer of TPC cluster required
84   Int_t fFilterBit;          // filter bit to be used
85   TList *fList;              //! List for output objects
86   TList *fList2;             //! List for output objects
87   TList *fList3;             //! List for output objects
88
89   //
90   Float_t fCentrality;  //! current centrality for the tree
91   Float_t fPsi;         //! current Psi from TPC
92
93   Float_t fPtKs;   //! variable to fill the tree
94   Float_t fPhiKs;  //! variable to fill the tree
95   Float_t fEtaKs;  //! variable to fill the tree
96   Float_t fMassV0; //! variable to fill the tree
97   Float_t fPtKp;  //! variable to fill the tree
98   Float_t fPhiKp; //! variable to fill the tree
99   Float_t fEtaKp; //! variable to fill the tree
100   Float_t fPtKn;  //! variable to fill the tree
101   Float_t fPhiKn; //! variable to fill the tree
102   Float_t fEtaKn; //! variable to fill the tree
103   Int_t fPidKp;   //! variable to fill the tree
104   Int_t fPidKn;   //! variable to fill the tree
105
106   TH2F *hMatching[4]; //! matching (all, pi, k ,p)
107   TH2F *hTracking[4]; //! tracking (all, pi, k ,p)
108  
109   TH2F *fTOFTPCsignal;   //! histo with tof signal
110   TH1F *fCombsignal;   //! histo with tof signal
111
112   static Float_t fPtKsMin[nPtBin];// ptmin bin
113   static Float_t fPtKsMax[nPtBin];// ptmax bin
114
115   // QA plots
116   TH2F *fPiTPC[nCentrBin];//! TPC dE/dx plot
117   TH2F *fKaTPC[nCentrBin];//! TPC dE/dx plot
118   TH2F *fPrTPC[nCentrBin];//! TPC dE/dx plot
119   TH2F *fElTPC[nCentrBin];//! TPC dE/dx plot
120
121   TH2F *fPiTOF[nCentrBin];//! TPC dE/dx plot
122   TH2F *fKaTOF[nCentrBin];//! TPC dE/dx plot
123   TH2F *fPrTOF[nCentrBin];//! TPC dE/dx plot
124   TH2F *fElTOF[nCentrBin];//! TPC dE/dx plot
125
126   AliESDtrackCuts *fCutsDaughter;
127
128   AliPIDCombined *fPIDCombined;  //! PID combined object
129   AliPIDperfContainer* fContPid;      //! results for positive
130   AliPIDperfContainer* fContPid2;     //! results for negative
131   AliPIDperfContainer* fContUser;     //! results for positive user cut
132   AliPIDperfContainer* fContUser2;    //! results for negative user cut
133
134   Int_t fNK0s; //! number of K0s in my private selection
135   Float_t fPhiK0s[1000]; //! phi of K0s in my private selection
136   Float_t fPtK0s[1000];//! pt of K0s in my private selection
137   Int_t fNpiPos; //! number of positive pions for K0s selection
138   Int_t fNpiNeg; //! number of negative pions for K0s selection
139   Int_t fIPiPos[1000]; //! position in the AOD stack of positive pions candidates
140   Int_t fIPiNeg[1000]; //! position in the AOD stack of negative pions candidates
141   Int_t fIpiP[1000]; //! position in the AOD stack of positive pions for K0s
142   Int_t fIpiN[1000]; //! position in the AOD stack of negative pions for K0s
143   Float_t fMassKs[1000]; //! K0s mass
144
145   TH1F *fHmismTOF; //! TOF mismatch distribution
146   TH1D *fHchannelTOFdistr; //! TOF channel distance w.r.t. IP
147
148   Int_t fTypeCol; // type of collision system (0=pp, 1=pPb, 2=PbPb)
149   AliPIDperfCut *fPIDuserCut;  // pid user cut to be cheked
150
151   Bool_t fToEP;        // correlate to TPC EP
152
153   ClassDef(AliAnalysisTaskK0sBayes, 4);    //Analysis task for bayesian (K0s)
154 };
155
156 #endif