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, UOA-CERN, Panos.Christakoglou@cern.ch
20 //-----------------------------------------------------------------
21 #include <Riostream.h>
28 #include <TParticle.h>
30 #include "AliProtonAnalysis.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>
42 ClassImp(AliProtonAnalysis)
44 //____________________________________________________________________//
45 AliProtonAnalysis::AliProtonAnalysis() :
47 fNBinsY(0), fMinY(0), fMaxY(0),
48 fNBinsPt(0), fMinPt(0), fMaxPt(0),
49 fMinTPCClusters(0), fMinITSClusters(0),
50 fMaxChi2PerTPCCluster(0), fMaxChi2PerITSCluster(0),
51 fMaxCov11(0), fMaxCov22(0), fMaxCov33(0), fMaxCov44(0), fMaxCov55(0),
52 fMaxSigmaToVertex(0), fMaxSigmaToVertexTPC(0),
53 fMinTPCClustersFlag(kFALSE), fMinITSClustersFlag(kFALSE),
54 fMaxChi2PerTPCClusterFlag(kFALSE), fMaxChi2PerITSClusterFlag(kFALSE),
55 fMaxCov11Flag(kFALSE), fMaxCov22Flag(kFALSE),
56 fMaxCov33Flag(kFALSE), fMaxCov44Flag(kFALSE), fMaxCov55Flag(kFALSE),
57 fMaxSigmaToVertexFlag(kFALSE), fMaxSigmaToVertexTPCFlag(kFALSE),
58 fITSRefitFlag(kFALSE), fTPCRefitFlag(kFALSE),
59 fESDpidFlag(kFALSE), fTPCpidFlag(kFALSE),
60 //fQAHistograms(kFALSE),
61 fGlobalQAList(0), fQA2DList(0),
62 fQAPrimaryProtonsAcceptedList(0),
63 fQAPrimaryProtonsRejectedList(0),
64 fQASecondaryProtonsAcceptedList(0),
65 fQASecondaryProtonsRejectedList(0),
66 fQAPrimaryAntiProtonsAcceptedList(0),
67 fQAPrimaryAntiProtonsRejectedList(0),
68 fQASecondaryAntiProtonsAcceptedList(0),
69 fQASecondaryAntiProtonsRejectedList(0),
70 fFunctionProbabilityFlag(kFALSE),
71 fElectronFunction(0), fMuonFunction(0),
72 fPionFunction(0), fKaonFunction(0), fProtonFunction(0),
74 fProtonContainer(0), fAntiProtonContainer(0),
75 fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
76 fEffGridListProtons(0), fCorrectionListProtons2D(0),
77 fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
78 fEffGridListAntiProtons(0), fCorrectionListAntiProtons2D(0),
79 fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0),
80 fCorrectProtons(0), fCorrectAntiProtons(0) {
82 for(Int_t i = 0; i < 5; i++) fPartFrac[i] = 0.0;
85 //____________________________________________________________________//
86 AliProtonAnalysis::AliProtonAnalysis(Int_t nbinsY, Float_t fLowY, Float_t fHighY,Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt) :
88 fNBinsY(nbinsY), fMinY(fLowY), fMaxY(fHighY),
89 fNBinsPt(nbinsPt), fMinPt(fLowPt), fMaxPt(fHighPt),
90 fMinTPCClusters(0), fMinITSClusters(0),
91 fMaxChi2PerTPCCluster(0), fMaxChi2PerITSCluster(0),
92 fMaxCov11(0), fMaxCov22(0), fMaxCov33(0), fMaxCov44(0), fMaxCov55(0),
93 fMaxSigmaToVertex(0), fMaxSigmaToVertexTPC(0),
94 fMinTPCClustersFlag(kFALSE), fMinITSClustersFlag(kFALSE),
95 fMaxChi2PerTPCClusterFlag(kFALSE), fMaxChi2PerITSClusterFlag(kFALSE),
96 fMaxCov11Flag(kFALSE), fMaxCov22Flag(kFALSE),
97 fMaxCov33Flag(kFALSE), fMaxCov44Flag(kFALSE), fMaxCov55Flag(kFALSE),
98 fMaxSigmaToVertexFlag(kFALSE), fMaxSigmaToVertexTPCFlag(kFALSE),
99 fITSRefitFlag(kFALSE), fTPCRefitFlag(kFALSE),
100 fESDpidFlag(kFALSE), fTPCpidFlag(kFALSE),
101 //fQAHistograms(kFALSE),
102 fGlobalQAList(0), fQA2DList(0),
103 fQAPrimaryProtonsAcceptedList(0),
104 fQAPrimaryProtonsRejectedList(0),
105 fQASecondaryProtonsAcceptedList(0),
106 fQASecondaryProtonsRejectedList(0),
107 fQAPrimaryAntiProtonsAcceptedList(0),
108 fQAPrimaryAntiProtonsRejectedList(0),
109 fQASecondaryAntiProtonsAcceptedList(0),
110 fQASecondaryAntiProtonsRejectedList(0),
111 fFunctionProbabilityFlag(kFALSE),
112 fElectronFunction(0), fMuonFunction(0),
113 fPionFunction(0), fKaonFunction(0), fProtonFunction(0),
115 fProtonContainer(0), fAntiProtonContainer(0),
116 fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
117 fEffGridListProtons(0), fCorrectionListProtons2D(0),
118 fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
119 fEffGridListAntiProtons(0), fCorrectionListAntiProtons2D(0),
120 fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0),
121 fCorrectProtons(0), fCorrectAntiProtons(0){
122 //Default constructor
124 fHistEvents = new TH1I("fHistEvents","Analyzed events",1,0,1);
126 fHistYPtProtons = new TH2D("fHistYPtProtons","y-Pt Protons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
127 fHistYPtProtons->SetStats(kTRUE);
128 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
129 fHistYPtProtons->GetXaxis()->SetTitle("y");
130 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
132 fHistYPtAntiProtons = new TH2D("fHistYPtAntiProtons","y-Pt Antiprotons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
133 fHistYPtAntiProtons->SetStats(kTRUE);
134 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
135 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
136 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
138 //setting up the containers
142 Double_t *binLimY = new Double_t[nbinsY+1];
143 Double_t *binLimPt = new Double_t[nbinsPt+1];
144 //values for bin lower bounds
145 for(Int_t i = 0; i <= nbinsY; i++)
146 binLimY[i]=(Double_t)fLowY + (fHighY - fLowY) /nbinsY*(Double_t)i;
147 for(Int_t i = 0; i <= nbinsPt; i++)
148 binLimPt[i]=(Double_t)fLowPt + (fHighPt - fLowPt) /nbinsPt*(Double_t)i;
150 fProtonContainer = new AliCFContainer("containerProtons",
151 "container for protons",
153 fProtonContainer->SetBinLimits(0,binLimY); //rapidity
154 fProtonContainer->SetBinLimits(1,binLimPt); //pT
155 fAntiProtonContainer = new AliCFContainer("containerAntiProtons",
156 "container for antiprotons",
158 fAntiProtonContainer->SetBinLimits(0,binLimY); //rapidity
159 fAntiProtonContainer->SetBinLimits(1,binLimPt); //pT
162 //____________________________________________________________________//
163 AliProtonAnalysis::~AliProtonAnalysis() {
165 if(fHistEvents) delete fHistEvents;
166 if(fHistYPtProtons) delete fHistYPtProtons;
167 if(fHistYPtAntiProtons) delete fHistYPtAntiProtons;
168 if(fProtonContainer) delete fProtonContainer;
169 if(fAntiProtonContainer) delete fAntiProtonContainer;
171 if(fGlobalQAList) delete fGlobalQAList;
172 if(fQA2DList) delete fQA2DList;
173 if(fQAPrimaryProtonsAcceptedList) delete fQAPrimaryProtonsAcceptedList;
174 if(fQAPrimaryProtonsRejectedList) delete fQAPrimaryProtonsRejectedList;
175 if(fQASecondaryProtonsAcceptedList) delete fQASecondaryProtonsAcceptedList;
176 if(fQASecondaryProtonsRejectedList) delete fQASecondaryProtonsRejectedList;
177 if(fQAPrimaryAntiProtonsAcceptedList)
178 delete fQAPrimaryAntiProtonsAcceptedList;
179 if(fQAPrimaryAntiProtonsRejectedList)
180 delete fQAPrimaryAntiProtonsRejectedList;
181 if(fQASecondaryAntiProtonsAcceptedList)
182 delete fQASecondaryAntiProtonsAcceptedList;
183 if(fQASecondaryAntiProtonsRejectedList)
184 delete fQASecondaryAntiProtonsRejectedList;
186 if(fEffGridListProtons) delete fEffGridListProtons;
187 if(fCorrectionListProtons2D) delete fCorrectionListProtons2D;
188 if(fEfficiencyListProtons1D) delete fEfficiencyListProtons1D;
189 if(fCorrectionListProtons1D) delete fCorrectionListProtons1D;
190 if(fEffGridListAntiProtons) delete fEffGridListAntiProtons;
191 if(fCorrectionListAntiProtons2D) delete fCorrectionListAntiProtons2D;
192 if(fEfficiencyListAntiProtons1D) delete fEfficiencyListAntiProtons1D;
193 if(fCorrectionListAntiProtons1D) delete fCorrectionListAntiProtons1D;
194 if(fCorrectProtons) delete fCorrectProtons;
195 if(fCorrectAntiProtons) delete fCorrectAntiProtons;
198 //____________________________________________________________________//
199 void AliProtonAnalysis::InitAnalysisHistograms(Int_t nbinsY,
200 Float_t fLowY, Float_t fHighY,
202 Float_t fLowPt, Float_t fHighPt) {
210 fHistEvents = new TH1I("fHistEvents","Anallyzed events",1,0,1);
212 fHistYPtProtons = new TH2D("fHistYPtProtons","y-Pt Protons",
213 fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
214 fHistYPtProtons->SetStats(kTRUE);
215 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
216 fHistYPtProtons->GetXaxis()->SetTitle("y");
217 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
219 fHistYPtAntiProtons = new TH2D("fHistYPtAntiProtons","y-Pt Antiprotons",
220 fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
221 fHistYPtAntiProtons->SetStats(kTRUE);
222 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
223 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
224 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
226 //setting up the containers
230 Double_t *binLimY = new Double_t[nbinsY+1];
231 Double_t *binLimPt = new Double_t[nbinsPt+1];
232 //values for bin lower bounds
233 for(Int_t i = 0; i <= nbinsY; i++)
234 binLimY[i]=(Double_t)fLowY + (fHighY - fLowY) /nbinsY*(Double_t)i;
235 for(Int_t i = 0; i <= nbinsPt; i++)
236 binLimPt[i]=(Double_t)fLowPt + (fHighPt - fLowPt) /nbinsPt*(Double_t)i;
238 fProtonContainer = new AliCFContainer("containerProtons",
239 "container for protons",
241 fProtonContainer->SetBinLimits(0,binLimY); //rapidity
242 fProtonContainer->SetBinLimits(1,binLimPt); //pT
243 fAntiProtonContainer = new AliCFContainer("containerAntiProtons",
244 "container for antiprotons",
246 fAntiProtonContainer->SetBinLimits(0,binLimY); //rapidity
247 fAntiProtonContainer->SetBinLimits(1,binLimPt); //pT
250 //____________________________________________________________________//
251 Bool_t AliProtonAnalysis::ReadFromFile(const char* filename) {
252 Bool_t status = kTRUE;
254 TFile *file = TFile::Open(filename);
256 cout<<"Could not find the input file "<<filename<<endl;
260 TList *list = (TList *)file->Get("outputList1");
262 cout<<"Retrieving objects from the list "<<list->GetName()<<"..."<<endl;
263 fHistYPtProtons = (TH2D *)list->At(0);
264 fHistYPtAntiProtons = (TH2D *)list->At(1);
265 fHistEvents = (TH1I *)list->At(2);
266 fProtonContainer = (AliCFContainer *)list->At(3);
267 fAntiProtonContainer = (AliCFContainer *)list->At(4);
270 cout<<"Retrieving objects from the file... "<<endl;
271 fHistYPtProtons = (TH2D *)file->Get("fHistYPtProtons");
272 fHistYPtAntiProtons = (TH2D *)file->Get("fHistYPtAntiProtons");
273 fHistEvents = (TH1I *)file->Get("fHistEvents");
274 fProtonContainer = (AliCFContainer *)file->Get("containerProtons");
275 fAntiProtonContainer = (AliCFContainer *)file->Get("containerAntiProtons");
277 if((!fHistYPtProtons)||(!fHistYPtAntiProtons)||(!fHistEvents)
278 ||(!fProtonContainer)||(!fAntiProtonContainer)) {
279 cout<<"Input containers were not found!!!"<<endl;
283 fHistYPtProtons = fProtonContainer->ShowProjection(0,1,0);
284 fHistYPtAntiProtons = fAntiProtonContainer->ShowProjection(0,1,0);
285 //fHistYPtProtons->Sumw2();
286 //fHistYPtAntiProtons->Sumw2();
292 //____________________________________________________________________//
293 TH1D *AliProtonAnalysis::GetProtonYHistogram() {
294 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
296 //TH1D *fYProtons = (TH1D *)fHistYPtProtons->ProjectionX("fYProtons",0,fHistYPtProtons->GetYaxis()->GetNbins(),"e");
297 TH1D *fYProtons = fProtonContainer->ShowProjection(0,0); //variable-step
299 fYProtons->SetStats(kFALSE);
300 fYProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
301 fYProtons->SetTitle("dN/dy protons");
302 fYProtons->SetMarkerStyle(kFullCircle);
303 fYProtons->SetMarkerColor(4);
304 if(nAnalyzedEvents > 0)
305 fYProtons->Scale(1./nAnalyzedEvents);
310 //____________________________________________________________________//
311 TH1D *AliProtonAnalysis::GetAntiProtonYHistogram() {
312 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
313 //TH1D *fYAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionX("fYAntiProtons",0,fHistYPtAntiProtons->GetYaxis()->GetNbins(),"e");
314 TH1D *fYAntiProtons = fAntiProtonContainer->ShowProjection(0,0);//variable-step
316 fYAntiProtons->SetStats(kFALSE);
317 fYAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
318 fYAntiProtons->SetTitle("dN/dy antiprotons");
319 fYAntiProtons->SetMarkerStyle(kFullCircle);
320 fYAntiProtons->SetMarkerColor(4);
321 if(nAnalyzedEvents > 0)
322 fYAntiProtons->Scale(1./nAnalyzedEvents);
324 return fYAntiProtons;
327 //____________________________________________________________________//
328 TH1D *AliProtonAnalysis::GetProtonPtHistogram() {
329 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
330 //TH1D *fPtProtons = (TH1D *)fHistYPtProtons->ProjectionY("fPtProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"e");
331 TH1D *fPtProtons = fProtonContainer->ShowProjection(1,0); //variable-step
333 fPtProtons->SetStats(kFALSE);
334 fPtProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
335 fPtProtons->SetTitle("dN/dPt protons");
336 fPtProtons->SetMarkerStyle(kFullCircle);
337 fPtProtons->SetMarkerColor(4);
338 if(nAnalyzedEvents > 0)
339 fPtProtons->Scale(1./nAnalyzedEvents);
344 //____________________________________________________________________//
345 TH1D *AliProtonAnalysis::GetAntiProtonPtHistogram() {
346 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
347 //TH1D *fPtAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionY("fPtAntiProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"e");
348 TH1D *fPtAntiProtons = fAntiProtonContainer->ShowProjection(1,0); //variable-step
350 fPtAntiProtons->SetStats(kFALSE);
351 fPtAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
352 fPtAntiProtons->SetTitle("dN/dPt antiprotons");
353 fPtAntiProtons->SetMarkerStyle(kFullCircle);
354 fPtAntiProtons->SetMarkerColor(4);
355 if(nAnalyzedEvents > 0)
356 fPtAntiProtons->Scale(1./nAnalyzedEvents);
358 return fPtAntiProtons;
361 //____________________________________________________________________//
362 TH1D *AliProtonAnalysis::GetProtonCorrectedYHistogram() {
363 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
365 TH1D *fYProtons = fCorrectProtons->Project(0); //0: rapidity
367 fYProtons->SetStats(kFALSE);
368 fYProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
369 fYProtons->GetXaxis()->SetTitle("y");
370 fYProtons->SetTitle("dN/dy protons");
371 fYProtons->SetMarkerStyle(kFullCircle);
372 fYProtons->SetMarkerColor(4);
373 if(nAnalyzedEvents > 0)
374 fYProtons->Scale(1./nAnalyzedEvents);
379 //____________________________________________________________________//
380 TH1D *AliProtonAnalysis::GetAntiProtonCorrectedYHistogram() {
381 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
383 TH1D *fYAntiProtons = fCorrectAntiProtons->Project(0); //0: rapidity
385 fYAntiProtons->SetStats(kFALSE);
386 fYAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
387 fYAntiProtons->GetXaxis()->SetTitle("y");
388 fYAntiProtons->SetTitle("dN/dy protons");
389 fYAntiProtons->SetMarkerStyle(kFullCircle);
390 fYAntiProtons->SetMarkerColor(4);
391 if(nAnalyzedEvents > 0)
392 fYAntiProtons->Scale(1./nAnalyzedEvents);
394 return fYAntiProtons;
397 //____________________________________________________________________//
398 TH1D *AliProtonAnalysis::GetProtonCorrectedPtHistogram() {
399 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
401 TH1D *fPtProtons = fCorrectProtons->Project(0); //0: rapidity
403 fPtProtons->SetStats(kFALSE);
404 fPtProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
405 fPtProtons->GetXaxis()->SetTitle("P_{T} [GeV/c]");
406 fPtProtons->SetTitle("dN/dPt protons");
407 fPtProtons->SetMarkerStyle(kFullCircle);
408 fPtProtons->SetMarkerColor(4);
409 if(nAnalyzedEvents > 0)
410 fPtProtons->Scale(1./nAnalyzedEvents);
415 //____________________________________________________________________//
416 TH1D *AliProtonAnalysis::GetAntiProtonCorrectedPtHistogram() {
417 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
419 TH1D *fPtAntiProtons = fCorrectAntiProtons->Project(0); //0: rapidity
421 fPtAntiProtons->SetStats(kFALSE);
422 fPtAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
423 fPtAntiProtons->GetXaxis()->SetTitle("P_{T} [GeV/c]");
424 fPtAntiProtons->SetTitle("dN/dPt antiprotons");
425 fPtAntiProtons->SetMarkerStyle(kFullCircle);
426 fPtAntiProtons->SetMarkerColor(4);
427 if(nAnalyzedEvents > 0)
428 fPtAntiProtons->Scale(1./nAnalyzedEvents);
430 return fPtAntiProtons;
433 //____________________________________________________________________//
434 TH1D *AliProtonAnalysis::GetYRatioHistogram() {
435 TH1D *fYProtons = GetProtonYHistogram();
436 TH1D *fYAntiProtons = GetAntiProtonYHistogram();
438 TH1D *hRatioY = new TH1D("hRatioY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
439 hRatioY->Divide(fYAntiProtons,fYProtons,1.0,1.0);
440 hRatioY->SetMarkerStyle(kFullCircle);
441 hRatioY->SetMarkerColor(4);
442 hRatioY->GetYaxis()->SetTitle("#bar{p}/p");
443 hRatioY->GetYaxis()->SetTitleOffset(1.4);
444 hRatioY->GetXaxis()->SetTitle("y");
445 hRatioY->GetXaxis()->SetTitleColor(1);
446 hRatioY->SetStats(kFALSE);
451 //____________________________________________________________________//
452 TH1D *AliProtonAnalysis::GetPtRatioHistogram() {
453 TH1D *fPtProtons = GetProtonPtHistogram();
454 TH1D *fPtAntiProtons = GetAntiProtonPtHistogram();
456 TH1D *hRatioPt = new TH1D("hRatioPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
457 hRatioPt->Divide(fPtAntiProtons,fPtProtons,1.0,1.0);
458 hRatioPt->SetMarkerStyle(kFullCircle);
459 hRatioPt->SetMarkerColor(4);
460 hRatioPt->GetYaxis()->SetTitle("#bar{p}/p");
461 hRatioPt->GetYaxis()->SetTitleOffset(1.4);
462 hRatioPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
463 hRatioPt->GetXaxis()->SetTitleColor(1);
464 hRatioPt->SetStats(kFALSE);
469 //____________________________________________________________________//
470 TH1D *AliProtonAnalysis::GetYAsymmetryHistogram() {
471 TH1D *fYProtons = GetProtonYHistogram();
472 TH1D *fYAntiProtons = GetAntiProtonYHistogram();
474 TH1D *hsum = new TH1D("hsumY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
475 hsum->Add(fYProtons,fYAntiProtons,1.0,1.0);
477 TH1D *hdiff = new TH1D("hdiffY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
478 hdiff->Add(fYProtons,fYAntiProtons,1.0,-1.0);
480 TH1D *hAsymmetryY = new TH1D("hAsymmetryY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
481 hAsymmetryY->Divide(hdiff,hsum,2.0,1.);
482 hAsymmetryY->SetMarkerStyle(kFullCircle);
483 hAsymmetryY->SetMarkerColor(4);
484 hAsymmetryY->GetYaxis()->SetTitle("A_{p}");
485 hAsymmetryY->GetYaxis()->SetTitleOffset(1.4);
486 hAsymmetryY->GetXaxis()->SetTitle("y");
487 hAsymmetryY->GetXaxis()->SetTitleColor(1);
488 hAsymmetryY->SetStats(kFALSE);
493 //____________________________________________________________________//
494 TH1D *AliProtonAnalysis::GetPtAsymmetryHistogram() {
495 TH1D *fPtProtons = GetProtonPtHistogram();
496 TH1D *fPtAntiProtons = GetAntiProtonPtHistogram();
498 TH1D *hsum = new TH1D("hsumPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
499 hsum->Add(fPtProtons,fPtAntiProtons,1.0,1.0);
501 TH1D *hdiff = new TH1D("hdiffPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
502 hdiff->Add(fPtProtons,fPtAntiProtons,1.0,-1.0);
504 TH1D *hAsymmetryPt = new TH1D("hAsymmetryPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
505 hAsymmetryPt->Divide(hdiff,hsum,2.0,1.);
506 hAsymmetryPt->SetMarkerStyle(kFullCircle);
507 hAsymmetryPt->SetMarkerColor(4);
508 hAsymmetryPt->GetYaxis()->SetTitle("A_{p}");
509 hAsymmetryPt->GetYaxis()->SetTitleOffset(1.4);
510 hAsymmetryPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
511 hAsymmetryPt->GetXaxis()->SetTitleColor(1);
512 hAsymmetryPt->SetStats(kFALSE);
517 //____________________________________________________________________//
518 Double_t AliProtonAnalysis::GetParticleFraction(Int_t i, Double_t p) {
520 if(fFunctionProbabilityFlag) {
521 if(i == 0) partFrac = fElectronFunction->Eval(p);
522 if(i == 1) partFrac = fMuonFunction->Eval(p);
523 if(i == 2) partFrac = fPionFunction->Eval(p);
524 if(i == 3) partFrac = fKaonFunction->Eval(p);
525 if(i == 4) partFrac = fProtonFunction->Eval(p);
527 else partFrac = fPartFrac[i];
532 //____________________________________________________________________//
533 void AliProtonAnalysis::Analyze(AliESDEvent* fESD) {
534 //Main analysis part - ESD
535 fHistEvents->Fill(0); //number of analyzed events
536 Double_t containerInput[2] ;
537 Double_t Pt = 0.0, P = 0.0;
538 Int_t nGoodTracks = fESD->GetNumberOfTracks();
539 for(Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
540 AliESDtrack* track = fESD->GetTrack(iTracks);
541 Double_t probability[5];
543 if(IsAccepted(track)) {
545 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
546 if(!tpcTrack) continue;
551 track->GetTPCpid(probability);
553 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
554 rcc += probability[i]*GetParticleFraction(i,P);
555 if(rcc == 0.0) continue;
557 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
558 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
559 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
560 if(fParticleType == 4) {
561 if(tpcTrack->Charge() > 0) {
562 fHistYPtProtons->Fill(Rapidity(tpcTrack->Px(),
567 containerInput[0] = Rapidity(tpcTrack->Px(),
570 containerInput[1] = Pt;
571 fProtonContainer->Fill(containerInput,0);
573 else if(tpcTrack->Charge() < 0) {
574 fHistYPtAntiProtons->Fill(Rapidity(tpcTrack->Px(),
579 containerInput[0] = Rapidity(tpcTrack->Px(),
582 containerInput[1] = Pt;
583 fAntiProtonContainer->Fill(containerInput,0);
587 else if(!fUseTPCOnly) {
592 track->GetESDpid(probability);
594 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
595 rcc += probability[i]*GetParticleFraction(i,P);
596 if(rcc == 0.0) continue;
598 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
599 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
600 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
601 if(fParticleType == 4) {
602 //cout<<"(Anti)protons found..."<<endl;
603 if(track->Charge() > 0) {
604 fHistYPtProtons->Fill(Rapidity(track->Px(),
609 containerInput[0] = Rapidity(track->Px(),
612 containerInput[1] = Pt;
613 fProtonContainer->Fill(containerInput,0);
615 else if(track->Charge() < 0) {
616 fHistYPtAntiProtons->Fill(Rapidity(track->Px(),
621 containerInput[0] = Rapidity(track->Px(),
624 containerInput[1] = Pt;
625 fAntiProtonContainer->Fill(containerInput,0);
633 //____________________________________________________________________//
634 void AliProtonAnalysis::Analyze(AliAODEvent* fAOD) {
635 //Main analysis part - AOD
636 fHistEvents->Fill(0); //number of analyzed events
637 Int_t nGoodTracks = fAOD->GetNumberOfTracks();
638 for(Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
639 AliAODTrack* track = fAOD->GetTrack(iTracks);
640 Double_t Pt = track->Pt();
641 Double_t P = track->P();
644 Double_t probability[10];
645 track->GetPID(probability);
647 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) rcc += probability[i]*GetParticleFraction(i,P);
648 if(rcc == 0.0) continue;
650 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
651 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIESN,w);
652 if(fParticleType == 4) {
653 if(track->Charge() > 0)
654 fHistYPtProtons->Fill(track->Y(fParticleType),Pt);
655 else if(track->Charge() < 0)
656 fHistYPtAntiProtons->Fill(track->Y(fParticleType),Pt);
661 //____________________________________________________________________//
662 void AliProtonAnalysis::Analyze(AliStack* stack) {
663 //Main analysis part - MC
664 fHistEvents->Fill(0); //number of analyzed events
665 for(Int_t i = 0; i < stack->GetNprimary(); i++) {
666 TParticle *particle = stack->Particle(i);
667 if(particle->Pt() < 0.1) continue;
668 if(TMath::Abs(particle->Eta()) > 1.0) continue;
669 Int_t pdgcode = particle->GetPdgCode();
670 if(pdgcode == 2212) fHistYPtProtons->Fill(Rapidity(particle->Px(),
674 if(pdgcode == -2212) fHistYPtAntiProtons->Fill(Rapidity(particle->Px(),
681 //____________________________________________________________________//
682 Bool_t AliProtonAnalysis::IsAccepted(AliESDtrack* track) {
683 // Checks if the track is excluded from the cuts
684 Double_t Pt = 0.0, Px = 0.0, Py = 0.0, Pz = 0.0;
686 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
688 Pt = 0.0; Px = 0.0; Py = 0.0; Pz = 0.0;
705 Int_t nClustersITS = track->GetITSclusters(fIdxInt);
706 Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
708 Float_t chi2PerClusterITS = -1;
710 chi2PerClusterITS = track->GetITSchi2()/Float_t(nClustersITS);
711 Float_t chi2PerClusterTPC = -1;
713 chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);
716 track->GetExternalCovariance(extCov);
718 if(fMinITSClustersFlag)
719 if(nClustersITS < fMinITSClusters) return kFALSE;
720 if(fMaxChi2PerITSClusterFlag)
721 if(chi2PerClusterITS > fMaxChi2PerITSCluster) return kFALSE;
722 if(fMinTPCClustersFlag)
723 if(nClustersTPC < fMinTPCClusters) return kFALSE;
724 if(fMaxChi2PerTPCClusterFlag)
725 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) return kFALSE;
727 if(extCov[0] > fMaxCov11) return kFALSE;
729 if(extCov[2] > fMaxCov22) return kFALSE;
731 if(extCov[5] > fMaxCov33) return kFALSE;
733 if(extCov[9] > fMaxCov44) return kFALSE;
735 if(extCov[14] > fMaxCov55) return kFALSE;
736 if(fMaxSigmaToVertexFlag)
737 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) return kFALSE;
738 if(fMaxSigmaToVertexTPCFlag)
739 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) return kFALSE;
741 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
743 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
745 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) return kFALSE;
747 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) return kFALSE;
749 if((Pt < fMinPt) || (Pt > fMaxPt)) return kFALSE;
750 if((Rapidity(Px,Py,Pz) < fMinY) || (Rapidity(Px,Py,Pz) > fMaxY))
756 //____________________________________________________________________//
757 void AliProtonAnalysis::FillQA(AliESDtrack* track, AliStack *stack) {
758 // Checks if the track is excluded from the cuts
759 Int_t nPrimaries = stack->GetNprimary();
760 Int_t label = TMath::Abs(track->GetLabel());
762 Double_t Pt = 0.0, Px = 0.0, Py = 0.0, Pz = 0.0;
764 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
766 Pt = 0.0; Px = 0.0; Py = 0.0; Pz = 0.0;
783 Int_t nClustersITS = track->GetITSclusters(fIdxInt);
784 Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
786 Float_t chi2PerClusterITS = -1;
788 chi2PerClusterITS = track->GetITSchi2()/Float_t(nClustersITS);
789 Float_t chi2PerClusterTPC = -1;
791 chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);
794 track->GetExternalCovariance(extCov);
796 //cout<<"Charge: "<<track->Charge()<<
797 //" - Label/Primaries: "<<label<<"/"<<nPrimaries<<
798 //" - TPC clusters: "<<nClustersTPC<<endl;
800 if(track->Charge() > 0) {
802 if(label <= nPrimaries) {
803 if(fMinITSClustersFlag) {
804 if(nClustersITS < fMinITSClusters) {
805 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
808 else if(nClustersITS >= fMinITSClusters)
809 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
811 if(fMaxChi2PerITSClusterFlag) {
812 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
813 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
816 else if(chi2PerClusterITS <= fMaxChi2PerITSCluster)
817 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
818 }//chi2 per ITS cluster
819 if(fMinTPCClustersFlag) {
820 if(nClustersTPC < fMinTPCClusters) {
821 //cout<<"Primary proton rejected"<<endl;
822 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(2)))->Fill(nClustersTPC);
825 else if(nClustersTPC >= fMinTPCClusters) {
826 //cout<<"Primary proton accepted"<<endl;
827 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
830 if(fMaxChi2PerTPCClusterFlag) {
831 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
832 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
835 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
836 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
837 }//chi2 per TPC cluster
839 if(extCov[0] > fMaxCov11) {
840 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
843 else if(extCov[0] <= fMaxCov11)
844 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
847 if(extCov[2] > fMaxCov22) {
848 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
851 else if(extCov[2] <= fMaxCov22)
852 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
855 if(extCov[5] > fMaxCov33) {
856 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
859 else if(extCov[5] <= fMaxCov33)
860 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
863 if(extCov[9] > fMaxCov44) {
864 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
867 else if(extCov[9] <= fMaxCov44)
868 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
871 if(extCov[14] > fMaxCov55) {
872 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
875 else if(extCov[14] <= fMaxCov55)
876 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
878 if(fMaxSigmaToVertexFlag) {
879 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
880 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
883 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
884 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
886 if(fMaxSigmaToVertexTPCFlag) {
887 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
888 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
891 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
892 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
893 }//sigma to vertex TPC
895 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
896 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(11)))->Fill(0);
899 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
900 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(11)))->Fill(0);
903 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
904 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(12)))->Fill(0);
907 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
908 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(12)))->Fill(0);
911 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
912 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(13)))->Fill(0);
915 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
916 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(13)))->Fill(0);
919 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
920 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(13)))->Fill(0);
923 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
924 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(13)))->Fill(0);
926 }//primary particle cut
929 if(label > nPrimaries) {
930 if(fMinITSClustersFlag) {
931 if(nClustersITS < fMinITSClusters) {
932 ((TH1F *)(fQASecondaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
935 else if(nClustersITS >= fMinITSClusters)
936 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
938 if(fMaxChi2PerITSClusterFlag) {
939 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
940 ((TH1F *)(fQASecondaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
943 else if(chi2PerClusterITS <= fMaxChi2PerITSCluster)
944 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
945 }//chi2 per ITS cluster
946 if(fMinTPCClustersFlag) {
947 if(nClustersTPC < fMinTPCClusters) {
948 //cout<<"Secondary proton rejected"<<endl;
949 ((TH1F *)(fQASecondaryProtonsRejectedList->At(2)))->Fill(nClustersTPC);
952 else if(nClustersTPC >= fMinTPCClusters) {
953 //cout<<"Secondary proton accepted"<<endl;
954 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
957 if(fMaxChi2PerTPCClusterFlag) {
958 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
959 ((TH1F *)(fQASecondaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
962 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
963 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
964 }//chi2 per TPC cluster
966 if(extCov[0] > fMaxCov11) {
967 ((TH1F *)(fQASecondaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
970 else if(extCov[0] <= fMaxCov11)
971 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
974 if(extCov[2] > fMaxCov22) {
975 ((TH1F *)(fQASecondaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
978 else if(extCov[2] <= fMaxCov22)
979 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
982 if(extCov[5] > fMaxCov33) {
983 ((TH1F *)(fQASecondaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
986 else if(extCov[5] <= fMaxCov33)
987 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
990 if(extCov[9] > fMaxCov44) {
991 ((TH1F *)(fQASecondaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
994 else if(extCov[9] <= fMaxCov44)
995 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
998 if(extCov[14] > fMaxCov55) {
999 ((TH1F *)(fQASecondaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
1002 else if(extCov[14] <= fMaxCov55)
1003 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
1005 if(fMaxSigmaToVertexFlag) {
1006 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
1007 ((TH1F *)(fQASecondaryProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
1010 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
1011 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
1013 if(fMaxSigmaToVertexTPCFlag) {
1014 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
1015 ((TH1F *)(fQASecondaryProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
1018 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
1019 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
1020 }//sigma to vertex TPC
1022 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
1023 ((TH1F *)(fQASecondaryProtonsRejectedList->At(11)))->Fill(0);
1026 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
1027 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(11)))->Fill(0);
1030 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
1031 ((TH1F *)(fQASecondaryProtonsRejectedList->At(12)))->Fill(0);
1034 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
1035 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(12)))->Fill(0);
1038 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
1039 ((TH1F *)(fQASecondaryProtonsRejectedList->At(13)))->Fill(0);
1042 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
1043 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(13)))->Fill(0);
1046 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
1047 ((TH1F *)(fQASecondaryProtonsRejectedList->At(13)))->Fill(0);
1050 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
1051 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(13)))->Fill(0);
1053 }//secondary particle cut
1057 if(track->Charge() < 0) {
1059 if(label <= nPrimaries) {
1060 if(fMinITSClustersFlag) {
1061 if(nClustersITS < fMinITSClusters) {
1062 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(0)))->Fill(nClustersITS);
1065 else if(nClustersITS >= fMinITSClusters)
1066 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(0)))->Fill(nClustersITS);
1068 if(fMaxChi2PerITSClusterFlag) {
1069 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
1070 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
1073 else if(chi2PerClusterITS <= fMaxChi2PerITSCluster)
1074 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
1075 }//chi2 per ITS cluster
1076 if(fMinTPCClustersFlag) {
1077 if(nClustersTPC < fMinTPCClusters) {
1078 //cout<<"Primary antiproton rejected"<<endl;
1079 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(2)))->Fill(nClustersTPC);
1082 else if(nClustersTPC >= fMinTPCClusters) {
1083 //cout<<"Primary antiproton accepted"<<endl;
1084 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
1087 if(fMaxChi2PerTPCClusterFlag) {
1088 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
1089 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
1092 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
1093 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
1094 }//chi2 per TPC cluster
1096 if(extCov[0] > fMaxCov11) {
1097 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(4)))->Fill(extCov[0]);
1100 else if(extCov[0] <= fMaxCov11)
1101 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(4)))->Fill(extCov[0]);
1104 if(extCov[2] > fMaxCov22) {
1105 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(5)))->Fill(extCov[2]);
1108 else if(extCov[2] <= fMaxCov22)
1109 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(5)))->Fill(extCov[2]);
1112 if(extCov[5] > fMaxCov33) {
1113 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(6)))->Fill(extCov[5]);
1116 else if(extCov[5] <= fMaxCov33)
1117 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(6)))->Fill(extCov[5]);
1120 if(extCov[9] > fMaxCov44) {
1121 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(7)))->Fill(extCov[9]);
1124 else if(extCov[9] <= fMaxCov44)
1125 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(7)))->Fill(extCov[9]);
1128 if(extCov[14] > fMaxCov55) {
1129 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(8)))->Fill(extCov[14]);
1132 else if(extCov[14] <= fMaxCov55)
1133 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(8)))->Fill(extCov[14]);
1135 if(fMaxSigmaToVertexFlag) {
1136 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
1137 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
1140 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
1141 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
1143 if(fMaxSigmaToVertexTPCFlag) {
1144 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
1145 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
1148 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
1149 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
1150 }//sigma to vertex TPC
1152 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
1153 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(11)))->Fill(0);
1156 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
1157 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(11)))->Fill(0);
1160 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
1161 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(12)))->Fill(0);
1164 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
1165 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(12)))->Fill(0);
1168 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
1169 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(13)))->Fill(0);
1172 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
1173 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(13)))->Fill(0);
1176 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
1177 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(13)))->Fill(0);
1180 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
1181 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(13)))->Fill(0);
1183 }//primary particle cut
1186 if(label > nPrimaries) {
1187 if(fMinITSClustersFlag) {
1188 if(nClustersITS < fMinITSClusters) {
1189 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(0)))->Fill(nClustersITS);
1192 else if(nClustersITS >= fMinITSClusters)
1193 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(0)))->Fill(nClustersITS);
1195 if(fMaxChi2PerITSClusterFlag) {
1196 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
1197 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
1200 else if(chi2PerClusterITS <= fMaxChi2PerITSCluster)
1201 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
1202 }//chi2 per ITS cluster
1203 if(fMinTPCClustersFlag) {
1204 if(nClustersTPC < fMinTPCClusters) {
1205 //cout<<"Secondary antiproton rejected"<<endl;
1206 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(2)))->Fill(nClustersTPC);
1209 else if(nClustersTPC >= fMinTPCClusters) {
1210 //cout<<"Secondary antiproton accepted"<<endl;
1211 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
1214 if(fMaxChi2PerTPCClusterFlag) {
1215 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
1216 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
1219 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
1220 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
1221 }//chi2 per TPC cluster
1223 if(extCov[0] > fMaxCov11) {
1224 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(4)))->Fill(extCov[0]);
1227 else if(extCov[0] <= fMaxCov11)
1228 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(4)))->Fill(extCov[0]);
1231 if(extCov[2] > fMaxCov22) {
1232 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(5)))->Fill(extCov[2]);
1235 else if(extCov[2] <= fMaxCov22)
1236 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(5)))->Fill(extCov[2]);
1239 if(extCov[5] > fMaxCov33) {
1240 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(6)))->Fill(extCov[5]);
1243 else if(extCov[5] <= fMaxCov33)
1244 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(6)))->Fill(extCov[5]);
1247 if(extCov[9] > fMaxCov44) {
1248 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(7)))->Fill(extCov[9]);
1251 else if(extCov[9] <= fMaxCov44)
1252 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(7)))->Fill(extCov[9]);
1255 if(extCov[14] > fMaxCov55) {
1256 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(8)))->Fill(extCov[14]);
1259 else if(extCov[14] <= fMaxCov55)
1260 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(8)))->Fill(extCov[14]);
1262 if(fMaxSigmaToVertexFlag) {
1263 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
1264 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
1267 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
1268 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
1270 if(fMaxSigmaToVertexTPCFlag) {
1271 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
1272 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
1275 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
1276 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
1277 }//sigma to vertex TPC
1279 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
1280 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(11)))->Fill(0);
1283 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
1284 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(11)))->Fill(0);
1287 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
1288 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(12)))->Fill(0);
1291 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
1292 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(12)))->Fill(0);
1295 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
1296 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(13)))->Fill(0);
1299 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
1300 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(13)))->Fill(0);
1303 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
1304 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(13)))->Fill(0);
1307 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
1308 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(13)))->Fill(0);
1310 }//secondary particle cut
1313 //if((Pt < fMinPt) || (Pt > fMaxPt)) //status = kFALSE;
1314 //if((Rapidity(Px,Py,Pz) < fMinY) || (Rapidity(Px,Py,Pz) > fMaxY))
1320 //____________________________________________________________________//
1321 Float_t AliProtonAnalysis::GetSigmaToVertex(AliESDtrack* esdTrack) {
1322 // Calculates the number of sigma to the vertex.
1328 esdTrack->GetImpactParametersTPC(b,bCov);
1330 esdTrack->GetImpactParameters(b,bCov);
1332 if (bCov[0]<=0 || bCov[2]<=0) {
1333 //AliDebug(1, "Estimated b resolution lower or equal zero!");
1334 bCov[0]=0; bCov[2]=0;
1336 bRes[0] = TMath::Sqrt(bCov[0]);
1337 bRes[1] = TMath::Sqrt(bCov[2]);
1339 if (bRes[0] == 0 || bRes[1] ==0) return -1;
1341 Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2));
1343 if (TMath::Exp(-d * d / 2) < 1e-10) return 1000;
1345 d = TMath::ErfInverse(1 - TMath::Exp(-d * d / 2)) * TMath::Sqrt(2);
1350 //____________________________________________________________________//
1351 Double_t AliProtonAnalysis::Rapidity(Double_t Px, Double_t Py, Double_t Pz) {
1352 //returns the rapidity of the proton - to be removed
1353 Double_t fMass = 9.38270000000000048e-01;
1355 Double_t P = TMath::Sqrt(TMath::Power(Px,2) +
1356 TMath::Power(Py,2) +
1357 TMath::Power(Pz,2));
1358 Double_t energy = TMath::Sqrt(P*P + fMass*fMass);
1361 y = 0.5*TMath::Log((energy + Pz)/(energy - Pz));
1366 //____________________________________________________________________//
1367 Bool_t AliProtonAnalysis::PrintMean(TH1 *hist, Double_t edge) {
1368 //calculates the mean value of the ratio/asymmetry within \pm edge
1371 //calculate the mean
1372 for(Int_t i = 0; i < hist->GetXaxis()->GetNbins(); i++) {
1373 Double_t x = hist->GetBinCenter(i+1);
1374 Double_t y = hist->GetBinContent(i+1);
1375 if(TMath::Abs(x) < edge) {
1380 Double_t mean = 0.0;
1382 mean = sum/nentries;
1384 //calculate the error
1385 for(Int_t i = 0; i < hist->GetXaxis()->GetNbins(); i++) {
1386 Double_t x = hist->GetBinCenter(i+1);
1387 Double_t y = hist->GetBinContent(i+1);
1388 if(TMath::Abs(x) < edge) {
1389 sum += TMath::Power((mean - y),2);
1394 Double_t error = 0.0;
1396 error = TMath::Sqrt(sum)/nentries;
1398 cout<<"========================================="<<endl;
1399 cout<<"Input distribution: "<<hist->GetName()<<endl;
1400 cout<<"Interval used: -"<<edge<<" -> "<<edge<<endl;
1401 cout<<"Mean value :"<<mean<<endl;
1402 cout<<"Error: "<<error<<endl;
1403 cout<<"========================================="<<endl;
1408 //____________________________________________________________________//
1409 Bool_t AliProtonAnalysis::PrintYields(TH1 *hist, Double_t edge) {
1410 //calculates the (anti)proton yields within the \pm edge
1411 Double_t sum = 0.0, sumerror = 0.0;
1412 Double_t error = 0.0;
1413 for(Int_t i = 0; i < hist->GetXaxis()->GetNbins(); i++) {
1414 Double_t x = hist->GetBinCenter(i+1);
1415 Double_t y = hist->GetBinContent(i+1);
1416 if(TMath::Abs(x) < edge) {
1418 sumerror += TMath::Power(hist->GetBinError(i+1),2);
1422 error = TMath::Sqrt(sumerror);
1424 cout<<"========================================="<<endl;
1425 cout<<"Input distribution: "<<hist->GetName()<<endl;
1426 cout<<"Interval used: -"<<edge<<" -> "<<edge<<endl;
1427 cout<<"Yields :"<<sum<<endl;
1428 cout<<"Error: "<<error<<endl;
1429 cout<<"========================================="<<endl;
1434 //____________________________________________________________________//
1435 void AliProtonAnalysis::Correct(Int_t step) {
1436 //Applies the correction maps to the initial containers
1437 fCorrectProtons = new AliCFDataGrid("correctProtons",
1440 fCorrectProtons->ApplyEffCorrection(*(AliCFEffGrid *)fEffGridListProtons->At(step));
1442 fCorrectAntiProtons = new AliCFDataGrid("correctAntiProtons",
1444 *fAntiProtonContainer);
1445 fCorrectAntiProtons->ApplyEffCorrection(*(AliCFEffGrid *)fEffGridListAntiProtons->At(step));
1448 //____________________________________________________________________//
1449 Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
1450 // Reads the outout of the correction framework task
1451 // Creates the correction maps
1452 // Puts the results in the different TList objects
1453 Bool_t status = kTRUE;
1455 TFile *file = TFile::Open(filename);
1457 cout<<"Could not find the input CORRFW file "<<filename<<endl;
1461 //________________________________________//
1463 fEffGridListProtons = new TList();
1464 fCorrectionListProtons2D = new TList();
1465 fEfficiencyListProtons1D = new TList();
1466 fCorrectionListProtons1D = new TList();
1468 AliCFContainer *corrfwContainerProtons = (AliCFContainer*) (file->Get("containerProtons"));
1469 if(!corrfwContainerProtons) {
1470 cout<<"CORRFW container for protons not found!"<<endl;
1474 Int_t nSteps = corrfwContainerProtons->GetNStep();
1476 //currently the GRID is formed by the y-pT parameters
1477 //Add Vz as a next step
1478 Int_t iRap = 0, iPt = 1;
1479 AliCFEffGrid *effProtonsStep0Step1 = new AliCFEffGrid("eff10",
1480 "effProtonsStep0Step1",
1481 *corrfwContainerProtons);
1482 effProtonsStep0Step1->CalculateEfficiency(1,0); //eff= step1/step0
1483 fEffGridListProtons->Add(effProtonsStep0Step1);
1484 gYPt[0] = effProtonsStep0Step1->Project(iRap,iPt);
1485 fCorrectionListProtons2D->Add(gYPt[0]);
1487 AliCFEffGrid *effProtonsStep0Step2 = new AliCFEffGrid("eff20",
1488 "effProtonsStep0Step2",
1489 *corrfwContainerProtons);
1490 effProtonsStep0Step2->CalculateEfficiency(2,0); //eff= step2/step0
1491 fEffGridListProtons->Add(effProtonsStep0Step2);
1492 gYPt[1] = effProtonsStep0Step2->Project(iRap,iPt);
1493 fCorrectionListProtons2D->Add(gYPt[1]);
1495 AliCFEffGrid *effProtonsStep0Step3 = new AliCFEffGrid("eff30",
1496 "effProtonsStep0Step3",
1497 *corrfwContainerProtons);
1498 effProtonsStep0Step3->CalculateEfficiency(3,0); //eff= step1/step0
1499 fEffGridListProtons->Add(effProtonsStep0Step3);
1500 gYPt[2] = effProtonsStep0Step3->Project(iRap,iPt);
1501 fCorrectionListProtons2D->Add(gYPt[2]);
1503 TH1D *gEfficiency[2][3]; //efficiency as a function of pT and of y (raws-[2])
1504 TH1D *gCorrection[2][3]; //efficiency as a function of pT and of y (raws-[2])
1506 //Get the projection of the efficiency maps
1507 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1508 gEfficiency[iParameter][0] = effProtonsStep0Step1->Project(iParameter);
1509 gTitle = "ProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1510 gTitle += "_Step0_Step1";
1511 gEfficiency[iParameter][0]->SetName(gTitle.Data());
1512 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][0]);
1513 gTitle = "ProtonsCorrection_Parameter"; gTitle += iParameter+1;
1514 gTitle += "_Step0_Step1";
1515 gCorrection[iParameter][0] = new TH1D(gTitle.Data(),
1517 gEfficiency[iParameter][0]->GetNbinsX(),
1518 gEfficiency[iParameter][0]->GetXaxis()->GetXmin(),
1519 gEfficiency[iParameter][0]->GetXaxis()->GetXmax());
1520 //initialisation of the correction
1521 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][0]->GetNbinsX(); iBin++)
1522 gCorrection[iParameter][0]->SetBinContent(iBin,1.0);
1524 gEfficiency[iParameter][1] = effProtonsStep0Step2->Project(iParameter);
1525 gTitle = "ProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1526 gTitle += "_Step0_Step2";
1527 gEfficiency[iParameter][1]->SetName(gTitle.Data());
1528 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][1]);
1529 gTitle = "ProtonsCorrection_Parameter"; gTitle += iParameter+1;
1530 gTitle += "_Step0_Step2";
1531 gCorrection[iParameter][1] = new TH1D(gTitle.Data(),
1533 gEfficiency[iParameter][1]->GetNbinsX(),
1534 gEfficiency[iParameter][1]->GetXaxis()->GetXmin(),
1535 gEfficiency[iParameter][1]->GetXaxis()->GetXmax());
1536 //initialisation of the correction
1537 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][1]->GetNbinsX(); iBin++)
1538 gCorrection[iParameter][1]->SetBinContent(iBin,1.0);
1540 gEfficiency[iParameter][2] = effProtonsStep0Step3->Project(iParameter);
1541 gTitle = "ProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1542 gTitle += "_Step0_Step3";
1543 gEfficiency[iParameter][2]->SetName(gTitle.Data());
1544 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][2]);
1545 gTitle = "ProtonsCorrection_Parameter"; gTitle += iParameter+1;
1546 gTitle += "_Step0_Step3";
1547 gCorrection[iParameter][2] = new TH1D(gTitle.Data(),
1549 gEfficiency[iParameter][2]->GetNbinsX(),
1550 gEfficiency[iParameter][2]->GetXaxis()->GetXmin(),
1551 gEfficiency[iParameter][2]->GetXaxis()->GetXmax());
1552 //initialisation of the correction
1553 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][2]->GetNbinsX(); iBin++)
1554 gCorrection[iParameter][2]->SetBinContent(iBin,1.0);
1556 //Calculate the 1D correction parameters as a function of y and pT
1557 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1558 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1559 gCorrection[iParameter][iStep-1]->Divide(gEfficiency[iParameter][iStep-1]);
1560 fCorrectionListProtons1D->Add(gCorrection[iParameter][iStep-1]);
1564 //________________________________________//
1566 fEffGridListAntiProtons = new TList();
1567 fCorrectionListAntiProtons2D = new TList();
1568 fEfficiencyListAntiProtons1D = new TList();
1569 fCorrectionListAntiProtons1D = new TList();
1571 AliCFContainer *corrfwContainerAntiProtons = (AliCFContainer*) (file->Get("containerAntiProtons"));
1572 if(!corrfwContainerAntiProtons) {
1573 cout<<"CORRFW container for antiprotons not found!"<<endl;
1577 nSteps = corrfwContainerAntiProtons->GetNStep();
1578 //currently the GRID is formed by the y-pT parameters
1579 //Add Vz as a next step
1580 AliCFEffGrid *effAntiProtonsStep0Step1 = new AliCFEffGrid("eff10",
1581 "effAntiProtonsStep0Step1",
1582 *corrfwContainerAntiProtons);
1583 effAntiProtonsStep0Step1->CalculateEfficiency(1,0); //eff= step1/step0
1584 fEffGridListAntiProtons->Add(effAntiProtonsStep0Step1);
1585 gYPt[0] = effAntiProtonsStep0Step1->Project(iRap,iPt);
1586 fCorrectionListAntiProtons2D->Add(gYPt[0]);
1588 AliCFEffGrid *effAntiProtonsStep0Step2 = new AliCFEffGrid("eff20",
1589 "effAntiProtonsStep0Step2",
1590 *corrfwContainerAntiProtons);
1591 effAntiProtonsStep0Step2->CalculateEfficiency(2,0); //eff= step2/step0
1592 fEffGridListAntiProtons->Add(effAntiProtonsStep0Step2);
1593 gYPt[1] = effAntiProtonsStep0Step2->Project(iRap,iPt);
1594 fCorrectionListAntiProtons2D->Add(gYPt[1]);
1596 AliCFEffGrid *effAntiProtonsStep0Step3 = new AliCFEffGrid("eff30",
1597 "effAntiProtonsStep0Step3",
1598 *corrfwContainerAntiProtons);
1599 effAntiProtonsStep0Step3->CalculateEfficiency(3,0); //eff= step1/step0
1600 fEffGridListAntiProtons->Add(effAntiProtonsStep0Step3);
1601 gYPt[2] = effAntiProtonsStep0Step3->Project(iRap,iPt);
1602 fCorrectionListAntiProtons2D->Add(gYPt[2]);
1604 //Get the projection of the efficiency maps
1605 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1606 gEfficiency[iParameter][0] = effAntiProtonsStep0Step1->Project(iParameter);
1607 gTitle = "AntiProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1608 gTitle += "_Step0_Step1";
1609 gEfficiency[iParameter][0]->SetName(gTitle.Data());
1610 fEfficiencyListAntiProtons1D->Add(gEfficiency[iParameter][0]);
1611 gTitle = "AntiProtonsCorrection_Parameter"; gTitle += iParameter+1;
1612 gTitle += "_Step0_Step1";
1613 gCorrection[iParameter][0] = new TH1D(gTitle.Data(),
1615 gEfficiency[iParameter][0]->GetNbinsX(),
1616 gEfficiency[iParameter][0]->GetXaxis()->GetXmin(),
1617 gEfficiency[iParameter][0]->GetXaxis()->GetXmax());
1618 //initialisation of the correction
1619 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][0]->GetNbinsX(); iBin++)
1620 gCorrection[iParameter][0]->SetBinContent(iBin,1.0);
1622 gEfficiency[iParameter][1] = effAntiProtonsStep0Step2->Project(iParameter);
1623 gTitle = "AntiProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1624 gTitle += "_Step0_Step2";
1625 gEfficiency[iParameter][1]->SetName(gTitle.Data());
1626 fEfficiencyListAntiProtons1D->Add(gEfficiency[iParameter][1]);
1627 gTitle = "AntiProtonsCorrection_Parameter"; gTitle += iParameter+1;
1628 gTitle += "_Step0_Step2";
1629 gCorrection[iParameter][1] = new TH1D(gTitle.Data(),
1631 gEfficiency[iParameter][1]->GetNbinsX(),
1632 gEfficiency[iParameter][1]->GetXaxis()->GetXmin(),
1633 gEfficiency[iParameter][1]->GetXaxis()->GetXmax());
1634 //initialisation of the correction
1635 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][1]->GetNbinsX(); iBin++)
1636 gCorrection[iParameter][1]->SetBinContent(iBin,1.0);
1638 gEfficiency[iParameter][2] = effAntiProtonsStep0Step3->Project(iParameter);
1639 gTitle = "AntiProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1640 gTitle += "_Step0_Step3";
1641 gEfficiency[iParameter][2]->SetName(gTitle.Data());
1642 fEfficiencyListAntiProtons1D->Add(gEfficiency[iParameter][2]);
1643 gTitle = "AntiProtonsCorrection_Parameter"; gTitle += iParameter+1;
1644 gTitle += "_Step0_Step3";
1645 gCorrection[iParameter][2] = new TH1D(gTitle.Data(),
1647 gEfficiency[iParameter][2]->GetNbinsX(),
1648 gEfficiency[iParameter][2]->GetXaxis()->GetXmin(),
1649 gEfficiency[iParameter][2]->GetXaxis()->GetXmax());
1650 //initialisation of the correction
1651 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][2]->GetNbinsX(); iBin++)
1652 gCorrection[iParameter][2]->SetBinContent(iBin,1.0);
1654 //Calculate the 1D correction parameters as a function of y and pT
1655 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1656 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1657 gCorrection[iParameter][iStep-1]->Divide(gEfficiency[iParameter][iStep-1]);
1658 fCorrectionListAntiProtons1D->Add(gCorrection[iParameter][iStep-1]);
1665 //____________________________________________________________________//
1666 void AliProtonAnalysis::SetQAOn() {
1667 //initializes the QA lists
1668 //fQAHistograms = kTRUE;
1669 fGlobalQAList = new TList();
1670 fQA2DList = new TList();
1671 fQA2DList->SetName("fQA2DList");
1672 fGlobalQAList->Add(fQA2DList);
1674 fQAPrimaryProtonsAcceptedList = new TList();
1675 fQAPrimaryProtonsAcceptedList->SetName("fQAPrimaryProtonsAcceptedList");
1676 fGlobalQAList->Add(fQAPrimaryProtonsAcceptedList);
1678 fQAPrimaryProtonsRejectedList = new TList();
1679 fQAPrimaryProtonsRejectedList->SetName("fQAPrimaryProtonsRejectedList");
1680 fGlobalQAList->Add(fQAPrimaryProtonsRejectedList);
1682 fQASecondaryProtonsAcceptedList = new TList();
1683 fQASecondaryProtonsAcceptedList->SetName("fQASecondaryProtonsAcceptedList");
1684 fGlobalQAList->Add(fQASecondaryProtonsAcceptedList);
1686 fQASecondaryProtonsRejectedList = new TList();
1687 fQASecondaryProtonsRejectedList->SetName("fQASecondaryProtonsRejectedList");
1688 fGlobalQAList->Add(fQASecondaryProtonsRejectedList);
1690 fQAPrimaryAntiProtonsAcceptedList = new TList();
1691 fQAPrimaryAntiProtonsAcceptedList->SetName("fQAPrimaryAntiProtonsAcceptedList");
1692 fGlobalQAList->Add(fQAPrimaryAntiProtonsAcceptedList);
1694 fQAPrimaryAntiProtonsRejectedList = new TList();
1695 fQAPrimaryAntiProtonsRejectedList->SetName("fQAPrimaryAntiProtonsRejectedList");
1696 fGlobalQAList->Add(fQAPrimaryAntiProtonsRejectedList);
1698 fQASecondaryAntiProtonsAcceptedList = new TList();
1699 fQASecondaryAntiProtonsAcceptedList->SetName("fQASecondaryAntiProtonsAcceptedList");
1700 fGlobalQAList->Add(fQASecondaryAntiProtonsAcceptedList);
1702 fQASecondaryAntiProtonsRejectedList = new TList();
1703 fQASecondaryAntiProtonsRejectedList->SetName("fQASecondaryAntiProtonsRejectedList");
1704 fGlobalQAList->Add(fQASecondaryAntiProtonsRejectedList);
1707 //____________________________________________________________________//
1708 void AliProtonAnalysis::SetQAYPtBins(Int_t nbinsY, Double_t minY, Double_t maxY,
1709 Int_t nbinsPt, Double_t minPt, Double_t maxPt) {
1710 //Initializes the QA binning
1712 fMinY = minY; fMaxY = maxY;
1714 fMinPt = minPt; fMaxPt = maxPt;
1718 //____________________________________________________________________//
1719 void AliProtonAnalysis::InitQA() {
1720 //Initializes the QA histograms and builds the directory structure
1721 //if(!fQAHistograms)
1725 //TDirectory *dir2D = gDirectory->mkdir("2D");
1726 //fGlobalQAList->Add(dir2D); dir2D->cd();
1727 TH2D *gHistYPtPrimaryProtonsPass = new TH2D("gHistYPtPrimaryProtonsPass",
1729 fNBinsY,fMinY,fMaxY,
1730 fNBinsPt,fMinPt,fMaxPt);
1731 gHistYPtPrimaryProtonsPass->SetStats(kTRUE);
1732 gHistYPtPrimaryProtonsPass->GetXaxis()->SetTitleColor(1);
1733 fQA2DList->Add(gHistYPtPrimaryProtonsPass);
1734 TH2D *gHistYPtPrimaryProtonsReject = new TH2D("gHistYPtPrimaryProtonsReject",
1736 fNBinsY,fMinY,fMaxY,
1737 fNBinsPt,fMinPt,fMaxPt);
1738 gHistYPtPrimaryProtonsReject->SetStats(kTRUE);
1739 gHistYPtPrimaryProtonsReject->GetXaxis()->SetTitleColor(1);
1740 fQA2DList->Add(gHistYPtPrimaryProtonsReject);
1742 TH2D *gHistYPtSecondaryProtonsPass = new TH2D("gHistYPtSecondaryProtonsPass",
1744 fNBinsY,fMinY,fMaxY,
1745 fNBinsPt,fMinPt,fMaxPt);
1746 gHistYPtSecondaryProtonsPass->SetStats(kTRUE);
1747 gHistYPtSecondaryProtonsPass->GetXaxis()->SetTitleColor(1);
1748 fQA2DList->Add(gHistYPtSecondaryProtonsPass);
1749 TH2D *gHistYPtSecondaryProtonsReject = new TH2D("gHistYPtSecondaryProtonsReject",
1751 fNBinsY,fMinY,fMaxY,
1752 fNBinsPt,fMinPt,fMaxPt);
1753 gHistYPtSecondaryProtonsReject->SetStats(kTRUE);
1754 gHistYPtSecondaryProtonsReject->GetXaxis()->SetTitleColor(1);
1755 fQA2DList->Add(gHistYPtSecondaryProtonsReject);
1757 TH2D *gHistYPtPrimaryAntiProtonsPass = new TH2D("gHistYPtPrimaryAntiProtonsPass",
1759 fNBinsY,fMinY,fMaxY,
1760 fNBinsPt,fMinPt,fMaxPt);
1761 gHistYPtPrimaryAntiProtonsPass->SetStats(kTRUE);
1762 gHistYPtPrimaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1763 fQA2DList->Add(gHistYPtPrimaryAntiProtonsPass);
1764 TH2D *gHistYPtPrimaryAntiProtonsReject = new TH2D("gHistYPtPrimaryAntiProtonsReject",
1766 fNBinsY,fMinY,fMaxY,
1767 fNBinsPt,fMinPt,fMaxPt);
1768 gHistYPtPrimaryAntiProtonsReject->SetStats(kTRUE);
1769 gHistYPtPrimaryAntiProtonsReject->GetXaxis()->SetTitleColor(1);
1770 fQA2DList->Add(gHistYPtPrimaryAntiProtonsReject);
1772 TH2D *gHistYPtSecondaryAntiProtonsPass = new TH2D("gHistYPtSecondaryAntiProtonsPass",
1774 fNBinsY,fMinY,fMaxY,
1775 fNBinsPt,fMinPt,fMaxPt);
1776 gHistYPtSecondaryAntiProtonsPass->SetStats(kTRUE);
1777 gHistYPtSecondaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1778 fQA2DList->Add(gHistYPtSecondaryAntiProtonsPass);
1779 TH2D *gHistYPtSecondaryAntiProtonsReject = new TH2D("gHistYPtSecondaryAntiProtonsReject",
1781 fNBinsY,fMinY,fMaxY,
1782 fNBinsPt,fMinPt,fMaxPt);
1783 gHistYPtSecondaryAntiProtonsReject->SetStats(kTRUE);
1784 gHistYPtSecondaryAntiProtonsReject->GetXaxis()->SetTitleColor(1);
1785 fQA2DList->Add(gHistYPtSecondaryAntiProtonsReject);
1787 /*gDirectory->cd("../");
1789 TDirectory *dirProtons = gDirectory->mkdir("Protons");
1790 fGlobalQAList->Add(dirProtons); dirProtons->cd();*/
1792 //________________________________________________________________//
1793 /*TDirectory *dirProtonsPrimary = gDirectory->mkdir("Primaries");
1794 dirProtonsPrimary->cd();
1795 TDirectory *dirProtonsPrimaryAccepted = gDirectory->mkdir("Accepted");
1796 dirProtonsPrimaryAccepted->cd();*/
1798 //Accepted primary protons
1799 TH1F *fPrimaryProtonsITSClustersPass = new TH1F("fPrimaryProtonsITSClustersPass",
1800 ";N_{clusters} (ITS);Entries",
1802 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsITSClustersPass);
1803 TH1F *fPrimaryProtonsChi2PerClusterITSPass = new TH1F("fPrimaryProtonsChi2PerClusterITSPass",
1804 ";x^{2}/N_{clusters} (ITS);Entries",
1806 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsChi2PerClusterITSPass);
1807 TH1F *fPrimaryProtonsTPCClustersPass = new TH1F("fPrimaryProtonsTPCClustersPass",
1808 ";N_{clusters} (TPC);Entries",
1810 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsTPCClustersPass);
1811 TH1F *fPrimaryProtonsChi2PerClusterTPCPass = new TH1F("fPrimaryProtonsChi2PerClusterTPCPass",
1812 ";x^{2}/N_{clusters} (TPC);Entries",
1814 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsChi2PerClusterTPCPass);
1815 TH1F *fPrimaryProtonsExtCov11Pass = new TH1F("fPrimaryProtonsExtCov11Pass",
1816 ";#sigma_{y} [cm];Entries",
1818 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov11Pass);
1819 TH1F *fPrimaryProtonsExtCov22Pass = new TH1F("fPrimaryProtonsExtCov22Pass",
1820 ";#sigma_{z} [cm];Entries",
1822 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov22Pass);
1823 TH1F *fPrimaryProtonsExtCov33Pass = new TH1F("fPrimaryProtonsExtCov33Pass",
1824 ";#sigma_{sin(#phi)};Entries",
1826 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov33Pass);
1827 TH1F *fPrimaryProtonsExtCov44Pass = new TH1F("fPrimaryProtonsExtCov44Pass",
1828 ";#sigma_{tan(#lambda)};Entries",
1830 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov44Pass);
1831 TH1F *fPrimaryProtonsExtCov55Pass = new TH1F("fPrimaryProtonsExtCov55Pass",
1832 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1834 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov55Pass);
1835 TH1F *fPrimaryProtonsSigmaToVertexPass = new TH1F("fPrimaryProtonsSigmaToVertexPass",
1836 ";#sigma_{Vertex};Entries",
1838 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsSigmaToVertexPass);
1839 TH1F *fPrimaryProtonsSigmaToVertexTPCPass = new TH1F("fPrimaryProtonsSigmaToVertexTPCPass",
1840 ";#sigma_{Vertex};Entries",
1842 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsSigmaToVertexTPCPass);
1843 TH1F *fPrimaryProtonsITSRefitPass = new TH1F("fPrimaryProtonsITSRefitPass",
1845 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsITSRefitPass);
1846 TH1F *fPrimaryProtonsTPCRefitPass = new TH1F("fPrimaryProtonsTPCRefitPass",
1848 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsTPCRefitPass);
1849 TH1F *fPrimaryProtonsESDpidPass = new TH1F("fPrimaryProtonsESDpidPass",
1851 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsESDpidPass);
1852 TH1F *fPrimaryProtonsTPCpidPass = new TH1F("fPrimaryProtonsTPCpidPass",
1854 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsTPCpidPass);
1856 //Rejected primary protons
1857 /*gDirectory->cd("../");
1858 TDirectory *dirProtonsPrimaryRejected = gDirectory->mkdir("Rejected");
1859 dirProtonsPrimaryRejected->cd();*/
1861 TH1F *fPrimaryProtonsITSClustersReject = new TH1F("fPrimaryProtonsITSClustersReject",
1862 ";N_{clusters} (ITS);Entries",
1864 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsITSClustersReject);
1865 TH1F *fPrimaryProtonsChi2PerClusterITSReject = new TH1F("fPrimaryProtonsChi2PerClusterITSReject",
1866 ";x^{2}/N_{clusters} (ITS);Entries",
1868 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsChi2PerClusterITSReject);
1869 TH1F *fPrimaryProtonsTPCClustersReject = new TH1F("fPrimaryProtonsTPCClustersReject",
1870 ";N_{clusters} (TPC);Entries",
1872 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsTPCClustersReject);
1873 TH1F *fPrimaryProtonsChi2PerClusterTPCReject = new TH1F("fPrimaryProtonsChi2PerClusterTPCReject",
1874 ";x^{2}/N_{clusters} (TPC);Entries",
1876 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsChi2PerClusterTPCReject);
1877 TH1F *fPrimaryProtonsExtCov11Reject = new TH1F("fPrimaryProtonsExtCov11Reject",
1878 ";#sigma_{y} [cm];Entries",
1880 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov11Reject);
1881 TH1F *fPrimaryProtonsExtCov22Reject = new TH1F("fPrimaryProtonsExtCov22Reject",
1882 ";#sigma_{z} [cm];Entries",
1884 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov22Reject);
1885 TH1F *fPrimaryProtonsExtCov33Reject = new TH1F("fPrimaryProtonsExtCov33Reject",
1886 ";#sigma_{sin(#phi)};Entries",
1888 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov33Reject);
1889 TH1F *fPrimaryProtonsExtCov44Reject = new TH1F("fPrimaryProtonsExtCov44Reject",
1890 ";#sigma_{tan(#lambda)};Entries",
1892 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov44Reject);
1893 TH1F *fPrimaryProtonsExtCov55Reject = new TH1F("fPrimaryProtonsExtCov55Reject",
1894 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1896 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov55Reject);
1897 TH1F *fPrimaryProtonsSigmaToVertexReject = new TH1F("fPrimaryProtonsSigmaToVertexReject",
1898 ";#sigma_{Vertex};Entries",
1900 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsSigmaToVertexReject);
1901 TH1F *fPrimaryProtonsSigmaToVertexTPCReject = new TH1F("fPrimaryProtonsSigmaToVertexTPCReject",
1902 ";#sigma_{Vertex};Entries",
1904 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsSigmaToVertexTPCReject);
1905 TH1F *fPrimaryProtonsITSRefitReject = new TH1F("fPrimaryProtonsITSRefitReject",
1907 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsITSRefitReject);
1908 TH1F *fPrimaryProtonsTPCRefitReject = new TH1F("fPrimaryProtonsTPCRefitReject",
1910 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsTPCRefitReject);
1911 TH1F *fPrimaryProtonsESDpidReject = new TH1F("fPrimaryProtonsESDpidReject",
1913 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsESDpidReject);
1914 TH1F *fPrimaryProtonsTPCpidReject = new TH1F("fPrimaryProtonsTPCpidReject",
1916 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsTPCpidReject);
1918 //________________________________________________________________//
1919 /*gDirectory->cd("../../");
1921 TDirectory *dirProtonsSecondary = gDirectory->mkdir("Secondaries");
1922 dirProtonsSecondary->cd();
1923 TDirectory *dirProtonsSecondaryAccepted = gDirectory->mkdir("Accepted");
1924 dirProtonsSecondaryAccepted->cd();*/
1926 //Accepted secondary protons
1927 TH1F *fSecondaryProtonsITSClustersPass = new TH1F("fSecondaryProtonsITSClustersPass",
1928 ";N_{clusters} (ITS);Entries",
1930 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsITSClustersPass);
1931 TH1F *fSecondaryProtonsChi2PerClusterITSPass = new TH1F("fSecondaryProtonsChi2PerClusterITSPass",
1932 ";x^{2}/N_{clusters} (ITS);Entries",
1934 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsChi2PerClusterITSPass);
1935 TH1F *fSecondaryProtonsTPCClustersPass = new TH1F("fSecondaryProtonsTPCClustersPass",
1936 ";N_{clusters} (TPC);Entries",
1938 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsTPCClustersPass);
1939 TH1F *fSecondaryProtonsChi2PerClusterTPCPass = new TH1F("fSecondaryProtonsChi2PerClusterTPCPass",
1940 ";x^{2}/N_{clusters} (TPC);Entries",
1942 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsChi2PerClusterTPCPass);
1943 TH1F *fSecondaryProtonsExtCov11Pass = new TH1F("fSecondaryProtonsExtCov11Pass",
1944 ";#sigma_{y} [cm];Entries",
1946 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov11Pass);
1947 TH1F *fSecondaryProtonsExtCov22Pass = new TH1F("fSecondaryProtonsExtCov22Pass",
1948 ";#sigma_{z} [cm];Entries",
1950 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov22Pass);
1951 TH1F *fSecondaryProtonsExtCov33Pass = new TH1F("fSecondaryProtonsExtCov33Pass",
1952 ";#sigma_{sin(#phi)};Entries",
1954 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov33Pass);
1955 TH1F *fSecondaryProtonsExtCov44Pass = new TH1F("fSecondaryProtonsExtCov44Pass",
1956 ";#sigma_{tan(#lambda)};Entries",
1958 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov44Pass);
1959 TH1F *fSecondaryProtonsExtCov55Pass = new TH1F("fSecondaryProtonsExtCov55Pass",
1960 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1962 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov55Pass);
1963 TH1F *fSecondaryProtonsSigmaToVertexPass = new TH1F("fSecondaryProtonsSigmaToVertexPass",
1964 ";#sigma_{Vertex};Entries",
1966 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsSigmaToVertexPass);
1967 TH1F *fSecondaryProtonsSigmaToVertexTPCPass = new TH1F("fSecondaryProtonsSigmaToVertexTPCPass",
1968 ";#sigma_{Vertex};Entries",
1970 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsSigmaToVertexTPCPass);
1971 TH1F *fSecondaryProtonsITSRefitPass = new TH1F("fSecondaryProtonsITSRefitPass",
1973 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsITSRefitPass);
1974 TH1F *fSecondaryProtonsTPCRefitPass = new TH1F("fSecondaryProtonsTPCRefitPass",
1976 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsTPCRefitPass);
1977 TH1F *fSecondaryProtonsESDpidPass = new TH1F("fSecondaryProtonsESDpidPass",
1979 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsESDpidPass);
1980 TH1F *fSecondaryProtonsTPCpidPass = new TH1F("fSecondaryProtonsTPCpidPass",
1982 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsTPCpidPass);
1984 //Rejected secondary protons
1985 /*gDirectory->cd("../");
1986 TDirectory *dirProtonsSecondaryRejected = gDirectory->mkdir("Rejected");
1987 dirProtonsSecondaryRejected->cd();*/
1989 TH1F *fSecondaryProtonsITSClustersReject = new TH1F("fSecondaryProtonsITSClustersReject",
1990 ";N_{clusters} (ITS);Entries",
1992 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsITSClustersReject);
1993 TH1F *fSecondaryProtonsChi2PerClusterITSReject = new TH1F("fSecondaryProtonsChi2PerClusterITSReject",
1994 ";x^{2}/N_{clusters} (ITS);Entries",
1996 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsChi2PerClusterITSReject);
1997 TH1F *fSecondaryProtonsTPCClustersReject = new TH1F("fSecondaryProtonsTPCClustersReject",
1998 ";N_{clusters} (TPC);Entries",
2000 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsTPCClustersReject);
2001 TH1F *fSecondaryProtonsChi2PerClusterTPCReject = new TH1F("fSecondaryProtonsChi2PerClusterTPCReject",
2002 ";x^{2}/N_{clusters} (TPC);Entries",
2004 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsChi2PerClusterTPCReject);
2005 TH1F *fSecondaryProtonsExtCov11Reject = new TH1F("fSecondaryProtonsExtCov11Reject",
2006 ";#sigma_{y} [cm];Entries",
2008 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov11Reject);
2009 TH1F *fSecondaryProtonsExtCov22Reject = new TH1F("fSecondaryProtonsExtCov22Reject",
2010 ";#sigma_{z} [cm];Entries",
2012 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov22Reject);
2013 TH1F *fSecondaryProtonsExtCov33Reject = new TH1F("fSecondaryProtonsExtCov33Reject",
2014 ";#sigma_{sin(#phi)};Entries",
2016 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov33Reject);
2017 TH1F *fSecondaryProtonsExtCov44Reject = new TH1F("fSecondaryProtonsExtCov44Reject",
2018 ";#sigma_{tan(#lambda)};Entries",
2020 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov44Reject);
2021 TH1F *fSecondaryProtonsExtCov55Reject = new TH1F("fSecondaryProtonsExtCov55Reject",
2022 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2024 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov55Reject);
2025 TH1F *fSecondaryProtonsSigmaToVertexReject = new TH1F("fSecondaryProtonsSigmaToVertexReject",
2026 ";#sigma_{Vertex};Entries",
2028 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsSigmaToVertexReject);
2029 TH1F *fSecondaryProtonsSigmaToVertexTPCReject = new TH1F("fSecondaryProtonsSigmaToVertexTPCReject",
2030 ";#sigma_{Vertex};Entries",
2032 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsSigmaToVertexTPCReject);
2033 TH1F *fSecondaryProtonsITSRefitReject = new TH1F("fSecondaryProtonsITSRefitReject",
2035 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsITSRefitReject);
2036 TH1F *fSecondaryProtonsTPCRefitReject = new TH1F("fSecondaryProtonsTPCRefitReject",
2038 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsTPCRefitReject);
2039 TH1F *fSecondaryProtonsESDpidReject = new TH1F("fSecondaryProtonsESDpidReject",
2041 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsESDpidReject);
2042 TH1F *fSecondaryProtonsTPCpidReject = new TH1F("fSecondaryProtonsTPCpidReject",
2044 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsTPCpidReject);
2047 /*gDirectory->cd("../../../");
2050 TDirectory *dirAntiProtons = gDirectory->mkdir("AntiProtons");
2051 fGlobalQAList->Add(dirAntiProtons); dirAntiProtons->cd();*/
2053 //________________________________________________________________//
2054 /*TDirectory *dirAntiProtonsPrimary = gDirectory->mkdir("Primaries");
2055 dirAntiProtonsPrimary->cd();
2056 TDirectory *dirAntiProtonsPrimaryAccepted = gDirectory->mkdir("Accepted");
2057 dirAntiProtonsPrimaryAccepted->cd();*/
2059 //Accepted primary antiprotons
2060 TH1F *fPrimaryAntiProtonsITSClustersPass = new TH1F("fPrimaryAntiProtonsITSClustersPass",
2061 ";N_{clusters} (ITS);Entries",
2063 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsITSClustersPass);
2064 TH1F *fPrimaryAntiProtonsChi2PerClusterITSPass = new TH1F("fPrimaryAntiProtonsChi2PerClusterITSPass",
2065 ";x^{2}/N_{clusters} (ITS);Entries",
2067 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsChi2PerClusterITSPass);
2068 TH1F *fPrimaryAntiProtonsTPCClustersPass = new TH1F("fPrimaryAntiProtonsTPCClustersPass",
2069 ";N_{clusters} (TPC);Entries",
2071 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsTPCClustersPass);
2072 TH1F *fPrimaryAntiProtonsChi2PerClusterTPCPass = new TH1F("fPrimaryAntiProtonsChi2PerClusterTPCPass",
2073 ";x^{2}/N_{clusters} (TPC);Entries",
2075 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsChi2PerClusterTPCPass);
2076 TH1F *fPrimaryAntiProtonsExtCov11Pass = new TH1F("fPrimaryAntiProtonsExtCov11Pass",
2077 ";#sigma_{y} [cm];Entries",
2079 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov11Pass);
2080 TH1F *fPrimaryAntiProtonsExtCov22Pass = new TH1F("fPrimaryAntiProtonsExtCov22Pass",
2081 ";#sigma_{z} [cm];Entries",
2083 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov22Pass);
2084 TH1F *fPrimaryAntiProtonsExtCov33Pass = new TH1F("fPrimaryAntiProtonsExtCov33Pass",
2085 ";#sigma_{sin(#phi)};Entries",
2087 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov33Pass);
2088 TH1F *fPrimaryAntiProtonsExtCov44Pass = new TH1F("fPrimaryAntiProtonsExtCov44Pass",
2089 ";#sigma_{tan(#lambda)};Entries",
2091 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov44Pass);
2092 TH1F *fPrimaryAntiProtonsExtCov55Pass = new TH1F("fPrimaryAntiProtonsExtCov55Pass",
2093 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2095 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov55Pass);
2096 TH1F *fPrimaryAntiProtonsSigmaToVertexPass = new TH1F("fPrimaryAntiProtonsSigmaToVertexPass",
2097 ";#sigma_{Vertex};Entries",
2099 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsSigmaToVertexPass);
2100 TH1F *fPrimaryAntiProtonsSigmaToVertexTPCPass = new TH1F("fPrimaryAntiProtonsSigmaToVertexTPCPass",
2101 ";#sigma_{Vertex};Entries",
2103 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsSigmaToVertexTPCPass);
2104 TH1F *fPrimaryAntiProtonsITSRefitPass = new TH1F("fPrimaryAntiProtonsITSRefitPass",
2106 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsITSRefitPass);
2107 TH1F *fPrimaryAntiProtonsTPCRefitPass = new TH1F("fPrimaryAntiProtonsTPCRefitPass",
2109 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsTPCRefitPass);
2110 TH1F *fPrimaryAntiProtonsESDpidPass = new TH1F("fPrimaryAntiProtonsESDpidPass",
2112 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsESDpidPass);
2113 TH1F *fPrimaryAntiProtonsTPCpidPass = new TH1F("fPrimaryAntiProtonsTPCpidPass",
2115 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsTPCpidPass);
2117 //Rejected primary antiprotons
2118 /*gDirectory->cd("../");
2119 TDirectory *dirAntiProtonsPrimaryRejected = gDirectory->mkdir("Rejected");
2120 dirAntiProtonsPrimaryRejected->cd();*/
2122 TH1F *fPrimaryAntiProtonsITSClustersReject = new TH1F("fPrimaryAntiProtonsITSClustersReject",
2123 ";N_{clusters} (ITS);Entries",
2125 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsITSClustersReject);
2126 TH1F *fPrimaryAntiProtonsChi2PerClusterITSReject = new TH1F("fPrimaryAntiProtonsChi2PerClusterITSReject",
2127 ";x^{2}/N_{clusters} (ITS);Entries",
2129 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsChi2PerClusterITSReject);
2130 TH1F *fPrimaryAntiProtonsTPCClustersReject = new TH1F("fPrimaryAntiProtonsTPCClustersReject",
2131 ";N_{clusters} (TPC);Entries",
2133 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsTPCClustersReject);
2134 TH1F *fPrimaryAntiProtonsChi2PerClusterTPCReject = new TH1F("fPrimaryAntiProtonsChi2PerClusterTPCReject",
2135 ";x^{2}/N_{clusters} (TPC);Entries",
2137 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsChi2PerClusterTPCReject);
2138 TH1F *fPrimaryAntiProtonsExtCov11Reject = new TH1F("fPrimaryAntiProtonsExtCov11Reject",
2139 ";#sigma_{y} [cm];Entries",
2141 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov11Reject);
2142 TH1F *fPrimaryAntiProtonsExtCov22Reject = new TH1F("fPrimaryAntiProtonsExtCov22Reject",
2143 ";#sigma_{z} [cm];Entries",
2145 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov22Reject);
2146 TH1F *fPrimaryAntiProtonsExtCov33Reject = new TH1F("fPrimaryAntiProtonsExtCov33Reject",
2147 ";#sigma_{sin(#phi)};Entries",
2149 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov33Reject);
2150 TH1F *fPrimaryAntiProtonsExtCov44Reject = new TH1F("fPrimaryAntiProtonsExtCov44Reject",
2151 ";#sigma_{tan(#lambda)};Entries",
2153 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov44Reject);
2154 TH1F *fPrimaryAntiProtonsExtCov55Reject = new TH1F("fPrimaryAntiProtonsExtCov55Reject",
2155 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2157 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov55Reject);
2158 TH1F *fPrimaryAntiProtonsSigmaToVertexReject = new TH1F("fPrimaryAntiProtonsSigmaToVertexReject",
2159 ";#sigma_{Vertex};Entries",
2161 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsSigmaToVertexReject);
2162 TH1F *fPrimaryAntiProtonsSigmaToVertexTPCReject = new TH1F("fPrimaryAntiProtonsSigmaToVertexTPCReject",
2163 ";#sigma_{Vertex};Entries",
2165 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsSigmaToVertexTPCReject);
2166 TH1F *fPrimaryAntiProtonsITSRefitReject = new TH1F("fPrimaryAntiProtonsITSRefitReject",
2168 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsITSRefitReject);
2169 TH1F *fPrimaryAntiProtonsTPCRefitReject = new TH1F("fPrimaryAntiProtonsTPCRefitReject",
2171 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsTPCRefitReject);
2172 TH1F *fPrimaryAntiProtonsESDpidReject = new TH1F("fPrimaryAntiProtonsESDpidReject",
2174 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsESDpidReject);
2175 TH1F *fPrimaryAntiProtonsTPCpidReject = new TH1F("fPrimaryAntiProtonsTPCpidReject",
2177 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsTPCpidReject);
2179 //________________________________________________________________//
2180 /*gDirectory->cd("../../");
2182 TDirectory *dirAntiProtonsSecondary = gDirectory->mkdir("Secondaries");
2183 dirAntiProtonsSecondary->cd();
2184 TDirectory *dirAntiProtonsSecondaryAccepted = gDirectory->mkdir("Accepted");
2185 dirAntiProtonsSecondaryAccepted->cd();*/
2187 //Accepted secondary antiprotons
2188 TH1F *fSecondaryAntiProtonsITSClustersPass = new TH1F("fSecondaryAntiProtonsITSClustersPass",
2189 ";N_{clusters} (ITS);Entries",
2191 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsITSClustersPass);
2192 TH1F *fSecondaryAntiProtonsChi2PerClusterITSPass = new TH1F("fSecondaryAntiProtonsChi2PerClusterITSPass",
2193 ";x^{2}/N_{clusters} (ITS);Entries",
2195 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsChi2PerClusterITSPass);
2196 TH1F *fSecondaryAntiProtonsTPCClustersPass = new TH1F("fSecondaryAntiProtonsTPCClustersPass",
2197 ";N_{clusters} (TPC);Entries",
2199 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsTPCClustersPass);
2200 TH1F *fSecondaryAntiProtonsChi2PerClusterTPCPass = new TH1F("fSecondaryAntiProtonsChi2PerClusterTPCPass",
2201 ";x^{2}/N_{clusters} (TPC);Entries",
2203 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsChi2PerClusterTPCPass);
2204 TH1F *fSecondaryAntiProtonsExtCov11Pass = new TH1F("fSecondaryAntiProtonsExtCov11Pass",
2205 ";#sigma_{y} [cm];Entries",
2207 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov11Pass);
2208 TH1F *fSecondaryAntiProtonsExtCov22Pass = new TH1F("fSecondaryAntiProtonsExtCov22Pass",
2209 ";#sigma_{z} [cm];Entries",
2211 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov22Pass);
2212 TH1F *fSecondaryAntiProtonsExtCov33Pass = new TH1F("fSecondaryAntiProtonsExtCov33Pass",
2213 ";#sigma_{sin(#phi)};Entries",
2215 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov33Pass);
2216 TH1F *fSecondaryAntiProtonsExtCov44Pass = new TH1F("fSecondaryAntiProtonsExtCov44Pass",
2217 ";#sigma_{tan(#lambda)};Entries",
2219 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov44Pass);
2220 TH1F *fSecondaryAntiProtonsExtCov55Pass = new TH1F("fSecondaryAntiProtonsExtCov55Pass",
2221 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2223 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov55Pass);
2224 TH1F *fSecondaryAntiProtonsSigmaToVertexPass = new TH1F("fSecondaryAntiProtonsSigmaToVertexPass",
2225 ";#sigma_{Vertex};Entries",
2227 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsSigmaToVertexPass);
2228 TH1F *fSecondaryAntiProtonsSigmaToVertexTPCPass = new TH1F("fSecondaryAntiProtonsSigmaToVertexTPCPass",
2229 ";#sigma_{Vertex};Entries",
2231 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsSigmaToVertexTPCPass);
2232 TH1F *fSecondaryAntiProtonsITSRefitPass = new TH1F("fSecondaryAntiProtonsITSRefitPass",
2234 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsITSRefitPass);
2235 TH1F *fSecondaryAntiProtonsTPCRefitPass = new TH1F("fSecondaryAntiProtonsTPCRefitPass",
2237 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsTPCRefitPass);
2238 TH1F *fSecondaryAntiProtonsESDpidPass = new TH1F("fSecondaryAntiProtonsESDpidPass",
2240 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsESDpidPass);
2241 TH1F *fSecondaryAntiProtonsTPCpidPass = new TH1F("fSecondaryAntiProtonsTPCpidPass",
2243 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsTPCpidPass);
2245 //Rejected secondary antiprotons
2246 /*gDirectory->cd("../");
2247 TDirectory *dirAntiProtonsSecondaryRejected = gDirectory->mkdir("Rejected");
2248 dirAntiProtonsSecondaryRejected->cd();*/
2250 TH1F *fSecondaryAntiProtonsITSClustersReject = new TH1F("fSecondaryAntiProtonsITSClustersReject",
2251 ";N_{clusters} (ITS);Entries",
2253 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsITSClustersReject);
2254 TH1F *fSecondaryAntiProtonsChi2PerClusterITSReject = new TH1F("fSecondaryAntiProtonsChi2PerClusterITSReject",
2255 ";x^{2}/N_{clusters} (ITS);Entries",
2257 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsChi2PerClusterITSReject);
2258 TH1F *fSecondaryAntiProtonsTPCClustersReject = new TH1F("fSecondaryAntiProtonsTPCClustersReject",
2259 ";N_{clusters} (TPC);Entries",
2261 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsTPCClustersReject);
2262 TH1F *fSecondaryAntiProtonsChi2PerClusterTPCReject = new TH1F("fSecondaryAntiProtonsChi2PerClusterTPCReject",
2263 ";x^{2}/N_{clusters} (TPC);Entries",
2265 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsChi2PerClusterTPCReject);
2266 TH1F *fSecondaryAntiProtonsExtCov11Reject = new TH1F("fSecondaryAntiProtonsExtCov11Reject",
2267 ";#sigma_{y} [cm];Entries",
2269 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov11Reject);
2270 TH1F *fSecondaryAntiProtonsExtCov22Reject = new TH1F("fSecondaryAntiProtonsExtCov22Reject",
2271 ";#sigma_{z} [cm];Entries",
2273 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov22Reject);
2274 TH1F *fSecondaryAntiProtonsExtCov33Reject = new TH1F("fSecondaryAntiProtonsExtCov33Reject",
2275 ";#sigma_{sin(#phi)};Entries",
2277 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov33Reject);
2278 TH1F *fSecondaryAntiProtonsExtCov44Reject = new TH1F("fSecondaryAntiProtonsExtCov44Reject",
2279 ";#sigma_{tan(#lambda)};Entries",
2281 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov44Reject);
2282 TH1F *fSecondaryAntiProtonsExtCov55Reject = new TH1F("fSecondaryAntiProtonsExtCov55Reject",
2283 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2285 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov55Reject);
2286 TH1F *fSecondaryAntiProtonsSigmaToVertexReject = new TH1F("fSecondaryAntiProtonsSigmaToVertexReject",
2287 ";#sigma_{Vertex};Entries",
2289 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsSigmaToVertexReject);
2290 TH1F *fSecondaryAntiProtonsSigmaToVertexTPCReject = new TH1F("fSecondaryAntiProtonsSigmaToVertexTPCReject",
2291 ";#sigma_{Vertex};Entries",
2293 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsSigmaToVertexTPCReject);
2294 TH1F *fSecondaryAntiProtonsITSRefitReject = new TH1F("fSecondaryAntiProtonsITSRefitReject",
2296 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsITSRefitReject);
2297 TH1F *fSecondaryAntiProtonsTPCRefitReject = new TH1F("fSecondaryAntiProtonsTPCRefitReject",
2299 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsTPCRefitReject);
2300 TH1F *fSecondaryAntiProtonsESDpidReject = new TH1F("fSecondaryAntiProtonsESDpidReject",
2302 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsESDpidReject);
2303 TH1F *fSecondaryAntiProtonsTPCpidReject = new TH1F("fSecondaryAntiProtonsTPCpidReject",
2305 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsTPCpidReject);
2309 //____________________________________________________________________//
2310 void AliProtonAnalysis::RunQA(AliStack *stack, AliESDEvent *fESD) {
2312 Int_t nGoodTracks = fESD->GetNumberOfTracks();
2313 for(Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
2314 AliESDtrack* track = fESD->GetTrack(iTracks);
2315 Int_t label = TMath::Abs(track->GetLabel());
2316 Double_t Pt = 0.0, P = 0.0;
2317 Double_t probability[5];
2320 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
2321 if(!tpcTrack) continue;
2322 Pt = tpcTrack->Pt();
2326 track->GetTPCpid(probability);
2328 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
2329 rcc += probability[i]*GetParticleFraction(i,P);
2330 if(rcc == 0.0) continue;
2332 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
2333 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
2334 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
2335 if(fParticleType == 4) {
2336 FillQA(track, stack);
2337 if(IsAccepted(track)) {
2338 if(label <= stack->GetNprimary()) {
2339 if(track->Charge() > 0)
2340 ((TH2D *)(fQA2DList->At(0)))->Fill(Rapidity(track->Px(),
2344 else if(track->Charge() < 0)
2345 ((TH2D *)(fQA2DList->At(4)))->Fill(Rapidity(track->Px(),
2349 }//primary particles
2350 else if(label > stack->GetNprimary()) {
2351 if(track->Charge() > 0)
2352 ((TH2D *)(fQA2DList->At(2)))->Fill(Rapidity(track->Px(),
2356 else if(track->Charge() < 0)
2357 ((TH2D *)(fQA2DList->At(6)))->Fill(Rapidity(track->Px(),
2361 }//secondary particles
2363 else if(!IsAccepted(track)) {
2364 if(label <= stack->GetNprimary()) {
2365 if(track->Charge() > 0)
2366 ((TH2D *)(fQA2DList->At(1)))->Fill(Rapidity(track->Px(),
2370 else if(track->Charge() < 0)
2371 ((TH2D *)(fQA2DList->At(5)))->Fill(Rapidity(track->Px(),
2375 }//primary particles
2376 else if(label > stack->GetNprimary()) {
2377 if(track->Charge() > 0)
2378 ((TH2D *)(fQA2DList->At(3)))->Fill(Rapidity(track->Px(),
2382 else if(track->Charge() < 0)
2383 ((TH2D *)(fQA2DList->At(7)))->Fill(Rapidity(track->Px(),
2387 }//secondary particles
2391 else if(!fUseTPCOnly) {
2396 track->GetESDpid(probability);
2398 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
2399 rcc += probability[i]*GetParticleFraction(i,P);
2400 if(rcc == 0.0) continue;
2402 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
2403 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
2404 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
2405 if(fParticleType == 4) {
2406 FillQA(track, stack);
2407 if(IsAccepted(track)) {
2408 if(label <= stack->GetNprimary()) {
2409 if(track->Charge() > 0)
2410 ((TH2D *)(fQA2DList->At(0)))->Fill(Rapidity(track->Px(),
2414 else if(track->Charge() < 0)
2415 ((TH2D *)(fQA2DList->At(4)))->Fill(Rapidity(track->Px(),
2419 }//primary particles
2420 else if(label > stack->GetNprimary()) {
2421 if(track->Charge() > 0)
2422 ((TH2D *)(fQA2DList->At(2)))->Fill(Rapidity(track->Px(),
2426 else if(track->Charge() < 0)
2427 ((TH2D *)(fQA2DList->At(6)))->Fill(Rapidity(track->Px(),
2431 }//secondary particles
2433 else if(!IsAccepted(track)) {
2434 if(label <= stack->GetNprimary()) {
2435 if(track->Charge() > 0)
2436 ((TH2D *)(fQA2DList->At(1)))->Fill(Rapidity(track->Px(),
2440 else if(track->Charge() < 0)
2441 ((TH2D *)(fQA2DList->At(5)))->Fill(Rapidity(track->Px(),
2445 }//primary particles
2446 else if(label > stack->GetNprimary()) {
2447 if(track->Charge() > 0)
2448 ((TH2D *)(fQA2DList->At(3)))->Fill(Rapidity(track->Px(),
2452 else if(track->Charge() < 0)
2453 ((TH2D *)(fQA2DList->At(7)))->Fill(Rapidity(track->Px(),
2457 }//secondary particles
2460 }//combined tracking