]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/SPECTRA/AliProtonQAAnalysis.h
Initialisation added.
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / AliProtonQAAnalysis.h
CommitLineData
3e6c06f4 1#ifndef ALIPROTONQAANALYSIS_H
2#define ALIPROTONQAANALYSIS_H
3
4/* See cxx source for full Copyright notice */
5
6
7/* $Id: AliProtonQAAnalysis.h 29114 2008-10-03 16:49:02Z pchrist $ */
8
9//-------------------------------------------------------------------------
10// Class AliProtonQAAnalysis
11// This is the class for the baryon (proton) analysis
12//
13// Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
14//-------------------------------------------------------------------------
15
16#include "TObject.h"
17#include "TH1I.h"
18#include "TList.h"
9c0b9f24 19#include "TArrayI.h"
3e6c06f4 20
21#include "AliPID.h"
22
23class TF1;
3e6c06f4 24class TH1F;
d4733690 25class TH3F;
3e6c06f4 26
27class AliESDEvent;
28class AliESDtrack;
29class AliStack;
6667f3a7 30class AliESDVertex;
3e6c06f4 31
32class AliProtonQAAnalysis : public TObject {
33 public:
34 AliProtonQAAnalysis();
35 virtual ~AliProtonQAAnalysis();
36
37 void UseTPCOnly() {fUseTPCOnly = kTRUE;}
0326e385 38 void UseHybridTPC() {fUseTPCOnly = kTRUE; fUseHybridTPC = kTRUE;}
6667f3a7 39
3e6c06f4 40 //Cut functions
0008a5a6 41 void SetPointOnITSLayer1() {fPointOnITSLayer1Flag = kTRUE;}
42 void SetPointOnITSLayer2() {fPointOnITSLayer2Flag = kTRUE;}
43 void SetPointOnITSLayer3() {fPointOnITSLayer3Flag = kTRUE;}
44 void SetPointOnITSLayer4() {fPointOnITSLayer4Flag = kTRUE;}
45 void SetPointOnITSLayer5() {fPointOnITSLayer5Flag = kTRUE;}
46 void SetPointOnITSLayer6() {fPointOnITSLayer6Flag = kTRUE;}
3e6c06f4 47 void SetMinITSClusters(Int_t minITSClusters) {
48 fMinITSClusters = minITSClusters;
49 fMinITSClustersFlag = kTRUE;
50 }
51 void SetMaxChi2PerITSCluster(Double_t maxChi2PerITSCluster) {
52 fMaxChi2PerITSCluster = maxChi2PerITSCluster;
53 fMaxChi2PerITSClusterFlag = kTRUE;
54 }
55 void SetMinTPCClusters(Int_t minTPCClusters) {
56 fMinTPCClusters = minTPCClusters;
57 fMinTPCClustersFlag = kTRUE;
58 }
59 void SetMaxChi2PerTPCCluster(Double_t maxChi2PerTPCCluster) {
60 fMaxChi2PerTPCCluster = maxChi2PerTPCCluster;
61 fMaxChi2PerTPCClusterFlag = kTRUE;
62 }
63 void SetMaxCov11(Double_t maxCov11) {
64 fMaxCov11 = maxCov11; fMaxCov11Flag = kTRUE;}
65 void SetMaxCov22(Double_t maxCov22) {
66 fMaxCov22 = maxCov22; fMaxCov22Flag = kTRUE;}
67 void SetMaxCov33(Double_t maxCov33) {
68 fMaxCov33 = maxCov33; fMaxCov33Flag = kTRUE;}
69 void SetMaxCov44(Double_t maxCov44) {
70 fMaxCov44 = maxCov44; fMaxCov44Flag = kTRUE;}
71 void SetMaxCov55(Double_t maxCov55) {
72 fMaxCov55 = maxCov55; fMaxCov55Flag = kTRUE;}
73 void SetMaxSigmaToVertex(Double_t maxSigmaToVertex) {
74 fMaxSigmaToVertex = maxSigmaToVertex;
75 fMaxSigmaToVertexFlag = kTRUE;
76 }
77 void SetMaxSigmaToVertexTPC(Double_t maxSigmaToVertex) {
78 fMaxSigmaToVertexTPC = maxSigmaToVertex;
79 fMaxSigmaToVertexTPCFlag = kTRUE;
80 }
81 void SetMaxDCAXY(Double_t maxDCAXY) {
82 fMaxDCAXY = maxDCAXY;
83 fMaxDCAXYFlag = kTRUE;
84 }
85 void SetMaxDCAXYTPC(Double_t maxDCAXY) {
86 fMaxDCAXYTPC = maxDCAXY;
87 fMaxDCAXYTPCFlag = kTRUE;
88 }
89 void SetMaxDCAZ(Double_t maxDCAZ) {
90 fMaxDCAZ = maxDCAZ;
91 fMaxDCAZFlag = kTRUE;
92 }
93 void SetMaxDCAZTPC(Double_t maxDCAZ) {
94 fMaxDCAZTPC = maxDCAZ;
95 fMaxDCAZTPCFlag = kTRUE;
96 }
97 void SetMaxConstrainChi2(Double_t maxConstrainChi2) {
98 fMaxConstrainChi2 = maxConstrainChi2;
99 fMaxConstrainChi2Flag = kTRUE;
100 }
101 void SetITSRefit() {fITSRefitFlag = kTRUE;}
102 void SetTPCRefit() {fTPCRefitFlag = kTRUE;}
103 void SetESDpid() {fESDpidFlag = kTRUE;}
104 void SetTPCpid() {fTPCpidFlag = kTRUE;}
105
3e6c06f4 106 //Prior probabilities
107 void SetPriorProbabilities(Double_t *partFrac) {
108 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) fPartFrac[i] = partFrac[i];}
109 void SetPriorProbabilityFunctions(TF1 *felectron, TF1 *fmuon, TF1 *fpion, TF1 *fkaon, TF1 *fproton) {
110 fFunctionProbabilityFlag = kTRUE;
111 fElectronFunction = felectron;
112 fMuonFunction = fmuon;
113 fPionFunction = fpion;
114 fKaonFunction = fkaon;
115 fProtonFunction = fproton;
116 }
117 Double_t GetParticleFraction(Int_t i, Double_t p);
118
9c0b9f24 119 //QA histograms
120 void SetQAYPtBins(Int_t nbinsY, Double_t minY, Double_t maxY,
121 Int_t nbinsPt, Double_t minPt, Double_t maxPt);
6667f3a7 122 void RunQAAnalysis(AliStack *stack,
123 AliESDEvent *esd,
124 const AliESDVertex *vertex);
9c0b9f24 125 void SetRunQAAnalysis();
126 TList *GetGlobalQAList() {return fGlobalQAList;}
127
128 //Efficiency plots (reconstruction & PID)
6667f3a7 129 void RunEfficiencyAnalysis(AliStack *stack,
130 AliESDEvent *esd,
131 const AliESDVertex *vertex);
e13bbda6 132 void SetRunEfficiencyAnalysis(Bool_t gEtaMode, Bool_t gUseCuts) {
133 fRunEfficiencyAnalysis = kTRUE;
134 fRunEfficiencyAnalysisEtaMode = gEtaMode;
135 fUseCutsInEfficiency = gUseCuts;
136 }
9c0b9f24 137 TList *GetEfficiencyQAList() {return fEfficiencyList;}
9c0b9f24 138
d4733690 139 //MC analysis
140 void RunMCAnalysis(AliStack* stack);
141 void SetRunMCAnalysis() {fRunMCAnalysis = kTRUE;}
5b8133c7 142 void SetMCProcessId(Int_t id) {
143 fMCProcessIdFlag = kTRUE;
144 fMCProcessId = id;
145 }
146 void SetMotherParticlePDGCode(Int_t pdgCode) {
147 fMotherParticlePDGCodeFlag = kTRUE;
148 fMotherParticlePDGCode = pdgCode;
149 }
d4733690 150 TList *GetPDGList() {return fPDGList;}
151 TList *GetMCProcessesList() {return fMCProcessesList;}
152
5b8133c7 153 TList *GetAcceptedCutList() {return fAcceptedCutList;}
154 TList *GetRejectedCutList() {return fRejectedCutList;}
155 TList *GetAcceptedDCAList() {return fAcceptedDCAList;}
156 TList *GetRejectedDCAList() {return fRejectedDCAList;}
157
3e6c06f4 158 private:
159 AliProtonQAAnalysis(const AliProtonQAAnalysis&); // Not implemented
9c0b9f24 160 AliProtonQAAnalysis& operator=(const AliProtonQAAnalysis&);// Not implemented
3e6c06f4 161
6667f3a7 162 Bool_t IsAccepted(AliESDEvent *esd,
163 const AliESDVertex *vertex,
164 AliESDtrack *track);
9c0b9f24 165
3e6c06f4 166 void FillQA(AliESDtrack *track, AliStack *stack);
9c0b9f24 167
168 void InitQA();
d4733690 169 void InitMCAnalysis();
5b8133c7 170 void InitCutLists();
9c0b9f24 171 void InitEfficiencyAnalysis();
172
173 Bool_t IsLabelUsed(TArrayI array, Int_t label);
d4733690 174 Int_t ConvertPDGToInt(Int_t pdgCode);
3e6c06f4 175 Float_t GetSigmaToVertex(AliESDtrack* esdTrack);
176 Double_t Rapidity(Double_t Px, Double_t Py, Double_t Pz);
177
178 Int_t fNBinsY; //number of bins in y
179 Float_t fMinY, fMaxY; //min & max value of y
180 Int_t fNBinsPt; //number of bins in pT
181 Float_t fMinPt, fMaxPt; //min & max value of pT
182
183 //cuts
184 Int_t fMinTPCClusters, fMinITSClusters; //min TPC & ITS clusters
185 Double_t fMaxChi2PerTPCCluster, fMaxChi2PerITSCluster; //max chi2 per TPC & ITS cluster
186 Double_t fMaxCov11, fMaxCov22, fMaxCov33, fMaxCov44, fMaxCov55; //max values of cov. matrix
187 Double_t fMaxSigmaToVertex; //max sigma to vertex cut
188 Double_t fMaxSigmaToVertexTPC; //max sigma to vertex cut
189 Double_t fMaxDCAXY, fMaxDCAXYTPC; //max DCA xy
190 Double_t fMaxDCAZ, fMaxDCAZTPC; //max DCA z
191 Double_t fMaxConstrainChi2; //max constrain chi2 - vertex
192 Bool_t fMinTPCClustersFlag, fMinITSClustersFlag; //shows if this cut is used or not
193 Bool_t fMaxChi2PerTPCClusterFlag, fMaxChi2PerITSClusterFlag; //shows if this cut is used or not
194 Bool_t fMaxCov11Flag, fMaxCov22Flag, fMaxCov33Flag, fMaxCov44Flag, fMaxCov55Flag; //shows if this cut is used or not
195 Bool_t fMaxSigmaToVertexFlag; //shows if this cut is used or not
196 Bool_t fMaxSigmaToVertexTPCFlag; //shows if this cut is used or not
197 Bool_t fMaxDCAXYFlag, fMaxDCAXYTPCFlag; //shows if this cut is used or not
198 Bool_t fMaxDCAZFlag, fMaxDCAZTPCFlag; //shows if this cut is used or not
199 Bool_t fMaxConstrainChi2Flag; //shows if this cut is used or not
200 Bool_t fITSRefitFlag, fTPCRefitFlag; //shows if this cut is used or not
201 Bool_t fESDpidFlag, fTPCpidFlag; //shows if this cut is used or not
0008a5a6 202 Bool_t fPointOnITSLayer1Flag, fPointOnITSLayer2Flag; //shows if this cut is used or not
203 Bool_t fPointOnITSLayer3Flag, fPointOnITSLayer4Flag; //shows if this cut is used or not
204 Bool_t fPointOnITSLayer5Flag, fPointOnITSLayer6Flag; //shows if this cut is used or not
205
3e6c06f4 206 //QA histograms
207 //Bool_t fQAHistograms; //Boolean to activate the QA histograms
208 TList *fGlobalQAList; //TList storing the directories for the QA histograms
209 TList *fQA2DList; //TList storing the accepted primary/secondary (anti)protons
210 TList *fQAPrimaryProtonsAcceptedList; //list of the QA histos for accepted primary protons
211 TList *fQAPrimaryProtonsRejectedList; //list of the QA histos for rejected primary protons
212 TList *fQASecondaryProtonsAcceptedList; //list of the QA histos for accepted secondary protons
213 TList *fQASecondaryProtonsRejectedList; //list of the QA histos for rejected secondary protons
214 TList *fQAPrimaryAntiProtonsAcceptedList; //list of the QA histos for accepted primary antiprotons
215 TList *fQAPrimaryAntiProtonsRejectedList; //list of the QA histos for rejected primary antiprotons
216 TList *fQASecondaryAntiProtonsAcceptedList; //list of the QA histos for accepted secondary antiprotons
217 TList *fQASecondaryAntiProtonsRejectedList; //list of the QA histos for rejected secondary antiprotons
218
219 //pid
220 Bool_t fFunctionProbabilityFlag; //flag: kTRUE if functions used
221 Double_t fPartFrac[10]; //prior probabilities
222 TF1 *fElectronFunction; //momentum dependence of the prior probs
223 TF1 *fMuonFunction; //momentum dependence of the prior probs
224 TF1 *fPionFunction; //momentum dependence of the prior probs
225 TF1 *fKaonFunction; //momentum dependence of the prior probs
226 TF1 *fProtonFunction; //momentum dependence of the prior probs
227
228 //Detectors
229 Bool_t fUseTPCOnly; //kTRUE if TPC only information is used
0326e385 230 Bool_t fUseHybridTPC; //kTRUE if TPC info is used for momentum - PID and ITS for vertex & points
3e6c06f4 231
d4733690 232 //MC analysis
233 TList *fPDGList; //list with the 3D histograms: y-pt-pdg (anti)protons
234 TList *fMCProcessesList; //list with the MC processes for every secondary (anti)proton
235 Bool_t fRunMCAnalysis; //run this part or not
5b8133c7 236 Bool_t fMCProcessIdFlag; //flag to see if we should check the process id
237 UInt_t fMCProcessId; //process id based on the TMCProcess
238 Bool_t fMotherParticlePDGCodeFlag; //flag to see if we should check the pdg code of the mother particle
239 Int_t fMotherParticlePDGCode; //pdg code of the mother particle
240
241 TList *fAcceptedCutList;// list of the cut parameters' histograms
242 TList *fRejectedCutList;// list of the cut parameters' histograms
243 TList *fAcceptedDCAList;// list of the DCA histograms
244 TList *fRejectedDCAList;// list of the DCA histograms
d4733690 245
9c0b9f24 246 //Efficiency (reconstruction & PID)
247 Bool_t fRunEfficiencyAnalysis; //run this part or not
e13bbda6 248 Bool_t fRunEfficiencyAnalysisEtaMode;//kTRUE in case of eta-pT otherwise y-pT
249 Bool_t fUseCutsInEfficiency;//use the cuts in the reco and pid efficiency
250
9c0b9f24 251 TList *fEfficiencyList;// list of the efficiency histograms
252
3e6c06f4 253 ClassDef(AliProtonQAAnalysis,0);
254};
255
256#endif