]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/SPECTRA/AliProtonAnalysis.cxx
Fixing some warning and memory leaks (Michal)
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / AliProtonAnalysis.cxx
CommitLineData
734d2c12 1/**************************************************************************
2 * Author: Panos Christakoglou. *
3 * Contributors are mentioned in the code where appropriate. *
4 * *
5 * Permission to use, copy, modify and distribute this software and its *
6 * documentation strictly for non-commercial purposes is hereby granted *
7 * without fee, provided that the above copyright notice appears in all *
8 * copies and that both the copyright notice and this permission notice *
9 * appear in the supporting documentation. The authors make no claims *
10 * about the suitability of this software for any purpose. It is *
11 * provided "as is" without express or implied warranty. *
12 **************************************************************************/
13
14/* $Id$ */
15
16//-----------------------------------------------------------------
17// AliProtonAnalysis class
18// This is the class to deal with the proton analysis
dd3fa486 19// Origin: Panos Christakoglou | Panos.Christakoglou@cern.ch
734d2c12 20//-----------------------------------------------------------------
21#include <Riostream.h>
22#include <TFile.h>
23#include <TSystem.h>
aafecd8b 24#include <TF1.h>
37cb8683 25#include <TH3F.h>
251e4034 26#include <TH2D.h>
734d2c12 27#include <TH1D.h>
3f6d0c08 28#include <TH1I.h>
e4358d7f 29#include <TParticle.h>
735cc63d 30#include <TList.h>
734d2c12 31
2b748670 32#include <AliExternalTrackParam.h>
ee4ca40d 33#include <AliAODEvent.h>
734d2c12 34#include <AliESDEvent.h>
73aba974 35//#include <AliLog.h>
ee4ca40d 36#include <AliPID.h>
e4358d7f 37#include <AliStack.h>
39f2a708 38#include <AliCFContainer.h>
39#include <AliCFEffGrid.h>
251e4034 40#include <AliCFDataGrid.h>
ff672838 41#include <AliTPCPIDResponse.h>
42#include <AliESDpid.h>
73aba974 43class AliLog;
44class AliESDVertex;
45
46#include "AliProtonAnalysis.h"
47#include "AliProtonAnalysisBase.h"
e4358d7f 48
734d2c12 49ClassImp(AliProtonAnalysis)
50
51//____________________________________________________________________//
52AliProtonAnalysis::AliProtonAnalysis() :
0ab648ea 53 TObject(), fProtonAnalysisBase(0),
734d2c12 54 fNBinsY(0), fMinY(0), fMaxY(0),
55 fNBinsPt(0), fMinPt(0), fMaxPt(0),
251e4034 56 fProtonContainer(0), fAntiProtonContainer(0),
71a67ee1 57 fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
58 fHistYPtProtonsCorrected(0), fHistYPtAntiProtonsCorrected(0),
ce9d2201 59 fHistEventStats(0), fYRatioInPtBinsList(0),
251e4034 60 fEffGridListProtons(0), fCorrectionListProtons2D(0),
61 fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
62 fEffGridListAntiProtons(0), fCorrectionListAntiProtons2D(0),
63 fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0),
735cc63d 64 fCorrectProtons(0), fCorrectAntiProtons(0),
336ea0ff 65 fHistEfficiencyYPtProtons(0), fHistEfficiencyYPtAntiProtons(0),
7deb716b 66 fHistCorrectionForCrossSectionYPtProtons(0),
67 fHistCorrectionForCrossSectionYPtAntiProtons(0),
68 fHistCorrectionForCrossSectionFlag(kFALSE),
437dd627 69 fHistYPtCorrectionForCutsProtons(0), fHistYPtCorrectionForCutsAntiProtons(0),
70 fCorrectForCutsFlag(kFALSE),
207a5280 71 fHistYPtCorrectionForTrackingProtons(0),
72 fHistYPtCorrectionForTrackingAntiProtons(0),
73 fCorrectForTrackingFlag(kFALSE),
437dd627 74 fHistYPtCorrectionForFeedDownProtons(0),
75 fHistYPtCorrectionForFeedDownAntiProtons(0),
76 fCorrectForFeedDownFlag(kFALSE),
2c60f603 77 fHistYPtCorrectionForSecondaries(0), fCorrectForSecondariesFlag(kFALSE),
735cc63d 78 fGlobalQAList(0), fQA2DList(0),
79 fQAProtonsAcceptedList(0), fQAProtonsRejectedList(0),
80 fQAAntiProtonsAcceptedList(0), fQAAntiProtonsRejectedList(0),
81 fInitQAFlag(kFALSE) {
734d2c12 82 //Default constructor
734d2c12 83}
84
85//____________________________________________________________________//
0ab648ea 86AliProtonAnalysis::AliProtonAnalysis(Int_t nbinsY,
87 Float_t fLowY, Float_t fHighY,
88 Int_t nbinsPt,
89 Float_t fLowPt, Float_t fHighPt) :
90 TObject(), fProtonAnalysisBase(0),
734d2c12 91 fNBinsY(nbinsY), fMinY(fLowY), fMaxY(fHighY),
92 fNBinsPt(nbinsPt), fMinPt(fLowPt), fMaxPt(fHighPt),
251e4034 93 fProtonContainer(0), fAntiProtonContainer(0),
ce9d2201 94 fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
71a67ee1 95 fHistYPtProtonsCorrected(0), fHistYPtAntiProtonsCorrected(0),
ce9d2201 96 fHistEventStats(0), fYRatioInPtBinsList(0),
251e4034 97 fEffGridListProtons(0), fCorrectionListProtons2D(0),
98 fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
99 fEffGridListAntiProtons(0), fCorrectionListAntiProtons2D(0),
100 fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0),
735cc63d 101 fCorrectProtons(0), fCorrectAntiProtons(0),
336ea0ff 102 fHistEfficiencyYPtProtons(0), fHistEfficiencyYPtAntiProtons(0),
7deb716b 103 fHistCorrectionForCrossSectionYPtProtons(0),
104 fHistCorrectionForCrossSectionYPtAntiProtons(0),
105 fHistCorrectionForCrossSectionFlag(kFALSE),
437dd627 106 fHistYPtCorrectionForCutsProtons(0), fHistYPtCorrectionForCutsAntiProtons(0),
107 fCorrectForCutsFlag(kFALSE),
207a5280 108 fHistYPtCorrectionForTrackingProtons(0),
109 fHistYPtCorrectionForTrackingAntiProtons(0),
110 fCorrectForTrackingFlag(kFALSE),
437dd627 111 fHistYPtCorrectionForFeedDownProtons(0),
112 fHistYPtCorrectionForFeedDownAntiProtons(0),
113 fCorrectForFeedDownFlag(kFALSE),
2c60f603 114 fHistYPtCorrectionForSecondaries(0), fCorrectForSecondariesFlag(kFALSE),
735cc63d 115 fGlobalQAList(0), fQA2DList(0),
116 fQAProtonsAcceptedList(0), fQAProtonsRejectedList(0),
117 fQAAntiProtonsAcceptedList(0), fQAAntiProtonsRejectedList(0),
118 fInitQAFlag(kFALSE) {
734d2c12 119 //Default constructor
f203beb9 120 fHistEvents = new TH1I("fHistEvents","Analyzed events",2,0.5,2.5);
121 fHistEvents->GetXaxis()->SetBinLabel(1,"Analyzed events");
122 fHistEvents->GetXaxis()->SetBinLabel(2,"Events with (anti)protons");
3f6d0c08 123
0ab648ea 124 fHistYPtProtons = new TH2D("fHistYPtProtons","Protons",
125 fNBinsY,fMinY,fMaxY,
126 fNBinsPt,fMinPt,fMaxPt);
734d2c12 127 fHistYPtProtons->SetStats(kTRUE);
0ab648ea 128 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
129 if(fProtonAnalysisBase->GetEtaMode())
130 fHistYPtProtons->GetXaxis()->SetTitle("#eta");
131 else
132 fHistYPtProtons->GetXaxis()->SetTitle("y");
734d2c12 133 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
134
0ab648ea 135 fHistYPtAntiProtons = new TH2D("fHistYPtAntiProtons","Antiprotons",
136 fNBinsY,fMinY,fMaxY,
137 fNBinsPt,fMinPt,fMaxPt);
734d2c12 138 fHistYPtAntiProtons->SetStats(kTRUE);
0ab648ea 139 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
140 if(fProtonAnalysisBase->GetEtaMode())
141 fHistYPtAntiProtons->GetXaxis()->SetTitle("#eta");
142 else
143 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
734d2c12 144 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
251e4034 145
71a67ee1 146 fHistYPtProtonsCorrected = new TH2D("fHistYPtProtonsCorrected","Protons",
147 fNBinsY,fMinY,fMaxY,
148 fNBinsPt,fMinPt,fMaxPt);
149 fHistYPtProtonsCorrected->SetStats(kTRUE);
150 fHistYPtProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
151 if(fProtonAnalysisBase->GetEtaMode())
152 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("#eta");
153 else
154 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("y");
155 fHistYPtProtonsCorrected->GetXaxis()->SetTitleColor(1);
156
157 fHistYPtAntiProtonsCorrected = new TH2D("fHistYPtAntiProtonsCorrected",
158 "Antiprotons",
159 fNBinsY,fMinY,fMaxY,
160 fNBinsPt,fMinPt,fMaxPt);
161 fHistYPtAntiProtonsCorrected->SetStats(kTRUE);
162 fHistYPtAntiProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
163 if(fProtonAnalysisBase->GetEtaMode())
164 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("#eta");
165 else
166 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("y");
167 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitleColor(1);
168
251e4034 169 //setting up the containers
170 Int_t iBin[2];
171 iBin[0] = nbinsY;
172 iBin[1] = nbinsPt;
173 Double_t *binLimY = new Double_t[nbinsY+1];
174 Double_t *binLimPt = new Double_t[nbinsPt+1];
175 //values for bin lower bounds
176 for(Int_t i = 0; i <= nbinsY; i++)
177 binLimY[i]=(Double_t)fLowY + (fHighY - fLowY) /nbinsY*(Double_t)i;
178 for(Int_t i = 0; i <= nbinsPt; i++)
179 binLimPt[i]=(Double_t)fLowPt + (fHighPt - fLowPt) /nbinsPt*(Double_t)i;
180
181 fProtonContainer = new AliCFContainer("containerProtons",
182 "container for protons",
2f1c0f45 183 kNSteps,2,iBin);
0ab648ea 184 fProtonContainer->SetBinLimits(0,binLimY); //rapidity or eta
251e4034 185 fProtonContainer->SetBinLimits(1,binLimPt); //pT
186 fAntiProtonContainer = new AliCFContainer("containerAntiProtons",
187 "container for antiprotons",
2f1c0f45 188 kNSteps,2,iBin);
0ab648ea 189 fAntiProtonContainer->SetBinLimits(0,binLimY); //rapidity or eta
251e4034 190 fAntiProtonContainer->SetBinLimits(1,binLimPt); //pT
e56f08ed 191
192 //Initialize the QA
193 if(!fInitQAFlag) InitQA();
734d2c12 194}
195
4acc9d4d 196//____________________________________________________________________//
197AliProtonAnalysis::AliProtonAnalysis(Int_t nbinsY, Double_t *gY,
198 Int_t nbinsPt,Double_t *gPt) :
199 TObject(), fProtonAnalysisBase(0),
200 fNBinsY(nbinsY), fMinY(gY[0]), fMaxY(gY[nbinsY]),
201 fNBinsPt(nbinsPt), fMinPt(gPt[0]), fMaxPt(gPt[nbinsPt]),
202 fProtonContainer(0), fAntiProtonContainer(0),
ce9d2201 203 fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
71a67ee1 204 fHistYPtProtonsCorrected(0), fHistYPtAntiProtonsCorrected(0),
ce9d2201 205 fHistEventStats(0), fYRatioInPtBinsList(0),
4acc9d4d 206 fEffGridListProtons(0), fCorrectionListProtons2D(0),
207 fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
208 fEffGridListAntiProtons(0), fCorrectionListAntiProtons2D(0),
209 fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0),
735cc63d 210 fCorrectProtons(0), fCorrectAntiProtons(0),
336ea0ff 211 fHistEfficiencyYPtProtons(0), fHistEfficiencyYPtAntiProtons(0),
7deb716b 212 fHistCorrectionForCrossSectionYPtProtons(0),
213 fHistCorrectionForCrossSectionYPtAntiProtons(0),
214 fHistCorrectionForCrossSectionFlag(kFALSE),
437dd627 215 fHistYPtCorrectionForCutsProtons(0), fHistYPtCorrectionForCutsAntiProtons(0),
216 fCorrectForCutsFlag(kFALSE),
207a5280 217 fHistYPtCorrectionForTrackingProtons(0),
218 fHistYPtCorrectionForTrackingAntiProtons(0),
219 fCorrectForTrackingFlag(kFALSE),
437dd627 220 fHistYPtCorrectionForFeedDownProtons(0),
221 fHistYPtCorrectionForFeedDownAntiProtons(0),
222 fCorrectForFeedDownFlag(kFALSE),
2c60f603 223 fHistYPtCorrectionForSecondaries(0), fCorrectForSecondariesFlag(kFALSE),
735cc63d 224 fGlobalQAList(0), fQA2DList(0),
225 fQAProtonsAcceptedList(0), fQAProtonsRejectedList(0),
226 fQAAntiProtonsAcceptedList(0), fQAAntiProtonsRejectedList(0),
227 fInitQAFlag(kFALSE) {
4acc9d4d 228 //Default constructor
f203beb9 229 fHistEvents = new TH1I("fHistEvents","Analyzed events",2,0.5,2.5);
230 fHistEvents->GetXaxis()->SetBinLabel(1,"Analyzed events");
231 fHistEvents->GetXaxis()->SetBinLabel(2,"Events with (anti)protons");
4acc9d4d 232
233 fHistYPtProtons = new TH2D("fHistYPtProtons","Protons",
234 fNBinsY,gY,fNBinsPt,gPt);
235 fHistYPtProtons->SetStats(kTRUE);
236 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
237 if(fProtonAnalysisBase->GetEtaMode())
238 fHistYPtProtons->GetXaxis()->SetTitle("#eta");
239 else
240 fHistYPtProtons->GetXaxis()->SetTitle("y");
241 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
242
243 fHistYPtAntiProtons = new TH2D("fHistYPtAntiProtons","Antiprotons",
244 fNBinsY,gY,fNBinsPt,gPt);
245 fHistYPtAntiProtons->SetStats(kTRUE);
246 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
247 if(fProtonAnalysisBase->GetEtaMode())
248 fHistYPtAntiProtons->GetXaxis()->SetTitle("#eta");
249 else
250 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
251 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
252
71a67ee1 253 fHistYPtProtonsCorrected = new TH2D("fHistYPtProtonsCorrected","Protons",
254 fNBinsY,fMinY,fMaxY,
255 fNBinsPt,fMinPt,fMaxPt);
256 fHistYPtProtonsCorrected->SetStats(kTRUE);
257 fHistYPtProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
258 if(fProtonAnalysisBase->GetEtaMode())
259 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("#eta");
260 else
261 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("y");
262 fHistYPtProtonsCorrected->GetXaxis()->SetTitleColor(1);
263
264 fHistYPtAntiProtonsCorrected = new TH2D("fHistYPtAntiProtonsCorrected",
265 "Antiprotons",
266 fNBinsY,fMinY,fMaxY,
267 fNBinsPt,fMinPt,fMaxPt);
268 fHistYPtAntiProtonsCorrected->SetStats(kTRUE);
269 fHistYPtAntiProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
270 if(fProtonAnalysisBase->GetEtaMode())
271 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("#eta");
272 else
273 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("y");
274 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitleColor(1);
275
4acc9d4d 276 //setting up the containers
277 Int_t iBin[2];
278 iBin[0] = nbinsY;
279 iBin[1] = nbinsPt;
280 fProtonContainer = new AliCFContainer("containerProtons",
281 "container for protons",
2f1c0f45 282 kNSteps,2,iBin);
4acc9d4d 283 fProtonContainer->SetBinLimits(0,gY); //rapidity or eta
284 fProtonContainer->SetBinLimits(1,gPt); //pT
285 fAntiProtonContainer = new AliCFContainer("containerAntiProtons",
286 "container for antiprotons",
2f1c0f45 287 kNSteps,2,iBin);
4acc9d4d 288 fAntiProtonContainer->SetBinLimits(0,gY); //rapidity or eta
289 fAntiProtonContainer->SetBinLimits(1,gPt); //pT
e56f08ed 290
291 //Initialize the QA
292 if(!fInitQAFlag) InitQA();
4acc9d4d 293}
294
734d2c12 295//____________________________________________________________________//
296AliProtonAnalysis::~AliProtonAnalysis() {
297 //Default destructor
0ab648ea 298 if(fProtonAnalysisBase) delete fProtonAnalysisBase;
299
39f2a708 300 if(fHistEvents) delete fHistEvents;
301 if(fHistYPtProtons) delete fHistYPtProtons;
302 if(fHistYPtAntiProtons) delete fHistYPtAntiProtons;
71a67ee1 303 if(fHistYPtProtonsCorrected) delete fHistYPtProtonsCorrected;
304 if(fHistYPtAntiProtonsCorrected) delete fHistYPtAntiProtonsCorrected;
52b04cf9 305 if(fHistEventStats) delete fHistEventStats;
ce9d2201 306 if(fYRatioInPtBinsList) delete fYRatioInPtBinsList;
307
251e4034 308 if(fProtonContainer) delete fProtonContainer;
309 if(fAntiProtonContainer) delete fAntiProtonContainer;
310
251e4034 311 if(fEffGridListProtons) delete fEffGridListProtons;
cdb3530f 312 if(fCorrectionListProtons2D) delete fCorrectionListProtons2D;
313 if(fEfficiencyListProtons1D) delete fEfficiencyListProtons1D;
314 if(fCorrectionListProtons1D) delete fCorrectionListProtons1D;
251e4034 315 if(fEffGridListAntiProtons) delete fEffGridListAntiProtons;
cdb3530f 316 if(fCorrectionListAntiProtons2D) delete fCorrectionListAntiProtons2D;
317 if(fEfficiencyListAntiProtons1D) delete fEfficiencyListAntiProtons1D;
318 if(fCorrectionListAntiProtons1D) delete fCorrectionListAntiProtons1D;
251e4034 319 if(fCorrectProtons) delete fCorrectProtons;
320 if(fCorrectAntiProtons) delete fCorrectAntiProtons;
336ea0ff 321 if(fHistEfficiencyYPtProtons) delete fHistEfficiencyYPtProtons;
322 if(fHistEfficiencyYPtAntiProtons) delete fHistEfficiencyYPtAntiProtons;
7deb716b 323 if(fHistCorrectionForCrossSectionYPtProtons) delete fHistCorrectionForCrossSectionYPtProtons;
324 if(fHistCorrectionForCrossSectionYPtAntiProtons) delete fHistCorrectionForCrossSectionYPtAntiProtons;
437dd627 325 if(fHistYPtCorrectionForCutsProtons) delete fHistYPtCorrectionForCutsProtons;
326 if(fHistYPtCorrectionForCutsAntiProtons) delete fHistYPtCorrectionForCutsAntiProtons;
207a5280 327 if(fHistYPtCorrectionForTrackingProtons) delete fHistYPtCorrectionForTrackingProtons;
328 if(fHistYPtCorrectionForTrackingAntiProtons) delete fHistYPtCorrectionForTrackingAntiProtons;
437dd627 329 if(fHistYPtCorrectionForFeedDownProtons) delete fHistYPtCorrectionForFeedDownProtons;
330 if(fHistYPtCorrectionForFeedDownAntiProtons) delete fHistYPtCorrectionForFeedDownAntiProtons;
2c60f603 331 if(fHistYPtCorrectionForSecondaries) delete fHistYPtCorrectionForSecondaries;
735cc63d 332
333 //QA lists
334 if(fGlobalQAList) delete fGlobalQAList;
335 if(fQA2DList) delete fQA2DList;
336 if(fQAProtonsAcceptedList) delete fQAProtonsAcceptedList;
337 if(fQAProtonsRejectedList) delete fQAProtonsRejectedList;
338 if(fQAAntiProtonsAcceptedList) delete fQAAntiProtonsAcceptedList;
339 if(fQAAntiProtonsRejectedList) delete fQAAntiProtonsRejectedList;
734d2c12 340}
341
342//____________________________________________________________________//
251e4034 343void AliProtonAnalysis::InitAnalysisHistograms(Int_t nbinsY,
344 Float_t fLowY, Float_t fHighY,
345 Int_t nbinsPt,
346 Float_t fLowPt, Float_t fHighPt) {
9cd594db 347 //Initializes the histograms
734d2c12 348 fNBinsY = nbinsY;
349 fMinY = fLowY;
350 fMaxY = fHighY;
351 fNBinsPt = nbinsPt;
352 fMinPt = fLowPt;
353 fMaxPt = fHighPt;
354
f203beb9 355 fHistEvents = new TH1I("fHistEvents","Analyzed events",2,0.5,2.5);
356 fHistEvents->GetXaxis()->SetBinLabel(1,"Analyzed events");
357 fHistEvents->GetXaxis()->SetBinLabel(2,"Events with (anti)protons");
3f6d0c08 358
0ab648ea 359 fHistYPtProtons = new TH2D("fHistYPtProtons","Protons",
360 fNBinsY,fMinY,fMaxY,
361 fNBinsPt,fMinPt,fMaxPt);
734d2c12 362 fHistYPtProtons->SetStats(kTRUE);
0ab648ea 363 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
364 if(fProtonAnalysisBase->GetEtaMode())
365 fHistYPtProtons->GetXaxis()->SetTitle("#eta");
366 else
367 fHistYPtProtons->GetXaxis()->SetTitle("y");
734d2c12 368 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
369
0ab648ea 370 fHistYPtAntiProtons = new TH2D("fHistYPtAntiProtons","Antiprotons",
371 fNBinsY,fMinY,fMaxY,
372 fNBinsPt,fMinPt,fMaxPt);
734d2c12 373 fHistYPtAntiProtons->SetStats(kTRUE);
0ab648ea 374 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
375 if(fProtonAnalysisBase->GetEtaMode())
376 fHistYPtAntiProtons->GetXaxis()->SetTitle("#eta");
377 else
378 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
734d2c12 379 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
251e4034 380
71a67ee1 381 fHistYPtProtonsCorrected = new TH2D("fHistYPtProtonsCorrected","Protons",
382 fNBinsY,fMinY,fMaxY,
383 fNBinsPt,fMinPt,fMaxPt);
384 fHistYPtProtonsCorrected->SetStats(kTRUE);
385 fHistYPtProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
386 if(fProtonAnalysisBase->GetEtaMode())
387 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("#eta");
388 else
389 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("y");
390 fHistYPtProtonsCorrected->GetXaxis()->SetTitleColor(1);
391
392 fHistYPtAntiProtonsCorrected = new TH2D("fHistYPtAntiProtonsCorrected",
393 "Antiprotons",
394 fNBinsY,fMinY,fMaxY,
395 fNBinsPt,fMinPt,fMaxPt);
396 fHistYPtAntiProtonsCorrected->SetStats(kTRUE);
397 fHistYPtAntiProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
398 if(fProtonAnalysisBase->GetEtaMode())
399 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("#eta");
400 else
401 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("y");
402 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitleColor(1);
403
251e4034 404 //setting up the containers
405 Int_t iBin[2];
406 iBin[0] = nbinsY;
407 iBin[1] = nbinsPt;
408 Double_t *binLimY = new Double_t[nbinsY+1];
409 Double_t *binLimPt = new Double_t[nbinsPt+1];
410 //values for bin lower bounds
411 for(Int_t i = 0; i <= nbinsY; i++)
412 binLimY[i]=(Double_t)fLowY + (fHighY - fLowY) /nbinsY*(Double_t)i;
413 for(Int_t i = 0; i <= nbinsPt; i++)
414 binLimPt[i]=(Double_t)fLowPt + (fHighPt - fLowPt) /nbinsPt*(Double_t)i;
415
416 fProtonContainer = new AliCFContainer("containerProtons",
417 "container for protons",
2f1c0f45 418 kNSteps,2,iBin);
251e4034 419 fProtonContainer->SetBinLimits(0,binLimY); //rapidity
420 fProtonContainer->SetBinLimits(1,binLimPt); //pT
421 fAntiProtonContainer = new AliCFContainer("containerAntiProtons",
422 "container for antiprotons",
2f1c0f45 423 kNSteps,2,iBin);
251e4034 424 fAntiProtonContainer->SetBinLimits(0,binLimY); //rapidity
425 fAntiProtonContainer->SetBinLimits(1,binLimPt); //pT
e56f08ed 426
bc554c73 427 delete [] binLimY;
428 delete [] binLimPt;
429
e56f08ed 430 //Initialize the QA
431 if(!fInitQAFlag) InitQA();
734d2c12 432}
433
4acc9d4d 434//____________________________________________________________________//
435void AliProtonAnalysis::InitAnalysisHistograms(Int_t nbinsY, Double_t *gY,
436 Int_t nbinsPt, Double_t *gPt) {
437 //Initializes the histograms using asymmetric values - global tracking
438 fNBinsY = nbinsY;
439 fMinY = gY[0];
440 fMaxY = gY[nbinsY];
441 fNBinsPt = nbinsPt;
442 fMinPt = gPt[0];
443 fMaxPt = gPt[nbinsPt];
444
f203beb9 445 fHistEvents = new TH1I("fHistEvents","Analyzed events",2,0.5,2.5);
446 fHistEvents->GetXaxis()->SetBinLabel(1,"Analyzed events");
447 fHistEvents->GetXaxis()->SetBinLabel(2,"Events with (anti)protons");
4acc9d4d 448
449 fHistYPtProtons = new TH2D("fHistYPtProtons","Protons",
450 fNBinsY,gY,fNBinsPt,gPt);
451 fHistYPtProtons->SetStats(kTRUE);
452 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
453 if(fProtonAnalysisBase->GetEtaMode())
454 fHistYPtProtons->GetXaxis()->SetTitle("#eta");
455 else
456 fHistYPtProtons->GetXaxis()->SetTitle("y");
457 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
458
459 fHistYPtAntiProtons = new TH2D("fHistYPtAntiProtons","Antiprotons",
460 fNBinsY,gY,fNBinsPt,gPt);
461 fHistYPtAntiProtons->SetStats(kTRUE);
462 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
463 if(fProtonAnalysisBase->GetEtaMode())
464 fHistYPtAntiProtons->GetXaxis()->SetTitle("#eta");
465 else
466 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
467 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
468
71a67ee1 469 fHistYPtProtonsCorrected = new TH2D("fHistYPtProtonsCorrected","Protons",
470 fNBinsY,gY,fNBinsPt,gPt);
471 fHistYPtProtonsCorrected->SetStats(kTRUE);
472 fHistYPtProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
473 if(fProtonAnalysisBase->GetEtaMode())
474 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("#eta");
475 else
476 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("y");
477 fHistYPtProtonsCorrected->GetXaxis()->SetTitleColor(1);
478
479 fHistYPtAntiProtonsCorrected = new TH2D("fHistYPtAntiProtonsCorrected",
480 "Antiprotons",
481 fNBinsY,gY,fNBinsPt,gPt);
482 fHistYPtAntiProtonsCorrected->SetStats(kTRUE);
483 fHistYPtAntiProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
484 if(fProtonAnalysisBase->GetEtaMode())
485 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("#eta");
486 else
487 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("y");
488 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitleColor(1);
489
4acc9d4d 490 //setting up the containers
491 Int_t iBin[2];
492 iBin[0] = nbinsY;
493 iBin[1] = nbinsPt;
494
495 fProtonContainer = new AliCFContainer("containerProtons",
496 "container for protons",
2f1c0f45 497 kNSteps,2,iBin);
4acc9d4d 498 fProtonContainer->SetBinLimits(0,gY); //rapidity
499 fProtonContainer->SetBinLimits(1,gPt); //pT
500 fAntiProtonContainer = new AliCFContainer("containerAntiProtons",
501 "container for antiprotons",
2f1c0f45 502 kNSteps,2,iBin);
4acc9d4d 503 fAntiProtonContainer->SetBinLimits(0,gY); //rapidity
504 fAntiProtonContainer->SetBinLimits(1,gPt); //pT
e56f08ed 505
506 //Initialize the QA
507 if(!fInitQAFlag) InitQA();
4acc9d4d 508}
509
734d2c12 510//____________________________________________________________________//
2b748670 511Bool_t AliProtonAnalysis::ReadFromFile(const char* filename) {
9cd594db 512 //Read the containers from the existing file
2b748670 513 Bool_t status = kTRUE;
514
734d2c12 515 TFile *file = TFile::Open(filename);
2b748670 516 if(!file) {
517 cout<<"Could not find the input file "<<filename<<endl;
518 status = kFALSE;
519 }
520
0ab648ea 521 TList *list = (TList *)file->Get("outputList");
2b748670 522 if(list) {
523 cout<<"Retrieving objects from the list "<<list->GetName()<<"..."<<endl;
251e4034 524 fHistYPtProtons = (TH2D *)list->At(0);
525 fHistYPtAntiProtons = (TH2D *)list->At(1);
3f6d0c08 526 fHistEvents = (TH1I *)list->At(2);
251e4034 527 fProtonContainer = (AliCFContainer *)list->At(3);
528 fAntiProtonContainer = (AliCFContainer *)list->At(4);
52b04cf9 529 fHistEventStats = (TH1F *)list->At(5);
2b748670 530 }
531 else if(!list) {
532 cout<<"Retrieving objects from the file... "<<endl;
251e4034 533 fHistYPtProtons = (TH2D *)file->Get("fHistYPtProtons");
534 fHistYPtAntiProtons = (TH2D *)file->Get("fHistYPtAntiProtons");
3f6d0c08 535 fHistEvents = (TH1I *)file->Get("fHistEvents");
251e4034 536 fProtonContainer = (AliCFContainer *)file->Get("containerProtons");
537 fAntiProtonContainer = (AliCFContainer *)file->Get("containerAntiProtons");
52b04cf9 538 fHistEventStats = (TH1F *)file->Get("fHistEventStats");
2b748670 539 }
251e4034 540 if((!fHistYPtProtons)||(!fHistYPtAntiProtons)||(!fHistEvents)
52b04cf9 541 ||(!fProtonContainer)||(!fAntiProtonContainer)||(!fHistEventStats)) {
2b748670 542 cout<<"Input containers were not found!!!"<<endl;
543 status = kFALSE;
544 }
545 else {
3e23254a 546 //fHistYPtProtons = fProtonContainer->ShowProjection(0,1,0);
547 //fHistYPtAntiProtons = fAntiProtonContainer->ShowProjection(0,1,0);
548 fHistYPtProtons->Sumw2();
549 fHistYPtAntiProtons->Sumw2();
2b748670 550 }
551
552 return status;
734d2c12 553}
554
ce9d2201 555//____________________________________________________________________//
556TList *AliProtonAnalysis::GetYRatioHistogramsInPtBins() {
557 //Returns a TList obkect with the eta (or y) dependent ratios for each
558 //pT bin taken from the 2D histograms (not from the containers)
559 fYRatioInPtBinsList = new TList();
560
561 //Protons
562 TH1D *gHistYProtons[100];
563 TString title;
564 for(Int_t iBin = 1; iBin <= fHistYPtProtons->GetNbinsY(); iBin++) {
565 title = "gHistYProtons_PtBin"; title += iBin;
566 gHistYProtons[iBin] = (TH1D *)fHistYPtProtons->ProjectionX(title.Data(),
567 iBin,
71a67ee1 568 iBin,"b");
ce9d2201 569 gHistYProtons[iBin]->Sumw2();
570 }
571
572 //Antiprotons
573 TH1D *gHistYAntiProtons[100];
574 for(Int_t iBin = 1; iBin <= fHistYPtAntiProtons->GetNbinsY(); iBin++) {
575 title = "gHistYAntiProtons_PtBin"; title += iBin;
576 gHistYAntiProtons[iBin] = (TH1D *)fHistYPtAntiProtons->ProjectionX(title.Data(),
577 iBin,
71a67ee1 578 iBin,"b");
ce9d2201 579 gHistYAntiProtons[iBin]->Sumw2();
580 }
581
582 Double_t pTmin = fHistYPtProtons->GetYaxis()->GetXmin();
583 Double_t pTStep = (fHistYPtProtons->GetYaxis()->GetXmax() - fHistYPtProtons->GetYaxis()->GetXmin())/fHistYPtProtons->GetNbinsY();
584 Double_t pTmax = pTmin + pTStep;
585 //Ratio
586 TH1D *gHistYRatio[100];
587 for(Int_t iBin = 1; iBin <= fHistYPtProtons->GetNbinsY(); iBin++) {
588 title = "gHistYRatio_PtBin"; title += iBin;
589 gHistYRatio[iBin] = new TH1D(title.Data(),"",
590 fHistYPtProtons->GetNbinsX(),
591 fHistYPtProtons->GetXaxis()->GetXmin(),
592 fHistYPtProtons->GetXaxis()->GetXmax());
593 title = "Pt: "; title += pTmin; title += " - "; title += pTmax;
594 gHistYRatio[iBin]->SetTitle(title.Data());
595 gHistYRatio[iBin]->GetYaxis()->SetTitle("#bar{p}/p");
596 gHistYRatio[iBin]->GetXaxis()->SetTitle(fHistYPtProtons->GetXaxis()->GetTitle());
597 gHistYRatio[iBin]->Divide(gHistYAntiProtons[iBin],
71a67ee1 598 gHistYProtons[iBin],1.0,1.0,"b");
ce9d2201 599 fYRatioInPtBinsList->Add(gHistYRatio[iBin]);
600 pTmin += pTStep;
601 pTmax += pTStep;
602 }
603
604 return fYRatioInPtBinsList;
605}
606
734d2c12 607//____________________________________________________________________//
608TH1D *AliProtonAnalysis::GetProtonYHistogram() {
9cd594db 609 //Get the y histogram for protons
3f6d0c08 610 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
251e4034 611
f203beb9 612 //TH1D *fYProtons = (TH1D *)fHistYPtProtons->ProjectionX("fYProtons",0,fHistYPtProtons->GetYaxis()->GetNbins(),"");
8d64ac62 613 TH1D *fYProtons = fProtonContainer->ShowProjection(0,kStepInPhaseSpace); //variable-step
251e4034 614
734d2c12 615 fYProtons->SetStats(kFALSE);
3f6d0c08 616 fYProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
734d2c12 617 fYProtons->SetTitle("dN/dy protons");
618 fYProtons->SetMarkerStyle(kFullCircle);
619 fYProtons->SetMarkerColor(4);
3f6d0c08 620 if(nAnalyzedEvents > 0)
251e4034 621 fYProtons->Scale(1./nAnalyzedEvents);
622
734d2c12 623 return fYProtons;
624}
625
626//____________________________________________________________________//
627TH1D *AliProtonAnalysis::GetAntiProtonYHistogram() {
9cd594db 628 //Get the y histogram for antiprotons
3f6d0c08 629 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
3e23254a 630
f203beb9 631 //TH1D *fYAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionX("fYAntiProtons",0,fHistYPtAntiProtons->GetYaxis()->GetNbins(),"");
8d64ac62 632 TH1D *fYAntiProtons = fAntiProtonContainer->ShowProjection(0,kStepInPhaseSpace);//variable-step
251e4034 633
734d2c12 634 fYAntiProtons->SetStats(kFALSE);
3f6d0c08 635 fYAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
734d2c12 636 fYAntiProtons->SetTitle("dN/dy antiprotons");
637 fYAntiProtons->SetMarkerStyle(kFullCircle);
638 fYAntiProtons->SetMarkerColor(4);
3f6d0c08 639 if(nAnalyzedEvents > 0)
640 fYAntiProtons->Scale(1./nAnalyzedEvents);
734d2c12 641
642 return fYAntiProtons;
643}
644
645//____________________________________________________________________//
646TH1D *AliProtonAnalysis::GetProtonPtHistogram() {
9cd594db 647 //Get the Pt histogram for protons
3f6d0c08 648 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
3e23254a 649
f203beb9 650 //TH1D *fPtProtons = (TH1D *)fHistYPtProtons->ProjectionY("fPtProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"");
8d64ac62 651 TH1D *fPtProtons = fProtonContainer->ShowProjection(1,kStepInPhaseSpace); //variable-step
251e4034 652
734d2c12 653 fPtProtons->SetStats(kFALSE);
3f6d0c08 654 fPtProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
734d2c12 655 fPtProtons->SetTitle("dN/dPt protons");
656 fPtProtons->SetMarkerStyle(kFullCircle);
657 fPtProtons->SetMarkerColor(4);
3f6d0c08 658 if(nAnalyzedEvents > 0)
659 fPtProtons->Scale(1./nAnalyzedEvents);
734d2c12 660
661 return fPtProtons;
662}
663
664//____________________________________________________________________//
665TH1D *AliProtonAnalysis::GetAntiProtonPtHistogram() {
9cd594db 666 //Get the Pt histogram for antiprotons
3f6d0c08 667 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
3e23254a 668
f203beb9 669 //TH1D *fPtAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionY("fPtAntiProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"");
8d64ac62 670 TH1D *fPtAntiProtons = fAntiProtonContainer->ShowProjection(1,kStepInPhaseSpace); //variable-step
251e4034 671
734d2c12 672 fPtAntiProtons->SetStats(kFALSE);
3f6d0c08 673 fPtAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
734d2c12 674 fPtAntiProtons->SetTitle("dN/dPt antiprotons");
675 fPtAntiProtons->SetMarkerStyle(kFullCircle);
676 fPtAntiProtons->SetMarkerColor(4);
3f6d0c08 677 if(nAnalyzedEvents > 0)
678 fPtAntiProtons->Scale(1./nAnalyzedEvents);
734d2c12 679
680 return fPtAntiProtons;
681}
682
251e4034 683//____________________________________________________________________//
684TH1D *AliProtonAnalysis::GetProtonCorrectedYHistogram() {
9cd594db 685 //Get the corrected y histogram for protons
251e4034 686 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
687
71a67ee1 688 TH1D *fYProtons = (TH1D *)fHistYPtProtonsCorrected->ProjectionX("fYProtons",1,fHistYPtProtons->GetYaxis()->GetNbins(),"e");
336ea0ff 689 //TH1D *fYProtons = fCorrectProtons->Project(0); //0: rapidity
251e4034 690
691 fYProtons->SetStats(kFALSE);
692 fYProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
693 fYProtons->GetXaxis()->SetTitle("y");
694 fYProtons->SetTitle("dN/dy protons");
695 fYProtons->SetMarkerStyle(kFullCircle);
696 fYProtons->SetMarkerColor(4);
697 if(nAnalyzedEvents > 0)
698 fYProtons->Scale(1./nAnalyzedEvents);
699
700 return fYProtons;
701}
702
703//____________________________________________________________________//
704TH1D *AliProtonAnalysis::GetAntiProtonCorrectedYHistogram() {
9cd594db 705 //Get the corrected y histogram for antiprotons
251e4034 706 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
336ea0ff 707
71a67ee1 708 TH1D *fYAntiProtons = (TH1D *)fHistYPtAntiProtonsCorrected->ProjectionX("fYAntiProtons",1,fHistYPtAntiProtons->GetYaxis()->GetNbins(),"e");
336ea0ff 709 //TH1D *fYAntiProtons = fCorrectAntiProtons->Project(0); //0: rapidity
251e4034 710
711 fYAntiProtons->SetStats(kFALSE);
712 fYAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
713 fYAntiProtons->GetXaxis()->SetTitle("y");
714 fYAntiProtons->SetTitle("dN/dy protons");
715 fYAntiProtons->SetMarkerStyle(kFullCircle);
716 fYAntiProtons->SetMarkerColor(4);
717 if(nAnalyzedEvents > 0)
718 fYAntiProtons->Scale(1./nAnalyzedEvents);
719
720 return fYAntiProtons;
721}
722
723//____________________________________________________________________//
724TH1D *AliProtonAnalysis::GetProtonCorrectedPtHistogram() {
9cd594db 725 //Get the corrected Pt histogram for protons
251e4034 726 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
727
37567742 728 //TH1D *fPtProtons = (TH1D *)fHistYPtProtonsCorrected->ProjectionY("fPtProtons",2,fHistYPtProtons->GetXaxis()->GetNbins()-1,"e");
729 TH1D *fPtProtons = (TH1D *)fHistYPtProtonsCorrected->ProjectionY("fPtProtons",3,7,"e"); //3,7: |y| < 0.5
336ea0ff 730 //TH1D *fPtProtons = fCorrectProtons->Project(0); //0: rapidity
251e4034 731
732 fPtProtons->SetStats(kFALSE);
733 fPtProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
734 fPtProtons->GetXaxis()->SetTitle("P_{T} [GeV/c]");
735 fPtProtons->SetTitle("dN/dPt protons");
736 fPtProtons->SetMarkerStyle(kFullCircle);
737 fPtProtons->SetMarkerColor(4);
738 if(nAnalyzedEvents > 0)
739 fPtProtons->Scale(1./nAnalyzedEvents);
740
741 return fPtProtons;
742}
743
744//____________________________________________________________________//
745TH1D *AliProtonAnalysis::GetAntiProtonCorrectedPtHistogram() {
9cd594db 746 //Get the corrected Pt histogram for antiprotons
251e4034 747 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
748
37567742 749 //TH1D *fPtAntiProtons = (TH1D *)fHistYPtAntiProtonsCorrected->ProjectionY("fPtAntiProtons",2,fHistYPtAntiProtons->GetXaxis()->GetNbins()-1,"e");
750 TH1D *fPtAntiProtons = (TH1D *)fHistYPtAntiProtonsCorrected->ProjectionY("fPtAntiProtons",3,7,"e"); //3,7: |y| < 0.5
336ea0ff 751//TH1D *fPtAntiProtons = fCorrectAntiProtons->Project(0); //0: rapidity
251e4034 752
753 fPtAntiProtons->SetStats(kFALSE);
754 fPtAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
755 fPtAntiProtons->GetXaxis()->SetTitle("P_{T} [GeV/c]");
756 fPtAntiProtons->SetTitle("dN/dPt antiprotons");
757 fPtAntiProtons->SetMarkerStyle(kFullCircle);
758 fPtAntiProtons->SetMarkerColor(4);
759 if(nAnalyzedEvents > 0)
760 fPtAntiProtons->Scale(1./nAnalyzedEvents);
761
762 return fPtAntiProtons;
763}
764
734d2c12 765//____________________________________________________________________//
766TH1D *AliProtonAnalysis::GetYRatioHistogram() {
3e23254a 767 //Returns the rapidity dependence of the ratio (uncorrected)
734d2c12 768 TH1D *fYProtons = GetProtonYHistogram();
769 TH1D *fYAntiProtons = GetAntiProtonYHistogram();
770
771 TH1D *hRatioY = new TH1D("hRatioY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
71a67ee1 772 hRatioY->Divide(fYAntiProtons,fYProtons,1.0,1.0,"e");
734d2c12 773 hRatioY->SetMarkerStyle(kFullCircle);
774 hRatioY->SetMarkerColor(4);
775 hRatioY->GetYaxis()->SetTitle("#bar{p}/p");
776 hRatioY->GetYaxis()->SetTitleOffset(1.4);
777 hRatioY->GetXaxis()->SetTitle("y");
778 hRatioY->GetXaxis()->SetTitleColor(1);
779 hRatioY->SetStats(kFALSE);
780
781 return hRatioY;
782}
783
3e23254a 784//____________________________________________________________________//
336ea0ff 785TH1D *AliProtonAnalysis::GetYRatioCorrectedHistogram() {
786//TH2D *gCorrectionProtons,
787//TH2D *gCorrectionAntiProtons) {
3e23254a 788 //Returns the rapidity dependence of the ratio (corrected)
336ea0ff 789 //fHistYPtProtons->Multiply(gCorrectionProtons);
790 TH1D *fYProtons = GetProtonCorrectedYHistogram();
791 //fHistYPtAntiProtons->Multiply(gCorrectionAntiProtons);
792 TH1D *fYAntiProtons = GetAntiProtonCorrectedYHistogram();
3e23254a 793
794 TH1D *hRatioY = new TH1D("hRatioY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
71a67ee1 795 hRatioY->Divide(fYAntiProtons,fYProtons,1.0,1.0,"e");
3e23254a 796 hRatioY->SetMarkerStyle(kFullCircle);
797 hRatioY->SetMarkerColor(4);
798 hRatioY->GetYaxis()->SetTitle("#bar{p}/p");
799 hRatioY->GetYaxis()->SetTitleOffset(1.4);
800 hRatioY->GetXaxis()->SetTitle("y");
801 hRatioY->GetXaxis()->SetTitleColor(1);
802 hRatioY->SetStats(kFALSE);
803
804 return hRatioY;
805}
806
734d2c12 807//____________________________________________________________________//
808TH1D *AliProtonAnalysis::GetPtRatioHistogram() {
3e23254a 809 //Returns the pT dependence of the ratio (uncorrected)
734d2c12 810 TH1D *fPtProtons = GetProtonPtHistogram();
811 TH1D *fPtAntiProtons = GetAntiProtonPtHistogram();
812
813 TH1D *hRatioPt = new TH1D("hRatioPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
71a67ee1 814 hRatioPt->Divide(fPtAntiProtons,fPtProtons,1.0,1.0,"e");
734d2c12 815 hRatioPt->SetMarkerStyle(kFullCircle);
816 hRatioPt->SetMarkerColor(4);
817 hRatioPt->GetYaxis()->SetTitle("#bar{p}/p");
818 hRatioPt->GetYaxis()->SetTitleOffset(1.4);
819 hRatioPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
820 hRatioPt->GetXaxis()->SetTitleColor(1);
821 hRatioPt->SetStats(kFALSE);
822
823 return hRatioPt;
824}
825
3e23254a 826//____________________________________________________________________//
336ea0ff 827TH1D *AliProtonAnalysis::GetPtRatioCorrectedHistogram() {
828 //TH2D *gCorrectionProtons,
829 //TH2D *gCorrectionAntiProtons) {
3e23254a 830 //Returns the Pt dependence of the ratio (corrected)
336ea0ff 831 //fHistYPtProtons->Multiply(gCorrectionProtons);
832 TH1D *fPtProtons = GetProtonCorrectedPtHistogram();
833 //fHistYPtAntiProtons->Multiply(gCorrectionAntiProtons);
834 TH1D *fPtAntiProtons = GetAntiProtonCorrectedPtHistogram();
3e23254a 835
836 TH1D *hRatioPt = new TH1D("hRatioPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
71a67ee1 837 hRatioPt->Divide(fPtAntiProtons,fPtProtons,1.0,1.0,"e");
3e23254a 838 hRatioPt->SetMarkerStyle(kFullCircle);
839 hRatioPt->SetMarkerColor(4);
840 hRatioPt->GetYaxis()->SetTitle("#bar{p}/p");
841 hRatioPt->GetYaxis()->SetTitleOffset(1.4);
842 hRatioPt->GetXaxis()->SetTitle("y");
843 hRatioPt->GetXaxis()->SetTitleColor(1);
844 hRatioPt->SetStats(kFALSE);
845
846 return hRatioPt;
847}
848
734d2c12 849//____________________________________________________________________//
850TH1D *AliProtonAnalysis::GetYAsymmetryHistogram() {
3e23254a 851 //Returns the rapidity dependence of the asymmetry (uncorrected)
734d2c12 852 TH1D *fYProtons = GetProtonYHistogram();
853 TH1D *fYAntiProtons = GetAntiProtonYHistogram();
854
855 TH1D *hsum = new TH1D("hsumY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
856 hsum->Add(fYProtons,fYAntiProtons,1.0,1.0);
857
858 TH1D *hdiff = new TH1D("hdiffY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
859 hdiff->Add(fYProtons,fYAntiProtons,1.0,-1.0);
860
861 TH1D *hAsymmetryY = new TH1D("hAsymmetryY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
71a67ee1 862 hAsymmetryY->Divide(hdiff,hsum,2.0,1.,"e");
734d2c12 863 hAsymmetryY->SetMarkerStyle(kFullCircle);
864 hAsymmetryY->SetMarkerColor(4);
865 hAsymmetryY->GetYaxis()->SetTitle("A_{p}");
866 hAsymmetryY->GetYaxis()->SetTitleOffset(1.4);
867 hAsymmetryY->GetXaxis()->SetTitle("y");
868 hAsymmetryY->GetXaxis()->SetTitleColor(1);
869 hAsymmetryY->SetStats(kFALSE);
870
871 return hAsymmetryY;
872}
873
874//____________________________________________________________________//
875TH1D *AliProtonAnalysis::GetPtAsymmetryHistogram() {
3e23254a 876 //Returns the pT dependence of the asymmetry (uncorrected)
734d2c12 877 TH1D *fPtProtons = GetProtonPtHistogram();
878 TH1D *fPtAntiProtons = GetAntiProtonPtHistogram();
879
880 TH1D *hsum = new TH1D("hsumPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
881 hsum->Add(fPtProtons,fPtAntiProtons,1.0,1.0);
882
883 TH1D *hdiff = new TH1D("hdiffPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
884 hdiff->Add(fPtProtons,fPtAntiProtons,1.0,-1.0);
885
886 TH1D *hAsymmetryPt = new TH1D("hAsymmetryPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
71a67ee1 887 hAsymmetryPt->Divide(hdiff,hsum,2.0,1.,"e");
734d2c12 888 hAsymmetryPt->SetMarkerStyle(kFullCircle);
889 hAsymmetryPt->SetMarkerColor(4);
890 hAsymmetryPt->GetYaxis()->SetTitle("A_{p}");
891 hAsymmetryPt->GetYaxis()->SetTitleOffset(1.4);
892 hAsymmetryPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
893 hAsymmetryPt->GetXaxis()->SetTitleColor(1);
894 hAsymmetryPt->SetStats(kFALSE);
895
896 return hAsymmetryPt;
897}
898
899//____________________________________________________________________//
6667f3a7 900void AliProtonAnalysis::Analyze(AliESDEvent* esd,
901 const AliESDVertex *vertex) {
e4358d7f 902 //Main analysis part - ESD
0ab648ea 903 Int_t nTracks = 0;
904 Int_t nIdentifiedProtons = 0, nIdentifiedAntiProtons = 0;
905 Int_t nSurvivedProtons = 0, nSurvivedAntiProtons = 0;
ff672838 906
907 //=========================================//
908 //Aleph parametrization
909 Double_t fAlephParameters[5];
910 if(fProtonAnalysisBase->GetMCAnalysisMode()) {
911 fAlephParameters[0] = 2.15898e+00/50.;
912 fAlephParameters[1] = 1.75295e+01;
913 fAlephParameters[2] = 3.40030e-09;
914 fAlephParameters[3] = 1.96178e+00;
915 fAlephParameters[4] = 3.91720e+00;
916 }
917 else {
918 fAlephParameters[0] = 0.0283086;
919 fAlephParameters[1] = 2.63394e+01;
920 fAlephParameters[2] = 5.04114e-11;
921 fAlephParameters[3] = 2.12543e+00;
922 fAlephParameters[4] = 4.88663e+00;
923 }
bc554c73 924
925 AliTPCPIDResponse *tpcResponse = new AliTPCPIDResponse();
926 tpcResponse->SetBetheBlochParameters(fAlephParameters[0],fAlephParameters[1],fAlephParameters[2],fAlephParameters[3],fAlephParameters[4]);
ff672838 927 //=========================================//
0ab648ea 928
f203beb9 929 fHistEvents->Fill(1); //number of analyzed events
251e4034 930 Double_t containerInput[2] ;
9cd594db 931 Double_t gPt = 0.0, gP = 0.0;
afc2ac17 932 Float_t dcaXY = 0.0, dcaZ = 0.0;
933
0ab648ea 934 nTracks = esd->GetNumberOfTracks();
935 for(Int_t iTracks = 0; iTracks < nTracks; iTracks++) {
6667f3a7 936 AliESDtrack* track = esd->GetTrack(iTracks);
df1e8a78 937 AliESDtrack trackTPC;
2b748670 938
e0919e87 939 Int_t nClustersTPC = track->GetTPCclusters(0x0);
37cb8683 940 Int_t npointsTPCdEdx = track->GetTPCsignalN();
4de4661f 941 Double_t dca[2] = {0.0,0.0}, cov[3] = {0.0,0.0,0.0}; //The impact parameters and their covariance.
71a67ee1 942 Double_t dca3D = 0.0;
37cb8683 943
0ab648ea 944 if((fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kTPC)||(fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kHybrid)) {
945 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
946 if(!tpcTrack) continue;
947 gPt = tpcTrack->Pt();
b8cca027 948 gP = track->GetInnerParam()->P();
4de4661f 949 tpcTrack->PropagateToDCA(vertex,
950 esd->GetMagneticField(),
951 100.,dca,cov);
71a67ee1 952 dca3D = TMath::Sqrt(TMath::Power(dca[0],2) +
953 TMath::Power(dca[1],2));
4de4661f 954
bc554c73 955 if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
956 if(fProtonAnalysisBase->IsAccepted(track)) {
957 ((TH2F *)(fQA2DList->At(0)))->Fill(gP,track->GetTPCsignal());
958 ((TH2F *)(fQA2DList->At(2)))->Fill(gP,TMath::Log(track->GetTPCsignal()/tpcResponse->GetExpectedSignal(gP,AliPID::kProton)));
ff672838 959 ((TH3F *)(fQA2DList->At(4)))->Fill(tpcTrack->Eta(),
4de4661f 960 tpcTrack->Phi()*180./TMath::Pi(),
961 npointsTPCdEdx);
ff672838 962 ((TH3F *)(fQA2DList->At(6)))->Fill(tpcTrack->Eta(),
4de4661f 963 tpcTrack->Phi()*180./TMath::Pi(),
964 nClustersTPC);
ff672838 965 ((TH3F *)(fQA2DList->At(8)))->Fill(gPt,
4de4661f 966 tpcTrack->Phi()*180./TMath::Pi(),
967 npointsTPCdEdx);
ff672838 968 ((TH3F *)(fQA2DList->At(10)))->Fill(gPt,
4de4661f 969 tpcTrack->Phi()*180./TMath::Pi(),
970 nClustersTPC);
f0e42d04 971 if(track->Charge() > 0)
972 ((TH2F *)(fQA2DList->At(20)))->Fill(gP,track->GetTPCsignal());
973 if(track->Charge() < 0)
bc554c73 974 ((TH2F *)(fQA2DList->At(21)))->Fill(gP,track->GetTPCsignal());
975 }//quality cuts
976 }//primary cuts
4de4661f 977
978 if(fProtonAnalysisBase->IsProton(track)) {
979 //Step: kStepIdentified
980 if(fProtonAnalysisBase->GetEtaMode())
981 containerInput[0] = tpcTrack->Eta();
982 else
983 containerInput[0] = fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
984 tpcTrack->Py(),
985 tpcTrack->Pz());
986 containerInput[1] = gPt;
987 if(tpcTrack->Charge() > 0) {
735cc63d 988 nIdentifiedProtons += 1;
4de4661f 989 fProtonContainer->Fill(containerInput,kStepIdentified);
990 }//protons
991 else if(tpcTrack->Charge() < 0) {
735cc63d 992 nIdentifiedAntiProtons += 1;
4de4661f 993 fAntiProtonContainer->Fill(containerInput,kStepIdentified);
994 }//protons
995
996 //Step: kStepIsPrimary
997 if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
998 if(tpcTrack->Charge() > 0)
999 fProtonContainer->Fill(containerInput,kStepIsPrimary);
1000 else if(tpcTrack->Charge() < 0)
e56f08ed 1001 fAntiProtonContainer->Fill(containerInput,kStepIsPrimary);
4de4661f 1002
e0919e87 1003 //FillQA(esd,vertex,track);
4de4661f 1004
1005 //Step: kStepSurvived
30f87a5b 1006 if(fProtonAnalysisBase->IsAccepted(track)) {
bc554c73 1007 ((TH2F *)(fQA2DList->At(1)))->Fill(gP,track->GetTPCsignal());
1008 ((TH2F *)(fQA2DList->At(3)))->Fill(gP,TMath::Log(track->GetTPCsignal()/tpcResponse->GetExpectedSignal(gP,AliPID::kProton)));
ff672838 1009 ((TH3F *)(fQA2DList->At(5)))->Fill(tpcTrack->Eta(),
e56f08ed 1010 tpcTrack->Phi()*180./TMath::Pi(),
1011 npointsTPCdEdx);
ff672838 1012 ((TH3F *)(fQA2DList->At(7)))->Fill(tpcTrack->Eta(),
e56f08ed 1013 tpcTrack->Phi()*180./TMath::Pi(),
1014 nClustersTPC);
ff672838 1015 ((TH3F *)(fQA2DList->At(9)))->Fill(gPt,
e56f08ed 1016 tpcTrack->Phi()*180./TMath::Pi(),
1017 npointsTPCdEdx);
ff672838 1018 ((TH3F *)(fQA2DList->At(11)))->Fill(gPt,
e56f08ed 1019 tpcTrack->Phi()*180./TMath::Pi(),
bc554c73 1020 nClustersTPC);
e56f08ed 1021
4de4661f 1022 if(tpcTrack->Charge() > 0) {
1023 fProtonContainer->Fill(containerInput,kStepSurvived);
bc554c73 1024 ((TH2F *)(fQA2DList->At(12)))->Fill(tpcTrack->Eta(),
4de4661f 1025 tpcTrack->Phi()*180./TMath::Pi());
7deb716b 1026 if(fProtonAnalysisBase->GetEtaMode()) {
1027 ((TH3F *)(fQA2DList->At(14)))->Fill(tpcTrack->Eta(),
1028 tpcTrack->Pt(),
3770a478 1029 dca[0]);
7deb716b 1030 ((TH3F *)(fQA2DList->At(15)))->Fill(tpcTrack->Eta(),
1031 tpcTrack->Pt(),
3770a478 1032 dca[1]);
7deb716b 1033 ((TH3F *)(fQA2DList->At(18)))->Fill(tpcTrack->Eta(),
1034 tpcTrack->Pt(),
1035 TMath::Abs(dca3D));
1036 }
1037 else {
1038 ((TH3F *)(fQA2DList->At(14)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1039 tpcTrack->Pt(),
3770a478 1040 dca[0]);
7deb716b 1041 ((TH3F *)(fQA2DList->At(15)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1042 tpcTrack->Pt(),
3770a478 1043 dca[1]);
7deb716b 1044 ((TH3F *)(fQA2DList->At(18)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1045 tpcTrack->Pt(),
1046 TMath::Abs(dca3D));
bc554c73 1047 }
4de4661f 1048 }//protons
1049 else if(tpcTrack->Charge() < 0) {
1050 fAntiProtonContainer->Fill(containerInput,kStepSurvived);
bc554c73 1051 ((TH2F *)(fQA2DList->At(13)))->Fill(tpcTrack->Eta(),
4de4661f 1052 tpcTrack->Phi()*180./TMath::Pi());
7deb716b 1053 if(fProtonAnalysisBase->GetEtaMode()) {
1054 ((TH3F *)(fQA2DList->At(16)))->Fill(tpcTrack->Eta(),
1055 tpcTrack->Pt(),
3770a478 1056 dca[0]);
7deb716b 1057 ((TH3F *)(fQA2DList->At(17)))->Fill(tpcTrack->Eta(),
1058 tpcTrack->Pt(),
3770a478 1059 dca[1]);
7deb716b 1060 ((TH3F *)(fQA2DList->At(19)))->Fill(tpcTrack->Eta(),
1061 tpcTrack->Pt(),
1062 TMath::Abs(dca3D));
1063 }
1064 else {
1065 ((TH3F *)(fQA2DList->At(16)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1066 tpcTrack->Pt(),
3770a478 1067 dca[0]);
7deb716b 1068 ((TH3F *)(fQA2DList->At(17)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1069 tpcTrack->Pt(),
3770a478 1070 dca[1]);
7deb716b 1071 ((TH3F *)(fQA2DList->At(19)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1072 tpcTrack->Pt(),
1073 TMath::Abs(dca3D));
bc554c73 1074 }
4de4661f 1075 }//antiprotons
1076
1077 //Step: kStepInPhaseSpace
1078 if(fProtonAnalysisBase->IsInPhaseSpace(track)) {
1079 if(tpcTrack->Charge() > 0) {
1080 nSurvivedProtons += 1;
1081 fHistYPtProtons->Fill(containerInput[0],
1082 containerInput[1]);
1083 fProtonContainer->Fill(containerInput,kStepInPhaseSpace);
1084 }//protons
1085 else if(tpcTrack->Charge() < 0) {
1086 nSurvivedAntiProtons += 1;
1087 fHistYPtAntiProtons->Fill(containerInput[0],
1088 containerInput[1]);
1089 fAntiProtonContainer->Fill(containerInput,kStepInPhaseSpace);
1090 }//antiprotons
1091 }//Step: kStepInPhaseSpace
1092 }//Step: kStepSurvived
1093 }//Step: kStepIsPrimary
1094 }//Step: kStepIdentified
0ab648ea 1095 }//TPC only tracks
afc2ac17 1096 if(fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kFullHybrid) {
1097 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
1098 if(!tpcTrack) continue;
1099
1100 AliExternalTrackParam cParam;
1101 /*Double_t phi = tpcTrack->Phi();
1102 Double_t eta = tpcTrack->Eta();
1103 Double_t gPx = tpcTrack->Px();
1104 Double_t gPy = tpcTrack->Py();
1105 Double_t gPz = tpcTrack->Pz();*/
1106 gPt = tpcTrack->Pt();
1107 //gP = tpcTrack->P();
1108 gP = track->GetInnerParam()->P();
1109 track->RelateToVertex(vertex,
1110 esd->GetMagneticField(),
1111 100.,&cParam);
1112 track->GetImpactParameters(dcaXY,dcaZ);
1113 dca[0] = dcaXY; dca[1] = dcaZ;
1114 dca3D = TMath::Sqrt(TMath::Power(dca[0],2) +
1115 TMath::Power(dca[1],2));
1116
bc554c73 1117 if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
afc2ac17 1118 if(fProtonAnalysisBase->IsAccepted(track)) {
1119 ((TH2F *)(fQA2DList->At(0)))->Fill(gP,track->GetTPCsignal());
bc554c73 1120 ((TH2F *)(fQA2DList->At(2)))->Fill(gP,TMath::Log(track->GetTPCsignal()/tpcResponse->GetExpectedSignal(gP,AliPID::kProton)));
afc2ac17 1121 ((TH3F *)(fQA2DList->At(4)))->Fill(tpcTrack->Eta(),
1122 tpcTrack->Phi()*180./TMath::Pi(),
1123 npointsTPCdEdx);
1124 ((TH3F *)(fQA2DList->At(6)))->Fill(tpcTrack->Eta(),
1125 tpcTrack->Phi()*180./TMath::Pi(),
1126 nClustersTPC);
1127 ((TH3F *)(fQA2DList->At(8)))->Fill(gPt,
1128 tpcTrack->Phi()*180./TMath::Pi(),
1129 npointsTPCdEdx);
1130 ((TH3F *)(fQA2DList->At(10)))->Fill(gPt,
1131 tpcTrack->Phi()*180./TMath::Pi(),
1132 nClustersTPC);
f0e42d04 1133 if(track->Charge() > 0)
1134 ((TH2F *)(fQA2DList->At(20)))->Fill(gP,track->GetTPCsignal());
1135 if(track->Charge() < 0)
1136 ((TH2F *)(fQA2DList->At(21)))->Fill(gP,track->GetTPCsignal());
afc2ac17 1137 }//quality cuts
bc554c73 1138 }//primary cuts
afc2ac17 1139
1140 if(fProtonAnalysisBase->IsProton(track)) {
1141 //Step: kStepIdentified
1142 if(fProtonAnalysisBase->GetEtaMode())
1143 containerInput[0] = tpcTrack->Eta();
1144 else
1145 containerInput[0] = fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
1146 tpcTrack->Py(),
1147 tpcTrack->Pz());
1148 containerInput[1] = gPt;
1149 if(tpcTrack->Charge() > 0) {
1150 nIdentifiedProtons += 1;
1151 fProtonContainer->Fill(containerInput,kStepIdentified);
1152 }//protons
1153 else if(tpcTrack->Charge() < 0) {
1154 nIdentifiedAntiProtons += 1;
1155 fAntiProtonContainer->Fill(containerInput,kStepIdentified);
1156 }//protons
1157
1158 //Step: kStepIsPrimary
1159 if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
1160 if(tpcTrack->Charge() > 0)
1161 fProtonContainer->Fill(containerInput,kStepIsPrimary);
1162 else if(tpcTrack->Charge() < 0)
1163 fAntiProtonContainer->Fill(containerInput,kStepIsPrimary);
1164
bc554c73 1165 FillQA(esd,vertex,track);
afc2ac17 1166
1167 //Step: kStepSurvived
1168 if(fProtonAnalysisBase->IsAccepted(track)) {
bc554c73 1169 ((TH2F *)(fQA2DList->At(1)))->Fill(gP,track->GetTPCsignal());
1170 ((TH2F *)(fQA2DList->At(3)))->Fill(gP,TMath::Log(track->GetTPCsignal()/tpcResponse->GetExpectedSignal(gP,AliPID::kProton)));
afc2ac17 1171 ((TH3F *)(fQA2DList->At(5)))->Fill(tpcTrack->Eta(),
1172 tpcTrack->Phi()*180./TMath::Pi(),
1173 npointsTPCdEdx);
1174 ((TH3F *)(fQA2DList->At(7)))->Fill(tpcTrack->Eta(),
1175 tpcTrack->Phi()*180./TMath::Pi(),
1176 nClustersTPC);
1177 ((TH3F *)(fQA2DList->At(9)))->Fill(gPt,
1178 tpcTrack->Phi()*180./TMath::Pi(),
1179 npointsTPCdEdx);
1180 ((TH3F *)(fQA2DList->At(11)))->Fill(gPt,
1181 tpcTrack->Phi()*180./TMath::Pi(),
bc554c73 1182 nClustersTPC);
afc2ac17 1183
1184 if(tpcTrack->Charge() > 0) {
1185 fProtonContainer->Fill(containerInput,kStepSurvived);
bc554c73 1186 ((TH2F *)(fQA2DList->At(12)))->Fill(tpcTrack->Eta(),
afc2ac17 1187 tpcTrack->Phi()*180./TMath::Pi());
1188 if(fProtonAnalysisBase->GetEtaMode()) {
1189 ((TH3F *)(fQA2DList->At(14)))->Fill(tpcTrack->Eta(),
1190 tpcTrack->Pt(),
3770a478 1191 dca[0]);
afc2ac17 1192 ((TH3F *)(fQA2DList->At(15)))->Fill(tpcTrack->Eta(),
1193 tpcTrack->Pt(),
3770a478 1194 dca[1]);
afc2ac17 1195 ((TH3F *)(fQA2DList->At(18)))->Fill(tpcTrack->Eta(),
1196 tpcTrack->Pt(),
1197 TMath::Abs(dca3D));
1198 }
1199 else {
1200 ((TH3F *)(fQA2DList->At(14)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1201 tpcTrack->Pt(),
3770a478 1202 dca[0]);
afc2ac17 1203 ((TH3F *)(fQA2DList->At(15)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1204 tpcTrack->Pt(),
3770a478 1205 dca[1]);
afc2ac17 1206 ((TH3F *)(fQA2DList->At(18)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1207 tpcTrack->Pt(),
1208 TMath::Abs(dca3D));
bc554c73 1209 }
afc2ac17 1210 }//protons
1211 else if(tpcTrack->Charge() < 0) {
1212 fAntiProtonContainer->Fill(containerInput,kStepSurvived);
bc554c73 1213 ((TH2F *)(fQA2DList->At(13)))->Fill(tpcTrack->Eta(),
afc2ac17 1214 tpcTrack->Phi()*180./TMath::Pi());
1215 if(fProtonAnalysisBase->GetEtaMode()) {
1216 ((TH3F *)(fQA2DList->At(16)))->Fill(tpcTrack->Eta(),
1217 tpcTrack->Pt(),
3770a478 1218 dca[0]);
afc2ac17 1219 ((TH3F *)(fQA2DList->At(17)))->Fill(tpcTrack->Eta(),
1220 tpcTrack->Pt(),
3770a478 1221 dca[1]);
afc2ac17 1222 ((TH3F *)(fQA2DList->At(19)))->Fill(tpcTrack->Eta(),
1223 tpcTrack->Pt(),
1224 TMath::Abs(dca3D));
1225 }
1226 else {
1227 ((TH3F *)(fQA2DList->At(16)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1228 tpcTrack->Pt(),
3770a478 1229 dca[0]);
afc2ac17 1230 ((TH3F *)(fQA2DList->At(17)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1231 tpcTrack->Pt(),
3770a478 1232 dca[1]);
afc2ac17 1233 ((TH3F *)(fQA2DList->At(19)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1234 tpcTrack->Pt(),
1235 TMath::Abs(dca3D));
bc554c73 1236 }
afc2ac17 1237 }//antiprotons
1238
1239 //Step: kStepInPhaseSpace
1240 if(fProtonAnalysisBase->IsInPhaseSpace(track)) {
1241 if(tpcTrack->Charge() > 0) {
1242 nSurvivedProtons += 1;
1243 fHistYPtProtons->Fill(containerInput[0],
1244 containerInput[1]);
1245 fProtonContainer->Fill(containerInput,kStepInPhaseSpace);
1246 }//protons
1247 else if(tpcTrack->Charge() < 0) {
1248 nSurvivedAntiProtons += 1;
1249 fHistYPtAntiProtons->Fill(containerInput[0],
1250 containerInput[1]);
1251 fAntiProtonContainer->Fill(containerInput,kStepInPhaseSpace);
1252 }//antiprotons
1253 }//Step: kStepInPhaseSpace
1254 }//Step: kStepSurvived
1255 }//Step: kStepIsPrimary
1256 }//Step: kStepIdentified
1257 }//Full hybrid
0ab648ea 1258 else if(fProtonAnalysisBase->GetAnalysisMode() == AliProtonAnalysisBase::kGlobal) {
1259 gPt = track->Pt();
b8cca027 1260 //gP = track->P();
1261 gP = track->GetInnerParam()->P();
1262
4de4661f 1263 track->PropagateToDCA(vertex,
1264 esd->GetMagneticField(),
1265 100.,dca,cov);
71a67ee1 1266 dca3D = TMath::Sqrt(TMath::Power(dca[0],2) +
1267 TMath::Power(dca[1],2));
1268
bc554c73 1269 if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
30f87a5b 1270 if(fProtonAnalysisBase->IsAccepted(track)) {
4de4661f 1271 ((TH2F *)(fQA2DList->At(0)))->Fill(gP,track->GetTPCsignal());
bc554c73 1272 ((TH2F *)(fQA2DList->At(2)))->Fill(gP,TMath::Log(track->GetTPCsignal()/tpcResponse->GetExpectedSignal(gP,AliPID::kProton)));
ff672838 1273 ((TH3F *)(fQA2DList->At(4)))->Fill(track->Eta(),
4de4661f 1274 track->Phi()*180./TMath::Pi(),
1275 npointsTPCdEdx);
ff672838 1276 ((TH3F *)(fQA2DList->At(6)))->Fill(track->Eta(),
4de4661f 1277 track->Phi()*180./TMath::Pi(),
1278 nClustersTPC);
ff672838 1279 ((TH3F *)(fQA2DList->At(8)))->Fill(gPt,
4de4661f 1280 track->Phi()*180./TMath::Pi(),
1281 npointsTPCdEdx);
ff672838 1282 ((TH3F *)(fQA2DList->At(10)))->Fill(gPt,
4de4661f 1283 track->Phi()*180./TMath::Pi(),
1284 nClustersTPC);
f0e42d04 1285 if(track->Charge() > 0)
1286 ((TH2F *)(fQA2DList->At(20)))->Fill(gP,track->GetTPCsignal());
1287 if(track->Charge() < 0)
1288 ((TH2F *)(fQA2DList->At(21)))->Fill(gP,track->GetTPCsignal());
e56f08ed 1289 }//quality cuts
bc554c73 1290 }//primary cuts
4de4661f 1291
1292 if(fProtonAnalysisBase->IsProton(track)) {
1293 //Step: kStepIdentified
1294 if(fProtonAnalysisBase->GetEtaMode())
1295 containerInput[0] = track->Eta();
1296 else
1297 containerInput[0] = fProtonAnalysisBase->Rapidity(track->Px(),
1298 track->Py(),
1299 track->Pz());
1300 containerInput[1] = gPt;
1301 if(track->Charge() > 0) {
0ab648ea 1302 nIdentifiedProtons += 1;
4de4661f 1303 fProtonContainer->Fill(containerInput,kStepIdentified);
1304 }//protons
1305 else if(track->Charge() < 0) {
0ab648ea 1306 nIdentifiedAntiProtons += 1;
4de4661f 1307 fAntiProtonContainer->Fill(containerInput,kStepIdentified);
1308 }//protons
1309
1310 //Step: kStepIsPrimary
1311 if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
1312 if(track->Charge() > 0)
1313 fProtonContainer->Fill(containerInput,kStepIsPrimary);
1314 else if(track->Charge() < 0)
e56f08ed 1315 fAntiProtonContainer->Fill(containerInput,kStepIsPrimary);
4de4661f 1316
e0919e87 1317 //FillQA(esd,vertex,track);
4de4661f 1318
1319 //Step: kStepSurvived
30f87a5b 1320 if(fProtonAnalysisBase->IsAccepted(track)) {
bc554c73 1321 ((TH2F *)(fQA2DList->At(1)))->Fill(gP,track->GetTPCsignal());
1322 ((TH2F *)(fQA2DList->At(3)))->Fill(gP,TMath::Log(track->GetTPCsignal()/tpcResponse->GetExpectedSignal(gP,AliPID::kProton)));
ff672838 1323 ((TH3F *)(fQA2DList->At(5)))->Fill(track->Eta(),
e56f08ed 1324 track->Phi()*180./TMath::Pi(),
1325 npointsTPCdEdx);
ff672838 1326 ((TH3F *)(fQA2DList->At(7)))->Fill(track->Eta(),
e56f08ed 1327 track->Phi()*180./TMath::Pi(),
1328 nClustersTPC);
ff672838 1329 ((TH3F *)(fQA2DList->At(9)))->Fill(gPt,
e56f08ed 1330 track->Phi()*180./TMath::Pi(),
1331 npointsTPCdEdx);
ff672838 1332 ((TH3F *)(fQA2DList->At(11)))->Fill(gPt,
e56f08ed 1333 track->Phi()*180./TMath::Pi(),
bc554c73 1334 nClustersTPC);
e56f08ed 1335
4de4661f 1336 if(track->Charge() > 0) {
1337 fProtonContainer->Fill(containerInput,kStepSurvived);
bc554c73 1338 ((TH2F *)(fQA2DList->At(12)))->Fill(track->Eta(),
4de4661f 1339 track->Phi()*180./TMath::Pi());
7deb716b 1340 if(fProtonAnalysisBase->GetEtaMode()) {
1341 ((TH3F *)(fQA2DList->At(14)))->Fill(track->Eta(),
1342 track->Pt(),
3770a478 1343 dca[0]);
7deb716b 1344 ((TH3F *)(fQA2DList->At(15)))->Fill(track->Eta(),
1345 track->Pt(),
3770a478 1346 dca[1]);
7deb716b 1347 ((TH3F *)(fQA2DList->At(18)))->Fill(track->Eta(),
1348 track->Pt(),
1349 TMath::Abs(dca3D));
1350
1351 }
1352 else {
1353 ((TH3F *)(fQA2DList->At(14)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),track->Py(),track->Pz()),
1354 track->Pt(),
3770a478 1355 dca[0]);
7deb716b 1356 ((TH3F *)(fQA2DList->At(15)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),track->Py(),track->Pz()),
1357 track->Pt(),
3770a478 1358 dca[1]);
7deb716b 1359 ((TH3F *)(fQA2DList->At(18)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),track->Py(),track->Pz()),
1360 track->Pt(),
1361 TMath::Abs(dca3D));
bc554c73 1362 }
4de4661f 1363 }//protons
1364 else if(track->Charge() < 0) {
1365 fAntiProtonContainer->Fill(containerInput,kStepSurvived);
bc554c73 1366 ((TH2F *)(fQA2DList->At(13)))->Fill(track->Eta(),
4de4661f 1367 track->Phi()*180./TMath::Pi());
7deb716b 1368 if(fProtonAnalysisBase->GetEtaMode()) {
1369 ((TH3F *)(fQA2DList->At(16)))->Fill(track->Eta(),
1370 track->Pt(),
3770a478 1371 dca[0]);
7deb716b 1372 ((TH3F *)(fQA2DList->At(17)))->Fill(track->Eta(),
1373 track->Pt(),
3770a478 1374 dca[1]);
7deb716b 1375 ((TH3F *)(fQA2DList->At(19)))->Fill(track->Eta(),
1376 track->Pt(),
1377 TMath::Abs(dca3D));
1378 }
1379 else {
1380 ((TH3F *)(fQA2DList->At(16)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),track->Py(),track->Pz()),
1381 track->Pt(),
3770a478 1382 dca[0]);
7deb716b 1383 ((TH3F *)(fQA2DList->At(17)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),track->Py(),track->Pz()),
1384 track->Pt(),
3770a478 1385 dca[1]);
7deb716b 1386 ((TH3F *)(fQA2DList->At(19)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),track->Py(),track->Pz()),
1387 track->Pt(),
1388 TMath::Abs(dca3D));
bc554c73 1389 }
4de4661f 1390 }//antiprotons
1391
1392 //Step: kStepInPhaseSpace
1393 if(fProtonAnalysisBase->IsInPhaseSpace(track)) {
1394 if(track->Charge() > 0) {
1395 nSurvivedProtons += 1;
1396 fHistYPtProtons->Fill(containerInput[0],
1397 containerInput[1]);
1398 fProtonContainer->Fill(containerInput,kStepInPhaseSpace);
1399 }//protons
1400 else if(track->Charge() < 0) {
1401 nSurvivedAntiProtons += 1;
1402 fHistYPtAntiProtons->Fill(containerInput[0],
1403 containerInput[1]);
1404 fAntiProtonContainer->Fill(containerInput,kStepInPhaseSpace);
1405 }//antiprotons
1406 }//Step: kStepInPhaseSpace
1407 }//Step: kStepSurvived
1408 }//Step: kStepIsPrimary
1409 }//Step: kStepIdentified
1410 }//Global tracking
734d2c12 1411 }//track loop
0ab648ea 1412
bc554c73 1413 delete tpcResponse;
e0919e87 1414
f203beb9 1415 if((nIdentifiedProtons > 0)||(nIdentifiedAntiProtons > 0))
1416 fHistEvents->Fill(2); //number of analyzed events with at least one (anti)proton
1417
0ab648ea 1418 if(fProtonAnalysisBase->GetDebugMode())
1419 Printf("Initial number of tracks: %d | Identified (anti)protons: %d - %d | Survived (anti)protons: %d - %d",nTracks,nIdentifiedProtons,nIdentifiedAntiProtons,nSurvivedProtons,nSurvivedAntiProtons);
734d2c12 1420}
1421
ee4ca40d 1422//____________________________________________________________________//
9cd594db 1423void AliProtonAnalysis::Analyze(AliAODEvent* const fAOD) {
e4358d7f 1424 //Main analysis part - AOD
f203beb9 1425 fHistEvents->Fill(1); //number of analyzed events
0ab648ea 1426 Int_t nTracks = fAOD->GetNumberOfTracks();
1427 for(Int_t iTracks = 0; iTracks < nTracks; iTracks++) {
ee4ca40d 1428 AliAODTrack* track = fAOD->GetTrack(iTracks);
9cd594db 1429 Double_t gPt = track->Pt();
1430 Double_t gP = track->P();
ee4ca40d 1431
1432 //pid
1433 Double_t probability[10];
1434 track->GetPID(probability);
1435 Double_t rcc = 0.0;
0ab648ea 1436 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) rcc += probability[i]*fProtonAnalysisBase->GetParticleFraction(i,gP);
ee4ca40d 1437 if(rcc == 0.0) continue;
738619fd 1438 Double_t w[10];
0ab648ea 1439 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) w[i] = probability[i]*fProtonAnalysisBase->GetParticleFraction(i,gP)/rcc;
ee4ca40d 1440 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIESN,w);
1441 if(fParticleType == 4) {
251e4034 1442 if(track->Charge() > 0)
9cd594db 1443 fHistYPtProtons->Fill(track->Y(fParticleType),gPt);
251e4034 1444 else if(track->Charge() < 0)
9cd594db 1445 fHistYPtAntiProtons->Fill(track->Y(fParticleType),gPt);
ee4ca40d 1446 }//proton check
1447 }//track loop
1448}
1449
e4358d7f 1450//____________________________________________________________________//
9cd594db 1451void AliProtonAnalysis::Analyze(AliStack* const stack,
da8c4c1c 1452 Bool_t iInclusive) {
e4358d7f 1453 //Main analysis part - MC
f203beb9 1454 fHistEvents->Fill(1); //number of analyzed events
3e23254a 1455
1456 Int_t nParticles = 0;
1457 //inclusive protons -
1458 if(iInclusive) nParticles = stack->GetNtrack();
1459 else nParticles = stack->GetNprimary();
1460
1461 for(Int_t i = 0; i < nParticles; i++) {
e4358d7f 1462 TParticle *particle = stack->Particle(i);
55f9a666 1463 if(!particle) continue;
537afcc3 1464
da8c4c1c 1465 //in case of inclusive protons reject the secondaries from hadronic inter.
1466 if(particle->GetUniqueID() == 13) continue;
1467
537afcc3 1468 if(TMath::Abs(particle->Eta()) > 1.0) continue;
1469 if((particle->Pt() > fMaxPt)||(particle->Pt() < fMinPt)) continue;
0ab648ea 1470 if((fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()) > fMaxY)||(fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()) < fMinY)) continue;
537afcc3 1471
e4358d7f 1472 Int_t pdgcode = particle->GetPdgCode();
0ab648ea 1473 if(pdgcode == 2212) fHistYPtProtons->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
1474 particle->Py(),
1475 particle->Pz()),
e4358d7f 1476 particle->Pt());
0ab648ea 1477 if(pdgcode == -2212) fHistYPtAntiProtons->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
1478 particle->Py(),
1479 particle->Pz()),
e4358d7f 1480 particle->Pt());
251e4034 1481 }//particle loop
e4358d7f 1482}
1483
3f6d0c08 1484//____________________________________________________________________//
1485Bool_t AliProtonAnalysis::PrintMean(TH1 *hist, Double_t edge) {
1486 //calculates the mean value of the ratio/asymmetry within \pm edge
336ea0ff 1487 Double_t sum = 0.0, sumError = 0.0;
3f6d0c08 1488 Int_t nentries = 0;
1489 //calculate the mean
336ea0ff 1490 for(Int_t i = 1; i <= hist->GetXaxis()->GetNbins(); i++) {
1491 Double_t x = hist->GetBinCenter(i);
1492 Double_t y = hist->GetBinContent(i);
3f6d0c08 1493 if(TMath::Abs(x) < edge) {
1494 sum += y;
336ea0ff 1495 sumError += TMath::Power(hist->GetBinError(i),2);
3f6d0c08 1496 nentries += 1;
1497 }
a3bc43fb 1498 //Printf("eta: %lf - sum: %lf - sumError: %lf - counter: %d",
1499 //TMath::Abs(x),sum,sumError,nentries);
3f6d0c08 1500 }
1501 Double_t mean = 0.0;
336ea0ff 1502 Double_t error = 0.0;
1503 if(nentries != 0) {
3f6d0c08 1504 mean = sum/nentries;
336ea0ff 1505 error = TMath::Sqrt(sumError)/nentries;
1506 }
3f6d0c08 1507
1508 //calculate the error
336ea0ff 1509 /*for(Int_t i = 1; i <= hist->GetXaxis()->GetNbins(); i++) {
1510 Double_t x = hist->GetBinCenter(i);
1511 Double_t y = hist->GetBinContent(i);
3f6d0c08 1512 if(TMath::Abs(x) < edge) {
1513 sum += TMath::Power((mean - y),2);
1514 nentries += 1;
1515 }
336ea0ff 1516 }*/
3f6d0c08 1517
3f6d0c08 1518
1519 cout<<"========================================="<<endl;
1520 cout<<"Input distribution: "<<hist->GetName()<<endl;
1521 cout<<"Interval used: -"<<edge<<" -> "<<edge<<endl;
1522 cout<<"Mean value :"<<mean<<endl;
1523 cout<<"Error: "<<error<<endl;
1524 cout<<"========================================="<<endl;
1525
1526 return 0;
1527}
1528
1529//____________________________________________________________________//
1530Bool_t AliProtonAnalysis::PrintYields(TH1 *hist, Double_t edge) {
1531 //calculates the (anti)proton yields within the \pm edge
1532 Double_t sum = 0.0, sumerror = 0.0;
1533 Double_t error = 0.0;
1534 for(Int_t i = 0; i < hist->GetXaxis()->GetNbins(); i++) {
1535 Double_t x = hist->GetBinCenter(i+1);
1536 Double_t y = hist->GetBinContent(i+1);
1537 if(TMath::Abs(x) < edge) {
1538 sum += y;
1539 sumerror += TMath::Power(hist->GetBinError(i+1),2);
1540 }
1541 }
1542
1543 error = TMath::Sqrt(sumerror);
1544
1545 cout<<"========================================="<<endl;
1546 cout<<"Input distribution: "<<hist->GetName()<<endl;
1547 cout<<"Interval used: -"<<edge<<" -> "<<edge<<endl;
1548 cout<<"Yields :"<<sum<<endl;
1549 cout<<"Error: "<<error<<endl;
1550 cout<<"========================================="<<endl;
1551
1552 return 0;
1553}
1554
437dd627 1555//____________________________________________________________________//
1556void AliProtonAnalysis::SetCorrectionMapForCuts(const char* filename) {
1557 //Reads the file with the correction maps for the cut efficiency
1558 TFile *gCorrectionForCuts = TFile::Open(filename);
1559 if(!gCorrectionForCuts) {
1560 Printf("The TFile object is not valid!!!");
1561 return;
1562 }
1563 if(!gCorrectionForCuts->IsOpen()) {
1564 Printf("The file is not found!!!");
1565 return;
1566 }
1567 fHistYPtCorrectionForCutsProtons = dynamic_cast<TH2D *>(gCorrectionForCuts->Get("gHistCorrectionForCutsProtons"));
1568 fHistYPtCorrectionForCutsAntiProtons = dynamic_cast<TH2D *>(gCorrectionForCuts->Get("gHistCorrectionForCutsAntiProtons"));
1569 fCorrectForCutsFlag = kTRUE;
1570}
1571
207a5280 1572//____________________________________________________________________//
1573void AliProtonAnalysis::SetCorrectionMapForTracking(const char* filename) {
1574 //Reads the file with the correction maps for the tracking efficiency
1575 TFile *gCorrectionForTracking = TFile::Open(filename);
1576 if(!gCorrectionForTracking) {
1577 Printf("The TFile object is not valid!!!");
1578 return;
1579 }
1580 if(!gCorrectionForTracking->IsOpen()) {
1581 Printf("The file is not found!!!");
1582 return;
1583 }
1584 fHistYPtCorrectionForTrackingProtons = dynamic_cast<TH2D *>(gCorrectionForTracking->Get("gHistCorrectionForTrackingProtons"));
1585 fHistYPtCorrectionForTrackingAntiProtons = dynamic_cast<TH2D *>(gCorrectionForTracking->Get("gHistCorrectionForTrackingAntiProtons"));
1586 fCorrectForTrackingFlag = kTRUE;
1587}
1588
437dd627 1589//____________________________________________________________________//
1590void AliProtonAnalysis::SetCorrectionMapForFeedDown(const char* filename) {
1591 //Reads the file with the correction maps for the feed-down contamination
1592 TFile *gCorrectionForFeedDown = TFile::Open(filename);
1593 if(!gCorrectionForFeedDown) {
1594 Printf("The TFile object is not valid!!!");
1595 return;
1596 }
1597 if(!gCorrectionForFeedDown->IsOpen()) {
1598 Printf("The file is not found!!!");
1599 return;
1600 }
1601 fHistYPtCorrectionForFeedDownProtons = dynamic_cast<TH2D *>(gCorrectionForFeedDown->Get("gHistCorrectionForFeedDownProtons"));
1602 fHistYPtCorrectionForFeedDownAntiProtons = dynamic_cast<TH2D *>(gCorrectionForFeedDown->Get("gHistCorrectionForFeedDownAntiProtons"));
1603 fCorrectForFeedDownFlag = kTRUE;
1604}
1605
2c60f603 1606//____________________________________________________________________//
1607void AliProtonAnalysis::SetCorrectionMapForSecondaries(const char* filename) {
1608 //Reads the file with the correction maps for the secondaries
1609 TFile *gCorrectionForSecondaries = TFile::Open(filename);
1610 if(!gCorrectionForSecondaries) {
1611 Printf("The TFile object is not valid!!!");
1612 return;
1613 }
1614 if(!gCorrectionForSecondaries->IsOpen()) {
1615 Printf("The file is not found!!!");
1616 return;
1617 }
1618
1619 fHistYPtCorrectionForSecondaries = dynamic_cast<TH2D *>(gCorrectionForSecondaries->Get("gHistCorrectionForSecondaries"));
1620 fCorrectForSecondariesFlag = kTRUE;
1621}
1622
7deb716b 1623//____________________________________________________________________//
1624void AliProtonAnalysis::SetCorrectionMapForCrossSection(const char* filename) {
1625 //Reads the file with the correction maps for the proper x-section
1626 TFile *gCorrectionForXSection = TFile::Open(filename);
1627 if(!gCorrectionForXSection) {
1628 Printf("The TFile object is not valid!!!");
1629 return;
1630 }
1631 if(!gCorrectionForXSection->IsOpen()) {
1632 Printf("The file is not found!!!");
1633 return;
1634 }
1635
1636 fHistCorrectionForCrossSectionYPtProtons = dynamic_cast<TH2D *>(gCorrectionForXSection->Get("gHistCorrectionForCrossSectionProtons"));
1637 fHistCorrectionForCrossSectionYPtAntiProtons = dynamic_cast<TH2D *>(gCorrectionForXSection->Get("gHistCorrectionForCrossSectionAntiProtons"));
1638 fHistCorrectionForCrossSectionFlag = kTRUE;
1639}
1640
336ea0ff 1641//____________________________________________________________________//
1642void AliProtonAnalysis::Correct() {
a3bc43fb 1643 //Apply the corrections: Fast & dirty way for the absorption corrections
2c60f603 1644 //Correct the protons for the efficiency
71a67ee1 1645 fHistYPtProtonsCorrected = fProtonContainer->ShowProjection(0,1,kStepInPhaseSpace);
1646 fHistYPtProtonsCorrected->Divide(fHistEfficiencyYPtProtons);
7deb716b 1647 //Correct the protons for proper cross-section
1648 if(fHistCorrectionForCrossSectionFlag)
2f7be6f2 1649 fHistYPtProtonsCorrected->Multiply(fHistCorrectionForCrossSectionYPtProtons);
7deb716b 1650 //Correct the protons for secondaries
2c60f603 1651 if(fCorrectForSecondariesFlag)
1652 fHistYPtProtonsCorrected->Divide(fHistYPtCorrectionForSecondaries);
437dd627 1653 //Correct the protons for feed-down
1654 if(fCorrectForFeedDownFlag)
1655 fHistYPtProtonsCorrected->Divide(fHistYPtCorrectionForFeedDownProtons);
1656 //Correct the protons for the cut efficiency
1657 if(fCorrectForCutsFlag)
1658 fHistYPtProtonsCorrected->Multiply(fHistYPtCorrectionForCutsProtons);
207a5280 1659 //Correct the protons for the tracking efficiency
1660 if(fCorrectForTrackingFlag)
1661 fHistYPtProtonsCorrected->Multiply(fHistYPtCorrectionForTrackingProtons);
437dd627 1662
2c60f603 1663 //Correct the antiprotons for the efficiency
71a67ee1 1664 fHistYPtAntiProtonsCorrected = fAntiProtonContainer->ShowProjection(0,1,kStepInPhaseSpace);
1665 fHistYPtAntiProtonsCorrected->Divide(fHistEfficiencyYPtAntiProtons);
7deb716b 1666 //Correct the antiprotons for proper cross-section
1667 if(fHistCorrectionForCrossSectionFlag)
2f7be6f2 1668 fHistYPtAntiProtonsCorrected->Multiply(fHistCorrectionForCrossSectionYPtAntiProtons);
437dd627 1669 //Correct the antiprotons for feed-down
1670 if(fCorrectForFeedDownFlag)
1671 fHistYPtAntiProtonsCorrected->Divide(fHistYPtCorrectionForFeedDownAntiProtons);
1672 //Correct the antiprotons for the cut efficiency
1673 if(fCorrectForCutsFlag)
1674 fHistYPtAntiProtonsCorrected->Multiply(fHistYPtCorrectionForCutsAntiProtons);
207a5280 1675 //Correct the antiprotons for the tracking efficiency
1676 if(fCorrectForTrackingFlag)
1677 fHistYPtAntiProtonsCorrected->Multiply(fHistYPtCorrectionForTrackingAntiProtons);
336ea0ff 1678}
1679
251e4034 1680//____________________________________________________________________//
1681void AliProtonAnalysis::Correct(Int_t step) {
1682 //Applies the correction maps to the initial containers
1683 fCorrectProtons = new AliCFDataGrid("correctProtons",
1684 "corrected data",
1685 *fProtonContainer);
0ab648ea 1686 fCorrectProtons->SetMeasured(0);
251e4034 1687 fCorrectProtons->ApplyEffCorrection(*(AliCFEffGrid *)fEffGridListProtons->At(step));
1688
1689 fCorrectAntiProtons = new AliCFDataGrid("correctAntiProtons",
1690 "corrected data",
1691 *fAntiProtonContainer);
0ab648ea 1692 fCorrectAntiProtons->SetMeasured(0);
251e4034 1693 fCorrectAntiProtons->ApplyEffCorrection(*(AliCFEffGrid *)fEffGridListAntiProtons->At(step));
1694}
1695
39f2a708 1696//____________________________________________________________________//
1697Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
1698 // Reads the outout of the correction framework task
1699 // Creates the correction maps
1700 // Puts the results in the different TList objects
1701 Bool_t status = kTRUE;
1702
336ea0ff 1703 TFile *file = TFile::Open(filename);
1704 if(!file) {
1705 cout<<"Could not find the input CORRFW file "<<filename<<endl;
1706 status = kFALSE;
1707 }
1708 TList *list = dynamic_cast<TList *>(file->Get("outputList"));
1709 Int_t iRap = 0, iPt = 1;
1710
1711 //Calculation of efficiency/correction: Protons
1712 AliCFContainer *gProtonContainer = dynamic_cast<AliCFContainer *>(list->At(0));
1713 AliCFEffGrid *effProtonsStep0Step2 = new AliCFEffGrid("eff20",
1714 "effProtonsStep0Step2",
1715 *gProtonContainer);
1716 effProtonsStep0Step2->CalculateEfficiency(2,0);
1717 fHistEfficiencyYPtProtons = effProtonsStep0Step2->Project(iRap,iPt);
1718 fHistEfficiencyYPtProtons->Sumw2();
1719
1720 //Calculation of efficiency/correction: Protons
1721 AliCFContainer *gAntiProtonContainer = dynamic_cast<AliCFContainer *>(list->At(1));
1722 AliCFEffGrid *effAntiProtonsStep0Step2 = new AliCFEffGrid("eff20",
1723 "effAntiProtonsStep0Step2",
1724 *gAntiProtonContainer);
1725 effAntiProtonsStep0Step2->CalculateEfficiency(2,0);
1726 fHistEfficiencyYPtAntiProtons = effAntiProtonsStep0Step2->Project(iRap,iPt);
1727 fHistEfficiencyYPtAntiProtons->Sumw2();
1728
1729 Correct();
1730
1731 return status;
1732}
1733
1734//____________________________________________________________________//
1735/*Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
1736 // Reads the outout of the correction framework task
1737 // Creates the correction maps
1738 // Puts the results in the different TList objects
1739 Bool_t status = kTRUE;
1740
39f2a708 1741 TFile *file = TFile::Open(filename);
1742 if(!file) {
1743 cout<<"Could not find the input CORRFW file "<<filename<<endl;
1744 status = kFALSE;
1745 }
1746
cdb3530f 1747 //________________________________________//
1748 //Protons
251e4034 1749 fEffGridListProtons = new TList();
cdb3530f 1750 fCorrectionListProtons2D = new TList();
1751 fEfficiencyListProtons1D = new TList();
1752 fCorrectionListProtons1D = new TList();
1753
1754 AliCFContainer *corrfwContainerProtons = (AliCFContainer*) (file->Get("containerProtons"));
1755 if(!corrfwContainerProtons) {
1756 cout<<"CORRFW container for protons not found!"<<endl;
39f2a708 1757 status = kFALSE;
1758 }
1759
cdb3530f 1760 Int_t nSteps = corrfwContainerProtons->GetNStep();
39f2a708 1761 TH2D *gYPt[4];
1762 //currently the GRID is formed by the y-pT parameters
1763 //Add Vz as a next step
1764 Int_t iRap = 0, iPt = 1;
9b168f47 1765 AliCFEffGrid *effProtonsStep0Step1 = new AliCFEffGrid("eff10",
1766 "effProtonsStep0Step1",
1767 *corrfwContainerProtons);
1768 effProtonsStep0Step1->CalculateEfficiency(1,0); //eff= step1/step0
251e4034 1769 fEffGridListProtons->Add(effProtonsStep0Step1);
9b168f47 1770 gYPt[0] = effProtonsStep0Step1->Project(iRap,iPt);
1771 fCorrectionListProtons2D->Add(gYPt[0]);
1772
1773 AliCFEffGrid *effProtonsStep0Step2 = new AliCFEffGrid("eff20",
1774 "effProtonsStep0Step2",
1775 *corrfwContainerProtons);
1776 effProtonsStep0Step2->CalculateEfficiency(2,0); //eff= step2/step0
251e4034 1777 fEffGridListProtons->Add(effProtonsStep0Step2);
9b168f47 1778 gYPt[1] = effProtonsStep0Step2->Project(iRap,iPt);
1779 fCorrectionListProtons2D->Add(gYPt[1]);
1780
1781 AliCFEffGrid *effProtonsStep0Step3 = new AliCFEffGrid("eff30",
1782 "effProtonsStep0Step3",
1783 *corrfwContainerProtons);
1784 effProtonsStep0Step3->CalculateEfficiency(3,0); //eff= step1/step0
251e4034 1785 fEffGridListProtons->Add(effProtonsStep0Step3);
9b168f47 1786 gYPt[2] = effProtonsStep0Step3->Project(iRap,iPt);
1787 fCorrectionListProtons2D->Add(gYPt[2]);
1788
1789 TH1D *gEfficiency[2][3]; //efficiency as a function of pT and of y (raws-[2])
1790 TH1D *gCorrection[2][3]; //efficiency as a function of pT and of y (raws-[2])
9b4aee57 1791 TString gTitle;
cdb3530f 1792 //Get the projection of the efficiency maps
9b168f47 1793 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1794 gEfficiency[iParameter][0] = effProtonsStep0Step1->Project(iParameter);
1795 gTitle = "ProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1796 gTitle += "_Step0_Step1";
1797 gEfficiency[iParameter][0]->SetName(gTitle.Data());
1798 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][0]);
1799 gTitle = "ProtonsCorrection_Parameter"; gTitle += iParameter+1;
1800 gTitle += "_Step0_Step1";
1801 gCorrection[iParameter][0] = new TH1D(gTitle.Data(),
1802 gTitle.Data(),
1803 gEfficiency[iParameter][0]->GetNbinsX(),
1804 gEfficiency[iParameter][0]->GetXaxis()->GetXmin(),
1805 gEfficiency[iParameter][0]->GetXaxis()->GetXmax());
1806 //initialisation of the correction
1807 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][0]->GetNbinsX(); iBin++)
1808 gCorrection[iParameter][0]->SetBinContent(iBin,1.0);
1809
1810 gEfficiency[iParameter][1] = effProtonsStep0Step2->Project(iParameter);
1811 gTitle = "ProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1812 gTitle += "_Step0_Step2";
1813 gEfficiency[iParameter][1]->SetName(gTitle.Data());
1814 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][1]);
1815 gTitle = "ProtonsCorrection_Parameter"; gTitle += iParameter+1;
1816 gTitle += "_Step0_Step2";
1817 gCorrection[iParameter][1] = new TH1D(gTitle.Data(),
1818 gTitle.Data(),
1819 gEfficiency[iParameter][1]->GetNbinsX(),
1820 gEfficiency[iParameter][1]->GetXaxis()->GetXmin(),
1821 gEfficiency[iParameter][1]->GetXaxis()->GetXmax());
1822 //initialisation of the correction
1823 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][1]->GetNbinsX(); iBin++)
1824 gCorrection[iParameter][1]->SetBinContent(iBin,1.0);
1825
1826 gEfficiency[iParameter][2] = effProtonsStep0Step3->Project(iParameter);
1827 gTitle = "ProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1828 gTitle += "_Step0_Step3";
1829 gEfficiency[iParameter][2]->SetName(gTitle.Data());
1830 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][2]);
1831 gTitle = "ProtonsCorrection_Parameter"; gTitle += iParameter+1;
1832 gTitle += "_Step0_Step3";
1833 gCorrection[iParameter][2] = new TH1D(gTitle.Data(),
1834 gTitle.Data(),
1835 gEfficiency[iParameter][2]->GetNbinsX(),
1836 gEfficiency[iParameter][2]->GetXaxis()->GetXmin(),
1837 gEfficiency[iParameter][2]->GetXaxis()->GetXmax());
1838 //initialisation of the correction
1839 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][2]->GetNbinsX(); iBin++)
1840 gCorrection[iParameter][2]->SetBinContent(iBin,1.0);
cdb3530f 1841 }//parameter loop
1842 //Calculate the 1D correction parameters as a function of y and pT
1843 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1844 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1845 gCorrection[iParameter][iStep-1]->Divide(gEfficiency[iParameter][iStep-1]);
1846 fCorrectionListProtons1D->Add(gCorrection[iParameter][iStep-1]);
1847 }
1848 }
1849
1850 //________________________________________//
1851 //AntiProtons
251e4034 1852 fEffGridListAntiProtons = new TList();
cdb3530f 1853 fCorrectionListAntiProtons2D = new TList();
1854 fEfficiencyListAntiProtons1D = new TList();
1855 fCorrectionListAntiProtons1D = new TList();
1856
1857 AliCFContainer *corrfwContainerAntiProtons = (AliCFContainer*) (file->Get("containerAntiProtons"));
1858 if(!corrfwContainerAntiProtons) {
1859 cout<<"CORRFW container for antiprotons not found!"<<endl;
1860 status = kFALSE;
1861 }
1862
1863 nSteps = corrfwContainerAntiProtons->GetNStep();
1864 //currently the GRID is formed by the y-pT parameters
1865 //Add Vz as a next step
9b168f47 1866 AliCFEffGrid *effAntiProtonsStep0Step1 = new AliCFEffGrid("eff10",
1867 "effAntiProtonsStep0Step1",
1868 *corrfwContainerAntiProtons);
1869 effAntiProtonsStep0Step1->CalculateEfficiency(1,0); //eff= step1/step0
251e4034 1870 fEffGridListAntiProtons->Add(effAntiProtonsStep0Step1);
9b168f47 1871 gYPt[0] = effAntiProtonsStep0Step1->Project(iRap,iPt);
1872 fCorrectionListAntiProtons2D->Add(gYPt[0]);
1873
1874 AliCFEffGrid *effAntiProtonsStep0Step2 = new AliCFEffGrid("eff20",
1875 "effAntiProtonsStep0Step2",
1876 *corrfwContainerAntiProtons);
1877 effAntiProtonsStep0Step2->CalculateEfficiency(2,0); //eff= step2/step0
251e4034 1878 fEffGridListAntiProtons->Add(effAntiProtonsStep0Step2);
9b168f47 1879 gYPt[1] = effAntiProtonsStep0Step2->Project(iRap,iPt);
1880 fCorrectionListAntiProtons2D->Add(gYPt[1]);
1881
1882 AliCFEffGrid *effAntiProtonsStep0Step3 = new AliCFEffGrid("eff30",
1883 "effAntiProtonsStep0Step3",
1884 *corrfwContainerAntiProtons);
1885 effAntiProtonsStep0Step3->CalculateEfficiency(3,0); //eff= step1/step0
251e4034 1886 fEffGridListAntiProtons->Add(effAntiProtonsStep0Step3);
9b168f47 1887 gYPt[2] = effAntiProtonsStep0Step3->Project(iRap,iPt);
1888 fCorrectionListAntiProtons2D->Add(gYPt[2]);
cdb3530f 1889
39f2a708 1890 //Get the projection of the efficiency maps
9b168f47 1891 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1892 gEfficiency[iParameter][0] = effAntiProtonsStep0Step1->Project(iParameter);
1893 gTitle = "AntiProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1894 gTitle += "_Step0_Step1";
1895 gEfficiency[iParameter][0]->SetName(gTitle.Data());
1896 fEfficiencyListAntiProtons1D->Add(gEfficiency[iParameter][0]);
1897 gTitle = "AntiProtonsCorrection_Parameter"; gTitle += iParameter+1;
1898 gTitle += "_Step0_Step1";
1899 gCorrection[iParameter][0] = new TH1D(gTitle.Data(),
1900 gTitle.Data(),
1901 gEfficiency[iParameter][0]->GetNbinsX(),
1902 gEfficiency[iParameter][0]->GetXaxis()->GetXmin(),
1903 gEfficiency[iParameter][0]->GetXaxis()->GetXmax());
1904 //initialisation of the correction
1905 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][0]->GetNbinsX(); iBin++)
1906 gCorrection[iParameter][0]->SetBinContent(iBin,1.0);
1907
1908 gEfficiency[iParameter][1] = effAntiProtonsStep0Step2->Project(iParameter);
1909 gTitle = "AntiProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1910 gTitle += "_Step0_Step2";
1911 gEfficiency[iParameter][1]->SetName(gTitle.Data());
1912 fEfficiencyListAntiProtons1D->Add(gEfficiency[iParameter][1]);
1913 gTitle = "AntiProtonsCorrection_Parameter"; gTitle += iParameter+1;
1914 gTitle += "_Step0_Step2";
1915 gCorrection[iParameter][1] = new TH1D(gTitle.Data(),
1916 gTitle.Data(),
1917 gEfficiency[iParameter][1]->GetNbinsX(),
1918 gEfficiency[iParameter][1]->GetXaxis()->GetXmin(),
1919 gEfficiency[iParameter][1]->GetXaxis()->GetXmax());
1920 //initialisation of the correction
1921 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][1]->GetNbinsX(); iBin++)
1922 gCorrection[iParameter][1]->SetBinContent(iBin,1.0);
1923
1924 gEfficiency[iParameter][2] = effAntiProtonsStep0Step3->Project(iParameter);
1925 gTitle = "AntiProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1926 gTitle += "_Step0_Step3";
1927 gEfficiency[iParameter][2]->SetName(gTitle.Data());
1928 fEfficiencyListAntiProtons1D->Add(gEfficiency[iParameter][2]);
1929 gTitle = "AntiProtonsCorrection_Parameter"; gTitle += iParameter+1;
1930 gTitle += "_Step0_Step3";
1931 gCorrection[iParameter][2] = new TH1D(gTitle.Data(),
1932 gTitle.Data(),
1933 gEfficiency[iParameter][2]->GetNbinsX(),
1934 gEfficiency[iParameter][2]->GetXaxis()->GetXmin(),
1935 gEfficiency[iParameter][2]->GetXaxis()->GetXmax());
1936 //initialisation of the correction
1937 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][2]->GetNbinsX(); iBin++)
1938 gCorrection[iParameter][2]->SetBinContent(iBin,1.0);
39f2a708 1939 }//parameter loop
1940 //Calculate the 1D correction parameters as a function of y and pT
1941 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1942 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1943 gCorrection[iParameter][iStep-1]->Divide(gEfficiency[iParameter][iStep-1]);
cdb3530f 1944 fCorrectionListAntiProtons1D->Add(gCorrection[iParameter][iStep-1]);
39f2a708 1945 }
1946 }
ef1a8dbd 1947
1948 return status;
336ea0ff 1949 }*/
24421eb6 1950
735cc63d 1951//____________________________________________________________________//
1952void AliProtonAnalysis::InitQA() {
1953 //Applies the correction maps to the initial containers
1954 fInitQAFlag = kTRUE;
e0919e87 1955 /*fGlobalQAList = new TList();
735cc63d 1956 fGlobalQAList->SetName("fGlobalQAList");
1957
1958 //========================================================//
1959 fQA2DList = new TList();
1960 fQA2DList->SetName("fQA2DList");
1961 fGlobalQAList->Add(fQA2DList);
37cb8683 1962
790140ac 1963 //dEdx plots
37cb8683 1964 TH2F *gHistdEdxP = new TH2F("gHistdEdxP","dE/dx (TPC); P [GeV/c]; dE/dx [a.u]",1000,0.05,20.05,600,0,600);
790140ac 1965 fQA2DList->Add(gHistdEdxP);
37cb8683 1966 TH2F *gHistProtonsdEdxP = new TH2F("gHistProtonsdEdxP","Accepted protons dE/dx (TPC); P [GeV/c]; dE/dx [a.u]",1000,0.05,20.05,600,0,600);
790140ac 1967 fQA2DList->Add(gHistProtonsdEdxP);
37cb8683 1968
ff672838 1969 //normalized dEdx plots
1970 TH2F *gHistZP = new TH2F("gHistZP","Normalized dE/dx (TPC); P [GeV/c]; ln[(dE/dx)_{exp.}/(dE/dx)_{BB}] ",1000,0.05,20.05,100,-2.0,2.0);
1971 fQA2DList->Add(gHistZP);
1972 TH2F *gHistProtonsZP = new TH2F("gHistProtonsZP","Normalized dE/dx (TPC); P [GeV/c]; ln[(dE/dx)_{exp.}/(dE/dx)_{BB}] ",1000,0.05,20.05,100,-2.0,2.0);
1973 fQA2DList->Add(gHistProtonsZP);
1974
37cb8683 1975 //eta-phi-Npoints(dEdx)
1976 TH3F *gHistEtaPhiTPCdEdxNPoints = new TH3F("gHistEtaPhiTPCdEdxNPoints",
1977 ";#eta;#phi;N_{points}(TPC)",
e56f08ed 1978 18,-0.9,0.9,
1979 180,0,360,
37cb8683 1980 100,0,200);
1981 gHistEtaPhiTPCdEdxNPoints->SetStats(kTRUE);
1982 fQA2DList->Add(gHistEtaPhiTPCdEdxNPoints);
1983 TH3F *gHistProtonsEtaPhiTPCdEdxNPoints = new TH3F("gHistProtonsEtaPhiTPCdEdxNPoints",
1984 ";#eta;#phi;N_{points}(TPC)",
e56f08ed 1985 18,-0.9,0.9,
1986 180,0,360,
37cb8683 1987 100,0,200);
1988 gHistProtonsEtaPhiTPCdEdxNPoints->SetStats(kTRUE);
1989 fQA2DList->Add(gHistProtonsEtaPhiTPCdEdxNPoints);
1990
1991 //eta-phi-Npoints
1992 TH3F *gHistEtaPhiTPCNPoints = new TH3F("gHistEtaPhiTPCNPoints",
1993 ";#eta;#phi;N_{points}(TPC)",
e56f08ed 1994 18,-0.9,0.9,
1995 180,0,360,
37cb8683 1996 100,0,200);
1997 gHistEtaPhiTPCNPoints->SetStats(kTRUE);
1998 fQA2DList->Add(gHistEtaPhiTPCNPoints);
1999 TH3F *gHistProtonsEtaPhiTPCNPoints = new TH3F("gHistProtonsEtaPhiTPCNPoints",
2000 ";#eta;#phi;N_{points}(TPC)",
e56f08ed 2001 18,-0.9,0.9,
2002 180,0,360,
37cb8683 2003 100,0,200);
2004 gHistProtonsEtaPhiTPCNPoints->SetStats(kTRUE);
2005 fQA2DList->Add(gHistProtonsEtaPhiTPCNPoints);
2006
2007 //pt-phi-Npoints(dEdx)
2008 TH3F *gHistPtPhiTPCdEdxNPoints = new TH3F("gHistPtPhiTPCdEdxNPoints",
2009 ";P_{T} [GeV/c];#phi;N_{points}(TPC)",
2010 fNBinsPt,fMinPt,fMaxPt,
e56f08ed 2011 180,0,360,
37cb8683 2012 100,0,200);
2013 gHistPtPhiTPCdEdxNPoints->SetStats(kTRUE);
2014 fQA2DList->Add(gHistPtPhiTPCdEdxNPoints);
2015 TH3F *gHistProtonsPtPhiTPCdEdxNPoints = new TH3F("gHistProtonsPtPhiTPCdEdxNPoints",
2016 ";P_{T} [GeV/c];#phi;N_{points}(TPC)",
2017 fNBinsPt,fMinPt,fMaxPt,
e56f08ed 2018 180,0,360,
37cb8683 2019 100,0,200);
2020 gHistProtonsPtPhiTPCdEdxNPoints->SetStats(kTRUE);
2021 fQA2DList->Add(gHistProtonsPtPhiTPCdEdxNPoints);
2022
2023 //pt-phi-Npoints
2024 TH3F *gHistPtPhiTPCNPoints = new TH3F("gHistPtPhiTPCNPoints",
2025 ";P_{T} [GeV/c];#phi;N_{points}(TPC)",
2026 fNBinsPt,fMinPt,fMaxPt,
e56f08ed 2027 180,0,360,
37cb8683 2028 100,0,200);
2029 gHistPtPhiTPCNPoints->SetStats(kTRUE);
2030 fQA2DList->Add(gHistPtPhiTPCNPoints);
2031 TH3F *gHistProtonsPtPhiTPCNPoints = new TH3F("gHistProtonsPtPhiTPCNPoints",
2032 ";P_{T} [GeV/c];#phi;N_{points}(TPC)",
2033 fNBinsPt,fMinPt,fMaxPt,
e56f08ed 2034 180,0,360,
37cb8683 2035 100,0,200);
2036 gHistProtonsPtPhiTPCNPoints->SetStats(kTRUE);
2037 fQA2DList->Add(gHistProtonsPtPhiTPCNPoints);
2038
e56f08ed 2039 //eta-phi for protons & antiprotons
2040 TH2F *gHistProtonsEtaPhi = new TH2F("gHistProtonsEtaPhi",
2041 ";#eta;#phi",
2042 18,-0.9,0.9,
2043 180,0,360);
2044 gHistProtonsEtaPhi->SetStats(kTRUE);
2045 fQA2DList->Add(gHistProtonsEtaPhi);
2046 TH2F *gHistAntiProtonsEtaPhi = new TH2F("gHistAntiProtonsEtaPhi",
2047 ";#eta;#phi",
2048 18,-0.9,0.9,
2049 180,0,360);
2050 gHistAntiProtonsEtaPhi->SetStats(kTRUE);
2051 fQA2DList->Add(gHistAntiProtonsEtaPhi);
2052
f0e42d04 2053 const Int_t nBinsdca = 1000;
437dd627 2054 Double_t dcaBins[nBinsdca+1];
f0e42d04 2055 Double_t dcamin = -5., dcamax = 5.;
2056 Double_t dca = -5.;
437dd627 2057 Double_t dcaStepSmall = 0.01;
2058 Int_t iCounter = 0;
f0e42d04 2059 while(dca <= 5.) {
437dd627 2060 dcaBins[iCounter] = dcamin;
2061 dcamax = dcamin + dcaStepSmall;
2062 dca = dcamax;
2063 dcamin = dcamax;
2064 iCounter += 1;
2065 }
f0e42d04 2066
437dd627 2067 const Int_t nBinsY = 9;
2068 const Int_t nBinsPt = 6;
2069 Double_t gY[nBinsY+1] = {-0.9,-0.7,-0.5,-0.3,-0.1,0.1,0.3,0.5,0.7,0.9};
2070 Double_t gPt[nBinsPt+1] = {0.45,0.55,0.65,0.75,0.85,0.95,1.05};
2071
4de4661f 2072 //dca vs pT for protons & antiprotons
3322c804 2073 TH3F *gHistProtonsDCAxyEtaPt = new TH3F("gHistProtonsDCAxyEtaPt",
2074 ";P_{T} [GeV/c];dca_{xy} [cm]",
437dd627 2075 nBinsY,gY,nBinsPt,gPt,
2076 nBinsdca,dcaBins);
3322c804 2077 if(fProtonAnalysisBase->GetEtaMode())
2078 gHistProtonsDCAxyEtaPt->GetXaxis()->SetTitle("#eta");
2079 else
2080 gHistProtonsDCAxyEtaPt->GetXaxis()->SetTitle("y");
2081 gHistProtonsDCAxyEtaPt->SetStats(kTRUE);
2082 fQA2DList->Add(gHistProtonsDCAxyEtaPt);
2083 TH3F *gHistProtonsDCAzEtaPt = new TH3F("gHistProtonsDCAzEtaPt",
2084 ";P_{T} [GeV/c];dca_{z} [cm]",
437dd627 2085 nBinsY,gY,nBinsPt,gPt,
2086 nBinsdca,dcaBins);
3322c804 2087 if(fProtonAnalysisBase->GetEtaMode())
2088 gHistProtonsDCAzEtaPt->GetXaxis()->SetTitle("#eta");
2089 else
2090 gHistProtonsDCAzEtaPt->GetXaxis()->SetTitle("y");
2091 gHistProtonsDCAzEtaPt->SetStats(kTRUE);
2092 fQA2DList->Add(gHistProtonsDCAzEtaPt);
2093 TH3F *gHistAntiProtonsDCAxyEtaPt = new TH3F("gHistAntiProtonsDCAxyEtaPt",
2094 ";P_{T} [GeV/c];dca_{xy} [cm]",
437dd627 2095 nBinsY,gY,nBinsPt,gPt,
2096 nBinsdca,dcaBins);
3322c804 2097 if(fProtonAnalysisBase->GetEtaMode())
2098 gHistAntiProtonsDCAxyEtaPt->GetXaxis()->SetTitle("#eta");
2099 else
2100 gHistAntiProtonsDCAxyEtaPt->GetXaxis()->SetTitle("y");
2101 gHistAntiProtonsDCAxyEtaPt->SetStats(kTRUE);
2102 fQA2DList->Add(gHistAntiProtonsDCAxyEtaPt);
2103 TH3F *gHistAntiProtonsDCAzEtaPt = new TH3F("gHistAntiProtonsDCAzEtaPt",
2104 ";P_{T} [GeV/c];dca_{z} [cm]",
437dd627 2105 nBinsY,gY,nBinsPt,gPt,
2106 nBinsdca,dcaBins);
3322c804 2107 if(fProtonAnalysisBase->GetEtaMode())
2108 gHistAntiProtonsDCAzEtaPt->GetXaxis()->SetTitle("#eta");
2109 else
2110 gHistAntiProtonsDCAzEtaPt->GetXaxis()->SetTitle("y");
2111 gHistAntiProtonsDCAzEtaPt->SetStats(kTRUE);
2112 fQA2DList->Add(gHistAntiProtonsDCAzEtaPt);
4de4661f 2113
71a67ee1 2114 TH3F *gHistProtonsDCA3DEtaPt = new TH3F("gHistProtonsDCA3DEtaPt",
2115 ";P_{T} [GeV/c];dca [cm]",
2116 fNBinsY,fMinY,fMaxY,
2117 fNBinsPt,fMinPt,fMaxPt,
2118 100,0,20);
2119 if(fProtonAnalysisBase->GetEtaMode())
2120 gHistProtonsDCA3DEtaPt->GetXaxis()->SetTitle("#eta");
2121 else
2122 gHistProtonsDCA3DEtaPt->GetXaxis()->SetTitle("y");
2123 gHistProtonsDCA3DEtaPt->SetStats(kTRUE);
2124 fQA2DList->Add(gHistProtonsDCA3DEtaPt);
2125 TH3F *gHistAntiProtonsDCA3DEtaPt = new TH3F("gHistAntiProtonsDCA3DEtaPt",
2126 ";P_{T} [GeV/c];dca [cm]",
2127 fNBinsY,fMinY,fMaxY,
2128 fNBinsPt,fMinPt,fMaxPt,
2129 100,0,20);
2130 if(fProtonAnalysisBase->GetEtaMode())
2131 gHistAntiProtonsDCA3DEtaPt->GetXaxis()->SetTitle("#eta");
2132 else
2133 gHistAntiProtonsDCA3DEtaPt->GetXaxis()->SetTitle("y");
2134 gHistAntiProtonsDCA3DEtaPt->SetStats(kTRUE);
2135 fQA2DList->Add(gHistAntiProtonsDCA3DEtaPt);
2136
f0e42d04 2137 TH2F *gHistPosdEdxP = new TH2F("gHistPosdEdxP","dE/dx (TPC); P [GeV/c]; dE/dx [a.u]",1000,0.05,20.05,600,0,600);
2138 fQA2DList->Add(gHistPosdEdxP);
2139 TH2F *gHistNegdEdxP = new TH2F("gHistNegdEdxP","dE/dx (TPC); P [GeV/c]; dE/dx [a.u]",1000,0.05,20.05,600,0,600);
2140 fQA2DList->Add(gHistNegdEdxP);
2141
735cc63d 2142 //========================================================//
2143 fQAProtonsAcceptedList = new TList();
2144 fQAProtonsAcceptedList->SetName("fQAProtonsAcceptedList");
2145 fGlobalQAList->Add(fQAProtonsAcceptedList);
2146 //Accepted protons
2147 TH1F *gProtonsITSClustersPass = new TH1F("gProtonsITSClustersPass",
2148 ";N_{clusters} (ITS);Entries",
2149 7,0,7);
2150 fQAProtonsAcceptedList->Add(gProtonsITSClustersPass);
2151 TH1F *gProtonsChi2PerClusterITSPass = new TH1F("gProtonsChi2PerClusterITSPass",
2152 ";x^{2}/N_{clusters} (ITS);Entries",
2153 100,0,4);
2154 fQAProtonsAcceptedList->Add(gProtonsChi2PerClusterITSPass);
2155 TH1F *gProtonsTPCClustersPass = new TH1F("gProtonsTPCClustersPass",
2156 ";N_{clusters} (TPC);Entries",
2157 100,0,200);
2158 fQAProtonsAcceptedList->Add(gProtonsTPCClustersPass);
2159 TH1F *gProtonsChi2PerClusterTPCPass = new TH1F("gProtonsChi2PerClusterTPCPass",
2160 ";x^{2}/N_{clusters} (TPC);Entries",
2161 100,0,4);
2162 fQAProtonsAcceptedList->Add(gProtonsChi2PerClusterTPCPass);
2163 TH1F *gProtonsExtCov11Pass = new TH1F("gProtonsExtCov11Pass",
2164 ";#sigma_{y} [cm];Entries",
2165 100,0,4);
2166 fQAProtonsAcceptedList->Add(gProtonsExtCov11Pass);
2167 TH1F *gProtonsExtCov22Pass = new TH1F("gProtonsExtCov22Pass",
2168 ";#sigma_{z} [cm];Entries",
2169 100,0,4);
2170 fQAProtonsAcceptedList->Add(gProtonsExtCov22Pass);
2171 TH1F *gProtonsExtCov33Pass = new TH1F("gProtonsExtCov33Pass",
2172 ";#sigma_{sin(#phi)};Entries",
2173 100,0,4);
2174 fQAProtonsAcceptedList->Add(gProtonsExtCov33Pass);
2175 TH1F *gProtonsExtCov44Pass = new TH1F("gProtonsExtCov44Pass",
2176 ";#sigma_{tan(#lambda)};Entries",
2177 100,0,4);
2178 fQAProtonsAcceptedList->Add(gProtonsExtCov44Pass);
2179 TH1F *gProtonsExtCov55Pass = new TH1F("gProtonsExtCov55Pass",
2180 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2181 100,0,4);
2182 fQAProtonsAcceptedList->Add(gProtonsExtCov55Pass);
2183 TH1F *gProtonsSigmaToVertexPass = new TH1F("gProtonsSigmaToVertexPass",
2184 ";#sigma_{Vertex};Entries",
3770a478 2185 100,0.,10.);
735cc63d 2186 fQAProtonsAcceptedList->Add(gProtonsSigmaToVertexPass);
2187 TH1F *gProtonsSigmaToVertexTPCPass = new TH1F("gProtonsSigmaToVertexTPCPass",
2188 ";#sigma_{Vertex};Entries",
3770a478 2189 100,0.,10.);
735cc63d 2190 fQAProtonsAcceptedList->Add(gProtonsSigmaToVertexTPCPass);
2191 TH1F *gProtonsDCAXYPass = new TH1F("gProtonsDCAXYPass",
2192 ";DCA_{xy} [cm];Entries",
2193 100,0,20);
2194 fQAProtonsAcceptedList->Add(gProtonsDCAXYPass);
2195 TH1F *gProtonsDCAXYTPCPass = new TH1F("gProtonsDCAXYTPCPass",
2196 ";DCA_{xy} [cm];Entries",
2197 100,0,20);
2198 fQAProtonsAcceptedList->Add(gProtonsDCAXYTPCPass);
2199 TH1F *gProtonsDCAZPass = new TH1F("gProtonsDCAZPass",
2200 ";DCA_{z} [cm];Entries",
2201 100,0,20);
2202 fQAProtonsAcceptedList->Add(gProtonsDCAZPass);
2203 TH1F *gProtonsDCAZTPCPass = new TH1F("gProtonsDCAZTPCPass",
2204 ";DCA_{z} [cm];Entries",
2205 100,0,20);
2206 fQAProtonsAcceptedList->Add(gProtonsDCAZTPCPass);
2207 TH1F *gProtonsConstrainChi2Pass = new TH1F("gProtonsConstrainChi2Pass",
2208 ";Log_{10}(#chi^{2});Entries",
2209 100,-10,10);
2210 fQAProtonsAcceptedList->Add(gProtonsConstrainChi2Pass);
2211 TH1F *gProtonsITSRefitPass = new TH1F("gProtonsITSRefitPass",
2212 "",10,-1,1);
2213 fQAProtonsAcceptedList->Add(gProtonsITSRefitPass);
2214 TH1F *gProtonsTPCRefitPass = new TH1F("gProtonsTPCRefitPass",
2215 "",10,-1,1);
2216 fQAProtonsAcceptedList->Add(gProtonsTPCRefitPass);
2217 TH1F *gProtonsESDpidPass = new TH1F("gProtonsESDpidPass",
2218 "",10,-1,1);
2219 fQAProtonsAcceptedList->Add(gProtonsESDpidPass);
2220 TH1F *gProtonsTPCpidPass = new TH1F("gProtonsTPCpidPass",
2221 "",10,-1,1);
2222 fQAProtonsAcceptedList->Add(gProtonsTPCpidPass);
2223 TH1F *gProtonsPointOnITSLayer1Pass = new TH1F("gProtonsPointOnITSLayer1Pass",
2224 "",10,-1,1);
2225 fQAProtonsAcceptedList->Add(gProtonsPointOnITSLayer1Pass);
2226 TH1F *gProtonsPointOnITSLayer2Pass = new TH1F("gProtonsPointOnITSLayer2Pass",
2227 "",10,-1,1);
2228 fQAProtonsAcceptedList->Add(gProtonsPointOnITSLayer2Pass);
2229 TH1F *gProtonsPointOnITSLayer3Pass = new TH1F("gProtonsPointOnITSLayer3Pass",
2230 "",10,-1,1);
2231 fQAProtonsAcceptedList->Add(gProtonsPointOnITSLayer3Pass);
2232 TH1F *gProtonsPointOnITSLayer4Pass = new TH1F("gProtonsPointOnITSLayer4Pass",
2233 "",10,-1,1);
2234 fQAProtonsAcceptedList->Add(gProtonsPointOnITSLayer4Pass);
2235 TH1F *gProtonsPointOnITSLayer5Pass = new TH1F("gProtonsPointOnITSLayer5Pass",
2236 "",10,-1,1);
2237 fQAProtonsAcceptedList->Add(gProtonsPointOnITSLayer5Pass);
2238 TH1F *gProtonsPointOnITSLayer6Pass = new TH1F("gProtonsPointOnITSLayer6Pass",
2239 "",10,-1,1);
2240 fQAProtonsAcceptedList->Add(gProtonsPointOnITSLayer6Pass);
2241 TH1F *gProtonsNumberOfTPCdEdxPointsPass = new TH1F("gProtonsNumberOfTPCdEdxPointsPass","",100,0,200);
2242 fQAProtonsAcceptedList->Add(gProtonsNumberOfTPCdEdxPointsPass);
71a67ee1 2243 TH1F *gProtonsITSClusterMapPass = new TH1F("gProtonsITSClusterMapPass",";ITS Layer;Entries",6,0.5,6.5);
2244 fQAProtonsAcceptedList->Add(gProtonsITSClusterMapPass);
2245 TH1F *gProtonsDCA3DPass = new TH1F("gProtonsDCA3DPass",
2246 ";dca [cm];Entries",
2247 100,0,20);
2248 fQAProtonsAcceptedList->Add(gProtonsDCA3DPass);
735cc63d 2249
2250 //========================================================//
2251 fQAProtonsRejectedList = new TList();
2252 fQAProtonsRejectedList->SetName("fQAProtonsRejectedList");
2253 fGlobalQAList->Add(fQAProtonsRejectedList);
2254 //Rejected protons
2255 TH1F *gProtonsITSClustersReject = new TH1F("gProtonsITSClustersReject",
2256 ";N_{clusters} (ITS);Entries",
2257 7,0,7);
2258 gProtonsITSClustersReject->SetFillColor(kRed-2);
2259 fQAProtonsRejectedList->Add(gProtonsITSClustersReject);
2260 TH1F *gProtonsChi2PerClusterITSReject = new TH1F("gProtonsChi2PerClusterITSReject",
2261 ";x^{2}/N_{clusters} (ITS);Entries",
2262 100,0,4);
2263 gProtonsChi2PerClusterITSReject->SetFillColor(kRed-2);
2264 fQAProtonsRejectedList->Add(gProtonsChi2PerClusterITSReject);
2265 TH1F *gProtonsTPCClustersReject = new TH1F("gProtonsTPCClustersReject",
2266 ";N_{clusters} (TPC);Entries",
2267 100,0,200);
2268 gProtonsTPCClustersReject->SetFillColor(kRed-2);
2269 fQAProtonsRejectedList->Add(gProtonsTPCClustersReject);
2270 TH1F *gProtonsChi2PerClusterTPCReject = new TH1F("gProtonsChi2PerClusterTPCReject",
2271 ";x^{2}/N_{clusters} (TPC);Entries",
2272 100,0,4);
2273 gProtonsChi2PerClusterTPCReject->SetFillColor(kRed-2);
2274 fQAProtonsRejectedList->Add(gProtonsChi2PerClusterTPCReject);
2275 TH1F *gProtonsExtCov11Reject = new TH1F("gProtonsExtCov11Reject",
2276 ";#sigma_{y} [cm];Entries",
2277 100,0,4);
2278 gProtonsExtCov11Reject->SetFillColor(kRed-2);
2279 fQAProtonsRejectedList->Add(gProtonsExtCov11Reject);
2280 TH1F *gProtonsExtCov22Reject = new TH1F("gProtonsExtCov22Reject",
2281 ";#sigma_{z} [cm];Entries",
2282 100,0,4);
2283 gProtonsExtCov22Reject->SetFillColor(kRed-2);
2284 fQAProtonsRejectedList->Add(gProtonsExtCov22Reject);
2285 TH1F *gProtonsExtCov33Reject = new TH1F("gProtonsExtCov33Reject",
2286 ";#sigma_{sin(#phi)};Entries",
2287 100,0,4);
2288 gProtonsExtCov33Reject->SetFillColor(kRed-2);
2289 fQAProtonsRejectedList->Add(gProtonsExtCov33Reject);
2290 TH1F *gProtonsExtCov44Reject = new TH1F("gProtonsExtCov44Reject",
2291 ";#sigma_{tan(#lambda)};Entries",
2292 100,0,4);
2293 gProtonsExtCov44Reject->SetFillColor(kRed-2);
2294 fQAProtonsRejectedList->Add(gProtonsExtCov44Reject);
2295 TH1F *gProtonsExtCov55Reject = new TH1F("gProtonsExtCov55Reject",
2296 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2297 100,0,4);
2298 gProtonsExtCov55Reject->SetFillColor(kRed-2);
2299 fQAProtonsRejectedList->Add(gProtonsExtCov55Reject);
2300 TH1F *gProtonsSigmaToVertexReject = new TH1F("gProtonsSigmaToVertexReject",
2301 ";#sigma_{Vertex};Entries",
2302 100,0,10);
2303 gProtonsSigmaToVertexReject->SetFillColor(kRed-2);
2304 fQAProtonsRejectedList->Add(gProtonsSigmaToVertexReject);
2305 TH1F *gProtonsSigmaToVertexTPCReject = new TH1F("gProtonsSigmaToVertexTPCReject",
2306 ";#sigma_{Vertex};Entries",
2307 100,0,10);
2308 gProtonsSigmaToVertexTPCReject->SetFillColor(kRed-2);
2309 fQAProtonsRejectedList->Add(gProtonsSigmaToVertexTPCReject);
2310 TH1F *gProtonsDCAXYReject = new TH1F("gProtonsDCAXYReject",
2311 ";DCA_{xy} [cm];Entries",
2312 100,0,20);
2313 gProtonsDCAXYReject->SetFillColor(kRed-2);
2314 fQAProtonsRejectedList->Add(gProtonsDCAXYReject);
2315 TH1F *gProtonsDCAXYTPCReject = new TH1F("gProtonsDCAXYTPCReject",
2316 ";DCA_{xy} [cm];Entries",
2317 100,0,20);
2318 gProtonsDCAXYTPCReject->SetFillColor(kRed-2);
2319 fQAProtonsRejectedList->Add(gProtonsDCAXYTPCReject);
2320 TH1F *gProtonsDCAZReject = new TH1F("gProtonsDCAZReject",
2321 ";DCA_{z} [cm];Entries",
2322 100,0,20);
2323 gProtonsDCAZReject->SetFillColor(kRed-2);
2324 fQAProtonsRejectedList->Add(gProtonsDCAZReject);
2325 TH1F *gProtonsDCAZTPCReject = new TH1F("gProtonsDCAZTPCReject",
2326 ";DCA_{z} [cm];Entries",
2327 100,0,20);
2328 gProtonsDCAZTPCReject->SetFillColor(kRed-2);
2329 fQAProtonsRejectedList->Add(gProtonsDCAZTPCReject);
2330 TH1F *gProtonsConstrainChi2Reject = new TH1F("gProtonsConstrainChi2Reject",
2331 ";Log_{10}(#chi^{2});Entries",
2332 100,-10,10);
2333 gProtonsConstrainChi2Reject->SetFillColor(kRed-2);
2334 fQAProtonsRejectedList->Add(gProtonsConstrainChi2Reject);
2335 TH1F *gProtonsITSRefitReject = new TH1F("gProtonsITSRefitReject",
2336 "",10,-1,1);
2337 gProtonsITSRefitReject->SetFillColor(kRed-2);
2338 fQAProtonsRejectedList->Add(gProtonsITSRefitReject);
2339 TH1F *gProtonsTPCRefitReject = new TH1F("gProtonsTPCRefitReject",
2340 "",10,-1,1);
2341 gProtonsTPCRefitReject->SetFillColor(kRed-2);
2342 fQAProtonsRejectedList->Add(gProtonsTPCRefitReject);
2343 TH1F *gProtonsESDpidReject = new TH1F("gProtonsESDpidReject",
2344 "",10,-1,1);
2345 gProtonsESDpidReject->SetFillColor(kRed-2);
2346 fQAProtonsRejectedList->Add(gProtonsESDpidReject);
2347 TH1F *gProtonsTPCpidReject = new TH1F("gProtonsTPCpidReject",
2348 "",10,-1,1);
2349 gProtonsTPCpidReject->SetFillColor(kRed-2);
2350 fQAProtonsRejectedList->Add(gProtonsTPCpidReject);
2351 TH1F *gProtonsPointOnITSLayer1Reject = new TH1F("gProtonsPointOnITSLayer1Reject",
2352 "",10,-1,1);
2353 gProtonsPointOnITSLayer1Reject->SetFillColor(kRed-2);
2354 fQAProtonsRejectedList->Add(gProtonsPointOnITSLayer1Reject);
2355 TH1F *gProtonsPointOnITSLayer2Reject = new TH1F("gProtonsPointOnITSLayer2Reject",
2356 "",10,-1,1);
2357 gProtonsPointOnITSLayer2Reject->SetFillColor(kRed-2);
2358 fQAProtonsRejectedList->Add(gProtonsPointOnITSLayer2Reject);
2359 TH1F *gProtonsPointOnITSLayer3Reject = new TH1F("gProtonsPointOnITSLayer3Reject",
2360 "",10,-1,1);
2361 gProtonsPointOnITSLayer3Reject->SetFillColor(kRed-2);
2362 fQAProtonsRejectedList->Add(gProtonsPointOnITSLayer3Reject);
2363 TH1F *gProtonsPointOnITSLayer4Reject = new TH1F("gProtonsPointOnITSLayer4Reject",
2364 "",10,-1,1);
2365 gProtonsPointOnITSLayer4Reject->SetFillColor(kRed-2);
2366 fQAProtonsRejectedList->Add(gProtonsPointOnITSLayer4Reject);
2367 TH1F *gProtonsPointOnITSLayer5Reject = new TH1F("gProtonsPointOnITSLayer5Reject",
2368 "",10,-1,1);
2369 gProtonsPointOnITSLayer5Reject->SetFillColor(kRed-2);
2370 fQAProtonsRejectedList->Add(gProtonsPointOnITSLayer5Reject);
2371 TH1F *gProtonsPointOnITSLayer6Reject = new TH1F("gProtonsPointOnITSLayer6Reject",
2372 "",10,-1,1);
2373 gProtonsPointOnITSLayer6Reject->SetFillColor(kRed-2);
2374 fQAProtonsRejectedList->Add(gProtonsPointOnITSLayer6Reject);
2375 TH1F *gProtonsNumberOfTPCdEdxPointsReject = new TH1F("gProtonsNumberOfTPCdEdxPointsReject","",100,0,200);
2376 gProtonsNumberOfTPCdEdxPointsReject->SetFillColor(kRed-2);
2377 fQAProtonsRejectedList->Add(gProtonsNumberOfTPCdEdxPointsReject);
71a67ee1 2378 TH1F *gProtonsITSClusterMapReject = new TH1F("gProtonsITSClusterMapReject",";ITS Layer;Entries",6,0.5,6.5);
2379 gProtonsITSClusterMapReject->SetFillColor(kRed-2);
2380 fQAProtonsRejectedList->Add(gProtonsITSClusterMapReject);
2381 TH1F *gProtonsDCA3DReject = new TH1F("gProtonsDCA3DReject",
2382 ";dca [cm];Entries",
2383 100,0,20);
2384 gProtonsDCA3DReject->SetFillColor(kRed-2);
2385 fQAProtonsRejectedList->Add(gProtonsDCA3DReject);
735cc63d 2386
2387 //========================================================//
2388 fQAAntiProtonsAcceptedList = new TList();
2389 fQAAntiProtonsAcceptedList->SetName("fQAAntiProtonsAcceptedList");
2390 fGlobalQAList->Add(fQAAntiProtonsAcceptedList);
2391 //Accepted antiprotons
2392 TH1F *gAntiProtonsITSClustersPass = new TH1F("gAntiProtonsITSClustersPass",
2393 ";N_{clusters} (ITS);Entries",
2394 7,0,7);
2395 fQAAntiProtonsAcceptedList->Add(gAntiProtonsITSClustersPass);
2396 TH1F *gAntiProtonsChi2PerClusterITSPass = new TH1F("gAntiProtonsChi2PerClusterITSPass",
2397 ";x^{2}/N_{clusters} (ITS);Entries",
2398 100,0,4);
2399 fQAAntiProtonsAcceptedList->Add(gAntiProtonsChi2PerClusterITSPass);
2400 TH1F *gAntiProtonsTPCClustersPass = new TH1F("gAntiProtonsTPCClustersPass",
2401 ";N_{clusters} (TPC);Entries",
2402 100,0,200);
2403 fQAAntiProtonsAcceptedList->Add(gAntiProtonsTPCClustersPass);
2404 TH1F *gAntiProtonsChi2PerClusterTPCPass = new TH1F("gAntiProtonsChi2PerClusterTPCPass",
2405 ";x^{2}/N_{clusters} (TPC);Entries",
2406 100,0,4);
2407 fQAAntiProtonsAcceptedList->Add(gAntiProtonsChi2PerClusterTPCPass);
2408 TH1F *gAntiProtonsExtCov11Pass = new TH1F("gAntiProtonsExtCov11Pass",
2409 ";#sigma_{y} [cm];Entries",
2410 100,0,4);
2411 fQAAntiProtonsAcceptedList->Add(gAntiProtonsExtCov11Pass);
2412 TH1F *gAntiProtonsExtCov22Pass = new TH1F("gAntiProtonsExtCov22Pass",
2413 ";#sigma_{z} [cm];Entries",
2414 100,0,4);
2415 fQAAntiProtonsAcceptedList->Add(gAntiProtonsExtCov22Pass);
2416 TH1F *gAntiProtonsExtCov33Pass = new TH1F("gAntiProtonsExtCov33Pass",
2417 ";#sigma_{sin(#phi)};Entries",
2418 100,0,4);
2419 fQAAntiProtonsAcceptedList->Add(gAntiProtonsExtCov33Pass);
2420 TH1F *gAntiProtonsExtCov44Pass = new TH1F("gAntiProtonsExtCov44Pass",
2421 ";#sigma_{tan(#lambda)};Entries",
2422 100,0,4);
2423 fQAAntiProtonsAcceptedList->Add(gAntiProtonsExtCov44Pass);
2424 TH1F *gAntiProtonsExtCov55Pass = new TH1F("gAntiProtonsExtCov55Pass",
2425 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2426 100,0,4);
2427 fQAAntiProtonsAcceptedList->Add(gAntiProtonsExtCov55Pass);
2428 TH1F *gAntiProtonsSigmaToVertexPass = new TH1F("gAntiProtonsSigmaToVertexPass",
2429 ";#sigma_{Vertex};Entries",
2430 100,0,10);
2431 fQAAntiProtonsAcceptedList->Add(gAntiProtonsSigmaToVertexPass);
2432 TH1F *gAntiProtonsSigmaToVertexTPCPass = new TH1F("gAntiProtonsSigmaToVertexTPCPass",
2433 ";#sigma_{Vertex};Entries",
2434 100,0,10);
2435 fQAAntiProtonsAcceptedList->Add(gAntiProtonsSigmaToVertexTPCPass);
2436 TH1F *gAntiProtonsDCAXYPass = new TH1F("gAntiProtonsDCAXYPass",
2437 ";DCA_{xy} [cm];Entries",
2438 100,0,20);
2439 fQAAntiProtonsAcceptedList->Add(gAntiProtonsDCAXYPass);
2440 TH1F *gAntiProtonsDCAXYTPCPass = new TH1F("gAntiProtonsDCAXYTPCPass",
2441 ";DCA_{xy} [cm];Entries",
2442 100,0,20);
2443 fQAAntiProtonsAcceptedList->Add(gAntiProtonsDCAXYTPCPass);
2444 TH1F *gAntiProtonsDCAZPass = new TH1F("gAntiProtonsDCAZPass",
2445 ";DCA_{z} [cm];Entries",
2446 100,0,20);
2447 fQAAntiProtonsAcceptedList->Add(gAntiProtonsDCAZPass);
2448 TH1F *gAntiProtonsDCAZTPCPass = new TH1F("gAntiProtonsDCAZTPCPass",
2449 ";DCA_{z} [cm];Entries",
2450 100,0,20);
2451 fQAAntiProtonsAcceptedList->Add(gAntiProtonsDCAZTPCPass);
2452 TH1F *gAntiProtonsConstrainChi2Pass = new TH1F("gAntiProtonsConstrainChi2Pass",
2453 ";Log_{10}(#chi^{2});Entries",
2454 100,-10,10);
2455 fQAAntiProtonsAcceptedList->Add(gAntiProtonsConstrainChi2Pass);
2456 TH1F *gAntiProtonsITSRefitPass = new TH1F("gAntiProtonsITSRefitPass",
2457 "",10,-1,1);
2458 fQAAntiProtonsAcceptedList->Add(gAntiProtonsITSRefitPass);
2459 TH1F *gAntiProtonsTPCRefitPass = new TH1F("gAntiProtonsTPCRefitPass",
2460 "",10,-1,1);
2461 fQAAntiProtonsAcceptedList->Add(gAntiProtonsTPCRefitPass);
2462 TH1F *gAntiProtonsESDpidPass = new TH1F("gAntiProtonsESDpidPass",
2463 "",10,-1,1);
2464 fQAAntiProtonsAcceptedList->Add(gAntiProtonsESDpidPass);
2465 TH1F *gAntiProtonsTPCpidPass = new TH1F("gAntiProtonsTPCpidPass",
2466 "",10,-1,1);
2467 fQAAntiProtonsAcceptedList->Add(gAntiProtonsTPCpidPass);
2468 TH1F *gAntiProtonsPointOnITSLayer1Pass = new TH1F("gAntiProtonsPointOnITSLayer1Pass",
2469 "",10,-1,1);
2470 fQAAntiProtonsAcceptedList->Add(gAntiProtonsPointOnITSLayer1Pass);
2471 TH1F *gAntiProtonsPointOnITSLayer2Pass = new TH1F("gAntiProtonsPointOnITSLayer2Pass",
2472 "",10,-1,1);
2473 fQAAntiProtonsAcceptedList->Add(gAntiProtonsPointOnITSLayer2Pass);
2474 TH1F *gAntiProtonsPointOnITSLayer3Pass = new TH1F("gAntiProtonsPointOnITSLayer3Pass",
2475 "",10,-1,1);
2476 fQAAntiProtonsAcceptedList->Add(gAntiProtonsPointOnITSLayer3Pass);
2477 TH1F *gAntiProtonsPointOnITSLayer4Pass = new TH1F("gAntiProtonsPointOnITSLayer4Pass",
2478 "",10,-1,1);
2479 fQAAntiProtonsAcceptedList->Add(gAntiProtonsPointOnITSLayer4Pass);
2480 TH1F *gAntiProtonsPointOnITSLayer5Pass = new TH1F("gAntiProtonsPointOnITSLayer5Pass",
2481 "",10,-1,1);
2482 fQAAntiProtonsAcceptedList->Add(gAntiProtonsPointOnITSLayer5Pass);
2483 TH1F *gAntiProtonsPointOnITSLayer6Pass = new TH1F("gAntiProtonsPointOnITSLayer6Pass",
2484 "",10,-1,1);
2485 fQAAntiProtonsAcceptedList->Add(gAntiProtonsPointOnITSLayer6Pass);
2486 TH1F *gAntiProtonsNumberOfTPCdEdxPointsPass = new TH1F("gAntiProtonsNumberOfTPCdEdxPointsPass","",100,0,200);
2487 fQAAntiProtonsAcceptedList->Add(gAntiProtonsNumberOfTPCdEdxPointsPass);
71a67ee1 2488 TH1F *gAntiProtonsITSClusterMapPass = new TH1F("gAntiProtonsITSClusterMapPass",";ITS Layer;Entries",6,0.5,6.5);
2489 fQAAntiProtonsAcceptedList->Add(gAntiProtonsITSClusterMapPass);
2490 TH1F *gAntiProtonsDCA3DPass = new TH1F("gAntiProtonsDCA3DPass",
2491 ";dca [cm];Entries",
2492 100,0,20);
2493 fQAAntiProtonsAcceptedList->Add(gAntiProtonsDCA3DPass);
2494
735cc63d 2495 //========================================================//
2496 fQAAntiProtonsRejectedList = new TList();
2497 fQAAntiProtonsRejectedList->SetName("fQAAntiProtonsRejectedList");
2498 fGlobalQAList->Add(fQAAntiProtonsRejectedList);
2499 //Rejected antiprotons
2500 TH1F *gAntiProtonsITSClustersReject = new TH1F("gAntiProtonsITSClustersReject",
2501 ";N_{clusters} (ITS);Entries",
2502 7,0,7);
2503 gAntiProtonsITSClustersReject->SetFillColor(kRed-2);
2504 fQAAntiProtonsRejectedList->Add(gAntiProtonsITSClustersReject);
2505 TH1F *gAntiProtonsChi2PerClusterITSReject = new TH1F("gAntiProtonsChi2PerClusterITSReject",
2506 ";x^{2}/N_{clusters} (ITS);Entries",
2507 100,0,4);
2508 gAntiProtonsChi2PerClusterITSReject->SetFillColor(kRed-2);
2509 fQAAntiProtonsRejectedList->Add(gAntiProtonsChi2PerClusterITSReject);
2510 TH1F *gAntiProtonsTPCClustersReject = new TH1F("gAntiProtonsTPCClustersReject",
2511 ";N_{clusters} (TPC);Entries",
2512 100,0,200);
2513 gAntiProtonsTPCClustersReject->SetFillColor(kRed-2);
2514 fQAAntiProtonsRejectedList->Add(gAntiProtonsTPCClustersReject);
2515 TH1F *gAntiProtonsChi2PerClusterTPCReject = new TH1F("gAntiProtonsChi2PerClusterTPCReject",
2516 ";x^{2}/N_{clusters} (TPC);Entries",
2517 100,0,4);
2518 gAntiProtonsChi2PerClusterTPCReject->SetFillColor(kRed-2);
2519 fQAAntiProtonsRejectedList->Add(gAntiProtonsChi2PerClusterTPCReject);
2520 TH1F *gAntiProtonsExtCov11Reject = new TH1F("gAntiProtonsExtCov11Reject",
2521 ";#sigma_{y} [cm];Entries",
2522 100,0,4);
2523 gAntiProtonsExtCov11Reject->SetFillColor(kRed-2);
2524 fQAAntiProtonsRejectedList->Add(gAntiProtonsExtCov11Reject);
2525 TH1F *gAntiProtonsExtCov22Reject = new TH1F("gAntiProtonsExtCov22Reject",
2526 ";#sigma_{z} [cm];Entries",
2527 100,0,4);
2528 gAntiProtonsExtCov22Reject->SetFillColor(kRed-2);
2529 fQAAntiProtonsRejectedList->Add(gAntiProtonsExtCov22Reject);
2530 TH1F *gAntiProtonsExtCov33Reject = new TH1F("gAntiProtonsExtCov33Reject",
2531 ";#sigma_{sin(#phi)};Entries",
2532 100,0,4);
2533 gAntiProtonsExtCov33Reject->SetFillColor(kRed-2);
2534 fQAAntiProtonsRejectedList->Add(gAntiProtonsExtCov33Reject);
2535 TH1F *gAntiProtonsExtCov44Reject = new TH1F("gAntiProtonsExtCov44Reject",
2536 ";#sigma_{tan(#lambda)};Entries",
2537 100,0,4);
2538 gAntiProtonsExtCov44Reject->SetFillColor(kRed-2);
2539 fQAAntiProtonsRejectedList->Add(gAntiProtonsExtCov44Reject);
2540 TH1F *gAntiProtonsExtCov55Reject = new TH1F("gAntiProtonsExtCov55Reject",
2541 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2542 100,0,4);
2543 gAntiProtonsExtCov55Reject->SetFillColor(kRed-2);
2544 fQAAntiProtonsRejectedList->Add(gAntiProtonsExtCov55Reject);
2545 TH1F *gAntiProtonsSigmaToVertexReject = new TH1F("gAntiProtonsSigmaToVertexReject",
2546 ";#sigma_{Vertex};Entries",
2547 100,0,10);
2548 gAntiProtonsSigmaToVertexReject->SetFillColor(kRed-2);
2549 fQAAntiProtonsRejectedList->Add(gAntiProtonsSigmaToVertexReject);
2550 TH1F *gAntiProtonsSigmaToVertexTPCReject = new TH1F("gAntiProtonsSigmaToVertexTPCReject",
2551 ";#sigma_{Vertex};Entries",
2552 100,0,10);
2553 gAntiProtonsSigmaToVertexTPCReject->SetFillColor(kRed-2);
2554 fQAAntiProtonsRejectedList->Add(gAntiProtonsSigmaToVertexTPCReject);
2555 TH1F *gAntiProtonsDCAXYReject = new TH1F("gAntiProtonsDCAXYReject",
2556 ";DCA_{xy} [cm];Entries",
2557 100,0,20);
2558 gAntiProtonsDCAXYReject->SetFillColor(kRed-2);
2559 fQAAntiProtonsRejectedList->Add(gAntiProtonsDCAXYReject);
2560 TH1F *gAntiProtonsDCAXYTPCReject = new TH1F("gAntiProtonsDCAXYTPCReject",
2561 ";DCA_{xy} [cm];Entries",
2562 100,0,20);
2563 gAntiProtonsDCAXYTPCReject->SetFillColor(kRed-2);
2564 fQAAntiProtonsRejectedList->Add(gAntiProtonsDCAXYTPCReject);
2565 TH1F *gAntiProtonsDCAZReject = new TH1F("gAntiProtonsDCAZReject",
2566 ";DCA_{z} [cm];Entries",
2567 100,0,20);
2568 gAntiProtonsDCAZReject->SetFillColor(kRed-2);
2569 fQAAntiProtonsRejectedList->Add(gAntiProtonsDCAZReject);
2570 TH1F *gAntiProtonsDCAZTPCReject = new TH1F("gAntiProtonsDCAZTPCReject",
2571 ";DCA_{z} [cm];Entries",
2572 100,0,20);
2573 gAntiProtonsDCAZTPCReject->SetFillColor(kRed-2);
2574 fQAAntiProtonsRejectedList->Add(gAntiProtonsDCAZTPCReject);
2575 TH1F *gAntiProtonsConstrainChi2Reject = new TH1F("gAntiProtonsConstrainChi2Reject",
2576 ";Log_{10}(#chi^{2});Entries",
2577 100,-10,10);
2578 gAntiProtonsConstrainChi2Reject->SetFillColor(kRed-2);
2579 fQAAntiProtonsRejectedList->Add(gAntiProtonsConstrainChi2Reject);
2580 TH1F *gAntiProtonsITSRefitReject = new TH1F("gAntiProtonsITSRefitReject",
2581 "",10,-1,1);
2582 gAntiProtonsITSRefitReject->SetFillColor(kRed-2);
2583 fQAAntiProtonsRejectedList->Add(gAntiProtonsITSRefitReject);
2584 TH1F *gAntiProtonsTPCRefitReject = new TH1F("gAntiProtonsTPCRefitReject",
2585 "",10,-1,1);
2586 gAntiProtonsTPCRefitReject->SetFillColor(kRed-2);
2587 fQAAntiProtonsRejectedList->Add(gAntiProtonsTPCRefitReject);
2588 TH1F *gAntiProtonsESDpidReject = new TH1F("gAntiProtonsESDpidReject",
2589 "",10,-1,1);
2590 gAntiProtonsESDpidReject->SetFillColor(kRed-2);
2591 fQAAntiProtonsRejectedList->Add(gAntiProtonsESDpidReject);
2592 TH1F *gAntiProtonsTPCpidReject = new TH1F("gAntiProtonsTPCpidReject",
2593 "",10,-1,1);
2594 gAntiProtonsTPCpidReject->SetFillColor(kRed-2);
2595 fQAAntiProtonsRejectedList->Add(gAntiProtonsTPCpidReject);
2596 TH1F *gAntiProtonsPointOnITSLayer1Reject = new TH1F("gAntiProtonsPointOnITSLayer1Reject",
2597 "",10,-1,1);
2598 gAntiProtonsPointOnITSLayer1Reject->SetFillColor(kRed-2);
2599 fQAAntiProtonsRejectedList->Add(gAntiProtonsPointOnITSLayer1Reject);
2600 TH1F *gAntiProtonsPointOnITSLayer2Reject = new TH1F("gAntiProtonsPointOnITSLayer2Reject",
2601 "",10,-1,1);
2602 gAntiProtonsPointOnITSLayer2Reject->SetFillColor(kRed-2);
2603 fQAAntiProtonsRejectedList->Add(gAntiProtonsPointOnITSLayer2Reject);
2604 TH1F *gAntiProtonsPointOnITSLayer3Reject = new TH1F("gAntiProtonsPointOnITSLayer3Reject",
2605 "",10,-1,1);
2606 gAntiProtonsPointOnITSLayer3Reject->SetFillColor(kRed-2);
2607 fQAAntiProtonsRejectedList->Add(gAntiProtonsPointOnITSLayer3Reject);
2608 TH1F *gAntiProtonsPointOnITSLayer4Reject = new TH1F("gAntiProtonsPointOnITSLayer4Reject",
2609 "",10,-1,1);
2610 gAntiProtonsPointOnITSLayer4Reject->SetFillColor(kRed-2);
2611 fQAAntiProtonsRejectedList->Add(gAntiProtonsPointOnITSLayer4Reject);
2612 TH1F *gAntiProtonsPointOnITSLayer5Reject = new TH1F("gAntiProtonsPointOnITSLayer5Reject",
2613 "",10,-1,1);
2614 gAntiProtonsPointOnITSLayer5Reject->SetFillColor(kRed-2);
2615 fQAAntiProtonsRejectedList->Add(gAntiProtonsPointOnITSLayer5Reject);
2616 TH1F *gAntiProtonsPointOnITSLayer6Reject = new TH1F("gAntiProtonsPointOnITSLayer6Reject",
2617 "",10,-1,1);
2618 gAntiProtonsPointOnITSLayer6Reject->SetFillColor(kRed-2);
2619 fQAAntiProtonsRejectedList->Add(gAntiProtonsPointOnITSLayer6Reject);
2620 TH1F *gAntiProtonsNumberOfTPCdEdxPointsReject = new TH1F("gAntiProtonsNumberOfTPCdEdxPointsReject","",100,0,200);
2621 gAntiProtonsNumberOfTPCdEdxPointsReject->SetFillColor(kRed-2);
2622 fQAAntiProtonsRejectedList->Add(gAntiProtonsNumberOfTPCdEdxPointsReject);
71a67ee1 2623 TH1F *gAntiProtonsITSClusterMapReject = new TH1F("gAntiProtonsITSClusterMapReject",";ITS Layer;Entries",6,0.5,6.5);
2624 gAntiProtonsITSClusterMapReject->SetFillColor(kRed-2);
2625 fQAAntiProtonsRejectedList->Add(gAntiProtonsITSClusterMapReject);
2626 TH1F *gAntiProtonsDCA3DReject = new TH1F("gAntiProtonsDCA3DReject",
2627 ";dca [cm];Entries",
2628 100,0,20);
2629 gAntiProtonsDCA3DReject->SetFillColor(kRed-2);
e0919e87 2630 fQAAntiProtonsRejectedList->Add(gAntiProtonsDCA3DReject);*/
735cc63d 2631}
39f2a708 2632
735cc63d 2633//____________________________________________________________________//
2634void AliProtonAnalysis::FillQA(AliESDEvent *esd,
2635 const AliESDVertex *vertex,
2636 AliESDtrack* track) {
2637 //Fills the QA histograms
2638 Double_t gPt = 0.0, gPx = 0.0, gPy = 0.0, gPz = 0.0;
2639 Double_t dca[2] = {0.0,0.0}, cov[3] = {0.0,0.0,0.0}; //The impact parameters and their covariance.
71a67ee1 2640 Double_t dca3D = 0.0;
3770a478 2641 Float_t dcaXY = 0.0, dcaZ = 0.0;
735cc63d 2642
2643 if((fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kTPC)||(fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kHybrid)) {
2644 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
2645 if(!tpcTrack) {
2646 gPt = 0.0; gPx = 0.0; gPy = 0.0; gPz = 0.0;
2647 dca[0] = -100.; dca[1] = -100.;
2648 cov[0] = -100.; cov[1] = -100.; cov[2] = -100.;
2649 }
2650 else {
2651 gPt = tpcTrack->Pt();
2652 gPx = tpcTrack->Px();
2653 gPy = tpcTrack->Py();
2654 gPz = tpcTrack->Pz();
2655 tpcTrack->PropagateToDCA(vertex,
2656 esd->GetMagneticField(),
2657 100.,dca,cov);
2658 }
2659 }
3770a478 2660 if(fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kFullHybrid) {
2661 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
2662 AliExternalTrackParam cParam;
2663 if(!tpcTrack) {
2664 gPt = 0.0; gPx = 0.0; gPy = 0.0; gPz = 0.0;
2665 dca[0] = -100.; dca[1] = -100.;
2666 cov[0] = -100.; cov[1] = -100.; cov[2] = -100.;
2667 }
2668 else {
2669 gPt = tpcTrack->Pt();
2670 gPx = tpcTrack->Px();
2671 gPy = tpcTrack->Py();
2672 gPz = tpcTrack->Pz();
2673 track->RelateToVertex(vertex,
2674 esd->GetMagneticField(),
2675 100.,&cParam);
2676 track->GetImpactParameters(dcaXY,dcaZ);
2677 dca[0] = dcaXY; dca[1] = dcaZ;
2678 }
2679 }
735cc63d 2680 else{
2681 gPt = track->Pt();
2682 gPx = track->Px();
2683 gPy = track->Py();
2684 gPz = track->Pz();
2685 track->PropagateToDCA(vertex,
2686 esd->GetMagneticField(),
2687 100.,dca,cov);
2688 }
39f2a708 2689
71a67ee1 2690 dca3D = TMath::Sqrt(TMath::Power(dca[0],2) +
2691 TMath::Power(dca[1],2));
2692
e0919e87 2693 //Int_t fIdxInt[200];
2694 //Int_t nClustersITS = track->GetITSclusters(fIdxInt);
2695 //Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
2696 Int_t nClustersITS = track->GetITSclusters(0x0);
2697 Int_t nClustersTPC = track->GetTPCclusters(0x0);
39f2a708 2698
735cc63d 2699 Float_t chi2PerClusterITS = -1;
2700 if (nClustersITS!=0)
2701 chi2PerClusterITS = track->GetITSchi2()/Float_t(nClustersITS);
2702 Float_t chi2PerClusterTPC = -1;
2703 if (nClustersTPC!=0)
2704 chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);
39f2a708 2705
735cc63d 2706 Double_t extCov[15];
2707 track->GetExternalCovariance(extCov);
2708
2709 //protons
2710 if(track->Charge() > 0) {
2711 if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
2712 if(nClustersITS < fProtonAnalysisBase->GetMinITSClusters()) {
2713 ((TH1F *)(fQAProtonsRejectedList->At(0)))->Fill(nClustersITS);
2714 }
2715 else if(nClustersITS >= fProtonAnalysisBase->GetMinITSClusters())
2716 ((TH1F *)(fQAProtonsAcceptedList->At(0)))->Fill(nClustersITS);
2717 }//ITS clusters
2718 if(fProtonAnalysisBase->IsUsedMaxChi2PerITSCluster()) {
2719 if(chi2PerClusterITS > fProtonAnalysisBase->GetMaxChi2PerITSCluster()) {
2720 ((TH1F *)(fQAProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
2721 }
2722 else if(chi2PerClusterITS <= fProtonAnalysisBase->GetMaxChi2PerITSCluster())
2723 ((TH1F *)(fQAProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
2724 }//chi2 per ITS cluster
2725 if(fProtonAnalysisBase->IsUsedMinTPCClusters()) {
2726 if(nClustersTPC < fProtonAnalysisBase->GetMinTPCClusters()) {
2727 ((TH1F *)(fQAProtonsRejectedList->At(2)))->Fill(nClustersTPC);
2728 }
2729 else if(nClustersTPC >= fProtonAnalysisBase->GetMinTPCClusters()) {
2730 ((TH1F *)(fQAProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
2731 }
2732 }//TPC clusters
2733 if(fProtonAnalysisBase->IsUsedMaxChi2PerTPCCluster()) {
2734 if(chi2PerClusterTPC > fProtonAnalysisBase->GetMaxChi2PerTPCCluster()) {
2735 ((TH1F *)(fQAProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
2736 }
2737 else if(chi2PerClusterTPC <= fProtonAnalysisBase->GetMaxChi2PerTPCCluster())
2738 ((TH1F *)(fQAProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
2739 }//chi2 per TPC cluster
2740 if(fProtonAnalysisBase->IsUsedMaxCov11()) {
2741 if(extCov[0] > fProtonAnalysisBase->GetMaxCov11()) {
2742 ((TH1F *)(fQAProtonsRejectedList->At(4)))->Fill(extCov[0]);
2743 }
2744 else if(extCov[0] <= fProtonAnalysisBase->GetMaxCov11())
2745 ((TH1F *)(fQAProtonsAcceptedList->At(4)))->Fill(extCov[0]);
2746 }//cov11
2747 if(fProtonAnalysisBase->IsUsedMaxCov22()) {
2748 if(extCov[2] > fProtonAnalysisBase->GetMaxCov22()) {
2749 ((TH1F *)(fQAProtonsRejectedList->At(5)))->Fill(extCov[2]);
2750 }
2751 else if(extCov[2] <= fProtonAnalysisBase->GetMaxCov22())
2752 ((TH1F *)(fQAProtonsAcceptedList->At(5)))->Fill(extCov[2]);
2753 }//cov11
2754 if(fProtonAnalysisBase->IsUsedMaxCov33()) {
2755 if(extCov[5] > fProtonAnalysisBase->GetMaxCov33()) {
2756 ((TH1F *)(fQAProtonsRejectedList->At(6)))->Fill(extCov[5]);
2757 }
2758 else if(extCov[5] <= fProtonAnalysisBase->GetMaxCov33())
2759 ((TH1F *)(fQAProtonsAcceptedList->At(6)))->Fill(extCov[5]);
2760 }//cov11
2761 if(fProtonAnalysisBase->IsUsedMaxCov44()) {
2762 if(extCov[9] > fProtonAnalysisBase->GetMaxCov44()) {
2763 ((TH1F *)(fQAProtonsRejectedList->At(7)))->Fill(extCov[9]);
2764 }
2765 else if(extCov[9] <= fProtonAnalysisBase->GetMaxCov44())
2766 ((TH1F *)(fQAProtonsAcceptedList->At(7)))->Fill(extCov[9]);
2767 }//cov11
2768 if(fProtonAnalysisBase->IsUsedMaxCov55()) {
2769 if(extCov[14] > fProtonAnalysisBase->GetMaxCov55()) {
2770 ((TH1F *)(fQAProtonsRejectedList->At(8)))->Fill(extCov[14]);
2771 }
2772 else if(extCov[14] <= fProtonAnalysisBase->GetMaxCov55())
2773 ((TH1F *)(fQAProtonsAcceptedList->At(8)))->Fill(extCov[14]);
2774 }//cov55
2775 if(fProtonAnalysisBase->IsUsedMaxSigmaToVertex()) {
2776 if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertex()) {
2777 ((TH1F *)(fQAProtonsRejectedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2778 }
2779 else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertex())
2780 ((TH1F *)(fQAProtonsAcceptedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2781 }//sigma to vertex
2782 if(fProtonAnalysisBase->IsUsedMaxSigmaToVertexTPC()) {
2783 if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertexTPC()) {
2784 ((TH1F *)(fQAProtonsRejectedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2785 }
2786 else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertexTPC())
2787 ((TH1F *)(fQAProtonsAcceptedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2788 }//sigma to vertex TPC
2789 if(fProtonAnalysisBase->IsUsedMaxDCAXY()) {
2790 if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
2791 ((TH1F *)(fQAProtonsRejectedList->At(11)))->Fill(TMath::Abs(dca[0]));
2792 }
2793 else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
2794 ((TH1F *)(fQAProtonsAcceptedList->At(11)))->Fill(TMath::Abs(dca[0]));
2795 }//DCA xy global tracking
2796 if(fProtonAnalysisBase->IsUsedMaxDCAXYTPC()) {
2797 if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXYTPC()) {
2798 ((TH1F *)(fQAProtonsRejectedList->At(12)))->Fill(TMath::Abs(dca[0]));
2799 }
2800 else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXYTPC())
2801 ((TH1F *)(fQAProtonsAcceptedList->At(12)))->Fill(TMath::Abs(dca[0]));
2802 }//DCA xy TPC tracking
2803 if(fProtonAnalysisBase->IsUsedMaxDCAZ()) {
2804 if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
2805 ((TH1F *)(fQAProtonsRejectedList->At(13)))->Fill(TMath::Abs(dca[1]));
2806 }
2807 else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
2808 ((TH1F *)(fQAProtonsAcceptedList->At(13)))->Fill(TMath::Abs(dca[1]));
2809 }//DCA z global tracking
2810 if(fProtonAnalysisBase->IsUsedMaxDCAZTPC()) {
2811 if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZTPC()) {
2812 ((TH1F *)(fQAProtonsRejectedList->At(14)))->Fill(TMath::Abs(dca[1]));
2813 }
2814 else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZTPC())
2815 ((TH1F *)(fQAProtonsAcceptedList->At(14)))->Fill(TMath::Abs(dca[1]));
2816 }//DCA z TPC tracking
2817 if(fProtonAnalysisBase->IsUsedMaxConstrainChi2()) {
2818 if(track->GetConstrainedChi2() > 0) {
2819 if(TMath::Log(track->GetConstrainedChi2()) > fProtonAnalysisBase->GetMaxConstrainChi2()) {
2820 ((TH1F *)(fQAProtonsRejectedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
2821 }
2822 else if(TMath::Log(track->GetConstrainedChi2()) <= fProtonAnalysisBase->GetMaxConstrainChi2())
2823 ((TH1F *)(fQAProtonsAcceptedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
2824 }
2825 }//constrain chi2 - vertex
2826 if(fProtonAnalysisBase->IsUsedITSRefit()) {
2827 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
2828 ((TH1F *)(fQAProtonsRejectedList->At(16)))->Fill(0);
2829 }
2830 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
2831 ((TH1F *)(fQAProtonsAcceptedList->At(16)))->Fill(0);
2832 }//ITS refit
2833 if(fProtonAnalysisBase->IsUsedTPCRefit()) {
2834 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
2835 ((TH1F *)(fQAProtonsRejectedList->At(17)))->Fill(0);
2836 }
2837 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
2838 ((TH1F *)(fQAProtonsAcceptedList->At(17)))->Fill(0);
2839 }//TPC refit
2840 if(fProtonAnalysisBase->IsUsedESDpid()) {
2841 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
2842 ((TH1F *)(fQAProtonsRejectedList->At(18)))->Fill(0);
2843 }
2844 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
2845 ((TH1F *)(fQAProtonsAcceptedList->At(18)))->Fill(0);
2846 }//ESD pid
2847 if(fProtonAnalysisBase->IsUsedTPCpid()) {
2848 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
2849 ((TH1F *)(fQAProtonsRejectedList->At(19)))->Fill(0);
2850 }
2851 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
2852 ((TH1F *)(fQAProtonsAcceptedList->At(19)))->Fill(0);
2853 }//TPC pid
2854 if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
2855 if(!track->HasPointOnITSLayer(0)) {
2856 ((TH1F *)(fQAProtonsRejectedList->At(20)))->Fill(0);
2857 }
2858 else if(track->HasPointOnITSLayer(0))
2859 ((TH1F *)(fQAProtonsAcceptedList->At(20)))->Fill(0);
2860 }//point on SPD1
2861 if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
2862 if(!track->HasPointOnITSLayer(1)) {
2863 ((TH1F *)(fQAProtonsRejectedList->At(21)))->Fill(0);
2864 }
2865 else if(track->HasPointOnITSLayer(1))
2866 ((TH1F *)(fQAProtonsAcceptedList->At(21)))->Fill(0);
2867 }//point on SPD2
2868 if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
2869 if(!track->HasPointOnITSLayer(2)) {
2870 ((TH1F *)(fQAProtonsRejectedList->At(22)))->Fill(0);
2871 }
2872 else if(track->HasPointOnITSLayer(2))
2873 ((TH1F *)(fQAProtonsAcceptedList->At(22)))->Fill(0);
2874 }//point on SDD1
2875 if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
2876 if(!track->HasPointOnITSLayer(3)) {
2877 ((TH1F *)(fQAProtonsRejectedList->At(23)))->Fill(0);
2878 }
2879 else if(track->HasPointOnITSLayer(3))
2880 ((TH1F *)(fQAProtonsAcceptedList->At(23)))->Fill(0);
2881 }//point on SDD2
2882 if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
2883 if(!track->HasPointOnITSLayer(4)) {
2884 ((TH1F *)(fQAProtonsRejectedList->At(24)))->Fill(0);
2885 }
2886 else if(track->HasPointOnITSLayer(4))
2887 ((TH1F *)(fQAProtonsAcceptedList->At(24)))->Fill(0);
2888 }//point on SSD1
2889 if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
2890 if(!track->HasPointOnITSLayer(5)) {
2891 ((TH1F *)(fQAProtonsRejectedList->At(25)))->Fill(0);
2892 }
2893 else if(track->HasPointOnITSLayer(5))
2894 ((TH1F *)(fQAProtonsAcceptedList->At(25)))->Fill(0);
2895 }//point on SSD2
2896 if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
2897 if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
2898 ((TH1F *)(fQAProtonsRejectedList->At(26)))->Fill(track->GetTPCsignalN());
2899 }
2900 if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
2901 ((TH1F *)(fQAProtonsAcceptedList->At(26)))->Fill(track->GetTPCsignalN());
2902 }//number of TPC points for the dE/dx
71a67ee1 2903 if(fProtonAnalysisBase->IsUsedPointOnSPDLayer()) {
2904 if((!track->HasPointOnITSLayer(0))&&(!track->HasPointOnITSLayer(1))) {
2905 for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
2906 if(track->HasPointOnITSLayer(iLayer))
2907 ((TH1F *)(fQAProtonsRejectedList->At(27)))->Fill(iLayer+1);
2908 }
2909 }
2910 else if((track->HasPointOnITSLayer(0))||(track->HasPointOnITSLayer(1))) {
2911 for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
2912 if(track->HasPointOnITSLayer(iLayer))
2913 ((TH1F *)(fQAProtonsAcceptedList->At(27)))->Fill(iLayer+1);
2914 }
2915 }
2916 }//point on either SPD layers
2917 if(fProtonAnalysisBase->IsUsedMaxDCA3D()) {
2918 if(dca3D > fProtonAnalysisBase->GetMaxDCA3D()) {
2919 ((TH1F *)(fQAProtonsRejectedList->At(28)))->Fill(dca3D);
2920 }
2921 if(dca3D < fProtonAnalysisBase->GetMaxDCA3D())
2922 ((TH1F *)(fQAProtonsAcceptedList->At(28)))->Fill(dca3D);
2923 }//dca3D
735cc63d 2924 }//protons
2925
2926 //antiprotons
2927 if(track->Charge() < 0) {
2928 if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
2929 if(nClustersITS < fProtonAnalysisBase->GetMinITSClusters()) {
2930 ((TH1F *)(fQAAntiProtonsRejectedList->At(0)))->Fill(nClustersITS);
2931 }
2932 else if(nClustersITS >= fProtonAnalysisBase->GetMinITSClusters())
2933 ((TH1F *)(fQAAntiProtonsAcceptedList->At(0)))->Fill(nClustersITS);
2934 }//ITS clusters
2935 if(fProtonAnalysisBase->IsUsedMaxChi2PerITSCluster()) {
2936 if(chi2PerClusterITS > fProtonAnalysisBase->GetMaxChi2PerITSCluster()) {
2937 ((TH1F *)(fQAAntiProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
2938 }
2939 else if(chi2PerClusterITS <= fProtonAnalysisBase->GetMaxChi2PerITSCluster())
2940 ((TH1F *)(fQAAntiProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
2941 }//chi2 per ITS cluster
2942 if(fProtonAnalysisBase->IsUsedMinTPCClusters()) {
2943 if(nClustersTPC < fProtonAnalysisBase->GetMinTPCClusters()) {
2944 ((TH1F *)(fQAAntiProtonsRejectedList->At(2)))->Fill(nClustersTPC);
2945 }
2946 else if(nClustersTPC >= fProtonAnalysisBase->GetMinTPCClusters()) {
2947 ((TH1F *)(fQAAntiProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
2948 }
2949 }//TPC clusters
2950 if(fProtonAnalysisBase->IsUsedMaxChi2PerTPCCluster()) {
2951 if(chi2PerClusterTPC > fProtonAnalysisBase->GetMaxChi2PerTPCCluster()) {
2952 ((TH1F *)(fQAAntiProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
2953 }
2954 else if(chi2PerClusterTPC <= fProtonAnalysisBase->GetMaxChi2PerTPCCluster())
2955 ((TH1F *)(fQAAntiProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
2956 }//chi2 per TPC cluster
2957 if(fProtonAnalysisBase->IsUsedMaxCov11()) {
2958 if(extCov[0] > fProtonAnalysisBase->GetMaxCov11()) {
2959 ((TH1F *)(fQAAntiProtonsRejectedList->At(4)))->Fill(extCov[0]);
2960 }
2961 else if(extCov[0] <= fProtonAnalysisBase->GetMaxCov11())
2962 ((TH1F *)(fQAAntiProtonsAcceptedList->At(4)))->Fill(extCov[0]);
2963 }//cov11
2964 if(fProtonAnalysisBase->IsUsedMaxCov22()) {
2965 if(extCov[2] > fProtonAnalysisBase->GetMaxCov22()) {
2966 ((TH1F *)(fQAAntiProtonsRejectedList->At(5)))->Fill(extCov[2]);
2967 }
2968 else if(extCov[2] <= fProtonAnalysisBase->GetMaxCov22())
2969 ((TH1F *)(fQAAntiProtonsAcceptedList->At(5)))->Fill(extCov[2]);
2970 }//cov11
2971 if(fProtonAnalysisBase->IsUsedMaxCov33()) {
2972 if(extCov[5] > fProtonAnalysisBase->GetMaxCov33()) {
2973 ((TH1F *)(fQAAntiProtonsRejectedList->At(6)))->Fill(extCov[5]);
2974 }
2975 else if(extCov[5] <= fProtonAnalysisBase->GetMaxCov33())
2976 ((TH1F *)(fQAAntiProtonsAcceptedList->At(6)))->Fill(extCov[5]);
2977 }//cov11
2978 if(fProtonAnalysisBase->IsUsedMaxCov44()) {
2979 if(extCov[9] > fProtonAnalysisBase->GetMaxCov44()) {
2980 ((TH1F *)(fQAAntiProtonsRejectedList->At(7)))->Fill(extCov[9]);
2981 }
2982 else if(extCov[9] <= fProtonAnalysisBase->GetMaxCov44())
2983 ((TH1F *)(fQAAntiProtonsAcceptedList->At(7)))->Fill(extCov[9]);
2984 }//cov11
2985 if(fProtonAnalysisBase->IsUsedMaxCov55()) {
2986 if(extCov[14] > fProtonAnalysisBase->GetMaxCov55()) {
2987 ((TH1F *)(fQAAntiProtonsRejectedList->At(8)))->Fill(extCov[14]);
2988 }
2989 else if(extCov[14] <= fProtonAnalysisBase->GetMaxCov55())
2990 ((TH1F *)(fQAAntiProtonsAcceptedList->At(8)))->Fill(extCov[14]);
2991 }//cov55
2992 if(fProtonAnalysisBase->IsUsedMaxSigmaToVertex()) {
2993 if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertex()) {
2994 ((TH1F *)(fQAAntiProtonsRejectedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2995 }
2996 else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertex())
2997 ((TH1F *)(fQAAntiProtonsAcceptedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2998 }//sigma to vertex
2999 if(fProtonAnalysisBase->IsUsedMaxSigmaToVertexTPC()) {
3000 if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertexTPC()) {
3001 ((TH1F *)(fQAAntiProtonsRejectedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
3002 }
3003 else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertexTPC())
3004 ((TH1F *)(fQAAntiProtonsAcceptedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
3005 }//sigma to vertex TPC
3006 if(fProtonAnalysisBase->IsUsedMaxDCAXY()) {
3007 if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
3008 ((TH1F *)(fQAAntiProtonsRejectedList->At(11)))->Fill(TMath::Abs(dca[0]));
3009 }
3010 else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
3011 ((TH1F *)(fQAAntiProtonsAcceptedList->At(11)))->Fill(TMath::Abs(dca[0]));
3012 }//DCA xy global tracking
3013 if(fProtonAnalysisBase->IsUsedMaxDCAXYTPC()) {
3014 if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXYTPC()) {
3015 ((TH1F *)(fQAAntiProtonsRejectedList->At(12)))->Fill(TMath::Abs(dca[0]));
3016 }
3017 else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXYTPC())
3018 ((TH1F *)(fQAAntiProtonsAcceptedList->At(12)))->Fill(TMath::Abs(dca[0]));
3019 }//DCA xy TPC tracking
3020 if(fProtonAnalysisBase->IsUsedMaxDCAZ()) {
3021 if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
3022 ((TH1F *)(fQAAntiProtonsRejectedList->At(13)))->Fill(TMath::Abs(dca[1]));
3023 }
3024 else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
3025 ((TH1F *)(fQAAntiProtonsAcceptedList->At(13)))->Fill(TMath::Abs(dca[1]));
3026 }//DCA z global tracking
3027 if(fProtonAnalysisBase->IsUsedMaxDCAZTPC()) {
3028 if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZTPC()) {
3029 ((TH1F *)(fQAAntiProtonsRejectedList->At(14)))->Fill(TMath::Abs(dca[1]));
3030 }
3031 else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZTPC())
3032 ((TH1F *)(fQAAntiProtonsAcceptedList->At(14)))->Fill(TMath::Abs(dca[1]));
3033 }//DCA z TPC tracking
3034 if(fProtonAnalysisBase->IsUsedMaxConstrainChi2()) {
3035 if(track->GetConstrainedChi2() > 0) {
3036 if(TMath::Log(track->GetConstrainedChi2()) > fProtonAnalysisBase->GetMaxConstrainChi2()) {
3037 ((TH1F *)(fQAAntiProtonsRejectedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
3038 }
3039 else if(TMath::Log(track->GetConstrainedChi2()) <= fProtonAnalysisBase->GetMaxConstrainChi2())
3040 ((TH1F *)(fQAAntiProtonsAcceptedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
3041 }
3042 }//constrain chi2 - vertex
3043 if(fProtonAnalysisBase->IsUsedITSRefit()) {
3044 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
3045 ((TH1F *)(fQAAntiProtonsRejectedList->At(16)))->Fill(0);
3046 }
3047 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
3048 ((TH1F *)(fQAAntiProtonsAcceptedList->At(16)))->Fill(0);
3049 }//ITS refit
3050 if(fProtonAnalysisBase->IsUsedTPCRefit()) {
3051 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
3052 ((TH1F *)(fQAAntiProtonsRejectedList->At(17)))->Fill(0);
3053 }
3054 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
3055 ((TH1F *)(fQAAntiProtonsAcceptedList->At(17)))->Fill(0);
3056 }//TPC refit
3057 if(fProtonAnalysisBase->IsUsedESDpid()) {
3058 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
3059 ((TH1F *)(fQAAntiProtonsRejectedList->At(18)))->Fill(0);
3060 }
3061 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
3062 ((TH1F *)(fQAAntiProtonsAcceptedList->At(18)))->Fill(0);
3063 }//ESD pid
3064 if(fProtonAnalysisBase->IsUsedTPCpid()) {
3065 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
3066 ((TH1F *)(fQAAntiProtonsRejectedList->At(19)))->Fill(0);
3067 }
3068 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
3069 ((TH1F *)(fQAAntiProtonsAcceptedList->At(19)))->Fill(0);
3070 }//TPC pid
3071 if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
3072 if(!track->HasPointOnITSLayer(0)) {
3073 ((TH1F *)(fQAAntiProtonsRejectedList->At(20)))->Fill(0);
3074 }
3075 else if(track->HasPointOnITSLayer(0))
3076 ((TH1F *)(fQAAntiProtonsAcceptedList->At(20)))->Fill(0);
3077 }//point on SPD1
3078 if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
3079 if(!track->HasPointOnITSLayer(1)) {
3080 ((TH1F *)(fQAAntiProtonsRejectedList->At(21)))->Fill(0);
3081 }
3082 else if(track->HasPointOnITSLayer(1))
3083 ((TH1F *)(fQAAntiProtonsAcceptedList->At(21)))->Fill(0);
3084 }//point on SPD2
3085 if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
3086 if(!track->HasPointOnITSLayer(2)) {
3087 ((TH1F *)(fQAAntiProtonsRejectedList->At(22)))->Fill(0);
3088 }
3089 else if(track->HasPointOnITSLayer(2))
3090 ((TH1F *)(fQAAntiProtonsAcceptedList->At(22)))->Fill(0);
3091 }//point on SDD1
3092 if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
3093 if(!track->HasPointOnITSLayer(3)) {
3094 ((TH1F *)(fQAAntiProtonsRejectedList->At(23)))->Fill(0);
3095 }
3096 else if(track->HasPointOnITSLayer(3))
3097 ((TH1F *)(fQAAntiProtonsAcceptedList->At(23)))->Fill(0);
3098 }//point on SDD2
3099 if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
3100 if(!track->HasPointOnITSLayer(4)) {
3101 ((TH1F *)(fQAAntiProtonsRejectedList->At(24)))->Fill(0);
3102 }
3103 else if(track->HasPointOnITSLayer(4))
3104 ((TH1F *)(fQAAntiProtonsAcceptedList->At(24)))->Fill(0);
3105 }//point on SSD1
3106 if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
3107 if(!track->HasPointOnITSLayer(5)) {
3108 ((TH1F *)(fQAAntiProtonsRejectedList->At(25)))->Fill(0);
3109 }
3110 else if(track->HasPointOnITSLayer(5))
3111 ((TH1F *)(fQAAntiProtonsAcceptedList->At(25)))->Fill(0);
3112 }//point on SSD2
3113 if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
3114 if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
3115 ((TH1F *)(fQAAntiProtonsRejectedList->At(26)))->Fill(track->GetTPCsignalN());
3116 }
3117 if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
3118 ((TH1F *)(fQAAntiProtonsAcceptedList->At(26)))->Fill(track->GetTPCsignalN());
3119 }//number of TPC points for the dE/dx
71a67ee1 3120 if(fProtonAnalysisBase->IsUsedPointOnSPDLayer()) {
3121 if((!track->HasPointOnITSLayer(0))&&(!track->HasPointOnITSLayer(1))) {
3122 for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
3123 if(track->HasPointOnITSLayer(iLayer))
3124 ((TH1F *)(fQAAntiProtonsRejectedList->At(27)))->Fill(iLayer+1);
3125 }
3126 }
3127 else if((track->HasPointOnITSLayer(0))||(track->HasPointOnITSLayer(1))) {
3128 for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
3129 if(track->HasPointOnITSLayer(iLayer))
3130 ((TH1F *)(fQAAntiProtonsAcceptedList->At(27)))->Fill(iLayer+1);
3131 }
3132 }
3133 }//point on either SPD layers
3134 if(fProtonAnalysisBase->IsUsedMaxDCA3D()) {
3135 if(dca3D > fProtonAnalysisBase->GetMaxDCA3D()) {
3136 ((TH1F *)(fQAAntiProtonsRejectedList->At(28)))->Fill(dca3D);
3137 }
3138 if(dca3D < fProtonAnalysisBase->GetMaxDCA3D())
3139 ((TH1F *)(fQAAntiProtonsAcceptedList->At(28)))->Fill(dca3D);
3140 }//dca3D
735cc63d 3141 }//antiprotons
3142}