1 /**************************************************************************
2 * Author: Panos Christakoglou. *
3 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //-----------------------------------------------------------------
17 // AliProtonAnalysis class
18 // This is the class to deal with the proton analysis
19 // Origin: Panos Christakoglou | Panos.Christakoglou@cern.ch
20 //-----------------------------------------------------------------
21 #include <Riostream.h>
29 #include <TParticle.h>
32 #include <AliExternalTrackParam.h>
33 #include <AliAODEvent.h>
34 #include <AliESDEvent.h>
38 #include <AliCFContainer.h>
39 #include <AliCFEffGrid.h>
40 #include <AliCFDataGrid.h>
41 #include <AliTPCPIDResponse.h>
42 #include <AliESDpid.h>
46 #include "AliProtonAnalysis.h"
47 #include "AliProtonAnalysisBase.h"
49 ClassImp(AliProtonAnalysis)
51 //____________________________________________________________________//
52 AliProtonAnalysis::AliProtonAnalysis() :
53 TObject(), fProtonAnalysisBase(0),
54 fNBinsY(0), fMinY(0), fMaxY(0),
55 fNBinsPt(0), fMinPt(0), fMaxPt(0),
56 fProtonContainer(0), fAntiProtonContainer(0),
57 fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
58 fHistYPtProtonsCorrected(0), fHistYPtAntiProtonsCorrected(0),
59 fHistEventStats(0), fYRatioInPtBinsList(0),
60 fEffGridListProtons(0), fCorrectionListProtons2D(0),
61 fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
62 fEffGridListAntiProtons(0), fCorrectionListAntiProtons2D(0),
63 fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0),
64 fCorrectProtons(0), fCorrectAntiProtons(0),
65 fHistEfficiencyYPtProtons(0), fHistEfficiencyYPtAntiProtons(0),
66 fHistCorrectionForCrossSectionYPtProtons(0),
67 fHistCorrectionForCrossSectionYPtAntiProtons(0),
68 fHistCorrectionForCrossSectionFlag(kFALSE),
69 fHistYPtCorrectionForSecondaries(0), fCorrectForSecondariesFlag(kFALSE),
70 fGlobalQAList(0), fQA2DList(0),
71 fQAProtonsAcceptedList(0), fQAProtonsRejectedList(0),
72 fQAAntiProtonsAcceptedList(0), fQAAntiProtonsRejectedList(0),
77 //____________________________________________________________________//
78 AliProtonAnalysis::AliProtonAnalysis(Int_t nbinsY,
79 Float_t fLowY, Float_t fHighY,
81 Float_t fLowPt, Float_t fHighPt) :
82 TObject(), fProtonAnalysisBase(0),
83 fNBinsY(nbinsY), fMinY(fLowY), fMaxY(fHighY),
84 fNBinsPt(nbinsPt), fMinPt(fLowPt), fMaxPt(fHighPt),
85 fProtonContainer(0), fAntiProtonContainer(0),
86 fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
87 fHistYPtProtonsCorrected(0), fHistYPtAntiProtonsCorrected(0),
88 fHistEventStats(0), fYRatioInPtBinsList(0),
89 fEffGridListProtons(0), fCorrectionListProtons2D(0),
90 fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
91 fEffGridListAntiProtons(0), fCorrectionListAntiProtons2D(0),
92 fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0),
93 fCorrectProtons(0), fCorrectAntiProtons(0),
94 fHistEfficiencyYPtProtons(0), fHistEfficiencyYPtAntiProtons(0),
95 fHistCorrectionForCrossSectionYPtProtons(0),
96 fHistCorrectionForCrossSectionYPtAntiProtons(0),
97 fHistCorrectionForCrossSectionFlag(kFALSE),
98 fHistYPtCorrectionForSecondaries(0), fCorrectForSecondariesFlag(kFALSE),
99 fGlobalQAList(0), fQA2DList(0),
100 fQAProtonsAcceptedList(0), fQAProtonsRejectedList(0),
101 fQAAntiProtonsAcceptedList(0), fQAAntiProtonsRejectedList(0),
102 fInitQAFlag(kFALSE) {
103 //Default constructor
104 fHistEvents = new TH1I("fHistEvents","Analyzed events",2,0.5,2.5);
105 fHistEvents->GetXaxis()->SetBinLabel(1,"Analyzed events");
106 fHistEvents->GetXaxis()->SetBinLabel(2,"Events with (anti)protons");
108 fHistYPtProtons = new TH2D("fHistYPtProtons","Protons",
110 fNBinsPt,fMinPt,fMaxPt);
111 fHistYPtProtons->SetStats(kTRUE);
112 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
113 if(fProtonAnalysisBase->GetEtaMode())
114 fHistYPtProtons->GetXaxis()->SetTitle("#eta");
116 fHistYPtProtons->GetXaxis()->SetTitle("y");
117 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
119 fHistYPtAntiProtons = new TH2D("fHistYPtAntiProtons","Antiprotons",
121 fNBinsPt,fMinPt,fMaxPt);
122 fHistYPtAntiProtons->SetStats(kTRUE);
123 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
124 if(fProtonAnalysisBase->GetEtaMode())
125 fHistYPtAntiProtons->GetXaxis()->SetTitle("#eta");
127 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
128 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
130 fHistYPtProtonsCorrected = new TH2D("fHistYPtProtonsCorrected","Protons",
132 fNBinsPt,fMinPt,fMaxPt);
133 fHistYPtProtonsCorrected->SetStats(kTRUE);
134 fHistYPtProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
135 if(fProtonAnalysisBase->GetEtaMode())
136 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("#eta");
138 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("y");
139 fHistYPtProtonsCorrected->GetXaxis()->SetTitleColor(1);
141 fHistYPtAntiProtonsCorrected = new TH2D("fHistYPtAntiProtonsCorrected",
144 fNBinsPt,fMinPt,fMaxPt);
145 fHistYPtAntiProtonsCorrected->SetStats(kTRUE);
146 fHistYPtAntiProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
147 if(fProtonAnalysisBase->GetEtaMode())
148 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("#eta");
150 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("y");
151 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitleColor(1);
153 //setting up the containers
157 Double_t *binLimY = new Double_t[nbinsY+1];
158 Double_t *binLimPt = new Double_t[nbinsPt+1];
159 //values for bin lower bounds
160 for(Int_t i = 0; i <= nbinsY; i++)
161 binLimY[i]=(Double_t)fLowY + (fHighY - fLowY) /nbinsY*(Double_t)i;
162 for(Int_t i = 0; i <= nbinsPt; i++)
163 binLimPt[i]=(Double_t)fLowPt + (fHighPt - fLowPt) /nbinsPt*(Double_t)i;
165 fProtonContainer = new AliCFContainer("containerProtons",
166 "container for protons",
168 fProtonContainer->SetBinLimits(0,binLimY); //rapidity or eta
169 fProtonContainer->SetBinLimits(1,binLimPt); //pT
170 fAntiProtonContainer = new AliCFContainer("containerAntiProtons",
171 "container for antiprotons",
173 fAntiProtonContainer->SetBinLimits(0,binLimY); //rapidity or eta
174 fAntiProtonContainer->SetBinLimits(1,binLimPt); //pT
177 if(!fInitQAFlag) InitQA();
180 //____________________________________________________________________//
181 AliProtonAnalysis::AliProtonAnalysis(Int_t nbinsY, Double_t *gY,
182 Int_t nbinsPt,Double_t *gPt) :
183 TObject(), fProtonAnalysisBase(0),
184 fNBinsY(nbinsY), fMinY(gY[0]), fMaxY(gY[nbinsY]),
185 fNBinsPt(nbinsPt), fMinPt(gPt[0]), fMaxPt(gPt[nbinsPt]),
186 fProtonContainer(0), fAntiProtonContainer(0),
187 fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
188 fHistYPtProtonsCorrected(0), fHistYPtAntiProtonsCorrected(0),
189 fHistEventStats(0), fYRatioInPtBinsList(0),
190 fEffGridListProtons(0), fCorrectionListProtons2D(0),
191 fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
192 fEffGridListAntiProtons(0), fCorrectionListAntiProtons2D(0),
193 fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0),
194 fCorrectProtons(0), fCorrectAntiProtons(0),
195 fHistEfficiencyYPtProtons(0), fHistEfficiencyYPtAntiProtons(0),
196 fHistCorrectionForCrossSectionYPtProtons(0),
197 fHistCorrectionForCrossSectionYPtAntiProtons(0),
198 fHistCorrectionForCrossSectionFlag(kFALSE),
199 fHistYPtCorrectionForSecondaries(0), fCorrectForSecondariesFlag(kFALSE),
200 fGlobalQAList(0), fQA2DList(0),
201 fQAProtonsAcceptedList(0), fQAProtonsRejectedList(0),
202 fQAAntiProtonsAcceptedList(0), fQAAntiProtonsRejectedList(0),
203 fInitQAFlag(kFALSE) {
204 //Default constructor
205 fHistEvents = new TH1I("fHistEvents","Analyzed events",2,0.5,2.5);
206 fHistEvents->GetXaxis()->SetBinLabel(1,"Analyzed events");
207 fHistEvents->GetXaxis()->SetBinLabel(2,"Events with (anti)protons");
209 fHistYPtProtons = new TH2D("fHistYPtProtons","Protons",
210 fNBinsY,gY,fNBinsPt,gPt);
211 fHistYPtProtons->SetStats(kTRUE);
212 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
213 if(fProtonAnalysisBase->GetEtaMode())
214 fHistYPtProtons->GetXaxis()->SetTitle("#eta");
216 fHistYPtProtons->GetXaxis()->SetTitle("y");
217 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
219 fHistYPtAntiProtons = new TH2D("fHistYPtAntiProtons","Antiprotons",
220 fNBinsY,gY,fNBinsPt,gPt);
221 fHistYPtAntiProtons->SetStats(kTRUE);
222 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
223 if(fProtonAnalysisBase->GetEtaMode())
224 fHistYPtAntiProtons->GetXaxis()->SetTitle("#eta");
226 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
227 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
229 fHistYPtProtonsCorrected = new TH2D("fHistYPtProtonsCorrected","Protons",
231 fNBinsPt,fMinPt,fMaxPt);
232 fHistYPtProtonsCorrected->SetStats(kTRUE);
233 fHistYPtProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
234 if(fProtonAnalysisBase->GetEtaMode())
235 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("#eta");
237 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("y");
238 fHistYPtProtonsCorrected->GetXaxis()->SetTitleColor(1);
240 fHistYPtAntiProtonsCorrected = new TH2D("fHistYPtAntiProtonsCorrected",
243 fNBinsPt,fMinPt,fMaxPt);
244 fHistYPtAntiProtonsCorrected->SetStats(kTRUE);
245 fHistYPtAntiProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
246 if(fProtonAnalysisBase->GetEtaMode())
247 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("#eta");
249 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("y");
250 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitleColor(1);
252 //setting up the containers
256 fProtonContainer = new AliCFContainer("containerProtons",
257 "container for protons",
259 fProtonContainer->SetBinLimits(0,gY); //rapidity or eta
260 fProtonContainer->SetBinLimits(1,gPt); //pT
261 fAntiProtonContainer = new AliCFContainer("containerAntiProtons",
262 "container for antiprotons",
264 fAntiProtonContainer->SetBinLimits(0,gY); //rapidity or eta
265 fAntiProtonContainer->SetBinLimits(1,gPt); //pT
268 if(!fInitQAFlag) InitQA();
271 //____________________________________________________________________//
272 AliProtonAnalysis::~AliProtonAnalysis() {
274 if(fProtonAnalysisBase) delete fProtonAnalysisBase;
276 if(fHistEvents) delete fHistEvents;
277 if(fHistYPtProtons) delete fHistYPtProtons;
278 if(fHistYPtAntiProtons) delete fHistYPtAntiProtons;
279 if(fHistYPtProtonsCorrected) delete fHistYPtProtonsCorrected;
280 if(fHistYPtAntiProtonsCorrected) delete fHistYPtAntiProtonsCorrected;
281 if(fHistEventStats) delete fHistEventStats;
282 if(fYRatioInPtBinsList) delete fYRatioInPtBinsList;
284 if(fProtonContainer) delete fProtonContainer;
285 if(fAntiProtonContainer) delete fAntiProtonContainer;
287 if(fEffGridListProtons) delete fEffGridListProtons;
288 if(fCorrectionListProtons2D) delete fCorrectionListProtons2D;
289 if(fEfficiencyListProtons1D) delete fEfficiencyListProtons1D;
290 if(fCorrectionListProtons1D) delete fCorrectionListProtons1D;
291 if(fEffGridListAntiProtons) delete fEffGridListAntiProtons;
292 if(fCorrectionListAntiProtons2D) delete fCorrectionListAntiProtons2D;
293 if(fEfficiencyListAntiProtons1D) delete fEfficiencyListAntiProtons1D;
294 if(fCorrectionListAntiProtons1D) delete fCorrectionListAntiProtons1D;
295 if(fCorrectProtons) delete fCorrectProtons;
296 if(fCorrectAntiProtons) delete fCorrectAntiProtons;
297 if(fHistEfficiencyYPtProtons) delete fHistEfficiencyYPtProtons;
298 if(fHistEfficiencyYPtAntiProtons) delete fHistEfficiencyYPtAntiProtons;
299 if(fHistCorrectionForCrossSectionYPtProtons) delete fHistCorrectionForCrossSectionYPtProtons;
300 if(fHistCorrectionForCrossSectionYPtAntiProtons) delete fHistCorrectionForCrossSectionYPtAntiProtons;
301 if(fHistYPtCorrectionForSecondaries) delete fHistYPtCorrectionForSecondaries;
304 if(fGlobalQAList) delete fGlobalQAList;
305 if(fQA2DList) delete fQA2DList;
306 if(fQAProtonsAcceptedList) delete fQAProtonsAcceptedList;
307 if(fQAProtonsRejectedList) delete fQAProtonsRejectedList;
308 if(fQAAntiProtonsAcceptedList) delete fQAAntiProtonsAcceptedList;
309 if(fQAAntiProtonsRejectedList) delete fQAAntiProtonsRejectedList;
312 //____________________________________________________________________//
313 void AliProtonAnalysis::InitAnalysisHistograms(Int_t nbinsY,
314 Float_t fLowY, Float_t fHighY,
316 Float_t fLowPt, Float_t fHighPt) {
317 //Initializes the histograms
325 fHistEvents = new TH1I("fHistEvents","Analyzed events",2,0.5,2.5);
326 fHistEvents->GetXaxis()->SetBinLabel(1,"Analyzed events");
327 fHistEvents->GetXaxis()->SetBinLabel(2,"Events with (anti)protons");
329 fHistYPtProtons = new TH2D("fHistYPtProtons","Protons",
331 fNBinsPt,fMinPt,fMaxPt);
332 fHistYPtProtons->SetStats(kTRUE);
333 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
334 if(fProtonAnalysisBase->GetEtaMode())
335 fHistYPtProtons->GetXaxis()->SetTitle("#eta");
337 fHistYPtProtons->GetXaxis()->SetTitle("y");
338 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
340 fHistYPtAntiProtons = new TH2D("fHistYPtAntiProtons","Antiprotons",
342 fNBinsPt,fMinPt,fMaxPt);
343 fHistYPtAntiProtons->SetStats(kTRUE);
344 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
345 if(fProtonAnalysisBase->GetEtaMode())
346 fHistYPtAntiProtons->GetXaxis()->SetTitle("#eta");
348 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
349 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
351 fHistYPtProtonsCorrected = new TH2D("fHistYPtProtonsCorrected","Protons",
353 fNBinsPt,fMinPt,fMaxPt);
354 fHistYPtProtonsCorrected->SetStats(kTRUE);
355 fHistYPtProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
356 if(fProtonAnalysisBase->GetEtaMode())
357 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("#eta");
359 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("y");
360 fHistYPtProtonsCorrected->GetXaxis()->SetTitleColor(1);
362 fHistYPtAntiProtonsCorrected = new TH2D("fHistYPtAntiProtonsCorrected",
365 fNBinsPt,fMinPt,fMaxPt);
366 fHistYPtAntiProtonsCorrected->SetStats(kTRUE);
367 fHistYPtAntiProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
368 if(fProtonAnalysisBase->GetEtaMode())
369 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("#eta");
371 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("y");
372 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitleColor(1);
374 //setting up the containers
378 Double_t *binLimY = new Double_t[nbinsY+1];
379 Double_t *binLimPt = new Double_t[nbinsPt+1];
380 //values for bin lower bounds
381 for(Int_t i = 0; i <= nbinsY; i++)
382 binLimY[i]=(Double_t)fLowY + (fHighY - fLowY) /nbinsY*(Double_t)i;
383 for(Int_t i = 0; i <= nbinsPt; i++)
384 binLimPt[i]=(Double_t)fLowPt + (fHighPt - fLowPt) /nbinsPt*(Double_t)i;
386 fProtonContainer = new AliCFContainer("containerProtons",
387 "container for protons",
389 fProtonContainer->SetBinLimits(0,binLimY); //rapidity
390 fProtonContainer->SetBinLimits(1,binLimPt); //pT
391 fAntiProtonContainer = new AliCFContainer("containerAntiProtons",
392 "container for antiprotons",
394 fAntiProtonContainer->SetBinLimits(0,binLimY); //rapidity
395 fAntiProtonContainer->SetBinLimits(1,binLimPt); //pT
398 if(!fInitQAFlag) InitQA();
401 //____________________________________________________________________//
402 void AliProtonAnalysis::InitAnalysisHistograms(Int_t nbinsY, Double_t *gY,
403 Int_t nbinsPt, Double_t *gPt) {
404 //Initializes the histograms using asymmetric values - global tracking
410 fMaxPt = gPt[nbinsPt];
412 fHistEvents = new TH1I("fHistEvents","Analyzed events",2,0.5,2.5);
413 fHistEvents->GetXaxis()->SetBinLabel(1,"Analyzed events");
414 fHistEvents->GetXaxis()->SetBinLabel(2,"Events with (anti)protons");
416 fHistYPtProtons = new TH2D("fHistYPtProtons","Protons",
417 fNBinsY,gY,fNBinsPt,gPt);
418 fHistYPtProtons->SetStats(kTRUE);
419 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
420 if(fProtonAnalysisBase->GetEtaMode())
421 fHistYPtProtons->GetXaxis()->SetTitle("#eta");
423 fHistYPtProtons->GetXaxis()->SetTitle("y");
424 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
426 fHistYPtAntiProtons = new TH2D("fHistYPtAntiProtons","Antiprotons",
427 fNBinsY,gY,fNBinsPt,gPt);
428 fHistYPtAntiProtons->SetStats(kTRUE);
429 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV/c]");
430 if(fProtonAnalysisBase->GetEtaMode())
431 fHistYPtAntiProtons->GetXaxis()->SetTitle("#eta");
433 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
434 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
436 fHistYPtProtonsCorrected = new TH2D("fHistYPtProtonsCorrected","Protons",
437 fNBinsY,gY,fNBinsPt,gPt);
438 fHistYPtProtonsCorrected->SetStats(kTRUE);
439 fHistYPtProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
440 if(fProtonAnalysisBase->GetEtaMode())
441 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("#eta");
443 fHistYPtProtonsCorrected->GetXaxis()->SetTitle("y");
444 fHistYPtProtonsCorrected->GetXaxis()->SetTitleColor(1);
446 fHistYPtAntiProtonsCorrected = new TH2D("fHistYPtAntiProtonsCorrected",
448 fNBinsY,gY,fNBinsPt,gPt);
449 fHistYPtAntiProtonsCorrected->SetStats(kTRUE);
450 fHistYPtAntiProtonsCorrected->GetYaxis()->SetTitle("P_{T} [GeV/c]");
451 if(fProtonAnalysisBase->GetEtaMode())
452 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("#eta");
454 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitle("y");
455 fHistYPtAntiProtonsCorrected->GetXaxis()->SetTitleColor(1);
457 //setting up the containers
462 fProtonContainer = new AliCFContainer("containerProtons",
463 "container for protons",
465 fProtonContainer->SetBinLimits(0,gY); //rapidity
466 fProtonContainer->SetBinLimits(1,gPt); //pT
467 fAntiProtonContainer = new AliCFContainer("containerAntiProtons",
468 "container for antiprotons",
470 fAntiProtonContainer->SetBinLimits(0,gY); //rapidity
471 fAntiProtonContainer->SetBinLimits(1,gPt); //pT
474 if(!fInitQAFlag) InitQA();
477 //____________________________________________________________________//
478 Bool_t AliProtonAnalysis::ReadFromFile(const char* filename) {
479 //Read the containers from the existing file
480 Bool_t status = kTRUE;
482 TFile *file = TFile::Open(filename);
484 cout<<"Could not find the input file "<<filename<<endl;
488 TList *list = (TList *)file->Get("outputList");
490 cout<<"Retrieving objects from the list "<<list->GetName()<<"..."<<endl;
491 fHistYPtProtons = (TH2D *)list->At(0);
492 fHistYPtAntiProtons = (TH2D *)list->At(1);
493 fHistEvents = (TH1I *)list->At(2);
494 fProtonContainer = (AliCFContainer *)list->At(3);
495 fAntiProtonContainer = (AliCFContainer *)list->At(4);
496 fHistEventStats = (TH1F *)list->At(5);
499 cout<<"Retrieving objects from the file... "<<endl;
500 fHistYPtProtons = (TH2D *)file->Get("fHistYPtProtons");
501 fHistYPtAntiProtons = (TH2D *)file->Get("fHistYPtAntiProtons");
502 fHistEvents = (TH1I *)file->Get("fHistEvents");
503 fProtonContainer = (AliCFContainer *)file->Get("containerProtons");
504 fAntiProtonContainer = (AliCFContainer *)file->Get("containerAntiProtons");
505 fHistEventStats = (TH1F *)file->Get("fHistEventStats");
507 if((!fHistYPtProtons)||(!fHistYPtAntiProtons)||(!fHistEvents)
508 ||(!fProtonContainer)||(!fAntiProtonContainer)||(!fHistEventStats)) {
509 cout<<"Input containers were not found!!!"<<endl;
513 //fHistYPtProtons = fProtonContainer->ShowProjection(0,1,0);
514 //fHistYPtAntiProtons = fAntiProtonContainer->ShowProjection(0,1,0);
515 fHistYPtProtons->Sumw2();
516 fHistYPtAntiProtons->Sumw2();
522 //____________________________________________________________________//
523 TList *AliProtonAnalysis::GetYRatioHistogramsInPtBins() {
524 //Returns a TList obkect with the eta (or y) dependent ratios for each
525 //pT bin taken from the 2D histograms (not from the containers)
526 fYRatioInPtBinsList = new TList();
529 TH1D *gHistYProtons[100];
531 for(Int_t iBin = 1; iBin <= fHistYPtProtons->GetNbinsY(); iBin++) {
532 title = "gHistYProtons_PtBin"; title += iBin;
533 gHistYProtons[iBin] = (TH1D *)fHistYPtProtons->ProjectionX(title.Data(),
536 gHistYProtons[iBin]->Sumw2();
540 TH1D *gHistYAntiProtons[100];
541 for(Int_t iBin = 1; iBin <= fHistYPtAntiProtons->GetNbinsY(); iBin++) {
542 title = "gHistYAntiProtons_PtBin"; title += iBin;
543 gHistYAntiProtons[iBin] = (TH1D *)fHistYPtAntiProtons->ProjectionX(title.Data(),
546 gHistYAntiProtons[iBin]->Sumw2();
549 Double_t pTmin = fHistYPtProtons->GetYaxis()->GetXmin();
550 Double_t pTStep = (fHistYPtProtons->GetYaxis()->GetXmax() - fHistYPtProtons->GetYaxis()->GetXmin())/fHistYPtProtons->GetNbinsY();
551 Double_t pTmax = pTmin + pTStep;
553 TH1D *gHistYRatio[100];
554 for(Int_t iBin = 1; iBin <= fHistYPtProtons->GetNbinsY(); iBin++) {
555 title = "gHistYRatio_PtBin"; title += iBin;
556 gHistYRatio[iBin] = new TH1D(title.Data(),"",
557 fHistYPtProtons->GetNbinsX(),
558 fHistYPtProtons->GetXaxis()->GetXmin(),
559 fHistYPtProtons->GetXaxis()->GetXmax());
560 title = "Pt: "; title += pTmin; title += " - "; title += pTmax;
561 gHistYRatio[iBin]->SetTitle(title.Data());
562 gHistYRatio[iBin]->GetYaxis()->SetTitle("#bar{p}/p");
563 gHistYRatio[iBin]->GetXaxis()->SetTitle(fHistYPtProtons->GetXaxis()->GetTitle());
564 gHistYRatio[iBin]->Divide(gHistYAntiProtons[iBin],
565 gHistYProtons[iBin],1.0,1.0,"b");
566 fYRatioInPtBinsList->Add(gHistYRatio[iBin]);
571 return fYRatioInPtBinsList;
574 //____________________________________________________________________//
575 TH1D *AliProtonAnalysis::GetProtonYHistogram() {
576 //Get the y histogram for protons
577 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
579 //TH1D *fYProtons = (TH1D *)fHistYPtProtons->ProjectionX("fYProtons",0,fHistYPtProtons->GetYaxis()->GetNbins(),"");
580 TH1D *fYProtons = fProtonContainer->ShowProjection(0,kStepInPhaseSpace); //variable-step
582 fYProtons->SetStats(kFALSE);
583 fYProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
584 fYProtons->SetTitle("dN/dy protons");
585 fYProtons->SetMarkerStyle(kFullCircle);
586 fYProtons->SetMarkerColor(4);
587 if(nAnalyzedEvents > 0)
588 fYProtons->Scale(1./nAnalyzedEvents);
593 //____________________________________________________________________//
594 TH1D *AliProtonAnalysis::GetAntiProtonYHistogram() {
595 //Get the y histogram for antiprotons
596 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
598 //TH1D *fYAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionX("fYAntiProtons",0,fHistYPtAntiProtons->GetYaxis()->GetNbins(),"");
599 TH1D *fYAntiProtons = fAntiProtonContainer->ShowProjection(0,kStepInPhaseSpace);//variable-step
601 fYAntiProtons->SetStats(kFALSE);
602 fYAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
603 fYAntiProtons->SetTitle("dN/dy antiprotons");
604 fYAntiProtons->SetMarkerStyle(kFullCircle);
605 fYAntiProtons->SetMarkerColor(4);
606 if(nAnalyzedEvents > 0)
607 fYAntiProtons->Scale(1./nAnalyzedEvents);
609 return fYAntiProtons;
612 //____________________________________________________________________//
613 TH1D *AliProtonAnalysis::GetProtonPtHistogram() {
614 //Get the Pt histogram for protons
615 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
617 //TH1D *fPtProtons = (TH1D *)fHistYPtProtons->ProjectionY("fPtProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"");
618 TH1D *fPtProtons = fProtonContainer->ShowProjection(1,kStepInPhaseSpace); //variable-step
620 fPtProtons->SetStats(kFALSE);
621 fPtProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
622 fPtProtons->SetTitle("dN/dPt protons");
623 fPtProtons->SetMarkerStyle(kFullCircle);
624 fPtProtons->SetMarkerColor(4);
625 if(nAnalyzedEvents > 0)
626 fPtProtons->Scale(1./nAnalyzedEvents);
631 //____________________________________________________________________//
632 TH1D *AliProtonAnalysis::GetAntiProtonPtHistogram() {
633 //Get the Pt histogram for antiprotons
634 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
636 //TH1D *fPtAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionY("fPtAntiProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"");
637 TH1D *fPtAntiProtons = fAntiProtonContainer->ShowProjection(1,kStepInPhaseSpace); //variable-step
639 fPtAntiProtons->SetStats(kFALSE);
640 fPtAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
641 fPtAntiProtons->SetTitle("dN/dPt antiprotons");
642 fPtAntiProtons->SetMarkerStyle(kFullCircle);
643 fPtAntiProtons->SetMarkerColor(4);
644 if(nAnalyzedEvents > 0)
645 fPtAntiProtons->Scale(1./nAnalyzedEvents);
647 return fPtAntiProtons;
650 //____________________________________________________________________//
651 TH1D *AliProtonAnalysis::GetProtonCorrectedYHistogram() {
652 //Get the corrected y histogram for protons
653 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
655 TH1D *fYProtons = (TH1D *)fHistYPtProtonsCorrected->ProjectionX("fYProtons",1,fHistYPtProtons->GetYaxis()->GetNbins(),"e");
656 //TH1D *fYProtons = fCorrectProtons->Project(0); //0: rapidity
658 fYProtons->SetStats(kFALSE);
659 fYProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
660 fYProtons->GetXaxis()->SetTitle("y");
661 fYProtons->SetTitle("dN/dy protons");
662 fYProtons->SetMarkerStyle(kFullCircle);
663 fYProtons->SetMarkerColor(4);
664 if(nAnalyzedEvents > 0)
665 fYProtons->Scale(1./nAnalyzedEvents);
670 //____________________________________________________________________//
671 TH1D *AliProtonAnalysis::GetAntiProtonCorrectedYHistogram() {
672 //Get the corrected y histogram for antiprotons
673 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
675 TH1D *fYAntiProtons = (TH1D *)fHistYPtAntiProtonsCorrected->ProjectionX("fYAntiProtons",1,fHistYPtAntiProtons->GetYaxis()->GetNbins(),"e");
676 //TH1D *fYAntiProtons = fCorrectAntiProtons->Project(0); //0: rapidity
678 fYAntiProtons->SetStats(kFALSE);
679 fYAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
680 fYAntiProtons->GetXaxis()->SetTitle("y");
681 fYAntiProtons->SetTitle("dN/dy protons");
682 fYAntiProtons->SetMarkerStyle(kFullCircle);
683 fYAntiProtons->SetMarkerColor(4);
684 if(nAnalyzedEvents > 0)
685 fYAntiProtons->Scale(1./nAnalyzedEvents);
687 return fYAntiProtons;
690 //____________________________________________________________________//
691 TH1D *AliProtonAnalysis::GetProtonCorrectedPtHistogram() {
692 //Get the corrected Pt histogram for protons
693 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
695 TH1D *fPtProtons = (TH1D *)fHistYPtProtonsCorrected->ProjectionY("fPtProtons",2,fHistYPtProtons->GetXaxis()->GetNbins()-1,"e");
696 //TH1D *fPtProtons = fCorrectProtons->Project(0); //0: rapidity
698 fPtProtons->SetStats(kFALSE);
699 fPtProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
700 fPtProtons->GetXaxis()->SetTitle("P_{T} [GeV/c]");
701 fPtProtons->SetTitle("dN/dPt protons");
702 fPtProtons->SetMarkerStyle(kFullCircle);
703 fPtProtons->SetMarkerColor(4);
704 if(nAnalyzedEvents > 0)
705 fPtProtons->Scale(1./nAnalyzedEvents);
710 //____________________________________________________________________//
711 TH1D *AliProtonAnalysis::GetAntiProtonCorrectedPtHistogram() {
712 //Get the corrected Pt histogram for antiprotons
713 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
715 TH1D *fPtAntiProtons = (TH1D *)fHistYPtAntiProtonsCorrected->ProjectionY("fPtAntiProtons",2,fHistYPtAntiProtons->GetXaxis()->GetNbins()-1,"e");
716 //TH1D *fPtAntiProtons = fCorrectAntiProtons->Project(0); //0: rapidity
718 fPtAntiProtons->SetStats(kFALSE);
719 fPtAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
720 fPtAntiProtons->GetXaxis()->SetTitle("P_{T} [GeV/c]");
721 fPtAntiProtons->SetTitle("dN/dPt antiprotons");
722 fPtAntiProtons->SetMarkerStyle(kFullCircle);
723 fPtAntiProtons->SetMarkerColor(4);
724 if(nAnalyzedEvents > 0)
725 fPtAntiProtons->Scale(1./nAnalyzedEvents);
727 return fPtAntiProtons;
730 //____________________________________________________________________//
731 TH1D *AliProtonAnalysis::GetYRatioHistogram() {
732 //Returns the rapidity dependence of the ratio (uncorrected)
733 TH1D *fYProtons = GetProtonYHistogram();
734 TH1D *fYAntiProtons = GetAntiProtonYHistogram();
736 TH1D *hRatioY = new TH1D("hRatioY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
737 hRatioY->Divide(fYAntiProtons,fYProtons,1.0,1.0,"e");
738 hRatioY->SetMarkerStyle(kFullCircle);
739 hRatioY->SetMarkerColor(4);
740 hRatioY->GetYaxis()->SetTitle("#bar{p}/p");
741 hRatioY->GetYaxis()->SetTitleOffset(1.4);
742 hRatioY->GetXaxis()->SetTitle("y");
743 hRatioY->GetXaxis()->SetTitleColor(1);
744 hRatioY->SetStats(kFALSE);
749 //____________________________________________________________________//
750 TH1D *AliProtonAnalysis::GetYRatioCorrectedHistogram() {
751 //TH2D *gCorrectionProtons,
752 //TH2D *gCorrectionAntiProtons) {
753 //Returns the rapidity dependence of the ratio (corrected)
754 //fHistYPtProtons->Multiply(gCorrectionProtons);
755 TH1D *fYProtons = GetProtonCorrectedYHistogram();
756 //fHistYPtAntiProtons->Multiply(gCorrectionAntiProtons);
757 TH1D *fYAntiProtons = GetAntiProtonCorrectedYHistogram();
759 TH1D *hRatioY = new TH1D("hRatioY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
760 hRatioY->Divide(fYAntiProtons,fYProtons,1.0,1.0,"e");
761 hRatioY->SetMarkerStyle(kFullCircle);
762 hRatioY->SetMarkerColor(4);
763 hRatioY->GetYaxis()->SetTitle("#bar{p}/p");
764 hRatioY->GetYaxis()->SetTitleOffset(1.4);
765 hRatioY->GetXaxis()->SetTitle("y");
766 hRatioY->GetXaxis()->SetTitleColor(1);
767 hRatioY->SetStats(kFALSE);
772 //____________________________________________________________________//
773 TH1D *AliProtonAnalysis::GetPtRatioHistogram() {
774 //Returns the pT dependence of the ratio (uncorrected)
775 TH1D *fPtProtons = GetProtonPtHistogram();
776 TH1D *fPtAntiProtons = GetAntiProtonPtHistogram();
778 TH1D *hRatioPt = new TH1D("hRatioPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
779 hRatioPt->Divide(fPtAntiProtons,fPtProtons,1.0,1.0,"e");
780 hRatioPt->SetMarkerStyle(kFullCircle);
781 hRatioPt->SetMarkerColor(4);
782 hRatioPt->GetYaxis()->SetTitle("#bar{p}/p");
783 hRatioPt->GetYaxis()->SetTitleOffset(1.4);
784 hRatioPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
785 hRatioPt->GetXaxis()->SetTitleColor(1);
786 hRatioPt->SetStats(kFALSE);
791 //____________________________________________________________________//
792 TH1D *AliProtonAnalysis::GetPtRatioCorrectedHistogram() {
793 //TH2D *gCorrectionProtons,
794 //TH2D *gCorrectionAntiProtons) {
795 //Returns the Pt dependence of the ratio (corrected)
796 //fHistYPtProtons->Multiply(gCorrectionProtons);
797 TH1D *fPtProtons = GetProtonCorrectedPtHistogram();
798 //fHistYPtAntiProtons->Multiply(gCorrectionAntiProtons);
799 TH1D *fPtAntiProtons = GetAntiProtonCorrectedPtHistogram();
801 TH1D *hRatioPt = new TH1D("hRatioPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
802 hRatioPt->Divide(fPtAntiProtons,fPtProtons,1.0,1.0,"e");
803 hRatioPt->SetMarkerStyle(kFullCircle);
804 hRatioPt->SetMarkerColor(4);
805 hRatioPt->GetYaxis()->SetTitle("#bar{p}/p");
806 hRatioPt->GetYaxis()->SetTitleOffset(1.4);
807 hRatioPt->GetXaxis()->SetTitle("y");
808 hRatioPt->GetXaxis()->SetTitleColor(1);
809 hRatioPt->SetStats(kFALSE);
814 //____________________________________________________________________//
815 TH1D *AliProtonAnalysis::GetYAsymmetryHistogram() {
816 //Returns the rapidity dependence of the asymmetry (uncorrected)
817 TH1D *fYProtons = GetProtonYHistogram();
818 TH1D *fYAntiProtons = GetAntiProtonYHistogram();
820 TH1D *hsum = new TH1D("hsumY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
821 hsum->Add(fYProtons,fYAntiProtons,1.0,1.0);
823 TH1D *hdiff = new TH1D("hdiffY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
824 hdiff->Add(fYProtons,fYAntiProtons,1.0,-1.0);
826 TH1D *hAsymmetryY = new TH1D("hAsymmetryY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
827 hAsymmetryY->Divide(hdiff,hsum,2.0,1.,"e");
828 hAsymmetryY->SetMarkerStyle(kFullCircle);
829 hAsymmetryY->SetMarkerColor(4);
830 hAsymmetryY->GetYaxis()->SetTitle("A_{p}");
831 hAsymmetryY->GetYaxis()->SetTitleOffset(1.4);
832 hAsymmetryY->GetXaxis()->SetTitle("y");
833 hAsymmetryY->GetXaxis()->SetTitleColor(1);
834 hAsymmetryY->SetStats(kFALSE);
839 //____________________________________________________________________//
840 TH1D *AliProtonAnalysis::GetPtAsymmetryHistogram() {
841 //Returns the pT dependence of the asymmetry (uncorrected)
842 TH1D *fPtProtons = GetProtonPtHistogram();
843 TH1D *fPtAntiProtons = GetAntiProtonPtHistogram();
845 TH1D *hsum = new TH1D("hsumPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
846 hsum->Add(fPtProtons,fPtAntiProtons,1.0,1.0);
848 TH1D *hdiff = new TH1D("hdiffPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
849 hdiff->Add(fPtProtons,fPtAntiProtons,1.0,-1.0);
851 TH1D *hAsymmetryPt = new TH1D("hAsymmetryPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
852 hAsymmetryPt->Divide(hdiff,hsum,2.0,1.,"e");
853 hAsymmetryPt->SetMarkerStyle(kFullCircle);
854 hAsymmetryPt->SetMarkerColor(4);
855 hAsymmetryPt->GetYaxis()->SetTitle("A_{p}");
856 hAsymmetryPt->GetYaxis()->SetTitleOffset(1.4);
857 hAsymmetryPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
858 hAsymmetryPt->GetXaxis()->SetTitleColor(1);
859 hAsymmetryPt->SetStats(kFALSE);
864 //____________________________________________________________________//
865 void AliProtonAnalysis::Analyze(AliESDEvent* esd,
866 const AliESDVertex *vertex) {
867 //Main analysis part - ESD
869 Int_t nIdentifiedProtons = 0, nIdentifiedAntiProtons = 0;
870 Int_t nSurvivedProtons = 0, nSurvivedAntiProtons = 0;
872 //=========================================//
873 //Aleph parametrization
874 Double_t fAlephParameters[5];
875 if(fProtonAnalysisBase->GetMCAnalysisMode()) {
876 fAlephParameters[0] = 2.15898e+00/50.;
877 fAlephParameters[1] = 1.75295e+01;
878 fAlephParameters[2] = 3.40030e-09;
879 fAlephParameters[3] = 1.96178e+00;
880 fAlephParameters[4] = 3.91720e+00;
883 fAlephParameters[0] = 0.0283086;
884 fAlephParameters[1] = 2.63394e+01;
885 fAlephParameters[2] = 5.04114e-11;
886 fAlephParameters[3] = 2.12543e+00;
887 fAlephParameters[4] = 4.88663e+00;
889 AliESDpid *fESDpid = new AliESDpid();
890 AliTPCPIDResponse tpcResponse = fESDpid->GetTPCResponse();
891 tpcResponse.SetBetheBlochParameters(fAlephParameters[0],fAlephParameters[1],fAlephParameters[2],fAlephParameters[3],fAlephParameters[4]);
892 //=========================================//
894 fHistEvents->Fill(1); //number of analyzed events
895 Double_t containerInput[2] ;
896 Double_t gPt = 0.0, gP = 0.0;
897 Float_t dcaXY = 0.0, dcaZ = 0.0;
899 nTracks = esd->GetNumberOfTracks();
900 for(Int_t iTracks = 0; iTracks < nTracks; iTracks++) {
901 AliESDtrack* track = esd->GetTrack(iTracks);
902 AliESDtrack trackTPC;
904 //in case it's a TPC only track relate it to the proper vertex
905 /*if(fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kTPC) {
907 track->GetImpactParametersTPC(p,cov);
908 if (p[0]==0 && p[1]==0)
909 track->RelateToVertexTPC(((AliESDEvent*)esd)->GetPrimaryVertexTPC(),esd->GetMagneticField(),kVeryBig);
910 if (!track->FillTPCOnlyTrack(trackTPC)) {
917 Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
918 Int_t npointsTPCdEdx = track->GetTPCsignalN();
919 Double_t dca[2] = {0.0,0.0}, cov[3] = {0.0,0.0,0.0}; //The impact parameters and their covariance.
920 Double_t dca3D = 0.0;
922 if((fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kTPC)||(fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kHybrid)) {
923 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
924 if(!tpcTrack) continue;
925 gPt = tpcTrack->Pt();
926 //gP = tpcTrack->P();
927 gP = track->GetInnerParam()->P();
928 tpcTrack->PropagateToDCA(vertex,
929 esd->GetMagneticField(),
931 dca3D = TMath::Sqrt(TMath::Power(dca[0],2) +
932 TMath::Power(dca[1],2));
934 if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
935 if(fProtonAnalysisBase->IsAccepted(track)) {
936 ((TH2F *)(fQA2DList->At(0)))->Fill(gP,track->GetTPCsignal());
937 ((TH2F *)(fQA2DList->At(2)))->Fill(gP,TMath::Log(track->GetTPCsignal()/tpcResponse.GetExpectedSignal(gP,AliPID::kProton)));
938 ((TH3F *)(fQA2DList->At(4)))->Fill(tpcTrack->Eta(),
939 tpcTrack->Phi()*180./TMath::Pi(),
941 ((TH3F *)(fQA2DList->At(6)))->Fill(tpcTrack->Eta(),
942 tpcTrack->Phi()*180./TMath::Pi(),
944 ((TH3F *)(fQA2DList->At(8)))->Fill(gPt,
945 tpcTrack->Phi()*180./TMath::Pi(),
947 ((TH3F *)(fQA2DList->At(10)))->Fill(gPt,
948 tpcTrack->Phi()*180./TMath::Pi(),
953 if(fProtonAnalysisBase->IsProton(track)) {
954 //Step: kStepIdentified
955 if(fProtonAnalysisBase->GetEtaMode())
956 containerInput[0] = tpcTrack->Eta();
958 containerInput[0] = fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
961 containerInput[1] = gPt;
962 if(tpcTrack->Charge() > 0) {
963 nIdentifiedProtons += 1;
964 fProtonContainer->Fill(containerInput,kStepIdentified);
966 else if(tpcTrack->Charge() < 0) {
967 nIdentifiedAntiProtons += 1;
968 fAntiProtonContainer->Fill(containerInput,kStepIdentified);
971 //Step: kStepIsPrimary
972 if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
973 if(tpcTrack->Charge() > 0)
974 fProtonContainer->Fill(containerInput,kStepIsPrimary);
975 else if(tpcTrack->Charge() < 0)
976 fAntiProtonContainer->Fill(containerInput,kStepIsPrimary);
978 FillQA(esd,vertex,track);
980 //Step: kStepSurvived
981 if(fProtonAnalysisBase->IsAccepted(track)) {
982 ((TH2F *)(fQA2DList->At(1)))->Fill(gP,track->GetTPCsignal());
983 ((TH2F *)(fQA2DList->At(3)))->Fill(gP,TMath::Log(track->GetTPCsignal()/tpcResponse.GetExpectedSignal(gP,AliPID::kProton)));
984 ((TH3F *)(fQA2DList->At(5)))->Fill(tpcTrack->Eta(),
985 tpcTrack->Phi()*180./TMath::Pi(),
987 ((TH3F *)(fQA2DList->At(7)))->Fill(tpcTrack->Eta(),
988 tpcTrack->Phi()*180./TMath::Pi(),
990 ((TH3F *)(fQA2DList->At(9)))->Fill(gPt,
991 tpcTrack->Phi()*180./TMath::Pi(),
993 ((TH3F *)(fQA2DList->At(11)))->Fill(gPt,
994 tpcTrack->Phi()*180./TMath::Pi(),
997 if(tpcTrack->Charge() > 0) {
998 fProtonContainer->Fill(containerInput,kStepSurvived);
999 ((TH2F *)(fQA2DList->At(12)))->Fill(tpcTrack->Eta(),
1000 tpcTrack->Phi()*180./TMath::Pi());
1001 if(fProtonAnalysisBase->GetEtaMode()) {
1002 ((TH3F *)(fQA2DList->At(14)))->Fill(tpcTrack->Eta(),
1004 TMath::Abs(dca[0]));
1005 ((TH3F *)(fQA2DList->At(15)))->Fill(tpcTrack->Eta(),
1007 TMath::Abs(dca[1]));
1008 ((TH3F *)(fQA2DList->At(18)))->Fill(tpcTrack->Eta(),
1013 ((TH3F *)(fQA2DList->At(14)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1015 TMath::Abs(dca[0]));
1016 ((TH3F *)(fQA2DList->At(15)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1018 TMath::Abs(dca[1]));
1019 ((TH3F *)(fQA2DList->At(18)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1024 else if(tpcTrack->Charge() < 0) {
1025 fAntiProtonContainer->Fill(containerInput,kStepSurvived);
1026 ((TH2F *)(fQA2DList->At(13)))->Fill(tpcTrack->Eta(),
1027 tpcTrack->Phi()*180./TMath::Pi());
1028 if(fProtonAnalysisBase->GetEtaMode()) {
1029 ((TH3F *)(fQA2DList->At(16)))->Fill(tpcTrack->Eta(),
1031 TMath::Abs(dca[0]));
1032 ((TH3F *)(fQA2DList->At(17)))->Fill(tpcTrack->Eta(),
1034 TMath::Abs(dca[1]));
1035 ((TH3F *)(fQA2DList->At(19)))->Fill(tpcTrack->Eta(),
1040 ((TH3F *)(fQA2DList->At(16)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1042 TMath::Abs(dca[0]));
1043 ((TH3F *)(fQA2DList->At(17)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1045 TMath::Abs(dca[1]));
1046 ((TH3F *)(fQA2DList->At(19)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1052 //Step: kStepInPhaseSpace
1053 if(fProtonAnalysisBase->IsInPhaseSpace(track)) {
1054 if(tpcTrack->Charge() > 0) {
1055 nSurvivedProtons += 1;
1056 fHistYPtProtons->Fill(containerInput[0],
1058 fProtonContainer->Fill(containerInput,kStepInPhaseSpace);
1060 else if(tpcTrack->Charge() < 0) {
1061 nSurvivedAntiProtons += 1;
1062 fHistYPtAntiProtons->Fill(containerInput[0],
1064 fAntiProtonContainer->Fill(containerInput,kStepInPhaseSpace);
1066 }//Step: kStepInPhaseSpace
1067 }//Step: kStepSurvived
1068 }//Step: kStepIsPrimary
1069 }//Step: kStepIdentified
1071 if(fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kFullHybrid) {
1072 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
1073 if(!tpcTrack) continue;
1075 AliExternalTrackParam cParam;
1076 /*Double_t phi = tpcTrack->Phi();
1077 Double_t eta = tpcTrack->Eta();
1078 Double_t gPx = tpcTrack->Px();
1079 Double_t gPy = tpcTrack->Py();
1080 Double_t gPz = tpcTrack->Pz();*/
1081 gPt = tpcTrack->Pt();
1082 //gP = tpcTrack->P();
1083 gP = track->GetInnerParam()->P();
1084 track->RelateToVertex(vertex,
1085 esd->GetMagneticField(),
1087 track->GetImpactParameters(dcaXY,dcaZ);
1088 dca[0] = dcaXY; dca[1] = dcaZ;
1089 dca3D = TMath::Sqrt(TMath::Power(dca[0],2) +
1090 TMath::Power(dca[1],2));
1092 if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
1093 if(fProtonAnalysisBase->IsAccepted(track)) {
1094 ((TH2F *)(fQA2DList->At(0)))->Fill(gP,track->GetTPCsignal());
1095 ((TH2F *)(fQA2DList->At(2)))->Fill(gP,TMath::Log(track->GetTPCsignal()/tpcResponse.GetExpectedSignal(gP,AliPID::kProton)));
1096 ((TH3F *)(fQA2DList->At(4)))->Fill(tpcTrack->Eta(),
1097 tpcTrack->Phi()*180./TMath::Pi(),
1099 ((TH3F *)(fQA2DList->At(6)))->Fill(tpcTrack->Eta(),
1100 tpcTrack->Phi()*180./TMath::Pi(),
1102 ((TH3F *)(fQA2DList->At(8)))->Fill(gPt,
1103 tpcTrack->Phi()*180./TMath::Pi(),
1105 ((TH3F *)(fQA2DList->At(10)))->Fill(gPt,
1106 tpcTrack->Phi()*180./TMath::Pi(),
1111 if(fProtonAnalysisBase->IsProton(track)) {
1112 //Step: kStepIdentified
1113 if(fProtonAnalysisBase->GetEtaMode())
1114 containerInput[0] = tpcTrack->Eta();
1116 containerInput[0] = fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
1119 containerInput[1] = gPt;
1120 if(tpcTrack->Charge() > 0) {
1121 nIdentifiedProtons += 1;
1122 fProtonContainer->Fill(containerInput,kStepIdentified);
1124 else if(tpcTrack->Charge() < 0) {
1125 nIdentifiedAntiProtons += 1;
1126 fAntiProtonContainer->Fill(containerInput,kStepIdentified);
1129 //Step: kStepIsPrimary
1130 if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
1131 if(tpcTrack->Charge() > 0)
1132 fProtonContainer->Fill(containerInput,kStepIsPrimary);
1133 else if(tpcTrack->Charge() < 0)
1134 fAntiProtonContainer->Fill(containerInput,kStepIsPrimary);
1136 FillQA(esd,vertex,track);
1138 //Step: kStepSurvived
1139 if(fProtonAnalysisBase->IsAccepted(track)) {
1140 ((TH2F *)(fQA2DList->At(1)))->Fill(gP,track->GetTPCsignal());
1141 ((TH2F *)(fQA2DList->At(3)))->Fill(gP,TMath::Log(track->GetTPCsignal()/tpcResponse.GetExpectedSignal(gP,AliPID::kProton)));
1142 ((TH3F *)(fQA2DList->At(5)))->Fill(tpcTrack->Eta(),
1143 tpcTrack->Phi()*180./TMath::Pi(),
1145 ((TH3F *)(fQA2DList->At(7)))->Fill(tpcTrack->Eta(),
1146 tpcTrack->Phi()*180./TMath::Pi(),
1148 ((TH3F *)(fQA2DList->At(9)))->Fill(gPt,
1149 tpcTrack->Phi()*180./TMath::Pi(),
1151 ((TH3F *)(fQA2DList->At(11)))->Fill(gPt,
1152 tpcTrack->Phi()*180./TMath::Pi(),
1155 if(tpcTrack->Charge() > 0) {
1156 fProtonContainer->Fill(containerInput,kStepSurvived);
1157 ((TH2F *)(fQA2DList->At(12)))->Fill(tpcTrack->Eta(),
1158 tpcTrack->Phi()*180./TMath::Pi());
1159 if(fProtonAnalysisBase->GetEtaMode()) {
1160 ((TH3F *)(fQA2DList->At(14)))->Fill(tpcTrack->Eta(),
1162 TMath::Abs(dca[0]));
1163 ((TH3F *)(fQA2DList->At(15)))->Fill(tpcTrack->Eta(),
1165 TMath::Abs(dca[1]));
1166 ((TH3F *)(fQA2DList->At(18)))->Fill(tpcTrack->Eta(),
1171 ((TH3F *)(fQA2DList->At(14)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1173 TMath::Abs(dca[0]));
1174 ((TH3F *)(fQA2DList->At(15)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1176 TMath::Abs(dca[1]));
1177 ((TH3F *)(fQA2DList->At(18)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1182 else if(tpcTrack->Charge() < 0) {
1183 fAntiProtonContainer->Fill(containerInput,kStepSurvived);
1184 ((TH2F *)(fQA2DList->At(13)))->Fill(tpcTrack->Eta(),
1185 tpcTrack->Phi()*180./TMath::Pi());
1186 if(fProtonAnalysisBase->GetEtaMode()) {
1187 ((TH3F *)(fQA2DList->At(16)))->Fill(tpcTrack->Eta(),
1189 TMath::Abs(dca[0]));
1190 ((TH3F *)(fQA2DList->At(17)))->Fill(tpcTrack->Eta(),
1192 TMath::Abs(dca[1]));
1193 ((TH3F *)(fQA2DList->At(19)))->Fill(tpcTrack->Eta(),
1198 ((TH3F *)(fQA2DList->At(16)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1200 TMath::Abs(dca[0]));
1201 ((TH3F *)(fQA2DList->At(17)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1203 TMath::Abs(dca[1]));
1204 ((TH3F *)(fQA2DList->At(19)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),
1210 //Step: kStepInPhaseSpace
1211 if(fProtonAnalysisBase->IsInPhaseSpace(track)) {
1212 if(tpcTrack->Charge() > 0) {
1213 nSurvivedProtons += 1;
1214 fHistYPtProtons->Fill(containerInput[0],
1216 fProtonContainer->Fill(containerInput,kStepInPhaseSpace);
1218 else if(tpcTrack->Charge() < 0) {
1219 nSurvivedAntiProtons += 1;
1220 fHistYPtAntiProtons->Fill(containerInput[0],
1222 fAntiProtonContainer->Fill(containerInput,kStepInPhaseSpace);
1224 }//Step: kStepInPhaseSpace
1225 }//Step: kStepSurvived
1226 }//Step: kStepIsPrimary
1227 }//Step: kStepIdentified
1229 else if(fProtonAnalysisBase->GetAnalysisMode() == AliProtonAnalysisBase::kGlobal) {
1232 gP = track->GetInnerParam()->P();
1234 track->PropagateToDCA(vertex,
1235 esd->GetMagneticField(),
1237 dca3D = TMath::Sqrt(TMath::Power(dca[0],2) +
1238 TMath::Power(dca[1],2));
1240 if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
1241 if(fProtonAnalysisBase->IsAccepted(track)) {
1242 ((TH2F *)(fQA2DList->At(0)))->Fill(gP,track->GetTPCsignal());
1243 ((TH2F *)(fQA2DList->At(2)))->Fill(gP,TMath::Log(track->GetTPCsignal()/tpcResponse.GetExpectedSignal(gP,AliPID::kProton)));
1244 ((TH3F *)(fQA2DList->At(4)))->Fill(track->Eta(),
1245 track->Phi()*180./TMath::Pi(),
1247 ((TH3F *)(fQA2DList->At(6)))->Fill(track->Eta(),
1248 track->Phi()*180./TMath::Pi(),
1250 ((TH3F *)(fQA2DList->At(8)))->Fill(gPt,
1251 track->Phi()*180./TMath::Pi(),
1253 ((TH3F *)(fQA2DList->At(10)))->Fill(gPt,
1254 track->Phi()*180./TMath::Pi(),
1259 if(fProtonAnalysisBase->IsProton(track)) {
1260 //Step: kStepIdentified
1261 if(fProtonAnalysisBase->GetEtaMode())
1262 containerInput[0] = track->Eta();
1264 containerInput[0] = fProtonAnalysisBase->Rapidity(track->Px(),
1267 containerInput[1] = gPt;
1268 if(track->Charge() > 0) {
1269 nIdentifiedProtons += 1;
1270 fProtonContainer->Fill(containerInput,kStepIdentified);
1272 else if(track->Charge() < 0) {
1273 nIdentifiedAntiProtons += 1;
1274 fAntiProtonContainer->Fill(containerInput,kStepIdentified);
1277 //Step: kStepIsPrimary
1278 if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
1279 if(track->Charge() > 0)
1280 fProtonContainer->Fill(containerInput,kStepIsPrimary);
1281 else if(track->Charge() < 0)
1282 fAntiProtonContainer->Fill(containerInput,kStepIsPrimary);
1284 FillQA(esd,vertex,track);
1286 //Step: kStepSurvived
1287 if(fProtonAnalysisBase->IsAccepted(track)) {
1288 ((TH2F *)(fQA2DList->At(1)))->Fill(gP,track->GetTPCsignal());
1289 ((TH2F *)(fQA2DList->At(3)))->Fill(gP,TMath::Log(track->GetTPCsignal()/tpcResponse.GetExpectedSignal(gP,AliPID::kProton)));
1290 ((TH3F *)(fQA2DList->At(5)))->Fill(track->Eta(),
1291 track->Phi()*180./TMath::Pi(),
1293 ((TH3F *)(fQA2DList->At(7)))->Fill(track->Eta(),
1294 track->Phi()*180./TMath::Pi(),
1296 ((TH3F *)(fQA2DList->At(9)))->Fill(gPt,
1297 track->Phi()*180./TMath::Pi(),
1299 ((TH3F *)(fQA2DList->At(11)))->Fill(gPt,
1300 track->Phi()*180./TMath::Pi(),
1303 if(track->Charge() > 0) {
1304 fProtonContainer->Fill(containerInput,kStepSurvived);
1305 ((TH2F *)(fQA2DList->At(12)))->Fill(track->Eta(),
1306 track->Phi()*180./TMath::Pi());
1307 if(fProtonAnalysisBase->GetEtaMode()) {
1308 ((TH3F *)(fQA2DList->At(14)))->Fill(track->Eta(),
1310 TMath::Abs(dca[0]));
1311 ((TH3F *)(fQA2DList->At(15)))->Fill(track->Eta(),
1313 TMath::Abs(dca[1]));
1314 ((TH3F *)(fQA2DList->At(18)))->Fill(track->Eta(),
1320 ((TH3F *)(fQA2DList->At(14)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),track->Py(),track->Pz()),
1322 TMath::Abs(dca[0]));
1323 ((TH3F *)(fQA2DList->At(15)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),track->Py(),track->Pz()),
1325 TMath::Abs(dca[1]));
1326 ((TH3F *)(fQA2DList->At(18)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),track->Py(),track->Pz()),
1331 else if(track->Charge() < 0) {
1332 fAntiProtonContainer->Fill(containerInput,kStepSurvived);
1333 ((TH2F *)(fQA2DList->At(13)))->Fill(track->Eta(),
1334 track->Phi()*180./TMath::Pi());
1335 if(fProtonAnalysisBase->GetEtaMode()) {
1336 ((TH3F *)(fQA2DList->At(16)))->Fill(track->Eta(),
1338 TMath::Abs(dca[0]));
1339 ((TH3F *)(fQA2DList->At(17)))->Fill(track->Eta(),
1341 TMath::Abs(dca[1]));
1342 ((TH3F *)(fQA2DList->At(19)))->Fill(track->Eta(),
1347 ((TH3F *)(fQA2DList->At(16)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),track->Py(),track->Pz()),
1349 TMath::Abs(dca[0]));
1350 ((TH3F *)(fQA2DList->At(17)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),track->Py(),track->Pz()),
1352 TMath::Abs(dca[1]));
1353 ((TH3F *)(fQA2DList->At(19)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),track->Py(),track->Pz()),
1359 //Step: kStepInPhaseSpace
1360 if(fProtonAnalysisBase->IsInPhaseSpace(track)) {
1361 if(track->Charge() > 0) {
1362 nSurvivedProtons += 1;
1363 fHistYPtProtons->Fill(containerInput[0],
1365 fProtonContainer->Fill(containerInput,kStepInPhaseSpace);
1367 else if(track->Charge() < 0) {
1368 nSurvivedAntiProtons += 1;
1369 fHistYPtAntiProtons->Fill(containerInput[0],
1371 fAntiProtonContainer->Fill(containerInput,kStepInPhaseSpace);
1373 }//Step: kStepInPhaseSpace
1374 }//Step: kStepSurvived
1375 }//Step: kStepIsPrimary
1376 }//Step: kStepIdentified
1380 if((nIdentifiedProtons > 0)||(nIdentifiedAntiProtons > 0))
1381 fHistEvents->Fill(2); //number of analyzed events with at least one (anti)proton
1383 if(fProtonAnalysisBase->GetDebugMode())
1384 Printf("Initial number of tracks: %d | Identified (anti)protons: %d - %d | Survived (anti)protons: %d - %d",nTracks,nIdentifiedProtons,nIdentifiedAntiProtons,nSurvivedProtons,nSurvivedAntiProtons);
1387 //____________________________________________________________________//
1388 void AliProtonAnalysis::Analyze(AliAODEvent* const fAOD) {
1389 //Main analysis part - AOD
1390 fHistEvents->Fill(1); //number of analyzed events
1391 Int_t nTracks = fAOD->GetNumberOfTracks();
1392 for(Int_t iTracks = 0; iTracks < nTracks; iTracks++) {
1393 AliAODTrack* track = fAOD->GetTrack(iTracks);
1394 Double_t gPt = track->Pt();
1395 Double_t gP = track->P();
1398 Double_t probability[10];
1399 track->GetPID(probability);
1401 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) rcc += probability[i]*fProtonAnalysisBase->GetParticleFraction(i,gP);
1402 if(rcc == 0.0) continue;
1404 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) w[i] = probability[i]*fProtonAnalysisBase->GetParticleFraction(i,gP)/rcc;
1405 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIESN,w);
1406 if(fParticleType == 4) {
1407 if(track->Charge() > 0)
1408 fHistYPtProtons->Fill(track->Y(fParticleType),gPt);
1409 else if(track->Charge() < 0)
1410 fHistYPtAntiProtons->Fill(track->Y(fParticleType),gPt);
1415 //____________________________________________________________________//
1416 void AliProtonAnalysis::Analyze(AliStack* const stack,
1417 Bool_t iInclusive) {
1418 //Main analysis part - MC
1419 fHistEvents->Fill(1); //number of analyzed events
1421 Int_t nParticles = 0;
1422 //inclusive protons -
1423 if(iInclusive) nParticles = stack->GetNtrack();
1424 else nParticles = stack->GetNprimary();
1426 for(Int_t i = 0; i < nParticles; i++) {
1427 TParticle *particle = stack->Particle(i);
1428 if(!particle) continue;
1430 //in case of inclusive protons reject the secondaries from hadronic inter.
1431 if(particle->GetUniqueID() == 13) continue;
1433 if(TMath::Abs(particle->Eta()) > 1.0) continue;
1434 if((particle->Pt() > fMaxPt)||(particle->Pt() < fMinPt)) continue;
1435 if((fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()) > fMaxY)||(fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()) < fMinY)) continue;
1437 Int_t pdgcode = particle->GetPdgCode();
1438 if(pdgcode == 2212) fHistYPtProtons->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
1442 if(pdgcode == -2212) fHistYPtAntiProtons->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
1449 //____________________________________________________________________//
1450 Bool_t AliProtonAnalysis::PrintMean(TH1 *hist, Double_t edge) {
1451 //calculates the mean value of the ratio/asymmetry within \pm edge
1452 Double_t sum = 0.0, sumError = 0.0;
1454 //calculate the mean
1455 for(Int_t i = 1; i <= hist->GetXaxis()->GetNbins(); i++) {
1456 Double_t x = hist->GetBinCenter(i);
1457 Double_t y = hist->GetBinContent(i);
1458 if(TMath::Abs(x) < edge) {
1460 sumError += TMath::Power(hist->GetBinError(i),2);
1463 //Printf("eta: %lf - sum: %lf - sumError: %lf - counter: %d",
1464 //TMath::Abs(x),sum,sumError,nentries);
1466 Double_t mean = 0.0;
1467 Double_t error = 0.0;
1469 mean = sum/nentries;
1470 error = TMath::Sqrt(sumError)/nentries;
1473 //calculate the error
1474 /*for(Int_t i = 1; i <= hist->GetXaxis()->GetNbins(); i++) {
1475 Double_t x = hist->GetBinCenter(i);
1476 Double_t y = hist->GetBinContent(i);
1477 if(TMath::Abs(x) < edge) {
1478 sum += TMath::Power((mean - y),2);
1484 cout<<"========================================="<<endl;
1485 cout<<"Input distribution: "<<hist->GetName()<<endl;
1486 cout<<"Interval used: -"<<edge<<" -> "<<edge<<endl;
1487 cout<<"Mean value :"<<mean<<endl;
1488 cout<<"Error: "<<error<<endl;
1489 cout<<"========================================="<<endl;
1494 //____________________________________________________________________//
1495 Bool_t AliProtonAnalysis::PrintYields(TH1 *hist, Double_t edge) {
1496 //calculates the (anti)proton yields within the \pm edge
1497 Double_t sum = 0.0, sumerror = 0.0;
1498 Double_t error = 0.0;
1499 for(Int_t i = 0; i < hist->GetXaxis()->GetNbins(); i++) {
1500 Double_t x = hist->GetBinCenter(i+1);
1501 Double_t y = hist->GetBinContent(i+1);
1502 if(TMath::Abs(x) < edge) {
1504 sumerror += TMath::Power(hist->GetBinError(i+1),2);
1508 error = TMath::Sqrt(sumerror);
1510 cout<<"========================================="<<endl;
1511 cout<<"Input distribution: "<<hist->GetName()<<endl;
1512 cout<<"Interval used: -"<<edge<<" -> "<<edge<<endl;
1513 cout<<"Yields :"<<sum<<endl;
1514 cout<<"Error: "<<error<<endl;
1515 cout<<"========================================="<<endl;
1520 //____________________________________________________________________//
1521 void AliProtonAnalysis::SetCorrectionMapForSecondaries(const char* filename) {
1522 //Reads the file with the correction maps for the secondaries
1523 TFile *gCorrectionForSecondaries = TFile::Open(filename);
1524 if(!gCorrectionForSecondaries) {
1525 Printf("The TFile object is not valid!!!");
1528 if(!gCorrectionForSecondaries->IsOpen()) {
1529 Printf("The file is not found!!!");
1533 fHistYPtCorrectionForSecondaries = dynamic_cast<TH2D *>(gCorrectionForSecondaries->Get("gHistCorrectionForSecondaries"));
1534 fCorrectForSecondariesFlag = kTRUE;
1537 //____________________________________________________________________//
1538 void AliProtonAnalysis::SetCorrectionMapForCrossSection(const char* filename) {
1539 //Reads the file with the correction maps for the proper x-section
1540 TFile *gCorrectionForXSection = TFile::Open(filename);
1541 if(!gCorrectionForXSection) {
1542 Printf("The TFile object is not valid!!!");
1545 if(!gCorrectionForXSection->IsOpen()) {
1546 Printf("The file is not found!!!");
1550 fHistCorrectionForCrossSectionYPtProtons = dynamic_cast<TH2D *>(gCorrectionForXSection->Get("gHistCorrectionForCrossSectionProtons"));
1551 fHistCorrectionForCrossSectionYPtAntiProtons = dynamic_cast<TH2D *>(gCorrectionForXSection->Get("gHistCorrectionForCrossSectionAntiProtons"));
1552 fHistCorrectionForCrossSectionFlag = kTRUE;
1555 //____________________________________________________________________//
1556 void AliProtonAnalysis::Correct() {
1557 //Apply the corrections: Fast & dirty way for the absorption corrections
1558 //Correct the protons for the efficiency
1559 fHistYPtProtonsCorrected = fProtonContainer->ShowProjection(0,1,kStepInPhaseSpace);
1560 fHistYPtProtonsCorrected->Divide(fHistEfficiencyYPtProtons);
1561 //Correct the protons for proper cross-section
1562 if(fHistCorrectionForCrossSectionFlag)
1563 fHistYPtProtonsCorrected->Multiply(fHistCorrectionForCrossSectionYPtProtons);
1564 //Correct the protons for secondaries
1565 if(fCorrectForSecondariesFlag)
1566 fHistYPtProtonsCorrected->Divide(fHistYPtCorrectionForSecondaries);
1568 //Correct the antiprotons for the efficiency
1569 fHistYPtAntiProtonsCorrected = fAntiProtonContainer->ShowProjection(0,1,kStepInPhaseSpace);
1570 fHistYPtAntiProtonsCorrected->Divide(fHistEfficiencyYPtAntiProtons);
1571 //Correct the antiprotons for proper cross-section
1572 if(fHistCorrectionForCrossSectionFlag)
1573 fHistYPtAntiProtonsCorrected->Multiply(fHistCorrectionForCrossSectionYPtAntiProtons);
1576 //____________________________________________________________________//
1577 void AliProtonAnalysis::Correct(Int_t step) {
1578 //Applies the correction maps to the initial containers
1579 fCorrectProtons = new AliCFDataGrid("correctProtons",
1582 fCorrectProtons->SetMeasured(0);
1583 fCorrectProtons->ApplyEffCorrection(*(AliCFEffGrid *)fEffGridListProtons->At(step));
1585 fCorrectAntiProtons = new AliCFDataGrid("correctAntiProtons",
1587 *fAntiProtonContainer);
1588 fCorrectAntiProtons->SetMeasured(0);
1589 fCorrectAntiProtons->ApplyEffCorrection(*(AliCFEffGrid *)fEffGridListAntiProtons->At(step));
1592 //____________________________________________________________________//
1593 Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
1594 // Reads the outout of the correction framework task
1595 // Creates the correction maps
1596 // Puts the results in the different TList objects
1597 Bool_t status = kTRUE;
1599 TFile *file = TFile::Open(filename);
1601 cout<<"Could not find the input CORRFW file "<<filename<<endl;
1604 TList *list = dynamic_cast<TList *>(file->Get("outputList"));
1605 Int_t iRap = 0, iPt = 1;
1607 //Calculation of efficiency/correction: Protons
1608 AliCFContainer *gProtonContainer = dynamic_cast<AliCFContainer *>(list->At(0));
1609 AliCFEffGrid *effProtonsStep0Step2 = new AliCFEffGrid("eff20",
1610 "effProtonsStep0Step2",
1612 effProtonsStep0Step2->CalculateEfficiency(2,0);
1613 fHistEfficiencyYPtProtons = effProtonsStep0Step2->Project(iRap,iPt);
1614 fHistEfficiencyYPtProtons->Sumw2();
1616 //Calculation of efficiency/correction: Protons
1617 AliCFContainer *gAntiProtonContainer = dynamic_cast<AliCFContainer *>(list->At(1));
1618 AliCFEffGrid *effAntiProtonsStep0Step2 = new AliCFEffGrid("eff20",
1619 "effAntiProtonsStep0Step2",
1620 *gAntiProtonContainer);
1621 effAntiProtonsStep0Step2->CalculateEfficiency(2,0);
1622 fHistEfficiencyYPtAntiProtons = effAntiProtonsStep0Step2->Project(iRap,iPt);
1623 fHistEfficiencyYPtAntiProtons->Sumw2();
1630 //____________________________________________________________________//
1631 /*Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
1632 // Reads the outout of the correction framework task
1633 // Creates the correction maps
1634 // Puts the results in the different TList objects
1635 Bool_t status = kTRUE;
1637 TFile *file = TFile::Open(filename);
1639 cout<<"Could not find the input CORRFW file "<<filename<<endl;
1643 //________________________________________//
1645 fEffGridListProtons = new TList();
1646 fCorrectionListProtons2D = new TList();
1647 fEfficiencyListProtons1D = new TList();
1648 fCorrectionListProtons1D = new TList();
1650 AliCFContainer *corrfwContainerProtons = (AliCFContainer*) (file->Get("containerProtons"));
1651 if(!corrfwContainerProtons) {
1652 cout<<"CORRFW container for protons not found!"<<endl;
1656 Int_t nSteps = corrfwContainerProtons->GetNStep();
1658 //currently the GRID is formed by the y-pT parameters
1659 //Add Vz as a next step
1660 Int_t iRap = 0, iPt = 1;
1661 AliCFEffGrid *effProtonsStep0Step1 = new AliCFEffGrid("eff10",
1662 "effProtonsStep0Step1",
1663 *corrfwContainerProtons);
1664 effProtonsStep0Step1->CalculateEfficiency(1,0); //eff= step1/step0
1665 fEffGridListProtons->Add(effProtonsStep0Step1);
1666 gYPt[0] = effProtonsStep0Step1->Project(iRap,iPt);
1667 fCorrectionListProtons2D->Add(gYPt[0]);
1669 AliCFEffGrid *effProtonsStep0Step2 = new AliCFEffGrid("eff20",
1670 "effProtonsStep0Step2",
1671 *corrfwContainerProtons);
1672 effProtonsStep0Step2->CalculateEfficiency(2,0); //eff= step2/step0
1673 fEffGridListProtons->Add(effProtonsStep0Step2);
1674 gYPt[1] = effProtonsStep0Step2->Project(iRap,iPt);
1675 fCorrectionListProtons2D->Add(gYPt[1]);
1677 AliCFEffGrid *effProtonsStep0Step3 = new AliCFEffGrid("eff30",
1678 "effProtonsStep0Step3",
1679 *corrfwContainerProtons);
1680 effProtonsStep0Step3->CalculateEfficiency(3,0); //eff= step1/step0
1681 fEffGridListProtons->Add(effProtonsStep0Step3);
1682 gYPt[2] = effProtonsStep0Step3->Project(iRap,iPt);
1683 fCorrectionListProtons2D->Add(gYPt[2]);
1685 TH1D *gEfficiency[2][3]; //efficiency as a function of pT and of y (raws-[2])
1686 TH1D *gCorrection[2][3]; //efficiency as a function of pT and of y (raws-[2])
1688 //Get the projection of the efficiency maps
1689 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1690 gEfficiency[iParameter][0] = effProtonsStep0Step1->Project(iParameter);
1691 gTitle = "ProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1692 gTitle += "_Step0_Step1";
1693 gEfficiency[iParameter][0]->SetName(gTitle.Data());
1694 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][0]);
1695 gTitle = "ProtonsCorrection_Parameter"; gTitle += iParameter+1;
1696 gTitle += "_Step0_Step1";
1697 gCorrection[iParameter][0] = new TH1D(gTitle.Data(),
1699 gEfficiency[iParameter][0]->GetNbinsX(),
1700 gEfficiency[iParameter][0]->GetXaxis()->GetXmin(),
1701 gEfficiency[iParameter][0]->GetXaxis()->GetXmax());
1702 //initialisation of the correction
1703 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][0]->GetNbinsX(); iBin++)
1704 gCorrection[iParameter][0]->SetBinContent(iBin,1.0);
1706 gEfficiency[iParameter][1] = effProtonsStep0Step2->Project(iParameter);
1707 gTitle = "ProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1708 gTitle += "_Step0_Step2";
1709 gEfficiency[iParameter][1]->SetName(gTitle.Data());
1710 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][1]);
1711 gTitle = "ProtonsCorrection_Parameter"; gTitle += iParameter+1;
1712 gTitle += "_Step0_Step2";
1713 gCorrection[iParameter][1] = new TH1D(gTitle.Data(),
1715 gEfficiency[iParameter][1]->GetNbinsX(),
1716 gEfficiency[iParameter][1]->GetXaxis()->GetXmin(),
1717 gEfficiency[iParameter][1]->GetXaxis()->GetXmax());
1718 //initialisation of the correction
1719 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][1]->GetNbinsX(); iBin++)
1720 gCorrection[iParameter][1]->SetBinContent(iBin,1.0);
1722 gEfficiency[iParameter][2] = effProtonsStep0Step3->Project(iParameter);
1723 gTitle = "ProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1724 gTitle += "_Step0_Step3";
1725 gEfficiency[iParameter][2]->SetName(gTitle.Data());
1726 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][2]);
1727 gTitle = "ProtonsCorrection_Parameter"; gTitle += iParameter+1;
1728 gTitle += "_Step0_Step3";
1729 gCorrection[iParameter][2] = new TH1D(gTitle.Data(),
1731 gEfficiency[iParameter][2]->GetNbinsX(),
1732 gEfficiency[iParameter][2]->GetXaxis()->GetXmin(),
1733 gEfficiency[iParameter][2]->GetXaxis()->GetXmax());
1734 //initialisation of the correction
1735 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][2]->GetNbinsX(); iBin++)
1736 gCorrection[iParameter][2]->SetBinContent(iBin,1.0);
1738 //Calculate the 1D correction parameters as a function of y and pT
1739 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1740 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1741 gCorrection[iParameter][iStep-1]->Divide(gEfficiency[iParameter][iStep-1]);
1742 fCorrectionListProtons1D->Add(gCorrection[iParameter][iStep-1]);
1746 //________________________________________//
1748 fEffGridListAntiProtons = new TList();
1749 fCorrectionListAntiProtons2D = new TList();
1750 fEfficiencyListAntiProtons1D = new TList();
1751 fCorrectionListAntiProtons1D = new TList();
1753 AliCFContainer *corrfwContainerAntiProtons = (AliCFContainer*) (file->Get("containerAntiProtons"));
1754 if(!corrfwContainerAntiProtons) {
1755 cout<<"CORRFW container for antiprotons not found!"<<endl;
1759 nSteps = corrfwContainerAntiProtons->GetNStep();
1760 //currently the GRID is formed by the y-pT parameters
1761 //Add Vz as a next step
1762 AliCFEffGrid *effAntiProtonsStep0Step1 = new AliCFEffGrid("eff10",
1763 "effAntiProtonsStep0Step1",
1764 *corrfwContainerAntiProtons);
1765 effAntiProtonsStep0Step1->CalculateEfficiency(1,0); //eff= step1/step0
1766 fEffGridListAntiProtons->Add(effAntiProtonsStep0Step1);
1767 gYPt[0] = effAntiProtonsStep0Step1->Project(iRap,iPt);
1768 fCorrectionListAntiProtons2D->Add(gYPt[0]);
1770 AliCFEffGrid *effAntiProtonsStep0Step2 = new AliCFEffGrid("eff20",
1771 "effAntiProtonsStep0Step2",
1772 *corrfwContainerAntiProtons);
1773 effAntiProtonsStep0Step2->CalculateEfficiency(2,0); //eff= step2/step0
1774 fEffGridListAntiProtons->Add(effAntiProtonsStep0Step2);
1775 gYPt[1] = effAntiProtonsStep0Step2->Project(iRap,iPt);
1776 fCorrectionListAntiProtons2D->Add(gYPt[1]);
1778 AliCFEffGrid *effAntiProtonsStep0Step3 = new AliCFEffGrid("eff30",
1779 "effAntiProtonsStep0Step3",
1780 *corrfwContainerAntiProtons);
1781 effAntiProtonsStep0Step3->CalculateEfficiency(3,0); //eff= step1/step0
1782 fEffGridListAntiProtons->Add(effAntiProtonsStep0Step3);
1783 gYPt[2] = effAntiProtonsStep0Step3->Project(iRap,iPt);
1784 fCorrectionListAntiProtons2D->Add(gYPt[2]);
1786 //Get the projection of the efficiency maps
1787 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1788 gEfficiency[iParameter][0] = effAntiProtonsStep0Step1->Project(iParameter);
1789 gTitle = "AntiProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1790 gTitle += "_Step0_Step1";
1791 gEfficiency[iParameter][0]->SetName(gTitle.Data());
1792 fEfficiencyListAntiProtons1D->Add(gEfficiency[iParameter][0]);
1793 gTitle = "AntiProtonsCorrection_Parameter"; gTitle += iParameter+1;
1794 gTitle += "_Step0_Step1";
1795 gCorrection[iParameter][0] = new TH1D(gTitle.Data(),
1797 gEfficiency[iParameter][0]->GetNbinsX(),
1798 gEfficiency[iParameter][0]->GetXaxis()->GetXmin(),
1799 gEfficiency[iParameter][0]->GetXaxis()->GetXmax());
1800 //initialisation of the correction
1801 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][0]->GetNbinsX(); iBin++)
1802 gCorrection[iParameter][0]->SetBinContent(iBin,1.0);
1804 gEfficiency[iParameter][1] = effAntiProtonsStep0Step2->Project(iParameter);
1805 gTitle = "AntiProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1806 gTitle += "_Step0_Step2";
1807 gEfficiency[iParameter][1]->SetName(gTitle.Data());
1808 fEfficiencyListAntiProtons1D->Add(gEfficiency[iParameter][1]);
1809 gTitle = "AntiProtonsCorrection_Parameter"; gTitle += iParameter+1;
1810 gTitle += "_Step0_Step2";
1811 gCorrection[iParameter][1] = new TH1D(gTitle.Data(),
1813 gEfficiency[iParameter][1]->GetNbinsX(),
1814 gEfficiency[iParameter][1]->GetXaxis()->GetXmin(),
1815 gEfficiency[iParameter][1]->GetXaxis()->GetXmax());
1816 //initialisation of the correction
1817 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][1]->GetNbinsX(); iBin++)
1818 gCorrection[iParameter][1]->SetBinContent(iBin,1.0);
1820 gEfficiency[iParameter][2] = effAntiProtonsStep0Step3->Project(iParameter);
1821 gTitle = "AntiProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1822 gTitle += "_Step0_Step3";
1823 gEfficiency[iParameter][2]->SetName(gTitle.Data());
1824 fEfficiencyListAntiProtons1D->Add(gEfficiency[iParameter][2]);
1825 gTitle = "AntiProtonsCorrection_Parameter"; gTitle += iParameter+1;
1826 gTitle += "_Step0_Step3";
1827 gCorrection[iParameter][2] = new TH1D(gTitle.Data(),
1829 gEfficiency[iParameter][2]->GetNbinsX(),
1830 gEfficiency[iParameter][2]->GetXaxis()->GetXmin(),
1831 gEfficiency[iParameter][2]->GetXaxis()->GetXmax());
1832 //initialisation of the correction
1833 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][2]->GetNbinsX(); iBin++)
1834 gCorrection[iParameter][2]->SetBinContent(iBin,1.0);
1836 //Calculate the 1D correction parameters as a function of y and pT
1837 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1838 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1839 gCorrection[iParameter][iStep-1]->Divide(gEfficiency[iParameter][iStep-1]);
1840 fCorrectionListAntiProtons1D->Add(gCorrection[iParameter][iStep-1]);
1847 //____________________________________________________________________//
1848 void AliProtonAnalysis::InitQA() {
1849 //Applies the correction maps to the initial containers
1850 fInitQAFlag = kTRUE;
1851 fGlobalQAList = new TList();
1852 fGlobalQAList->SetName("fGlobalQAList");
1854 //========================================================//
1855 fQA2DList = new TList();
1856 fQA2DList->SetName("fQA2DList");
1857 fGlobalQAList->Add(fQA2DList);
1860 TH2F *gHistdEdxP = new TH2F("gHistdEdxP","dE/dx (TPC); P [GeV/c]; dE/dx [a.u]",1000,0.05,20.05,600,0,600);
1861 fQA2DList->Add(gHistdEdxP);
1862 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);
1863 fQA2DList->Add(gHistProtonsdEdxP);
1865 //normalized dEdx plots
1866 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);
1867 fQA2DList->Add(gHistZP);
1868 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);
1869 fQA2DList->Add(gHistProtonsZP);
1871 //eta-phi-Npoints(dEdx)
1872 TH3F *gHistEtaPhiTPCdEdxNPoints = new TH3F("gHistEtaPhiTPCdEdxNPoints",
1873 ";#eta;#phi;N_{points}(TPC)",
1877 gHistEtaPhiTPCdEdxNPoints->SetStats(kTRUE);
1878 fQA2DList->Add(gHistEtaPhiTPCdEdxNPoints);
1879 TH3F *gHistProtonsEtaPhiTPCdEdxNPoints = new TH3F("gHistProtonsEtaPhiTPCdEdxNPoints",
1880 ";#eta;#phi;N_{points}(TPC)",
1884 gHistProtonsEtaPhiTPCdEdxNPoints->SetStats(kTRUE);
1885 fQA2DList->Add(gHistProtonsEtaPhiTPCdEdxNPoints);
1888 TH3F *gHistEtaPhiTPCNPoints = new TH3F("gHistEtaPhiTPCNPoints",
1889 ";#eta;#phi;N_{points}(TPC)",
1893 gHistEtaPhiTPCNPoints->SetStats(kTRUE);
1894 fQA2DList->Add(gHistEtaPhiTPCNPoints);
1895 TH3F *gHistProtonsEtaPhiTPCNPoints = new TH3F("gHistProtonsEtaPhiTPCNPoints",
1896 ";#eta;#phi;N_{points}(TPC)",
1900 gHistProtonsEtaPhiTPCNPoints->SetStats(kTRUE);
1901 fQA2DList->Add(gHistProtonsEtaPhiTPCNPoints);
1903 //pt-phi-Npoints(dEdx)
1904 TH3F *gHistPtPhiTPCdEdxNPoints = new TH3F("gHistPtPhiTPCdEdxNPoints",
1905 ";P_{T} [GeV/c];#phi;N_{points}(TPC)",
1906 fNBinsPt,fMinPt,fMaxPt,
1909 gHistPtPhiTPCdEdxNPoints->SetStats(kTRUE);
1910 fQA2DList->Add(gHistPtPhiTPCdEdxNPoints);
1911 TH3F *gHistProtonsPtPhiTPCdEdxNPoints = new TH3F("gHistProtonsPtPhiTPCdEdxNPoints",
1912 ";P_{T} [GeV/c];#phi;N_{points}(TPC)",
1913 fNBinsPt,fMinPt,fMaxPt,
1916 gHistProtonsPtPhiTPCdEdxNPoints->SetStats(kTRUE);
1917 fQA2DList->Add(gHistProtonsPtPhiTPCdEdxNPoints);
1920 TH3F *gHistPtPhiTPCNPoints = new TH3F("gHistPtPhiTPCNPoints",
1921 ";P_{T} [GeV/c];#phi;N_{points}(TPC)",
1922 fNBinsPt,fMinPt,fMaxPt,
1925 gHistPtPhiTPCNPoints->SetStats(kTRUE);
1926 fQA2DList->Add(gHistPtPhiTPCNPoints);
1927 TH3F *gHistProtonsPtPhiTPCNPoints = new TH3F("gHistProtonsPtPhiTPCNPoints",
1928 ";P_{T} [GeV/c];#phi;N_{points}(TPC)",
1929 fNBinsPt,fMinPt,fMaxPt,
1932 gHistProtonsPtPhiTPCNPoints->SetStats(kTRUE);
1933 fQA2DList->Add(gHistProtonsPtPhiTPCNPoints);
1935 //eta-phi for protons & antiprotons
1936 TH2F *gHistProtonsEtaPhi = new TH2F("gHistProtonsEtaPhi",
1940 gHistProtonsEtaPhi->SetStats(kTRUE);
1941 fQA2DList->Add(gHistProtonsEtaPhi);
1942 TH2F *gHistAntiProtonsEtaPhi = new TH2F("gHistAntiProtonsEtaPhi",
1946 gHistAntiProtonsEtaPhi->SetStats(kTRUE);
1947 fQA2DList->Add(gHistAntiProtonsEtaPhi);
1949 //dca vs pT for protons & antiprotons
1950 TH3F *gHistProtonsDCAxyEtaPt = new TH3F("gHistProtonsDCAxyEtaPt",
1951 ";P_{T} [GeV/c];dca_{xy} [cm]",
1952 fNBinsY,fMinY,fMaxY,
1953 fNBinsPt,fMinPt,fMaxPt,
1955 if(fProtonAnalysisBase->GetEtaMode())
1956 gHistProtonsDCAxyEtaPt->GetXaxis()->SetTitle("#eta");
1958 gHistProtonsDCAxyEtaPt->GetXaxis()->SetTitle("y");
1959 gHistProtonsDCAxyEtaPt->SetStats(kTRUE);
1960 fQA2DList->Add(gHistProtonsDCAxyEtaPt);
1961 TH3F *gHistProtonsDCAzEtaPt = new TH3F("gHistProtonsDCAzEtaPt",
1962 ";P_{T} [GeV/c];dca_{z} [cm]",
1963 fNBinsY,fMinY,fMaxY,
1964 fNBinsPt,fMinPt,fMaxPt,
1966 if(fProtonAnalysisBase->GetEtaMode())
1967 gHistProtonsDCAzEtaPt->GetXaxis()->SetTitle("#eta");
1969 gHistProtonsDCAzEtaPt->GetXaxis()->SetTitle("y");
1970 gHistProtonsDCAzEtaPt->SetStats(kTRUE);
1971 fQA2DList->Add(gHistProtonsDCAzEtaPt);
1972 TH3F *gHistAntiProtonsDCAxyEtaPt = new TH3F("gHistAntiProtonsDCAxyEtaPt",
1973 ";P_{T} [GeV/c];dca_{xy} [cm]",
1974 fNBinsY,fMinY,fMaxY,
1975 fNBinsPt,fMinPt,fMaxPt,
1977 if(fProtonAnalysisBase->GetEtaMode())
1978 gHistAntiProtonsDCAxyEtaPt->GetXaxis()->SetTitle("#eta");
1980 gHistAntiProtonsDCAxyEtaPt->GetXaxis()->SetTitle("y");
1981 gHistAntiProtonsDCAxyEtaPt->SetStats(kTRUE);
1982 fQA2DList->Add(gHistAntiProtonsDCAxyEtaPt);
1983 TH3F *gHistAntiProtonsDCAzEtaPt = new TH3F("gHistAntiProtonsDCAzEtaPt",
1984 ";P_{T} [GeV/c];dca_{z} [cm]",
1985 fNBinsY,fMinY,fMaxY,
1986 fNBinsPt,fMinPt,fMaxPt,
1988 if(fProtonAnalysisBase->GetEtaMode())
1989 gHistAntiProtonsDCAzEtaPt->GetXaxis()->SetTitle("#eta");
1991 gHistAntiProtonsDCAzEtaPt->GetXaxis()->SetTitle("y");
1992 gHistAntiProtonsDCAzEtaPt->SetStats(kTRUE);
1993 fQA2DList->Add(gHistAntiProtonsDCAzEtaPt);
1995 TH3F *gHistProtonsDCA3DEtaPt = new TH3F("gHistProtonsDCA3DEtaPt",
1996 ";P_{T} [GeV/c];dca [cm]",
1997 fNBinsY,fMinY,fMaxY,
1998 fNBinsPt,fMinPt,fMaxPt,
2000 if(fProtonAnalysisBase->GetEtaMode())
2001 gHistProtonsDCA3DEtaPt->GetXaxis()->SetTitle("#eta");
2003 gHistProtonsDCA3DEtaPt->GetXaxis()->SetTitle("y");
2004 gHistProtonsDCA3DEtaPt->SetStats(kTRUE);
2005 fQA2DList->Add(gHistProtonsDCA3DEtaPt);
2006 TH3F *gHistAntiProtonsDCA3DEtaPt = new TH3F("gHistAntiProtonsDCA3DEtaPt",
2007 ";P_{T} [GeV/c];dca [cm]",
2008 fNBinsY,fMinY,fMaxY,
2009 fNBinsPt,fMinPt,fMaxPt,
2011 if(fProtonAnalysisBase->GetEtaMode())
2012 gHistAntiProtonsDCA3DEtaPt->GetXaxis()->SetTitle("#eta");
2014 gHistAntiProtonsDCA3DEtaPt->GetXaxis()->SetTitle("y");
2015 gHistAntiProtonsDCA3DEtaPt->SetStats(kTRUE);
2016 fQA2DList->Add(gHistAntiProtonsDCA3DEtaPt);
2018 //========================================================//
2019 fQAProtonsAcceptedList = new TList();
2020 fQAProtonsAcceptedList->SetName("fQAProtonsAcceptedList");
2021 fGlobalQAList->Add(fQAProtonsAcceptedList);
2023 TH1F *gProtonsITSClustersPass = new TH1F("gProtonsITSClustersPass",
2024 ";N_{clusters} (ITS);Entries",
2026 fQAProtonsAcceptedList->Add(gProtonsITSClustersPass);
2027 TH1F *gProtonsChi2PerClusterITSPass = new TH1F("gProtonsChi2PerClusterITSPass",
2028 ";x^{2}/N_{clusters} (ITS);Entries",
2030 fQAProtonsAcceptedList->Add(gProtonsChi2PerClusterITSPass);
2031 TH1F *gProtonsTPCClustersPass = new TH1F("gProtonsTPCClustersPass",
2032 ";N_{clusters} (TPC);Entries",
2034 fQAProtonsAcceptedList->Add(gProtonsTPCClustersPass);
2035 TH1F *gProtonsChi2PerClusterTPCPass = new TH1F("gProtonsChi2PerClusterTPCPass",
2036 ";x^{2}/N_{clusters} (TPC);Entries",
2038 fQAProtonsAcceptedList->Add(gProtonsChi2PerClusterTPCPass);
2039 TH1F *gProtonsExtCov11Pass = new TH1F("gProtonsExtCov11Pass",
2040 ";#sigma_{y} [cm];Entries",
2042 fQAProtonsAcceptedList->Add(gProtonsExtCov11Pass);
2043 TH1F *gProtonsExtCov22Pass = new TH1F("gProtonsExtCov22Pass",
2044 ";#sigma_{z} [cm];Entries",
2046 fQAProtonsAcceptedList->Add(gProtonsExtCov22Pass);
2047 TH1F *gProtonsExtCov33Pass = new TH1F("gProtonsExtCov33Pass",
2048 ";#sigma_{sin(#phi)};Entries",
2050 fQAProtonsAcceptedList->Add(gProtonsExtCov33Pass);
2051 TH1F *gProtonsExtCov44Pass = new TH1F("gProtonsExtCov44Pass",
2052 ";#sigma_{tan(#lambda)};Entries",
2054 fQAProtonsAcceptedList->Add(gProtonsExtCov44Pass);
2055 TH1F *gProtonsExtCov55Pass = new TH1F("gProtonsExtCov55Pass",
2056 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2058 fQAProtonsAcceptedList->Add(gProtonsExtCov55Pass);
2059 TH1F *gProtonsSigmaToVertexPass = new TH1F("gProtonsSigmaToVertexPass",
2060 ";#sigma_{Vertex};Entries",
2062 fQAProtonsAcceptedList->Add(gProtonsSigmaToVertexPass);
2063 TH1F *gProtonsSigmaToVertexTPCPass = new TH1F("gProtonsSigmaToVertexTPCPass",
2064 ";#sigma_{Vertex};Entries",
2066 fQAProtonsAcceptedList->Add(gProtonsSigmaToVertexTPCPass);
2067 TH1F *gProtonsDCAXYPass = new TH1F("gProtonsDCAXYPass",
2068 ";DCA_{xy} [cm];Entries",
2070 fQAProtonsAcceptedList->Add(gProtonsDCAXYPass);
2071 TH1F *gProtonsDCAXYTPCPass = new TH1F("gProtonsDCAXYTPCPass",
2072 ";DCA_{xy} [cm];Entries",
2074 fQAProtonsAcceptedList->Add(gProtonsDCAXYTPCPass);
2075 TH1F *gProtonsDCAZPass = new TH1F("gProtonsDCAZPass",
2076 ";DCA_{z} [cm];Entries",
2078 fQAProtonsAcceptedList->Add(gProtonsDCAZPass);
2079 TH1F *gProtonsDCAZTPCPass = new TH1F("gProtonsDCAZTPCPass",
2080 ";DCA_{z} [cm];Entries",
2082 fQAProtonsAcceptedList->Add(gProtonsDCAZTPCPass);
2083 TH1F *gProtonsConstrainChi2Pass = new TH1F("gProtonsConstrainChi2Pass",
2084 ";Log_{10}(#chi^{2});Entries",
2086 fQAProtonsAcceptedList->Add(gProtonsConstrainChi2Pass);
2087 TH1F *gProtonsITSRefitPass = new TH1F("gProtonsITSRefitPass",
2089 fQAProtonsAcceptedList->Add(gProtonsITSRefitPass);
2090 TH1F *gProtonsTPCRefitPass = new TH1F("gProtonsTPCRefitPass",
2092 fQAProtonsAcceptedList->Add(gProtonsTPCRefitPass);
2093 TH1F *gProtonsESDpidPass = new TH1F("gProtonsESDpidPass",
2095 fQAProtonsAcceptedList->Add(gProtonsESDpidPass);
2096 TH1F *gProtonsTPCpidPass = new TH1F("gProtonsTPCpidPass",
2098 fQAProtonsAcceptedList->Add(gProtonsTPCpidPass);
2099 TH1F *gProtonsPointOnITSLayer1Pass = new TH1F("gProtonsPointOnITSLayer1Pass",
2101 fQAProtonsAcceptedList->Add(gProtonsPointOnITSLayer1Pass);
2102 TH1F *gProtonsPointOnITSLayer2Pass = new TH1F("gProtonsPointOnITSLayer2Pass",
2104 fQAProtonsAcceptedList->Add(gProtonsPointOnITSLayer2Pass);
2105 TH1F *gProtonsPointOnITSLayer3Pass = new TH1F("gProtonsPointOnITSLayer3Pass",
2107 fQAProtonsAcceptedList->Add(gProtonsPointOnITSLayer3Pass);
2108 TH1F *gProtonsPointOnITSLayer4Pass = new TH1F("gProtonsPointOnITSLayer4Pass",
2110 fQAProtonsAcceptedList->Add(gProtonsPointOnITSLayer4Pass);
2111 TH1F *gProtonsPointOnITSLayer5Pass = new TH1F("gProtonsPointOnITSLayer5Pass",
2113 fQAProtonsAcceptedList->Add(gProtonsPointOnITSLayer5Pass);
2114 TH1F *gProtonsPointOnITSLayer6Pass = new TH1F("gProtonsPointOnITSLayer6Pass",
2116 fQAProtonsAcceptedList->Add(gProtonsPointOnITSLayer6Pass);
2117 TH1F *gProtonsNumberOfTPCdEdxPointsPass = new TH1F("gProtonsNumberOfTPCdEdxPointsPass","",100,0,200);
2118 fQAProtonsAcceptedList->Add(gProtonsNumberOfTPCdEdxPointsPass);
2119 TH1F *gProtonsITSClusterMapPass = new TH1F("gProtonsITSClusterMapPass",";ITS Layer;Entries",6,0.5,6.5);
2120 fQAProtonsAcceptedList->Add(gProtonsITSClusterMapPass);
2121 TH1F *gProtonsDCA3DPass = new TH1F("gProtonsDCA3DPass",
2122 ";dca [cm];Entries",
2124 fQAProtonsAcceptedList->Add(gProtonsDCA3DPass);
2126 //========================================================//
2127 fQAProtonsRejectedList = new TList();
2128 fQAProtonsRejectedList->SetName("fQAProtonsRejectedList");
2129 fGlobalQAList->Add(fQAProtonsRejectedList);
2131 TH1F *gProtonsITSClustersReject = new TH1F("gProtonsITSClustersReject",
2132 ";N_{clusters} (ITS);Entries",
2134 gProtonsITSClustersReject->SetFillColor(kRed-2);
2135 fQAProtonsRejectedList->Add(gProtonsITSClustersReject);
2136 TH1F *gProtonsChi2PerClusterITSReject = new TH1F("gProtonsChi2PerClusterITSReject",
2137 ";x^{2}/N_{clusters} (ITS);Entries",
2139 gProtonsChi2PerClusterITSReject->SetFillColor(kRed-2);
2140 fQAProtonsRejectedList->Add(gProtonsChi2PerClusterITSReject);
2141 TH1F *gProtonsTPCClustersReject = new TH1F("gProtonsTPCClustersReject",
2142 ";N_{clusters} (TPC);Entries",
2144 gProtonsTPCClustersReject->SetFillColor(kRed-2);
2145 fQAProtonsRejectedList->Add(gProtonsTPCClustersReject);
2146 TH1F *gProtonsChi2PerClusterTPCReject = new TH1F("gProtonsChi2PerClusterTPCReject",
2147 ";x^{2}/N_{clusters} (TPC);Entries",
2149 gProtonsChi2PerClusterTPCReject->SetFillColor(kRed-2);
2150 fQAProtonsRejectedList->Add(gProtonsChi2PerClusterTPCReject);
2151 TH1F *gProtonsExtCov11Reject = new TH1F("gProtonsExtCov11Reject",
2152 ";#sigma_{y} [cm];Entries",
2154 gProtonsExtCov11Reject->SetFillColor(kRed-2);
2155 fQAProtonsRejectedList->Add(gProtonsExtCov11Reject);
2156 TH1F *gProtonsExtCov22Reject = new TH1F("gProtonsExtCov22Reject",
2157 ";#sigma_{z} [cm];Entries",
2159 gProtonsExtCov22Reject->SetFillColor(kRed-2);
2160 fQAProtonsRejectedList->Add(gProtonsExtCov22Reject);
2161 TH1F *gProtonsExtCov33Reject = new TH1F("gProtonsExtCov33Reject",
2162 ";#sigma_{sin(#phi)};Entries",
2164 gProtonsExtCov33Reject->SetFillColor(kRed-2);
2165 fQAProtonsRejectedList->Add(gProtonsExtCov33Reject);
2166 TH1F *gProtonsExtCov44Reject = new TH1F("gProtonsExtCov44Reject",
2167 ";#sigma_{tan(#lambda)};Entries",
2169 gProtonsExtCov44Reject->SetFillColor(kRed-2);
2170 fQAProtonsRejectedList->Add(gProtonsExtCov44Reject);
2171 TH1F *gProtonsExtCov55Reject = new TH1F("gProtonsExtCov55Reject",
2172 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2174 gProtonsExtCov55Reject->SetFillColor(kRed-2);
2175 fQAProtonsRejectedList->Add(gProtonsExtCov55Reject);
2176 TH1F *gProtonsSigmaToVertexReject = new TH1F("gProtonsSigmaToVertexReject",
2177 ";#sigma_{Vertex};Entries",
2179 gProtonsSigmaToVertexReject->SetFillColor(kRed-2);
2180 fQAProtonsRejectedList->Add(gProtonsSigmaToVertexReject);
2181 TH1F *gProtonsSigmaToVertexTPCReject = new TH1F("gProtonsSigmaToVertexTPCReject",
2182 ";#sigma_{Vertex};Entries",
2184 gProtonsSigmaToVertexTPCReject->SetFillColor(kRed-2);
2185 fQAProtonsRejectedList->Add(gProtonsSigmaToVertexTPCReject);
2186 TH1F *gProtonsDCAXYReject = new TH1F("gProtonsDCAXYReject",
2187 ";DCA_{xy} [cm];Entries",
2189 gProtonsDCAXYReject->SetFillColor(kRed-2);
2190 fQAProtonsRejectedList->Add(gProtonsDCAXYReject);
2191 TH1F *gProtonsDCAXYTPCReject = new TH1F("gProtonsDCAXYTPCReject",
2192 ";DCA_{xy} [cm];Entries",
2194 gProtonsDCAXYTPCReject->SetFillColor(kRed-2);
2195 fQAProtonsRejectedList->Add(gProtonsDCAXYTPCReject);
2196 TH1F *gProtonsDCAZReject = new TH1F("gProtonsDCAZReject",
2197 ";DCA_{z} [cm];Entries",
2199 gProtonsDCAZReject->SetFillColor(kRed-2);
2200 fQAProtonsRejectedList->Add(gProtonsDCAZReject);
2201 TH1F *gProtonsDCAZTPCReject = new TH1F("gProtonsDCAZTPCReject",
2202 ";DCA_{z} [cm];Entries",
2204 gProtonsDCAZTPCReject->SetFillColor(kRed-2);
2205 fQAProtonsRejectedList->Add(gProtonsDCAZTPCReject);
2206 TH1F *gProtonsConstrainChi2Reject = new TH1F("gProtonsConstrainChi2Reject",
2207 ";Log_{10}(#chi^{2});Entries",
2209 gProtonsConstrainChi2Reject->SetFillColor(kRed-2);
2210 fQAProtonsRejectedList->Add(gProtonsConstrainChi2Reject);
2211 TH1F *gProtonsITSRefitReject = new TH1F("gProtonsITSRefitReject",
2213 gProtonsITSRefitReject->SetFillColor(kRed-2);
2214 fQAProtonsRejectedList->Add(gProtonsITSRefitReject);
2215 TH1F *gProtonsTPCRefitReject = new TH1F("gProtonsTPCRefitReject",
2217 gProtonsTPCRefitReject->SetFillColor(kRed-2);
2218 fQAProtonsRejectedList->Add(gProtonsTPCRefitReject);
2219 TH1F *gProtonsESDpidReject = new TH1F("gProtonsESDpidReject",
2221 gProtonsESDpidReject->SetFillColor(kRed-2);
2222 fQAProtonsRejectedList->Add(gProtonsESDpidReject);
2223 TH1F *gProtonsTPCpidReject = new TH1F("gProtonsTPCpidReject",
2225 gProtonsTPCpidReject->SetFillColor(kRed-2);
2226 fQAProtonsRejectedList->Add(gProtonsTPCpidReject);
2227 TH1F *gProtonsPointOnITSLayer1Reject = new TH1F("gProtonsPointOnITSLayer1Reject",
2229 gProtonsPointOnITSLayer1Reject->SetFillColor(kRed-2);
2230 fQAProtonsRejectedList->Add(gProtonsPointOnITSLayer1Reject);
2231 TH1F *gProtonsPointOnITSLayer2Reject = new TH1F("gProtonsPointOnITSLayer2Reject",
2233 gProtonsPointOnITSLayer2Reject->SetFillColor(kRed-2);
2234 fQAProtonsRejectedList->Add(gProtonsPointOnITSLayer2Reject);
2235 TH1F *gProtonsPointOnITSLayer3Reject = new TH1F("gProtonsPointOnITSLayer3Reject",
2237 gProtonsPointOnITSLayer3Reject->SetFillColor(kRed-2);
2238 fQAProtonsRejectedList->Add(gProtonsPointOnITSLayer3Reject);
2239 TH1F *gProtonsPointOnITSLayer4Reject = new TH1F("gProtonsPointOnITSLayer4Reject",
2241 gProtonsPointOnITSLayer4Reject->SetFillColor(kRed-2);
2242 fQAProtonsRejectedList->Add(gProtonsPointOnITSLayer4Reject);
2243 TH1F *gProtonsPointOnITSLayer5Reject = new TH1F("gProtonsPointOnITSLayer5Reject",
2245 gProtonsPointOnITSLayer5Reject->SetFillColor(kRed-2);
2246 fQAProtonsRejectedList->Add(gProtonsPointOnITSLayer5Reject);
2247 TH1F *gProtonsPointOnITSLayer6Reject = new TH1F("gProtonsPointOnITSLayer6Reject",
2249 gProtonsPointOnITSLayer6Reject->SetFillColor(kRed-2);
2250 fQAProtonsRejectedList->Add(gProtonsPointOnITSLayer6Reject);
2251 TH1F *gProtonsNumberOfTPCdEdxPointsReject = new TH1F("gProtonsNumberOfTPCdEdxPointsReject","",100,0,200);
2252 gProtonsNumberOfTPCdEdxPointsReject->SetFillColor(kRed-2);
2253 fQAProtonsRejectedList->Add(gProtonsNumberOfTPCdEdxPointsReject);
2254 TH1F *gProtonsITSClusterMapReject = new TH1F("gProtonsITSClusterMapReject",";ITS Layer;Entries",6,0.5,6.5);
2255 gProtonsITSClusterMapReject->SetFillColor(kRed-2);
2256 fQAProtonsRejectedList->Add(gProtonsITSClusterMapReject);
2257 TH1F *gProtonsDCA3DReject = new TH1F("gProtonsDCA3DReject",
2258 ";dca [cm];Entries",
2260 gProtonsDCA3DReject->SetFillColor(kRed-2);
2261 fQAProtonsRejectedList->Add(gProtonsDCA3DReject);
2263 //========================================================//
2264 fQAAntiProtonsAcceptedList = new TList();
2265 fQAAntiProtonsAcceptedList->SetName("fQAAntiProtonsAcceptedList");
2266 fGlobalQAList->Add(fQAAntiProtonsAcceptedList);
2267 //Accepted antiprotons
2268 TH1F *gAntiProtonsITSClustersPass = new TH1F("gAntiProtonsITSClustersPass",
2269 ";N_{clusters} (ITS);Entries",
2271 fQAAntiProtonsAcceptedList->Add(gAntiProtonsITSClustersPass);
2272 TH1F *gAntiProtonsChi2PerClusterITSPass = new TH1F("gAntiProtonsChi2PerClusterITSPass",
2273 ";x^{2}/N_{clusters} (ITS);Entries",
2275 fQAAntiProtonsAcceptedList->Add(gAntiProtonsChi2PerClusterITSPass);
2276 TH1F *gAntiProtonsTPCClustersPass = new TH1F("gAntiProtonsTPCClustersPass",
2277 ";N_{clusters} (TPC);Entries",
2279 fQAAntiProtonsAcceptedList->Add(gAntiProtonsTPCClustersPass);
2280 TH1F *gAntiProtonsChi2PerClusterTPCPass = new TH1F("gAntiProtonsChi2PerClusterTPCPass",
2281 ";x^{2}/N_{clusters} (TPC);Entries",
2283 fQAAntiProtonsAcceptedList->Add(gAntiProtonsChi2PerClusterTPCPass);
2284 TH1F *gAntiProtonsExtCov11Pass = new TH1F("gAntiProtonsExtCov11Pass",
2285 ";#sigma_{y} [cm];Entries",
2287 fQAAntiProtonsAcceptedList->Add(gAntiProtonsExtCov11Pass);
2288 TH1F *gAntiProtonsExtCov22Pass = new TH1F("gAntiProtonsExtCov22Pass",
2289 ";#sigma_{z} [cm];Entries",
2291 fQAAntiProtonsAcceptedList->Add(gAntiProtonsExtCov22Pass);
2292 TH1F *gAntiProtonsExtCov33Pass = new TH1F("gAntiProtonsExtCov33Pass",
2293 ";#sigma_{sin(#phi)};Entries",
2295 fQAAntiProtonsAcceptedList->Add(gAntiProtonsExtCov33Pass);
2296 TH1F *gAntiProtonsExtCov44Pass = new TH1F("gAntiProtonsExtCov44Pass",
2297 ";#sigma_{tan(#lambda)};Entries",
2299 fQAAntiProtonsAcceptedList->Add(gAntiProtonsExtCov44Pass);
2300 TH1F *gAntiProtonsExtCov55Pass = new TH1F("gAntiProtonsExtCov55Pass",
2301 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2303 fQAAntiProtonsAcceptedList->Add(gAntiProtonsExtCov55Pass);
2304 TH1F *gAntiProtonsSigmaToVertexPass = new TH1F("gAntiProtonsSigmaToVertexPass",
2305 ";#sigma_{Vertex};Entries",
2307 fQAAntiProtonsAcceptedList->Add(gAntiProtonsSigmaToVertexPass);
2308 TH1F *gAntiProtonsSigmaToVertexTPCPass = new TH1F("gAntiProtonsSigmaToVertexTPCPass",
2309 ";#sigma_{Vertex};Entries",
2311 fQAAntiProtonsAcceptedList->Add(gAntiProtonsSigmaToVertexTPCPass);
2312 TH1F *gAntiProtonsDCAXYPass = new TH1F("gAntiProtonsDCAXYPass",
2313 ";DCA_{xy} [cm];Entries",
2315 fQAAntiProtonsAcceptedList->Add(gAntiProtonsDCAXYPass);
2316 TH1F *gAntiProtonsDCAXYTPCPass = new TH1F("gAntiProtonsDCAXYTPCPass",
2317 ";DCA_{xy} [cm];Entries",
2319 fQAAntiProtonsAcceptedList->Add(gAntiProtonsDCAXYTPCPass);
2320 TH1F *gAntiProtonsDCAZPass = new TH1F("gAntiProtonsDCAZPass",
2321 ";DCA_{z} [cm];Entries",
2323 fQAAntiProtonsAcceptedList->Add(gAntiProtonsDCAZPass);
2324 TH1F *gAntiProtonsDCAZTPCPass = new TH1F("gAntiProtonsDCAZTPCPass",
2325 ";DCA_{z} [cm];Entries",
2327 fQAAntiProtonsAcceptedList->Add(gAntiProtonsDCAZTPCPass);
2328 TH1F *gAntiProtonsConstrainChi2Pass = new TH1F("gAntiProtonsConstrainChi2Pass",
2329 ";Log_{10}(#chi^{2});Entries",
2331 fQAAntiProtonsAcceptedList->Add(gAntiProtonsConstrainChi2Pass);
2332 TH1F *gAntiProtonsITSRefitPass = new TH1F("gAntiProtonsITSRefitPass",
2334 fQAAntiProtonsAcceptedList->Add(gAntiProtonsITSRefitPass);
2335 TH1F *gAntiProtonsTPCRefitPass = new TH1F("gAntiProtonsTPCRefitPass",
2337 fQAAntiProtonsAcceptedList->Add(gAntiProtonsTPCRefitPass);
2338 TH1F *gAntiProtonsESDpidPass = new TH1F("gAntiProtonsESDpidPass",
2340 fQAAntiProtonsAcceptedList->Add(gAntiProtonsESDpidPass);
2341 TH1F *gAntiProtonsTPCpidPass = new TH1F("gAntiProtonsTPCpidPass",
2343 fQAAntiProtonsAcceptedList->Add(gAntiProtonsTPCpidPass);
2344 TH1F *gAntiProtonsPointOnITSLayer1Pass = new TH1F("gAntiProtonsPointOnITSLayer1Pass",
2346 fQAAntiProtonsAcceptedList->Add(gAntiProtonsPointOnITSLayer1Pass);
2347 TH1F *gAntiProtonsPointOnITSLayer2Pass = new TH1F("gAntiProtonsPointOnITSLayer2Pass",
2349 fQAAntiProtonsAcceptedList->Add(gAntiProtonsPointOnITSLayer2Pass);
2350 TH1F *gAntiProtonsPointOnITSLayer3Pass = new TH1F("gAntiProtonsPointOnITSLayer3Pass",
2352 fQAAntiProtonsAcceptedList->Add(gAntiProtonsPointOnITSLayer3Pass);
2353 TH1F *gAntiProtonsPointOnITSLayer4Pass = new TH1F("gAntiProtonsPointOnITSLayer4Pass",
2355 fQAAntiProtonsAcceptedList->Add(gAntiProtonsPointOnITSLayer4Pass);
2356 TH1F *gAntiProtonsPointOnITSLayer5Pass = new TH1F("gAntiProtonsPointOnITSLayer5Pass",
2358 fQAAntiProtonsAcceptedList->Add(gAntiProtonsPointOnITSLayer5Pass);
2359 TH1F *gAntiProtonsPointOnITSLayer6Pass = new TH1F("gAntiProtonsPointOnITSLayer6Pass",
2361 fQAAntiProtonsAcceptedList->Add(gAntiProtonsPointOnITSLayer6Pass);
2362 TH1F *gAntiProtonsNumberOfTPCdEdxPointsPass = new TH1F("gAntiProtonsNumberOfTPCdEdxPointsPass","",100,0,200);
2363 fQAAntiProtonsAcceptedList->Add(gAntiProtonsNumberOfTPCdEdxPointsPass);
2364 TH1F *gAntiProtonsITSClusterMapPass = new TH1F("gAntiProtonsITSClusterMapPass",";ITS Layer;Entries",6,0.5,6.5);
2365 fQAAntiProtonsAcceptedList->Add(gAntiProtonsITSClusterMapPass);
2366 TH1F *gAntiProtonsDCA3DPass = new TH1F("gAntiProtonsDCA3DPass",
2367 ";dca [cm];Entries",
2369 fQAAntiProtonsAcceptedList->Add(gAntiProtonsDCA3DPass);
2371 //========================================================//
2372 fQAAntiProtonsRejectedList = new TList();
2373 fQAAntiProtonsRejectedList->SetName("fQAAntiProtonsRejectedList");
2374 fGlobalQAList->Add(fQAAntiProtonsRejectedList);
2375 //Rejected antiprotons
2376 TH1F *gAntiProtonsITSClustersReject = new TH1F("gAntiProtonsITSClustersReject",
2377 ";N_{clusters} (ITS);Entries",
2379 gAntiProtonsITSClustersReject->SetFillColor(kRed-2);
2380 fQAAntiProtonsRejectedList->Add(gAntiProtonsITSClustersReject);
2381 TH1F *gAntiProtonsChi2PerClusterITSReject = new TH1F("gAntiProtonsChi2PerClusterITSReject",
2382 ";x^{2}/N_{clusters} (ITS);Entries",
2384 gAntiProtonsChi2PerClusterITSReject->SetFillColor(kRed-2);
2385 fQAAntiProtonsRejectedList->Add(gAntiProtonsChi2PerClusterITSReject);
2386 TH1F *gAntiProtonsTPCClustersReject = new TH1F("gAntiProtonsTPCClustersReject",
2387 ";N_{clusters} (TPC);Entries",
2389 gAntiProtonsTPCClustersReject->SetFillColor(kRed-2);
2390 fQAAntiProtonsRejectedList->Add(gAntiProtonsTPCClustersReject);
2391 TH1F *gAntiProtonsChi2PerClusterTPCReject = new TH1F("gAntiProtonsChi2PerClusterTPCReject",
2392 ";x^{2}/N_{clusters} (TPC);Entries",
2394 gAntiProtonsChi2PerClusterTPCReject->SetFillColor(kRed-2);
2395 fQAAntiProtonsRejectedList->Add(gAntiProtonsChi2PerClusterTPCReject);
2396 TH1F *gAntiProtonsExtCov11Reject = new TH1F("gAntiProtonsExtCov11Reject",
2397 ";#sigma_{y} [cm];Entries",
2399 gAntiProtonsExtCov11Reject->SetFillColor(kRed-2);
2400 fQAAntiProtonsRejectedList->Add(gAntiProtonsExtCov11Reject);
2401 TH1F *gAntiProtonsExtCov22Reject = new TH1F("gAntiProtonsExtCov22Reject",
2402 ";#sigma_{z} [cm];Entries",
2404 gAntiProtonsExtCov22Reject->SetFillColor(kRed-2);
2405 fQAAntiProtonsRejectedList->Add(gAntiProtonsExtCov22Reject);
2406 TH1F *gAntiProtonsExtCov33Reject = new TH1F("gAntiProtonsExtCov33Reject",
2407 ";#sigma_{sin(#phi)};Entries",
2409 gAntiProtonsExtCov33Reject->SetFillColor(kRed-2);
2410 fQAAntiProtonsRejectedList->Add(gAntiProtonsExtCov33Reject);
2411 TH1F *gAntiProtonsExtCov44Reject = new TH1F("gAntiProtonsExtCov44Reject",
2412 ";#sigma_{tan(#lambda)};Entries",
2414 gAntiProtonsExtCov44Reject->SetFillColor(kRed-2);
2415 fQAAntiProtonsRejectedList->Add(gAntiProtonsExtCov44Reject);
2416 TH1F *gAntiProtonsExtCov55Reject = new TH1F("gAntiProtonsExtCov55Reject",
2417 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2419 gAntiProtonsExtCov55Reject->SetFillColor(kRed-2);
2420 fQAAntiProtonsRejectedList->Add(gAntiProtonsExtCov55Reject);
2421 TH1F *gAntiProtonsSigmaToVertexReject = new TH1F("gAntiProtonsSigmaToVertexReject",
2422 ";#sigma_{Vertex};Entries",
2424 gAntiProtonsSigmaToVertexReject->SetFillColor(kRed-2);
2425 fQAAntiProtonsRejectedList->Add(gAntiProtonsSigmaToVertexReject);
2426 TH1F *gAntiProtonsSigmaToVertexTPCReject = new TH1F("gAntiProtonsSigmaToVertexTPCReject",
2427 ";#sigma_{Vertex};Entries",
2429 gAntiProtonsSigmaToVertexTPCReject->SetFillColor(kRed-2);
2430 fQAAntiProtonsRejectedList->Add(gAntiProtonsSigmaToVertexTPCReject);
2431 TH1F *gAntiProtonsDCAXYReject = new TH1F("gAntiProtonsDCAXYReject",
2432 ";DCA_{xy} [cm];Entries",
2434 gAntiProtonsDCAXYReject->SetFillColor(kRed-2);
2435 fQAAntiProtonsRejectedList->Add(gAntiProtonsDCAXYReject);
2436 TH1F *gAntiProtonsDCAXYTPCReject = new TH1F("gAntiProtonsDCAXYTPCReject",
2437 ";DCA_{xy} [cm];Entries",
2439 gAntiProtonsDCAXYTPCReject->SetFillColor(kRed-2);
2440 fQAAntiProtonsRejectedList->Add(gAntiProtonsDCAXYTPCReject);
2441 TH1F *gAntiProtonsDCAZReject = new TH1F("gAntiProtonsDCAZReject",
2442 ";DCA_{z} [cm];Entries",
2444 gAntiProtonsDCAZReject->SetFillColor(kRed-2);
2445 fQAAntiProtonsRejectedList->Add(gAntiProtonsDCAZReject);
2446 TH1F *gAntiProtonsDCAZTPCReject = new TH1F("gAntiProtonsDCAZTPCReject",
2447 ";DCA_{z} [cm];Entries",
2449 gAntiProtonsDCAZTPCReject->SetFillColor(kRed-2);
2450 fQAAntiProtonsRejectedList->Add(gAntiProtonsDCAZTPCReject);
2451 TH1F *gAntiProtonsConstrainChi2Reject = new TH1F("gAntiProtonsConstrainChi2Reject",
2452 ";Log_{10}(#chi^{2});Entries",
2454 gAntiProtonsConstrainChi2Reject->SetFillColor(kRed-2);
2455 fQAAntiProtonsRejectedList->Add(gAntiProtonsConstrainChi2Reject);
2456 TH1F *gAntiProtonsITSRefitReject = new TH1F("gAntiProtonsITSRefitReject",
2458 gAntiProtonsITSRefitReject->SetFillColor(kRed-2);
2459 fQAAntiProtonsRejectedList->Add(gAntiProtonsITSRefitReject);
2460 TH1F *gAntiProtonsTPCRefitReject = new TH1F("gAntiProtonsTPCRefitReject",
2462 gAntiProtonsTPCRefitReject->SetFillColor(kRed-2);
2463 fQAAntiProtonsRejectedList->Add(gAntiProtonsTPCRefitReject);
2464 TH1F *gAntiProtonsESDpidReject = new TH1F("gAntiProtonsESDpidReject",
2466 gAntiProtonsESDpidReject->SetFillColor(kRed-2);
2467 fQAAntiProtonsRejectedList->Add(gAntiProtonsESDpidReject);
2468 TH1F *gAntiProtonsTPCpidReject = new TH1F("gAntiProtonsTPCpidReject",
2470 gAntiProtonsTPCpidReject->SetFillColor(kRed-2);
2471 fQAAntiProtonsRejectedList->Add(gAntiProtonsTPCpidReject);
2472 TH1F *gAntiProtonsPointOnITSLayer1Reject = new TH1F("gAntiProtonsPointOnITSLayer1Reject",
2474 gAntiProtonsPointOnITSLayer1Reject->SetFillColor(kRed-2);
2475 fQAAntiProtonsRejectedList->Add(gAntiProtonsPointOnITSLayer1Reject);
2476 TH1F *gAntiProtonsPointOnITSLayer2Reject = new TH1F("gAntiProtonsPointOnITSLayer2Reject",
2478 gAntiProtonsPointOnITSLayer2Reject->SetFillColor(kRed-2);
2479 fQAAntiProtonsRejectedList->Add(gAntiProtonsPointOnITSLayer2Reject);
2480 TH1F *gAntiProtonsPointOnITSLayer3Reject = new TH1F("gAntiProtonsPointOnITSLayer3Reject",
2482 gAntiProtonsPointOnITSLayer3Reject->SetFillColor(kRed-2);
2483 fQAAntiProtonsRejectedList->Add(gAntiProtonsPointOnITSLayer3Reject);
2484 TH1F *gAntiProtonsPointOnITSLayer4Reject = new TH1F("gAntiProtonsPointOnITSLayer4Reject",
2486 gAntiProtonsPointOnITSLayer4Reject->SetFillColor(kRed-2);
2487 fQAAntiProtonsRejectedList->Add(gAntiProtonsPointOnITSLayer4Reject);
2488 TH1F *gAntiProtonsPointOnITSLayer5Reject = new TH1F("gAntiProtonsPointOnITSLayer5Reject",
2490 gAntiProtonsPointOnITSLayer5Reject->SetFillColor(kRed-2);
2491 fQAAntiProtonsRejectedList->Add(gAntiProtonsPointOnITSLayer5Reject);
2492 TH1F *gAntiProtonsPointOnITSLayer6Reject = new TH1F("gAntiProtonsPointOnITSLayer6Reject",
2494 gAntiProtonsPointOnITSLayer6Reject->SetFillColor(kRed-2);
2495 fQAAntiProtonsRejectedList->Add(gAntiProtonsPointOnITSLayer6Reject);
2496 TH1F *gAntiProtonsNumberOfTPCdEdxPointsReject = new TH1F("gAntiProtonsNumberOfTPCdEdxPointsReject","",100,0,200);
2497 gAntiProtonsNumberOfTPCdEdxPointsReject->SetFillColor(kRed-2);
2498 fQAAntiProtonsRejectedList->Add(gAntiProtonsNumberOfTPCdEdxPointsReject);
2499 TH1F *gAntiProtonsITSClusterMapReject = new TH1F("gAntiProtonsITSClusterMapReject",";ITS Layer;Entries",6,0.5,6.5);
2500 gAntiProtonsITSClusterMapReject->SetFillColor(kRed-2);
2501 fQAAntiProtonsRejectedList->Add(gAntiProtonsITSClusterMapReject);
2502 TH1F *gAntiProtonsDCA3DReject = new TH1F("gAntiProtonsDCA3DReject",
2503 ";dca [cm];Entries",
2505 gAntiProtonsDCA3DReject->SetFillColor(kRed-2);
2506 fQAAntiProtonsRejectedList->Add(gAntiProtonsDCA3DReject);
2509 //____________________________________________________________________//
2510 void AliProtonAnalysis::FillQA(AliESDEvent *esd,
2511 const AliESDVertex *vertex,
2512 AliESDtrack* track) {
2513 //Fills the QA histograms
2514 Double_t gPt = 0.0, gPx = 0.0, gPy = 0.0, gPz = 0.0;
2515 Double_t dca[2] = {0.0,0.0}, cov[3] = {0.0,0.0,0.0}; //The impact parameters and their covariance.
2516 Double_t dca3D = 0.0;
2518 if((fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kTPC)||(fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kHybrid)) {
2519 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
2521 gPt = 0.0; gPx = 0.0; gPy = 0.0; gPz = 0.0;
2522 dca[0] = -100.; dca[1] = -100.;
2523 cov[0] = -100.; cov[1] = -100.; cov[2] = -100.;
2526 gPt = tpcTrack->Pt();
2527 gPx = tpcTrack->Px();
2528 gPy = tpcTrack->Py();
2529 gPz = tpcTrack->Pz();
2530 tpcTrack->PropagateToDCA(vertex,
2531 esd->GetMagneticField(),
2540 track->PropagateToDCA(vertex,
2541 esd->GetMagneticField(),
2545 dca3D = TMath::Sqrt(TMath::Power(dca[0],2) +
2546 TMath::Power(dca[1],2));
2549 Int_t nClustersITS = track->GetITSclusters(fIdxInt);
2550 Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
2552 Float_t chi2PerClusterITS = -1;
2553 if (nClustersITS!=0)
2554 chi2PerClusterITS = track->GetITSchi2()/Float_t(nClustersITS);
2555 Float_t chi2PerClusterTPC = -1;
2556 if (nClustersTPC!=0)
2557 chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);
2559 Double_t extCov[15];
2560 track->GetExternalCovariance(extCov);
2563 if(track->Charge() > 0) {
2564 if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
2565 if(nClustersITS < fProtonAnalysisBase->GetMinITSClusters()) {
2566 ((TH1F *)(fQAProtonsRejectedList->At(0)))->Fill(nClustersITS);
2568 else if(nClustersITS >= fProtonAnalysisBase->GetMinITSClusters())
2569 ((TH1F *)(fQAProtonsAcceptedList->At(0)))->Fill(nClustersITS);
2571 if(fProtonAnalysisBase->IsUsedMaxChi2PerITSCluster()) {
2572 if(chi2PerClusterITS > fProtonAnalysisBase->GetMaxChi2PerITSCluster()) {
2573 ((TH1F *)(fQAProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
2575 else if(chi2PerClusterITS <= fProtonAnalysisBase->GetMaxChi2PerITSCluster())
2576 ((TH1F *)(fQAProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
2577 }//chi2 per ITS cluster
2578 if(fProtonAnalysisBase->IsUsedMinTPCClusters()) {
2579 if(nClustersTPC < fProtonAnalysisBase->GetMinTPCClusters()) {
2580 ((TH1F *)(fQAProtonsRejectedList->At(2)))->Fill(nClustersTPC);
2582 else if(nClustersTPC >= fProtonAnalysisBase->GetMinTPCClusters()) {
2583 ((TH1F *)(fQAProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
2586 if(fProtonAnalysisBase->IsUsedMaxChi2PerTPCCluster()) {
2587 if(chi2PerClusterTPC > fProtonAnalysisBase->GetMaxChi2PerTPCCluster()) {
2588 ((TH1F *)(fQAProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
2590 else if(chi2PerClusterTPC <= fProtonAnalysisBase->GetMaxChi2PerTPCCluster())
2591 ((TH1F *)(fQAProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
2592 }//chi2 per TPC cluster
2593 if(fProtonAnalysisBase->IsUsedMaxCov11()) {
2594 if(extCov[0] > fProtonAnalysisBase->GetMaxCov11()) {
2595 ((TH1F *)(fQAProtonsRejectedList->At(4)))->Fill(extCov[0]);
2597 else if(extCov[0] <= fProtonAnalysisBase->GetMaxCov11())
2598 ((TH1F *)(fQAProtonsAcceptedList->At(4)))->Fill(extCov[0]);
2600 if(fProtonAnalysisBase->IsUsedMaxCov22()) {
2601 if(extCov[2] > fProtonAnalysisBase->GetMaxCov22()) {
2602 ((TH1F *)(fQAProtonsRejectedList->At(5)))->Fill(extCov[2]);
2604 else if(extCov[2] <= fProtonAnalysisBase->GetMaxCov22())
2605 ((TH1F *)(fQAProtonsAcceptedList->At(5)))->Fill(extCov[2]);
2607 if(fProtonAnalysisBase->IsUsedMaxCov33()) {
2608 if(extCov[5] > fProtonAnalysisBase->GetMaxCov33()) {
2609 ((TH1F *)(fQAProtonsRejectedList->At(6)))->Fill(extCov[5]);
2611 else if(extCov[5] <= fProtonAnalysisBase->GetMaxCov33())
2612 ((TH1F *)(fQAProtonsAcceptedList->At(6)))->Fill(extCov[5]);
2614 if(fProtonAnalysisBase->IsUsedMaxCov44()) {
2615 if(extCov[9] > fProtonAnalysisBase->GetMaxCov44()) {
2616 ((TH1F *)(fQAProtonsRejectedList->At(7)))->Fill(extCov[9]);
2618 else if(extCov[9] <= fProtonAnalysisBase->GetMaxCov44())
2619 ((TH1F *)(fQAProtonsAcceptedList->At(7)))->Fill(extCov[9]);
2621 if(fProtonAnalysisBase->IsUsedMaxCov55()) {
2622 if(extCov[14] > fProtonAnalysisBase->GetMaxCov55()) {
2623 ((TH1F *)(fQAProtonsRejectedList->At(8)))->Fill(extCov[14]);
2625 else if(extCov[14] <= fProtonAnalysisBase->GetMaxCov55())
2626 ((TH1F *)(fQAProtonsAcceptedList->At(8)))->Fill(extCov[14]);
2628 if(fProtonAnalysisBase->IsUsedMaxSigmaToVertex()) {
2629 if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertex()) {
2630 ((TH1F *)(fQAProtonsRejectedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2632 else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertex())
2633 ((TH1F *)(fQAProtonsAcceptedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2635 if(fProtonAnalysisBase->IsUsedMaxSigmaToVertexTPC()) {
2636 if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertexTPC()) {
2637 ((TH1F *)(fQAProtonsRejectedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2639 else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertexTPC())
2640 ((TH1F *)(fQAProtonsAcceptedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2641 }//sigma to vertex TPC
2642 if(fProtonAnalysisBase->IsUsedMaxDCAXY()) {
2643 if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
2644 ((TH1F *)(fQAProtonsRejectedList->At(11)))->Fill(TMath::Abs(dca[0]));
2646 else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
2647 ((TH1F *)(fQAProtonsAcceptedList->At(11)))->Fill(TMath::Abs(dca[0]));
2648 }//DCA xy global tracking
2649 if(fProtonAnalysisBase->IsUsedMaxDCAXYTPC()) {
2650 if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXYTPC()) {
2651 ((TH1F *)(fQAProtonsRejectedList->At(12)))->Fill(TMath::Abs(dca[0]));
2653 else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXYTPC())
2654 ((TH1F *)(fQAProtonsAcceptedList->At(12)))->Fill(TMath::Abs(dca[0]));
2655 }//DCA xy TPC tracking
2656 if(fProtonAnalysisBase->IsUsedMaxDCAZ()) {
2657 if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
2658 ((TH1F *)(fQAProtonsRejectedList->At(13)))->Fill(TMath::Abs(dca[1]));
2660 else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
2661 ((TH1F *)(fQAProtonsAcceptedList->At(13)))->Fill(TMath::Abs(dca[1]));
2662 }//DCA z global tracking
2663 if(fProtonAnalysisBase->IsUsedMaxDCAZTPC()) {
2664 if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZTPC()) {
2665 ((TH1F *)(fQAProtonsRejectedList->At(14)))->Fill(TMath::Abs(dca[1]));
2667 else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZTPC())
2668 ((TH1F *)(fQAProtonsAcceptedList->At(14)))->Fill(TMath::Abs(dca[1]));
2669 }//DCA z TPC tracking
2670 if(fProtonAnalysisBase->IsUsedMaxConstrainChi2()) {
2671 if(track->GetConstrainedChi2() > 0) {
2672 if(TMath::Log(track->GetConstrainedChi2()) > fProtonAnalysisBase->GetMaxConstrainChi2()) {
2673 ((TH1F *)(fQAProtonsRejectedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
2675 else if(TMath::Log(track->GetConstrainedChi2()) <= fProtonAnalysisBase->GetMaxConstrainChi2())
2676 ((TH1F *)(fQAProtonsAcceptedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
2678 }//constrain chi2 - vertex
2679 if(fProtonAnalysisBase->IsUsedITSRefit()) {
2680 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
2681 ((TH1F *)(fQAProtonsRejectedList->At(16)))->Fill(0);
2683 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
2684 ((TH1F *)(fQAProtonsAcceptedList->At(16)))->Fill(0);
2686 if(fProtonAnalysisBase->IsUsedTPCRefit()) {
2687 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
2688 ((TH1F *)(fQAProtonsRejectedList->At(17)))->Fill(0);
2690 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
2691 ((TH1F *)(fQAProtonsAcceptedList->At(17)))->Fill(0);
2693 if(fProtonAnalysisBase->IsUsedESDpid()) {
2694 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
2695 ((TH1F *)(fQAProtonsRejectedList->At(18)))->Fill(0);
2697 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
2698 ((TH1F *)(fQAProtonsAcceptedList->At(18)))->Fill(0);
2700 if(fProtonAnalysisBase->IsUsedTPCpid()) {
2701 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
2702 ((TH1F *)(fQAProtonsRejectedList->At(19)))->Fill(0);
2704 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
2705 ((TH1F *)(fQAProtonsAcceptedList->At(19)))->Fill(0);
2707 if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
2708 if(!track->HasPointOnITSLayer(0)) {
2709 ((TH1F *)(fQAProtonsRejectedList->At(20)))->Fill(0);
2711 else if(track->HasPointOnITSLayer(0))
2712 ((TH1F *)(fQAProtonsAcceptedList->At(20)))->Fill(0);
2714 if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
2715 if(!track->HasPointOnITSLayer(1)) {
2716 ((TH1F *)(fQAProtonsRejectedList->At(21)))->Fill(0);
2718 else if(track->HasPointOnITSLayer(1))
2719 ((TH1F *)(fQAProtonsAcceptedList->At(21)))->Fill(0);
2721 if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
2722 if(!track->HasPointOnITSLayer(2)) {
2723 ((TH1F *)(fQAProtonsRejectedList->At(22)))->Fill(0);
2725 else if(track->HasPointOnITSLayer(2))
2726 ((TH1F *)(fQAProtonsAcceptedList->At(22)))->Fill(0);
2728 if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
2729 if(!track->HasPointOnITSLayer(3)) {
2730 ((TH1F *)(fQAProtonsRejectedList->At(23)))->Fill(0);
2732 else if(track->HasPointOnITSLayer(3))
2733 ((TH1F *)(fQAProtonsAcceptedList->At(23)))->Fill(0);
2735 if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
2736 if(!track->HasPointOnITSLayer(4)) {
2737 ((TH1F *)(fQAProtonsRejectedList->At(24)))->Fill(0);
2739 else if(track->HasPointOnITSLayer(4))
2740 ((TH1F *)(fQAProtonsAcceptedList->At(24)))->Fill(0);
2742 if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
2743 if(!track->HasPointOnITSLayer(5)) {
2744 ((TH1F *)(fQAProtonsRejectedList->At(25)))->Fill(0);
2746 else if(track->HasPointOnITSLayer(5))
2747 ((TH1F *)(fQAProtonsAcceptedList->At(25)))->Fill(0);
2749 if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
2750 if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
2751 ((TH1F *)(fQAProtonsRejectedList->At(26)))->Fill(track->GetTPCsignalN());
2753 if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
2754 ((TH1F *)(fQAProtonsAcceptedList->At(26)))->Fill(track->GetTPCsignalN());
2755 }//number of TPC points for the dE/dx
2756 if(fProtonAnalysisBase->IsUsedPointOnSPDLayer()) {
2757 if((!track->HasPointOnITSLayer(0))&&(!track->HasPointOnITSLayer(1))) {
2758 for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
2759 if(track->HasPointOnITSLayer(iLayer))
2760 ((TH1F *)(fQAProtonsRejectedList->At(27)))->Fill(iLayer+1);
2763 else if((track->HasPointOnITSLayer(0))||(track->HasPointOnITSLayer(1))) {
2764 for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
2765 if(track->HasPointOnITSLayer(iLayer))
2766 ((TH1F *)(fQAProtonsAcceptedList->At(27)))->Fill(iLayer+1);
2769 }//point on either SPD layers
2770 if(fProtonAnalysisBase->IsUsedMaxDCA3D()) {
2771 if(dca3D > fProtonAnalysisBase->GetMaxDCA3D()) {
2772 ((TH1F *)(fQAProtonsRejectedList->At(28)))->Fill(dca3D);
2774 if(dca3D < fProtonAnalysisBase->GetMaxDCA3D())
2775 ((TH1F *)(fQAProtonsAcceptedList->At(28)))->Fill(dca3D);
2780 if(track->Charge() < 0) {
2781 if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
2782 if(nClustersITS < fProtonAnalysisBase->GetMinITSClusters()) {
2783 ((TH1F *)(fQAAntiProtonsRejectedList->At(0)))->Fill(nClustersITS);
2785 else if(nClustersITS >= fProtonAnalysisBase->GetMinITSClusters())
2786 ((TH1F *)(fQAAntiProtonsAcceptedList->At(0)))->Fill(nClustersITS);
2788 if(fProtonAnalysisBase->IsUsedMaxChi2PerITSCluster()) {
2789 if(chi2PerClusterITS > fProtonAnalysisBase->GetMaxChi2PerITSCluster()) {
2790 ((TH1F *)(fQAAntiProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
2792 else if(chi2PerClusterITS <= fProtonAnalysisBase->GetMaxChi2PerITSCluster())
2793 ((TH1F *)(fQAAntiProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
2794 }//chi2 per ITS cluster
2795 if(fProtonAnalysisBase->IsUsedMinTPCClusters()) {
2796 if(nClustersTPC < fProtonAnalysisBase->GetMinTPCClusters()) {
2797 ((TH1F *)(fQAAntiProtonsRejectedList->At(2)))->Fill(nClustersTPC);
2799 else if(nClustersTPC >= fProtonAnalysisBase->GetMinTPCClusters()) {
2800 ((TH1F *)(fQAAntiProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
2803 if(fProtonAnalysisBase->IsUsedMaxChi2PerTPCCluster()) {
2804 if(chi2PerClusterTPC > fProtonAnalysisBase->GetMaxChi2PerTPCCluster()) {
2805 ((TH1F *)(fQAAntiProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
2807 else if(chi2PerClusterTPC <= fProtonAnalysisBase->GetMaxChi2PerTPCCluster())
2808 ((TH1F *)(fQAAntiProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
2809 }//chi2 per TPC cluster
2810 if(fProtonAnalysisBase->IsUsedMaxCov11()) {
2811 if(extCov[0] > fProtonAnalysisBase->GetMaxCov11()) {
2812 ((TH1F *)(fQAAntiProtonsRejectedList->At(4)))->Fill(extCov[0]);
2814 else if(extCov[0] <= fProtonAnalysisBase->GetMaxCov11())
2815 ((TH1F *)(fQAAntiProtonsAcceptedList->At(4)))->Fill(extCov[0]);
2817 if(fProtonAnalysisBase->IsUsedMaxCov22()) {
2818 if(extCov[2] > fProtonAnalysisBase->GetMaxCov22()) {
2819 ((TH1F *)(fQAAntiProtonsRejectedList->At(5)))->Fill(extCov[2]);
2821 else if(extCov[2] <= fProtonAnalysisBase->GetMaxCov22())
2822 ((TH1F *)(fQAAntiProtonsAcceptedList->At(5)))->Fill(extCov[2]);
2824 if(fProtonAnalysisBase->IsUsedMaxCov33()) {
2825 if(extCov[5] > fProtonAnalysisBase->GetMaxCov33()) {
2826 ((TH1F *)(fQAAntiProtonsRejectedList->At(6)))->Fill(extCov[5]);
2828 else if(extCov[5] <= fProtonAnalysisBase->GetMaxCov33())
2829 ((TH1F *)(fQAAntiProtonsAcceptedList->At(6)))->Fill(extCov[5]);
2831 if(fProtonAnalysisBase->IsUsedMaxCov44()) {
2832 if(extCov[9] > fProtonAnalysisBase->GetMaxCov44()) {
2833 ((TH1F *)(fQAAntiProtonsRejectedList->At(7)))->Fill(extCov[9]);
2835 else if(extCov[9] <= fProtonAnalysisBase->GetMaxCov44())
2836 ((TH1F *)(fQAAntiProtonsAcceptedList->At(7)))->Fill(extCov[9]);
2838 if(fProtonAnalysisBase->IsUsedMaxCov55()) {
2839 if(extCov[14] > fProtonAnalysisBase->GetMaxCov55()) {
2840 ((TH1F *)(fQAAntiProtonsRejectedList->At(8)))->Fill(extCov[14]);
2842 else if(extCov[14] <= fProtonAnalysisBase->GetMaxCov55())
2843 ((TH1F *)(fQAAntiProtonsAcceptedList->At(8)))->Fill(extCov[14]);
2845 if(fProtonAnalysisBase->IsUsedMaxSigmaToVertex()) {
2846 if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertex()) {
2847 ((TH1F *)(fQAAntiProtonsRejectedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2849 else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertex())
2850 ((TH1F *)(fQAAntiProtonsAcceptedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2852 if(fProtonAnalysisBase->IsUsedMaxSigmaToVertexTPC()) {
2853 if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertexTPC()) {
2854 ((TH1F *)(fQAAntiProtonsRejectedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2856 else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertexTPC())
2857 ((TH1F *)(fQAAntiProtonsAcceptedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
2858 }//sigma to vertex TPC
2859 if(fProtonAnalysisBase->IsUsedMaxDCAXY()) {
2860 if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
2861 ((TH1F *)(fQAAntiProtonsRejectedList->At(11)))->Fill(TMath::Abs(dca[0]));
2863 else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
2864 ((TH1F *)(fQAAntiProtonsAcceptedList->At(11)))->Fill(TMath::Abs(dca[0]));
2865 }//DCA xy global tracking
2866 if(fProtonAnalysisBase->IsUsedMaxDCAXYTPC()) {
2867 if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXYTPC()) {
2868 ((TH1F *)(fQAAntiProtonsRejectedList->At(12)))->Fill(TMath::Abs(dca[0]));
2870 else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXYTPC())
2871 ((TH1F *)(fQAAntiProtonsAcceptedList->At(12)))->Fill(TMath::Abs(dca[0]));
2872 }//DCA xy TPC tracking
2873 if(fProtonAnalysisBase->IsUsedMaxDCAZ()) {
2874 if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
2875 ((TH1F *)(fQAAntiProtonsRejectedList->At(13)))->Fill(TMath::Abs(dca[1]));
2877 else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
2878 ((TH1F *)(fQAAntiProtonsAcceptedList->At(13)))->Fill(TMath::Abs(dca[1]));
2879 }//DCA z global tracking
2880 if(fProtonAnalysisBase->IsUsedMaxDCAZTPC()) {
2881 if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZTPC()) {
2882 ((TH1F *)(fQAAntiProtonsRejectedList->At(14)))->Fill(TMath::Abs(dca[1]));
2884 else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZTPC())
2885 ((TH1F *)(fQAAntiProtonsAcceptedList->At(14)))->Fill(TMath::Abs(dca[1]));
2886 }//DCA z TPC tracking
2887 if(fProtonAnalysisBase->IsUsedMaxConstrainChi2()) {
2888 if(track->GetConstrainedChi2() > 0) {
2889 if(TMath::Log(track->GetConstrainedChi2()) > fProtonAnalysisBase->GetMaxConstrainChi2()) {
2890 ((TH1F *)(fQAAntiProtonsRejectedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
2892 else if(TMath::Log(track->GetConstrainedChi2()) <= fProtonAnalysisBase->GetMaxConstrainChi2())
2893 ((TH1F *)(fQAAntiProtonsAcceptedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
2895 }//constrain chi2 - vertex
2896 if(fProtonAnalysisBase->IsUsedITSRefit()) {
2897 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
2898 ((TH1F *)(fQAAntiProtonsRejectedList->At(16)))->Fill(0);
2900 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
2901 ((TH1F *)(fQAAntiProtonsAcceptedList->At(16)))->Fill(0);
2903 if(fProtonAnalysisBase->IsUsedTPCRefit()) {
2904 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
2905 ((TH1F *)(fQAAntiProtonsRejectedList->At(17)))->Fill(0);
2907 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
2908 ((TH1F *)(fQAAntiProtonsAcceptedList->At(17)))->Fill(0);
2910 if(fProtonAnalysisBase->IsUsedESDpid()) {
2911 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
2912 ((TH1F *)(fQAAntiProtonsRejectedList->At(18)))->Fill(0);
2914 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
2915 ((TH1F *)(fQAAntiProtonsAcceptedList->At(18)))->Fill(0);
2917 if(fProtonAnalysisBase->IsUsedTPCpid()) {
2918 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
2919 ((TH1F *)(fQAAntiProtonsRejectedList->At(19)))->Fill(0);
2921 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
2922 ((TH1F *)(fQAAntiProtonsAcceptedList->At(19)))->Fill(0);
2924 if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
2925 if(!track->HasPointOnITSLayer(0)) {
2926 ((TH1F *)(fQAAntiProtonsRejectedList->At(20)))->Fill(0);
2928 else if(track->HasPointOnITSLayer(0))
2929 ((TH1F *)(fQAAntiProtonsAcceptedList->At(20)))->Fill(0);
2931 if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
2932 if(!track->HasPointOnITSLayer(1)) {
2933 ((TH1F *)(fQAAntiProtonsRejectedList->At(21)))->Fill(0);
2935 else if(track->HasPointOnITSLayer(1))
2936 ((TH1F *)(fQAAntiProtonsAcceptedList->At(21)))->Fill(0);
2938 if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
2939 if(!track->HasPointOnITSLayer(2)) {
2940 ((TH1F *)(fQAAntiProtonsRejectedList->At(22)))->Fill(0);
2942 else if(track->HasPointOnITSLayer(2))
2943 ((TH1F *)(fQAAntiProtonsAcceptedList->At(22)))->Fill(0);
2945 if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
2946 if(!track->HasPointOnITSLayer(3)) {
2947 ((TH1F *)(fQAAntiProtonsRejectedList->At(23)))->Fill(0);
2949 else if(track->HasPointOnITSLayer(3))
2950 ((TH1F *)(fQAAntiProtonsAcceptedList->At(23)))->Fill(0);
2952 if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
2953 if(!track->HasPointOnITSLayer(4)) {
2954 ((TH1F *)(fQAAntiProtonsRejectedList->At(24)))->Fill(0);
2956 else if(track->HasPointOnITSLayer(4))
2957 ((TH1F *)(fQAAntiProtonsAcceptedList->At(24)))->Fill(0);
2959 if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
2960 if(!track->HasPointOnITSLayer(5)) {
2961 ((TH1F *)(fQAAntiProtonsRejectedList->At(25)))->Fill(0);
2963 else if(track->HasPointOnITSLayer(5))
2964 ((TH1F *)(fQAAntiProtonsAcceptedList->At(25)))->Fill(0);
2966 if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
2967 if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
2968 ((TH1F *)(fQAAntiProtonsRejectedList->At(26)))->Fill(track->GetTPCsignalN());
2970 if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
2971 ((TH1F *)(fQAAntiProtonsAcceptedList->At(26)))->Fill(track->GetTPCsignalN());
2972 }//number of TPC points for the dE/dx
2973 if(fProtonAnalysisBase->IsUsedPointOnSPDLayer()) {
2974 if((!track->HasPointOnITSLayer(0))&&(!track->HasPointOnITSLayer(1))) {
2975 for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
2976 if(track->HasPointOnITSLayer(iLayer))
2977 ((TH1F *)(fQAAntiProtonsRejectedList->At(27)))->Fill(iLayer+1);
2980 else if((track->HasPointOnITSLayer(0))||(track->HasPointOnITSLayer(1))) {
2981 for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
2982 if(track->HasPointOnITSLayer(iLayer))
2983 ((TH1F *)(fQAAntiProtonsAcceptedList->At(27)))->Fill(iLayer+1);
2986 }//point on either SPD layers
2987 if(fProtonAnalysisBase->IsUsedMaxDCA3D()) {
2988 if(dca3D > fProtonAnalysisBase->GetMaxDCA3D()) {
2989 ((TH1F *)(fQAAntiProtonsRejectedList->At(28)))->Fill(dca3D);
2991 if(dca3D < fProtonAnalysisBase->GetMaxDCA3D())
2992 ((TH1F *)(fQAAntiProtonsAcceptedList->At(28)))->Fill(dca3D);