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 <AliCFEffGrid.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), fMaxCov33Flag(kFALSE), fMaxCov44Flag(kFALSE), fMaxCov55Flag(kFALSE),
56 fMaxSigmaToVertexFlag(kFALSE), fMaxSigmaToVertexTPCFlag(kFALSE),
57 fITSRefitFlag(kFALSE), fTPCRefitFlag(kFALSE),
58 fESDpidFlag(kFALSE), fTPCpidFlag(kFALSE),
59 fQAHistograms(kFALSE),
60 fGlobalQAList(0), fQA2DList(0),
61 fQAPrimaryProtonsAcceptedList(0),
62 fQAPrimaryProtonsRejectedList(0),
63 fQASecondaryProtonsAcceptedList(0),
64 fQASecondaryProtonsRejectedList(0),
65 fQAPrimaryAntiProtonsAcceptedList(0),
66 fQAPrimaryAntiProtonsRejectedList(0),
67 fQASecondaryAntiProtonsAcceptedList(0),
68 fQASecondaryAntiProtonsRejectedList(0),
69 fFunctionProbabilityFlag(kFALSE),
70 fElectronFunction(0), fMuonFunction(0),
71 fPionFunction(0), fKaonFunction(0), fProtonFunction(0),
72 fUseTPCOnly(kFALSE), fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
73 fCorrectionList2D(0), fEfficiencyList1D(0), fCorrectionList1D(0) {
75 for(Int_t i = 0; i < 5; i++) fPartFrac[i] = 0.0;
76 fCorrectionList2D = new TList();
77 fEfficiencyList1D = new TList();
78 fCorrectionList1D = new TList();
81 //____________________________________________________________________//
82 AliProtonAnalysis::AliProtonAnalysis(Int_t nbinsY, Float_t fLowY, Float_t fHighY,Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt) :
84 fNBinsY(nbinsY), fMinY(fLowY), fMaxY(fHighY),
85 fNBinsPt(nbinsPt), fMinPt(fLowPt), fMaxPt(fHighPt),
86 fMinTPCClusters(0), fMinITSClusters(0),
87 fMaxChi2PerTPCCluster(0), fMaxChi2PerITSCluster(0),
88 fMaxCov11(0), fMaxCov22(0), fMaxCov33(0), fMaxCov44(0), fMaxCov55(0),
89 fMaxSigmaToVertex(0), fMaxSigmaToVertexTPC(0),
90 fMinTPCClustersFlag(kFALSE), fMinITSClustersFlag(kFALSE),
91 fMaxChi2PerTPCClusterFlag(kFALSE), fMaxChi2PerITSClusterFlag(kFALSE),
92 fMaxCov11Flag(kFALSE), fMaxCov22Flag(kFALSE), fMaxCov33Flag(kFALSE), fMaxCov44Flag(kFALSE), fMaxCov55Flag(kFALSE),
93 fMaxSigmaToVertexFlag(kFALSE), fMaxSigmaToVertexTPCFlag(kFALSE),
94 fITSRefitFlag(kFALSE), fTPCRefitFlag(kFALSE),
95 fESDpidFlag(kFALSE), fTPCpidFlag(kFALSE),
96 fQAHistograms(kFALSE),
97 fGlobalQAList(0), fQA2DList(0),
98 fQAPrimaryProtonsAcceptedList(0),
99 fQAPrimaryProtonsRejectedList(0),
100 fQASecondaryProtonsAcceptedList(0),
101 fQASecondaryProtonsRejectedList(0),
102 fQAPrimaryAntiProtonsAcceptedList(0),
103 fQAPrimaryAntiProtonsRejectedList(0),
104 fQASecondaryAntiProtonsAcceptedList(0),
105 fQASecondaryAntiProtonsRejectedList(0),
106 fFunctionProbabilityFlag(kFALSE),
107 fElectronFunction(0), fMuonFunction(0),
108 fPionFunction(0), fKaonFunction(0), fProtonFunction(0),
109 fUseTPCOnly(kFALSE), fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
110 fCorrectionList2D(0), fEfficiencyList1D(0), fCorrectionList1D(0) {
111 //Default constructor
113 fHistEvents = new TH1I("fHistEvents","Analyzed events",1,0,1);
115 fHistYPtProtons = new TH2F("fHistYPtProtons","y-Pt Protons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
116 fHistYPtProtons->SetStats(kTRUE);
117 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
118 fHistYPtProtons->GetXaxis()->SetTitle("y");
119 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
121 fHistYPtAntiProtons = new TH2F("fHistYPtAntiProtons","y-Pt Antiprotons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
122 fHistYPtAntiProtons->SetStats(kTRUE);
123 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
124 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
125 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
128 //____________________________________________________________________//
129 AliProtonAnalysis::~AliProtonAnalysis() {
131 if(fHistEvents) delete fHistEvents;
132 if(fHistYPtProtons) delete fHistYPtProtons;
133 if(fHistYPtAntiProtons) delete fHistYPtAntiProtons;
134 if(fCorrectionList2D) delete fCorrectionList2D;
135 if(fEfficiencyList1D) delete fEfficiencyList1D;
136 if(fCorrectionList1D) delete fCorrectionList1D;
137 if(fGlobalQAList) delete fGlobalQAList;
138 if(fQA2DList) delete fQA2DList;
139 if(fQAPrimaryProtonsAcceptedList) delete fQAPrimaryProtonsAcceptedList;
140 if(fQAPrimaryProtonsRejectedList) delete fQAPrimaryProtonsRejectedList;
141 if(fQASecondaryProtonsAcceptedList) delete fQASecondaryProtonsAcceptedList;
142 if(fQASecondaryProtonsRejectedList) delete fQASecondaryProtonsRejectedList;
143 if(fQAPrimaryAntiProtonsAcceptedList) delete fQAPrimaryAntiProtonsAcceptedList;
144 if(fQAPrimaryAntiProtonsRejectedList) delete fQAPrimaryAntiProtonsRejectedList;
145 if(fQASecondaryAntiProtonsAcceptedList) delete fQASecondaryAntiProtonsAcceptedList;
146 if(fQASecondaryAntiProtonsRejectedList) delete fQASecondaryAntiProtonsRejectedList;
149 //____________________________________________________________________//
150 void AliProtonAnalysis::InitAnalysisHistograms(Int_t nbinsY, Float_t fLowY, Float_t fHighY,
151 Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt) {
159 fHistEvents = new TH1I("fHistEvents","Anallyzed events",1,0,1);
161 fHistYPtProtons = new TH2F("fHistYPtProtons","y-Pt Protons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
162 fHistYPtProtons->SetStats(kTRUE);
163 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
164 fHistYPtProtons->GetXaxis()->SetTitle("y");
165 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
167 fHistYPtAntiProtons = new TH2F("fHistYPtAntiProtons","y-Pt Antiprotons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
168 fHistYPtAntiProtons->SetStats(kTRUE);
169 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
170 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
171 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
174 //____________________________________________________________________//
175 Bool_t AliProtonAnalysis::ReadFromFile(const char* filename) {
176 Bool_t status = kTRUE;
178 TFile *file = TFile::Open(filename);
180 cout<<"Could not find the input file "<<filename<<endl;
184 TList *list = (TList *)file->Get("outputList1");
186 cout<<"Retrieving objects from the list "<<list->GetName()<<"..."<<endl;
187 fHistYPtProtons = (TH2F *)list->At(0);
188 fHistYPtAntiProtons = (TH2F *)list->At(1);
189 fHistEvents = (TH1I *)list->At(2);
192 cout<<"Retrieving objects from the file... "<<endl;
193 fHistYPtProtons = (TH2F *)file->Get("fHistYPtProtons");
194 fHistYPtAntiProtons = (TH2F *)file->Get("fHistYPtAntiProtons");
195 fHistEvents = (TH1I *)file->Get("fHistEvents");
197 if((!fHistYPtProtons)||(!fHistYPtAntiProtons)||(!fHistEvents)) {
198 cout<<"Input containers were not found!!!"<<endl;
202 fHistYPtProtons->Sumw2();
203 fHistYPtAntiProtons->Sumw2();
209 //____________________________________________________________________//
210 TH1D *AliProtonAnalysis::GetProtonYHistogram() {
211 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
212 TH1D *fYProtons = (TH1D *)fHistYPtProtons->ProjectionX("fYProtons",0,fHistYPtProtons->GetYaxis()->GetNbins(),"e");
213 fYProtons->SetStats(kFALSE);
214 fYProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
215 fYProtons->SetTitle("dN/dy protons");
216 fYProtons->SetMarkerStyle(kFullCircle);
217 fYProtons->SetMarkerColor(4);
218 if(nAnalyzedEvents > 0)
219 fYProtons->Scale(1./nAnalyzedEvents);
224 //____________________________________________________________________//
225 TH1D *AliProtonAnalysis::GetAntiProtonYHistogram() {
226 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
227 TH1D *fYAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionX("fYAntiProtons",0,fHistYPtAntiProtons->GetYaxis()->GetNbins(),"e");
228 fYAntiProtons->SetStats(kFALSE);
229 fYAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
230 fYAntiProtons->SetTitle("dN/dy antiprotons");
231 fYAntiProtons->SetMarkerStyle(kFullCircle);
232 fYAntiProtons->SetMarkerColor(4);
233 if(nAnalyzedEvents > 0)
234 fYAntiProtons->Scale(1./nAnalyzedEvents);
236 return fYAntiProtons;
239 //____________________________________________________________________//
240 TH1D *AliProtonAnalysis::GetProtonPtHistogram() {
241 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
242 TH1D *fPtProtons = (TH1D *)fHistYPtProtons->ProjectionY("fPtProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"e");
243 fPtProtons->SetStats(kFALSE);
244 fPtProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
245 fPtProtons->SetTitle("dN/dPt protons");
246 fPtProtons->SetMarkerStyle(kFullCircle);
247 fPtProtons->SetMarkerColor(4);
248 if(nAnalyzedEvents > 0)
249 fPtProtons->Scale(1./nAnalyzedEvents);
254 //____________________________________________________________________//
255 TH1D *AliProtonAnalysis::GetAntiProtonPtHistogram() {
256 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
257 TH1D *fPtAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionY("fPtAntiProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"e");
258 fPtAntiProtons->SetStats(kFALSE);
259 fPtAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
260 fPtAntiProtons->SetTitle("dN/dPt antiprotons");
261 fPtAntiProtons->SetMarkerStyle(kFullCircle);
262 fPtAntiProtons->SetMarkerColor(4);
263 if(nAnalyzedEvents > 0)
264 fPtAntiProtons->Scale(1./nAnalyzedEvents);
266 return fPtAntiProtons;
269 //____________________________________________________________________//
270 TH1D *AliProtonAnalysis::GetYRatioHistogram() {
271 TH1D *fYProtons = GetProtonYHistogram();
272 TH1D *fYAntiProtons = GetAntiProtonYHistogram();
274 TH1D *hRatioY = new TH1D("hRatioY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
275 hRatioY->Divide(fYAntiProtons,fYProtons,1.0,1.0);
276 hRatioY->SetMarkerStyle(kFullCircle);
277 hRatioY->SetMarkerColor(4);
278 hRatioY->GetYaxis()->SetTitle("#bar{p}/p");
279 hRatioY->GetYaxis()->SetTitleOffset(1.4);
280 hRatioY->GetXaxis()->SetTitle("y");
281 hRatioY->GetXaxis()->SetTitleColor(1);
282 hRatioY->SetStats(kFALSE);
287 //____________________________________________________________________//
288 TH1D *AliProtonAnalysis::GetPtRatioHistogram() {
289 TH1D *fPtProtons = GetProtonPtHistogram();
290 TH1D *fPtAntiProtons = GetAntiProtonPtHistogram();
292 TH1D *hRatioPt = new TH1D("hRatioPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
293 hRatioPt->Divide(fPtAntiProtons,fPtProtons,1.0,1.0);
294 hRatioPt->SetMarkerStyle(kFullCircle);
295 hRatioPt->SetMarkerColor(4);
296 hRatioPt->GetYaxis()->SetTitle("#bar{p}/p");
297 hRatioPt->GetYaxis()->SetTitleOffset(1.4);
298 hRatioPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
299 hRatioPt->GetXaxis()->SetTitleColor(1);
300 hRatioPt->SetStats(kFALSE);
305 //____________________________________________________________________//
306 TH1D *AliProtonAnalysis::GetYAsymmetryHistogram() {
307 TH1D *fYProtons = GetProtonYHistogram();
308 TH1D *fYAntiProtons = GetAntiProtonYHistogram();
310 TH1D *hsum = new TH1D("hsumY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
311 hsum->Add(fYProtons,fYAntiProtons,1.0,1.0);
313 TH1D *hdiff = new TH1D("hdiffY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
314 hdiff->Add(fYProtons,fYAntiProtons,1.0,-1.0);
316 TH1D *hAsymmetryY = new TH1D("hAsymmetryY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
317 hAsymmetryY->Divide(hdiff,hsum,2.0,1.);
318 hAsymmetryY->SetMarkerStyle(kFullCircle);
319 hAsymmetryY->SetMarkerColor(4);
320 hAsymmetryY->GetYaxis()->SetTitle("A_{p}");
321 hAsymmetryY->GetYaxis()->SetTitleOffset(1.4);
322 hAsymmetryY->GetXaxis()->SetTitle("y");
323 hAsymmetryY->GetXaxis()->SetTitleColor(1);
324 hAsymmetryY->SetStats(kFALSE);
329 //____________________________________________________________________//
330 TH1D *AliProtonAnalysis::GetPtAsymmetryHistogram() {
331 TH1D *fPtProtons = GetProtonPtHistogram();
332 TH1D *fPtAntiProtons = GetAntiProtonPtHistogram();
334 TH1D *hsum = new TH1D("hsumPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
335 hsum->Add(fPtProtons,fPtAntiProtons,1.0,1.0);
337 TH1D *hdiff = new TH1D("hdiffPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
338 hdiff->Add(fPtProtons,fPtAntiProtons,1.0,-1.0);
340 TH1D *hAsymmetryPt = new TH1D("hAsymmetryPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
341 hAsymmetryPt->Divide(hdiff,hsum,2.0,1.);
342 hAsymmetryPt->SetMarkerStyle(kFullCircle);
343 hAsymmetryPt->SetMarkerColor(4);
344 hAsymmetryPt->GetYaxis()->SetTitle("A_{p}");
345 hAsymmetryPt->GetYaxis()->SetTitleOffset(1.4);
346 hAsymmetryPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
347 hAsymmetryPt->GetXaxis()->SetTitleColor(1);
348 hAsymmetryPt->SetStats(kFALSE);
353 //____________________________________________________________________//
354 Double_t AliProtonAnalysis::GetParticleFraction(Int_t i, Double_t p) {
356 if(fFunctionProbabilityFlag) {
357 if(i == 0) partFrac = fElectronFunction->Eval(p);
358 if(i == 1) partFrac = fMuonFunction->Eval(p);
359 if(i == 2) partFrac = fPionFunction->Eval(p);
360 if(i == 3) partFrac = fKaonFunction->Eval(p);
361 if(i == 4) partFrac = fProtonFunction->Eval(p);
363 else partFrac = fPartFrac[i];
368 //____________________________________________________________________//
369 void AliProtonAnalysis::Analyze(AliESDEvent* fESD) {
370 //Main analysis part - ESD
371 fHistEvents->Fill(0); //number of analyzed events
372 Double_t Pt = 0.0, P = 0.0;
373 Int_t nGoodTracks = fESD->GetNumberOfTracks();
374 for(Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
375 AliESDtrack* track = fESD->GetTrack(iTracks);
376 Double_t probability[5];
378 if(IsAccepted(track)) {
380 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
381 if(!tpcTrack) continue;
386 track->GetTPCpid(probability);
388 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
389 rcc += probability[i]*GetParticleFraction(i,P);
390 if(rcc == 0.0) continue;
392 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
393 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
394 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
395 if(fParticleType == 4) {
396 if(tpcTrack->Charge() > 0)
397 fHistYPtProtons->Fill(Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),Pt);
398 else if(tpcTrack->Charge() < 0)
399 fHistYPtAntiProtons->Fill(Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),Pt);
402 else if(!fUseTPCOnly) {
407 track->GetESDpid(probability);
409 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
410 rcc += probability[i]*GetParticleFraction(i,P);
411 if(rcc == 0.0) continue;
413 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
414 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
415 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
416 if(fParticleType == 4) {
417 //cout<<"(Anti)protons found..."<<endl;
418 if(track->Charge() > 0)
419 fHistYPtProtons->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
420 else if(track->Charge() < 0)
421 fHistYPtAntiProtons->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
428 //____________________________________________________________________//
429 void AliProtonAnalysis::Analyze(AliAODEvent* fAOD) {
430 //Main analysis part - AOD
431 fHistEvents->Fill(0); //number of analyzed events
432 Int_t nGoodTracks = fAOD->GetNumberOfTracks();
433 for(Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
434 AliAODTrack* track = fAOD->GetTrack(iTracks);
435 Double_t Pt = track->Pt();
436 Double_t P = track->P();
439 Double_t probability[10];
440 track->GetPID(probability);
442 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) rcc += probability[i]*GetParticleFraction(i,P);
443 if(rcc == 0.0) continue;
445 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
446 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIESN,w);
447 if(fParticleType == 4) {
448 if(track->Charge() > 0) fHistYPtProtons->Fill(track->Y(fParticleType),Pt);
449 else if(track->Charge() < 0) fHistYPtAntiProtons->Fill(track->Y(fParticleType),Pt);
454 //____________________________________________________________________//
455 void AliProtonAnalysis::Analyze(AliStack* stack) {
456 //Main analysis part - MC
457 fHistEvents->Fill(0); //number of analyzed events
458 for(Int_t i = 0; i < stack->GetNprimary(); i++) {
459 TParticle *particle = stack->Particle(i);
460 if(particle->Pt() < 0.1) continue;
461 if(TMath::Abs(particle->Eta()) > 1.0) continue;
462 Int_t pdgcode = particle->GetPdgCode();
463 if(pdgcode == 2212) fHistYPtProtons->Fill(Rapidity(particle->Px(),
467 if(pdgcode == -2212) fHistYPtAntiProtons->Fill(Rapidity(particle->Px(),
474 //____________________________________________________________________//
475 Bool_t AliProtonAnalysis::IsAccepted(AliESDtrack* track) {
476 // Checks if the track is excluded from the cuts
477 Double_t Pt = 0.0, Px = 0.0, Py = 0.0, Pz = 0.0;
479 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
481 Pt = 0.0; Px = 0.0; Py = 0.0; Pz = 0.0;
498 Int_t nClustersITS = track->GetITSclusters(fIdxInt);
499 Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
501 Float_t chi2PerClusterITS = -1;
503 chi2PerClusterITS = track->GetITSchi2()/Float_t(nClustersITS);
504 Float_t chi2PerClusterTPC = -1;
506 chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);
509 track->GetExternalCovariance(extCov);
511 if(fMinITSClustersFlag)
512 if(nClustersITS < fMinITSClusters) return kFALSE;
513 if(fMaxChi2PerITSClusterFlag)
514 if(chi2PerClusterITS > fMaxChi2PerITSCluster) return kFALSE;
515 if(fMinTPCClustersFlag)
516 if(nClustersTPC < fMinTPCClusters) return kFALSE;
517 if(fMaxChi2PerTPCClusterFlag)
518 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) return kFALSE;
520 if(extCov[0] > fMaxCov11) return kFALSE;
522 if(extCov[2] > fMaxCov22) return kFALSE;
524 if(extCov[5] > fMaxCov33) return kFALSE;
526 if(extCov[9] > fMaxCov44) return kFALSE;
528 if(extCov[14] > fMaxCov55) return kFALSE;
529 if(fMaxSigmaToVertexFlag)
530 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) return kFALSE;
531 if(fMaxSigmaToVertexTPCFlag)
532 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) return kFALSE;
534 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
536 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
538 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) return kFALSE;
540 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) return kFALSE;
542 if((Pt < fMinPt) || (Pt > fMaxPt)) return kFALSE;
543 if((Rapidity(Px,Py,Pz) < fMinY) || (Rapidity(Px,Py,Pz) > fMaxY)) return kFALSE;
548 //____________________________________________________________________//
549 Bool_t AliProtonAnalysis::IsAccepted(AliESDtrack* track, AliStack *stack) {
550 // Checks if the track is excluded from the cuts
551 Bool_t status = kTRUE;
552 Int_t nPrimaries = stack->GetNprimary();
553 Int_t label = TMath::Abs(track->GetLabel());
555 Double_t Pt = 0.0, Px = 0.0, Py = 0.0, Pz = 0.0;
557 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
559 Pt = 0.0; Px = 0.0; Py = 0.0; Pz = 0.0;
576 Int_t nClustersITS = track->GetITSclusters(fIdxInt);
577 Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
579 Float_t chi2PerClusterITS = -1;
581 chi2PerClusterITS = track->GetITSchi2()/Float_t(nClustersITS);
582 Float_t chi2PerClusterTPC = -1;
584 chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);
587 track->GetExternalCovariance(extCov);
590 if(track->Charge() > 0) {
592 if(label <= nPrimaries) {
593 if(fMinITSClustersFlag) {
594 if(nClustersITS < fMinITSClusters) {
595 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
598 else if(nClustersITS >= fMinITSClusters)
599 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
601 if(fMaxChi2PerITSClusterFlag) {
602 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
603 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
606 else if(chi2PerClusterITS <= fMaxChi2PerITSCluster)
607 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
608 }//chi2 per ITS cluster
609 if(fMinTPCClustersFlag) {
610 if(nClustersTPC < fMinTPCClusters) {
611 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(2)))->Fill(nClustersTPC);
614 else if(nClustersTPC >= fMinTPCClusters)
615 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
617 if(fMaxChi2PerTPCClusterFlag) {
618 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
619 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
622 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
623 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
624 }//chi2 per TPC cluster
626 if(extCov[0] > fMaxCov11) {
627 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
630 else if(extCov[0] <= fMaxCov11)
631 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
634 if(extCov[2] > fMaxCov22) {
635 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
638 else if(extCov[2] <= fMaxCov22)
639 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
642 if(extCov[5] > fMaxCov33) {
643 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
646 else if(extCov[5] <= fMaxCov33)
647 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
650 if(extCov[9] > fMaxCov44) {
651 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
654 else if(extCov[9] <= fMaxCov44)
655 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
658 if(extCov[14] > fMaxCov55) {
659 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
662 else if(extCov[14] <= fMaxCov55)
663 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
665 if(fMaxSigmaToVertexFlag) {
666 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
667 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
670 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
671 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
673 if(fMaxSigmaToVertexTPCFlag) {
674 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
675 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
678 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
679 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
680 }//sigma to vertex TPC
682 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
683 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(11)))->Fill(0);
686 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
687 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(11)))->Fill(0);
690 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
691 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(12)))->Fill(0);
694 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
695 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(12)))->Fill(0);
698 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
699 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(13)))->Fill(0);
702 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
703 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(13)))->Fill(0);
706 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
707 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(13)))->Fill(0);
710 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
711 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(13)))->Fill(0);
713 }//primary particle cut
716 if(label > nPrimaries) {
717 if(fMinITSClustersFlag) {
718 if(nClustersITS < fMinITSClusters) {
719 ((TH1F *)(fQASecondaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
722 else if(nClustersITS >= fMinITSClusters)
723 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
725 if(fMaxChi2PerITSClusterFlag) {
726 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
727 ((TH1F *)(fQASecondaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
730 else if(chi2PerClusterITS <= fMaxChi2PerITSCluster)
731 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
732 }//chi2 per ITS cluster
733 if(fMinTPCClustersFlag) {
734 if(nClustersTPC < fMinTPCClusters) {
735 ((TH1F *)(fQASecondaryProtonsRejectedList->At(2)))->Fill(nClustersTPC);
738 else if(nClustersTPC >= fMinTPCClusters)
739 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
741 if(fMaxChi2PerTPCClusterFlag) {
742 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
743 ((TH1F *)(fQASecondaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
746 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
747 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
748 }//chi2 per TPC cluster
750 if(extCov[0] > fMaxCov11) {
751 ((TH1F *)(fQASecondaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
754 else if(extCov[0] <= fMaxCov11)
755 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
758 if(extCov[2] > fMaxCov22) {
759 ((TH1F *)(fQASecondaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
762 else if(extCov[2] <= fMaxCov22)
763 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
766 if(extCov[5] > fMaxCov33) {
767 ((TH1F *)(fQASecondaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
770 else if(extCov[5] <= fMaxCov33)
771 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
774 if(extCov[9] > fMaxCov44) {
775 ((TH1F *)(fQASecondaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
778 else if(extCov[9] <= fMaxCov44)
779 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
782 if(extCov[14] > fMaxCov55) {
783 ((TH1F *)(fQASecondaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
786 else if(extCov[14] <= fMaxCov55)
787 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
789 if(fMaxSigmaToVertexFlag) {
790 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
791 ((TH1F *)(fQASecondaryProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
794 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
795 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
797 if(fMaxSigmaToVertexTPCFlag) {
798 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
799 ((TH1F *)(fQASecondaryProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
802 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
803 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
804 }//sigma to vertex TPC
806 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
807 ((TH1F *)(fQASecondaryProtonsRejectedList->At(11)))->Fill(0);
810 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
811 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(11)))->Fill(0);
814 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
815 ((TH1F *)(fQASecondaryProtonsRejectedList->At(12)))->Fill(0);
818 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
819 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(12)))->Fill(0);
822 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
823 ((TH1F *)(fQASecondaryProtonsRejectedList->At(13)))->Fill(0);
826 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
827 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(13)))->Fill(0);
830 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
831 ((TH1F *)(fQASecondaryProtonsRejectedList->At(13)))->Fill(0);
834 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
835 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(13)))->Fill(0);
837 }//secondary particle cut
841 if(track->Charge() < 0) {
843 if(label <= nPrimaries) {
844 if(fMinITSClustersFlag) {
845 if(nClustersITS < fMinITSClusters) {
846 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(0)))->Fill(nClustersITS);
849 else if(nClustersITS >= fMinITSClusters)
850 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(0)))->Fill(nClustersITS);
852 if(fMaxChi2PerITSClusterFlag) {
853 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
854 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
857 else if(chi2PerClusterITS <= fMaxChi2PerITSCluster)
858 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
859 }//chi2 per ITS cluster
860 if(fMinTPCClustersFlag) {
861 if(nClustersTPC < fMinTPCClusters) {
862 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(2)))->Fill(nClustersTPC);
865 else if(nClustersTPC >= fMinTPCClusters)
866 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
868 if(fMaxChi2PerTPCClusterFlag) {
869 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
870 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
873 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
874 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
875 }//chi2 per TPC cluster
877 if(extCov[0] > fMaxCov11) {
878 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(4)))->Fill(extCov[0]);
881 else if(extCov[0] <= fMaxCov11)
882 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(4)))->Fill(extCov[0]);
885 if(extCov[2] > fMaxCov22) {
886 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(5)))->Fill(extCov[2]);
889 else if(extCov[2] <= fMaxCov22)
890 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(5)))->Fill(extCov[2]);
893 if(extCov[5] > fMaxCov33) {
894 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(6)))->Fill(extCov[5]);
897 else if(extCov[5] <= fMaxCov33)
898 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(6)))->Fill(extCov[5]);
901 if(extCov[9] > fMaxCov44) {
902 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(7)))->Fill(extCov[9]);
905 else if(extCov[9] <= fMaxCov44)
906 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(7)))->Fill(extCov[9]);
909 if(extCov[14] > fMaxCov55) {
910 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(8)))->Fill(extCov[14]);
913 else if(extCov[14] <= fMaxCov55)
914 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(8)))->Fill(extCov[14]);
916 if(fMaxSigmaToVertexFlag) {
917 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
918 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
921 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
922 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
924 if(fMaxSigmaToVertexTPCFlag) {
925 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
926 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
929 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
930 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
931 }//sigma to vertex TPC
933 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
934 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(11)))->Fill(0);
937 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
938 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(11)))->Fill(0);
941 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
942 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(12)))->Fill(0);
945 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
946 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(12)))->Fill(0);
949 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
950 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(13)))->Fill(0);
953 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
954 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(13)))->Fill(0);
957 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
958 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(13)))->Fill(0);
961 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
962 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(13)))->Fill(0);
964 }//primary particle cut
967 if(label > nPrimaries) {
968 if(fMinITSClustersFlag) {
969 if(nClustersITS < fMinITSClusters) {
970 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(0)))->Fill(nClustersITS);
973 else if(nClustersITS >= fMinITSClusters)
974 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(0)))->Fill(nClustersITS);
976 if(fMaxChi2PerITSClusterFlag) {
977 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
978 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
981 else if(chi2PerClusterITS <= fMaxChi2PerITSCluster)
982 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
983 }//chi2 per ITS cluster
984 if(fMinTPCClustersFlag) {
985 if(nClustersTPC < fMinTPCClusters) {
986 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(2)))->Fill(nClustersTPC);
989 else if(nClustersTPC >= fMinTPCClusters)
990 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
992 if(fMaxChi2PerTPCClusterFlag) {
993 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
994 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
997 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
998 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
999 }//chi2 per TPC cluster
1001 if(extCov[0] > fMaxCov11) {
1002 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(4)))->Fill(extCov[0]);
1005 else if(extCov[0] <= fMaxCov11)
1006 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(4)))->Fill(extCov[0]);
1009 if(extCov[2] > fMaxCov22) {
1010 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(5)))->Fill(extCov[2]);
1013 else if(extCov[2] <= fMaxCov22)
1014 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(5)))->Fill(extCov[2]);
1017 if(extCov[5] > fMaxCov33) {
1018 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(6)))->Fill(extCov[5]);
1021 else if(extCov[5] <= fMaxCov33)
1022 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(6)))->Fill(extCov[5]);
1025 if(extCov[9] > fMaxCov44) {
1026 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(7)))->Fill(extCov[9]);
1029 else if(extCov[9] <= fMaxCov44)
1030 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(7)))->Fill(extCov[9]);
1033 if(extCov[14] > fMaxCov55) {
1034 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(8)))->Fill(extCov[14]);
1037 else if(extCov[14] <= fMaxCov55)
1038 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(8)))->Fill(extCov[14]);
1040 if(fMaxSigmaToVertexFlag) {
1041 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
1042 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
1045 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
1046 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
1048 if(fMaxSigmaToVertexTPCFlag) {
1049 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
1050 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
1053 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
1054 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
1055 }//sigma to vertex TPC
1057 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
1058 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(11)))->Fill(0);
1061 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
1062 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(11)))->Fill(0);
1065 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
1066 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(12)))->Fill(0);
1069 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
1070 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(12)))->Fill(0);
1073 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
1074 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(13)))->Fill(0);
1077 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
1078 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(13)))->Fill(0);
1081 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
1082 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(13)))->Fill(0);
1085 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
1086 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(13)))->Fill(0);
1088 }//secondary particle cut
1091 if((Pt < fMinPt) || (Pt > fMaxPt)) status = kFALSE;
1092 if((Rapidity(Px,Py,Pz) < fMinY) || (Rapidity(Px,Py,Pz) > fMaxY)) status = kFALSE;
1097 //____________________________________________________________________//
1098 Float_t AliProtonAnalysis::GetSigmaToVertex(AliESDtrack* esdTrack) {
1099 // Calculates the number of sigma to the vertex.
1105 esdTrack->GetImpactParametersTPC(b,bCov);
1107 esdTrack->GetImpactParameters(b,bCov);
1109 if (bCov[0]<=0 || bCov[2]<=0) {
1110 //AliDebug(1, "Estimated b resolution lower or equal zero!");
1111 bCov[0]=0; bCov[2]=0;
1113 bRes[0] = TMath::Sqrt(bCov[0]);
1114 bRes[1] = TMath::Sqrt(bCov[2]);
1116 if (bRes[0] == 0 || bRes[1] ==0) return -1;
1118 Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2));
1120 if (TMath::Exp(-d * d / 2) < 1e-10) return 1000;
1122 d = TMath::ErfInverse(1 - TMath::Exp(-d * d / 2)) * TMath::Sqrt(2);
1127 //____________________________________________________________________//
1128 Double_t AliProtonAnalysis::Rapidity(Double_t Px, Double_t Py, Double_t Pz) {
1129 //returns the rapidity of the proton - to be removed
1130 Double_t fMass = 9.38270000000000048e-01;
1132 Double_t P = TMath::Sqrt(TMath::Power(Px,2) +
1133 TMath::Power(Py,2) +
1134 TMath::Power(Pz,2));
1135 Double_t energy = TMath::Sqrt(P*P + fMass*fMass);
1138 y = 0.5*TMath::Log((energy + Pz)/(energy - Pz));
1143 //____________________________________________________________________//
1144 Bool_t AliProtonAnalysis::PrintMean(TH1 *hist, Double_t edge) {
1145 //calculates the mean value of the ratio/asymmetry within \pm edge
1148 //calculate the mean
1149 for(Int_t i = 0; i < hist->GetXaxis()->GetNbins(); i++) {
1150 Double_t x = hist->GetBinCenter(i+1);
1151 Double_t y = hist->GetBinContent(i+1);
1152 if(TMath::Abs(x) < edge) {
1157 Double_t mean = 0.0;
1159 mean = sum/nentries;
1161 //calculate the error
1162 for(Int_t i = 0; i < hist->GetXaxis()->GetNbins(); i++) {
1163 Double_t x = hist->GetBinCenter(i+1);
1164 Double_t y = hist->GetBinContent(i+1);
1165 if(TMath::Abs(x) < edge) {
1166 sum += TMath::Power((mean - y),2);
1171 Double_t error = 0.0;
1173 error = TMath::Sqrt(sum)/nentries;
1175 cout<<"========================================="<<endl;
1176 cout<<"Input distribution: "<<hist->GetName()<<endl;
1177 cout<<"Interval used: -"<<edge<<" -> "<<edge<<endl;
1178 cout<<"Mean value :"<<mean<<endl;
1179 cout<<"Error: "<<error<<endl;
1180 cout<<"========================================="<<endl;
1185 //____________________________________________________________________//
1186 Bool_t AliProtonAnalysis::PrintYields(TH1 *hist, Double_t edge) {
1187 //calculates the (anti)proton yields within the \pm edge
1188 Double_t sum = 0.0, sumerror = 0.0;
1189 Double_t error = 0.0;
1190 for(Int_t i = 0; i < hist->GetXaxis()->GetNbins(); i++) {
1191 Double_t x = hist->GetBinCenter(i+1);
1192 Double_t y = hist->GetBinContent(i+1);
1193 if(TMath::Abs(x) < edge) {
1195 sumerror += TMath::Power(hist->GetBinError(i+1),2);
1199 error = TMath::Sqrt(sumerror);
1201 cout<<"========================================="<<endl;
1202 cout<<"Input distribution: "<<hist->GetName()<<endl;
1203 cout<<"Interval used: -"<<edge<<" -> "<<edge<<endl;
1204 cout<<"Yields :"<<sum<<endl;
1205 cout<<"Error: "<<error<<endl;
1206 cout<<"========================================="<<endl;
1211 //____________________________________________________________________//
1212 Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
1213 // Reads the outout of the correction framework task
1214 // Creates the correction maps
1215 // Puts the results in the different TList objects
1216 Bool_t status = kTRUE;
1218 TFile *file = TFile::Open(filename);
1220 cout<<"Could not find the input CORRFW file "<<filename<<endl;
1224 AliCFContainer *corrfwContainer = (AliCFContainer*) (file->Get("container"));
1225 if(!corrfwContainer) {
1226 cout<<"CORRFW container not found!"<<endl;
1230 Int_t nSteps = corrfwContainer->GetNStep();
1232 //currently the GRID is formed by the y-pT parameters
1233 //Add Vz as a next step
1234 Int_t iRap = 0, iPt = 1;
1235 for(Int_t iStep = 0; iStep < nSteps; iStep++) {
1236 gYPt[iStep] = corrfwContainer->ShowProjection(iRap,iPt,iStep);
1237 //fCorrectionList2D->Add(gYPt[iStep]);
1240 //construct the efficiency grid from the data container
1242 AliCFEffGrid *efficiency[3]; //The efficiency array has nStep-1 entries!!!
1243 TH1D *gEfficiency[2][3]; //efficiency as a function of pT and of y (raws - [2])
1244 TH1D *gCorrection[2][3]; //efficiency as a function of pT and of y (raws - [2])
1246 //Get the 2D efficiency maps
1247 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1248 gTitle = "Efficiency_Step0_Step"; gTitle += iStep;
1249 efficiency[iStep] = new AliCFEffGrid(gTitle.Data(),
1250 gTitle.Data(),*corrfwContainer);
1251 efficiency[iStep]->CalculateEfficiency(iStep,0); //eff= step[i]/step0
1252 fCorrectionList2D->Add(efficiency[iStep]);
1254 //Get the projection of the efficiency maps
1255 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1256 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1257 gEfficiency[iParameter][iStep-1] = efficiency[iStep]->Project(iParameter);
1258 fEfficiencyList1D->Add(gEfficiency[iParameter][iStep-1]);
1259 gTitle = "Correction_Parameter"; gTitle += iParameter+1;
1260 gTitle += "_Step0_Step"; gTitle += iStep;
1261 gCorrection[iParameter][iStep-1] = new TH1D(gTitle.Data(),
1263 gEfficiency[iParameter][iStep-1]->GetNbinsX(),
1264 gEfficiency[iParameter][iStep-1]->GetXaxis()->GetXmin(),
1265 gEfficiency[iParameter][iStep-1]->GetXaxis()->GetXmax());
1266 //initialisation of the correction
1267 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][iStep-1]->GetNbinsX(); iBin++)
1268 gCorrection[iParameter][iStep-1]->SetBinContent(iBin,1.0);
1271 //Calculate the 1D correction parameters as a function of y and pT
1272 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1273 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1274 gCorrection[iParameter][iStep-1]->Divide(gEfficiency[iParameter][iStep-1]);
1275 fCorrectionList1D->Add(gCorrection[iParameter][iStep-1]);
1282 //____________________________________________________________________//
1283 void AliProtonAnalysis::InitQA() {
1284 //Initializes the QA histograms and builds the directory structure
1285 if(!fQAHistograms) SetQAOn();
1288 TDirectory *dir2D = gDirectory->mkdir("2D");
1289 fGlobalQAList->Add(dir2D); dir2D->cd();
1290 TH2F *gHistYPtPrimaryProtonsPass = new TH2F("gHistYPtPrimaryProtonsPass",
1292 fNBinsY,fMinY,fMaxY,
1293 fNBinsPt,fMinPt,fMaxPt);
1294 gHistYPtPrimaryProtonsPass->SetStats(kTRUE);
1295 gHistYPtPrimaryProtonsPass->GetXaxis()->SetTitleColor(1);
1296 fQA2DList->Add(gHistYPtPrimaryProtonsPass);
1297 TH2F *gHistYPtPrimaryAntiProtonsPass = new TH2F("gHistYPtAntiPrimaryProtonsPass",
1299 fNBinsY,fMinY,fMaxY,
1300 fNBinsPt,fMinPt,fMaxPt);
1301 gHistYPtPrimaryAntiProtonsPass->SetStats(kTRUE);
1302 gHistYPtPrimaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1303 fQA2DList->Add(gHistYPtPrimaryAntiProtonsPass);
1304 TH2F *gHistYPtSecondaryProtonsPass = new TH2F("gHistYPtSecondaryAntiProtonsPass",
1306 fNBinsY,fMinY,fMaxY,
1307 fNBinsPt,fMinPt,fMaxPt);
1308 gHistYPtSecondaryProtonsPass->SetStats(kTRUE);
1309 gHistYPtSecondaryProtonsPass->GetXaxis()->SetTitleColor(1);
1310 fQA2DList->Add(gHistYPtSecondaryProtonsPass);
1311 TH2F *gHistYPtSecondaryAntiAntiProtonsPass = new TH2F("gHistYPtAntiSecondaryAntiProtonsPass",
1313 fNBinsY,fMinY,fMaxY,
1314 fNBinsPt,fMinPt,fMaxPt);
1315 gHistYPtSecondaryAntiAntiProtonsPass->SetStats(kTRUE);
1316 gHistYPtSecondaryAntiAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1317 fQA2DList->Add(gHistYPtSecondaryAntiAntiProtonsPass);
1319 gDirectory->cd("../");
1321 TDirectory *dirProtons = gDirectory->mkdir("Protons");
1322 fGlobalQAList->Add(dirProtons); dirProtons->cd();
1324 //________________________________________________________________//
1325 TDirectory *dirProtonsPrimary = gDirectory->mkdir("Primaries");
1326 dirProtonsPrimary->cd();
1327 TDirectory *dirProtonsPrimaryAccepted = gDirectory->mkdir("Accepted");
1328 dirProtonsPrimaryAccepted->cd();
1330 //Accepted primary protons
1331 TH1F *fPrimaryProtonsITSClustersPass = new TH1F("fPrimaryProtonsITSClustersPass",
1332 ";N_{clusters} (ITS);Entries",
1334 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsITSClustersPass);
1335 TH1F *fPrimaryProtonsChi2PerClusterITSPass = new TH1F("fPrimaryProtonsChi2PerClusterITSPass",
1336 ";x^{2}/N_{clusters} (ITS);Entries",
1338 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsChi2PerClusterITSPass);
1339 TH1F *fPrimaryProtonsTPCClustersPass = new TH1F("fPrimaryProtonsTPCClustersPass",
1340 ";N_{clusters} (TPC);Entries",
1342 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsTPCClustersPass);
1343 TH1F *fPrimaryProtonsChi2PerClusterTPCPass = new TH1F("fPrimaryProtonsChi2PerClusterTPCPass",
1344 ";x^{2}/N_{clusters} (TPC);Entries",
1346 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsChi2PerClusterTPCPass);
1347 TH1F *fPrimaryProtonsExtCov11Pass = new TH1F("fPrimaryProtonsExtCov11Pass",
1348 ";#sigma_{y} [cm];Entries",
1350 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov11Pass);
1351 TH1F *fPrimaryProtonsExtCov22Pass = new TH1F("fPrimaryProtonsExtCov22Pass",
1352 ";#sigma_{z} [cm];Entries",
1354 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov22Pass);
1355 TH1F *fPrimaryProtonsExtCov33Pass = new TH1F("fPrimaryProtonsExtCov33Pass",
1356 ";#sigma_{sin(#phi)};Entries",
1358 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov33Pass);
1359 TH1F *fPrimaryProtonsExtCov44Pass = new TH1F("fPrimaryProtonsExtCov44Pass",
1360 ";#sigma_{tan(#lambda)};Entries",
1362 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov44Pass);
1363 TH1F *fPrimaryProtonsExtCov55Pass = new TH1F("fPrimaryProtonsExtCov55Pass",
1364 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1366 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov55Pass);
1367 TH1F *fPrimaryProtonsSigmaToVertexPass = new TH1F("fPrimaryProtonsSigmaToVertexPass",
1368 ";#sigma_{Vertex};Entries",
1370 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsSigmaToVertexPass);
1371 TH1F *fPrimaryProtonsSigmaToVertexTPCPass = new TH1F("fPrimaryProtonsSigmaToVertexTPCPass",
1372 ";#sigma_{Vertex};Entries",
1374 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsSigmaToVertexTPCPass);
1375 TH1F *fPrimaryProtonsITSRefitPass = new TH1F("fPrimaryProtonsITSRefitPass",
1377 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsITSRefitPass);
1378 TH1F *fPrimaryProtonsTPCRefitPass = new TH1F("fPrimaryProtonsTPCRefitPass",
1380 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsTPCRefitPass);
1381 TH1F *fPrimaryProtonsESDpidPass = new TH1F("fPrimaryProtonsESDpidPass",
1383 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsESDpidPass);
1384 TH1F *fPrimaryProtonsTPCpidPass = new TH1F("fPrimaryProtonsTPCpidPass",
1386 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsTPCpidPass);
1388 //Rejected primary protons
1389 gDirectory->cd("../");
1390 TDirectory *dirProtonsPrimaryRejected = gDirectory->mkdir("Rejected");
1391 dirProtonsPrimaryRejected->cd();
1393 TH1F *fPrimaryProtonsITSClustersReject = new TH1F("fPrimaryProtonsITSClustersReject",
1394 ";N_{clusters} (ITS);Entries",
1396 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsITSClustersReject);
1397 TH1F *fPrimaryProtonsChi2PerClusterITSReject = new TH1F("fPrimaryProtonsChi2PerClusterITSReject",
1398 ";x^{2}/N_{clusters} (ITS);Entries",
1400 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsChi2PerClusterITSReject);
1401 TH1F *fPrimaryProtonsTPCClustersReject = new TH1F("fPrimaryProtonsTPCClustersReject",
1402 ";N_{clusters} (TPC);Entries",
1404 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsTPCClustersReject);
1405 TH1F *fPrimaryProtonsChi2PerClusterTPCReject = new TH1F("fPrimaryProtonsChi2PerClusterTPCReject",
1406 ";x^{2}/N_{clusters} (TPC);Entries",
1408 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsChi2PerClusterTPCReject);
1409 TH1F *fPrimaryProtonsExtCov11Reject = new TH1F("fPrimaryProtonsExtCov11Reject",
1410 ";#sigma_{y} [cm];Entries",
1412 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov11Reject);
1413 TH1F *fPrimaryProtonsExtCov22Reject = new TH1F("fPrimaryProtonsExtCov22Reject",
1414 ";#sigma_{z} [cm];Entries",
1416 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov22Reject);
1417 TH1F *fPrimaryProtonsExtCov33Reject = new TH1F("fPrimaryProtonsExtCov33Reject",
1418 ";#sigma_{sin(#phi)};Entries",
1420 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov33Reject);
1421 TH1F *fPrimaryProtonsExtCov44Reject = new TH1F("fPrimaryProtonsExtCov44Reject",
1422 ";#sigma_{tan(#lambda)};Entries",
1424 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov44Reject);
1425 TH1F *fPrimaryProtonsExtCov55Reject = new TH1F("fPrimaryProtonsExtCov55Reject",
1426 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1428 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov55Reject);
1429 TH1F *fPrimaryProtonsSigmaToVertexReject = new TH1F("fPrimaryProtonsSigmaToVertexReject",
1430 ";#sigma_{Vertex};Entries",
1432 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsSigmaToVertexReject);
1433 TH1F *fPrimaryProtonsSigmaToVertexTPCReject = new TH1F("fPrimaryProtonsSigmaToVertexTPCReject",
1434 ";#sigma_{Vertex};Entries",
1436 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsSigmaToVertexTPCReject);
1437 TH1F *fPrimaryProtonsITSRefitReject = new TH1F("fPrimaryProtonsITSRefitReject",
1439 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsITSRefitReject);
1440 TH1F *fPrimaryProtonsTPCRefitReject = new TH1F("fPrimaryProtonsTPCRefitReject",
1442 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsTPCRefitReject);
1443 TH1F *fPrimaryProtonsESDpidReject = new TH1F("fPrimaryProtonsESDpidReject",
1445 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsESDpidReject);
1446 TH1F *fPrimaryProtonsTPCpidReject = new TH1F("fPrimaryProtonsTPCpidReject",
1448 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsTPCpidReject);
1450 //________________________________________________________________//
1451 gDirectory->cd("../../");
1453 TDirectory *dirProtonsSecondary = gDirectory->mkdir("Secondaries");
1454 dirProtonsSecondary->cd();
1455 TDirectory *dirProtonsSecondaryAccepted = gDirectory->mkdir("Accepted");
1456 dirProtonsSecondaryAccepted->cd();
1458 //Accepted secondary protons
1459 TH1F *fSecondaryProtonsITSClustersPass = new TH1F("fSecondaryProtonsITSClustersPass",
1460 ";N_{clusters} (ITS);Entries",
1462 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsITSClustersPass);
1463 TH1F *fSecondaryProtonsChi2PerClusterITSPass = new TH1F("fSecondaryProtonsChi2PerClusterITSPass",
1464 ";x^{2}/N_{clusters} (ITS);Entries",
1466 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsChi2PerClusterITSPass);
1467 TH1F *fSecondaryProtonsTPCClustersPass = new TH1F("fSecondaryProtonsTPCClustersPass",
1468 ";N_{clusters} (TPC);Entries",
1470 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsTPCClustersPass);
1471 TH1F *fSecondaryProtonsChi2PerClusterTPCPass = new TH1F("fSecondaryProtonsChi2PerClusterTPCPass",
1472 ";x^{2}/N_{clusters} (TPC);Entries",
1474 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsChi2PerClusterTPCPass);
1475 TH1F *fSecondaryProtonsExtCov11Pass = new TH1F("fSecondaryProtonsExtCov11Pass",
1476 ";#sigma_{y} [cm];Entries",
1478 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov11Pass);
1479 TH1F *fSecondaryProtonsExtCov22Pass = new TH1F("fSecondaryProtonsExtCov22Pass",
1480 ";#sigma_{z} [cm];Entries",
1482 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov22Pass);
1483 TH1F *fSecondaryProtonsExtCov33Pass = new TH1F("fSecondaryProtonsExtCov33Pass",
1484 ";#sigma_{sin(#phi)};Entries",
1486 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov33Pass);
1487 TH1F *fSecondaryProtonsExtCov44Pass = new TH1F("fSecondaryProtonsExtCov44Pass",
1488 ";#sigma_{tan(#lambda)};Entries",
1490 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov44Pass);
1491 TH1F *fSecondaryProtonsExtCov55Pass = new TH1F("fSecondaryProtonsExtCov55Pass",
1492 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1494 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov55Pass);
1495 TH1F *fSecondaryProtonsSigmaToVertexPass = new TH1F("fSecondaryProtonsSigmaToVertexPass",
1496 ";#sigma_{Vertex};Entries",
1498 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsSigmaToVertexPass);
1499 TH1F *fSecondaryProtonsSigmaToVertexTPCPass = new TH1F("fSecondaryProtonsSigmaToVertexTPCPass",
1500 ";#sigma_{Vertex};Entries",
1502 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsSigmaToVertexTPCPass);
1503 TH1F *fSecondaryProtonsITSRefitPass = new TH1F("fSecondaryProtonsITSRefitPass",
1505 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsITSRefitPass);
1506 TH1F *fSecondaryProtonsTPCRefitPass = new TH1F("fSecondaryProtonsTPCRefitPass",
1508 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsTPCRefitPass);
1509 TH1F *fSecondaryProtonsESDpidPass = new TH1F("fSecondaryProtonsESDpidPass",
1511 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsESDpidPass);
1512 TH1F *fSecondaryProtonsTPCpidPass = new TH1F("fSecondaryProtonsTPCpidPass",
1514 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsTPCpidPass);
1516 //Rejected secondary protons
1517 gDirectory->cd("../");
1518 TDirectory *dirProtonsSecondaryRejected = gDirectory->mkdir("Rejected");
1519 dirProtonsSecondaryRejected->cd();
1521 TH1F *fSecondaryProtonsITSClustersReject = new TH1F("fSecondaryProtonsITSClustersReject",
1522 ";N_{clusters} (ITS);Entries",
1524 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsITSClustersReject);
1525 TH1F *fSecondaryProtonsChi2PerClusterITSReject = new TH1F("fSecondaryProtonsChi2PerClusterITSReject",
1526 ";x^{2}/N_{clusters} (ITS);Entries",
1528 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsChi2PerClusterITSReject);
1529 TH1F *fSecondaryProtonsTPCClustersReject = new TH1F("fSecondaryProtonsTPCClustersReject",
1530 ";N_{clusters} (TPC);Entries",
1532 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsTPCClustersReject);
1533 TH1F *fSecondaryProtonsChi2PerClusterTPCReject = new TH1F("fSecondaryProtonsChi2PerClusterTPCReject",
1534 ";x^{2}/N_{clusters} (TPC);Entries",
1536 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsChi2PerClusterTPCReject);
1537 TH1F *fSecondaryProtonsExtCov11Reject = new TH1F("fSecondaryProtonsExtCov11Reject",
1538 ";#sigma_{y} [cm];Entries",
1540 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov11Reject);
1541 TH1F *fSecondaryProtonsExtCov22Reject = new TH1F("fSecondaryProtonsExtCov22Reject",
1542 ";#sigma_{z} [cm];Entries",
1544 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov22Reject);
1545 TH1F *fSecondaryProtonsExtCov33Reject = new TH1F("fSecondaryProtonsExtCov33Reject",
1546 ";#sigma_{sin(#phi)};Entries",
1548 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov33Reject);
1549 TH1F *fSecondaryProtonsExtCov44Reject = new TH1F("fSecondaryProtonsExtCov44Reject",
1550 ";#sigma_{tan(#lambda)};Entries",
1552 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov44Reject);
1553 TH1F *fSecondaryProtonsExtCov55Reject = new TH1F("fSecondaryProtonsExtCov55Reject",
1554 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1556 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov55Reject);
1557 TH1F *fSecondaryProtonsSigmaToVertexReject = new TH1F("fSecondaryProtonsSigmaToVertexReject",
1558 ";#sigma_{Vertex};Entries",
1560 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsSigmaToVertexReject);
1561 TH1F *fSecondaryProtonsSigmaToVertexTPCReject = new TH1F("fSecondaryProtonsSigmaToVertexTPCReject",
1562 ";#sigma_{Vertex};Entries",
1564 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsSigmaToVertexTPCReject);
1565 TH1F *fSecondaryProtonsITSRefitReject = new TH1F("fSecondaryProtonsITSRefitReject",
1567 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsITSRefitReject);
1568 TH1F *fSecondaryProtonsTPCRefitReject = new TH1F("fSecondaryProtonsTPCRefitReject",
1570 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsTPCRefitReject);
1571 TH1F *fSecondaryProtonsESDpidReject = new TH1F("fSecondaryProtonsESDpidReject",
1573 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsESDpidReject);
1574 TH1F *fSecondaryProtonsTPCpidReject = new TH1F("fSecondaryProtonsTPCpidReject",
1576 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsTPCpidReject);
1579 gDirectory->cd("../../../");
1582 TDirectory *dirAntiProtons = gDirectory->mkdir("AntiProtons");
1583 fGlobalQAList->Add(dirAntiProtons); dirAntiProtons->cd();
1585 //________________________________________________________________//
1586 TDirectory *dirAntiProtonsPrimary = gDirectory->mkdir("Primaries");
1587 dirAntiProtonsPrimary->cd();
1588 TDirectory *dirAntiProtonsPrimaryAccepted = gDirectory->mkdir("Accepted");
1589 dirAntiProtonsPrimaryAccepted->cd();
1591 //Accepted primary antiprotons
1592 TH1F *fPrimaryAntiProtonsITSClustersPass = new TH1F("fPrimaryAntiProtonsITSClustersPass",
1593 ";N_{clusters} (ITS);Entries",
1595 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsITSClustersPass);
1596 TH1F *fPrimaryAntiProtonsChi2PerClusterITSPass = new TH1F("fPrimaryAntiProtonsChi2PerClusterITSPass",
1597 ";x^{2}/N_{clusters} (ITS);Entries",
1599 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsChi2PerClusterITSPass);
1600 TH1F *fPrimaryAntiProtonsTPCClustersPass = new TH1F("fPrimaryAntiProtonsTPCClustersPass",
1601 ";N_{clusters} (TPC);Entries",
1603 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsTPCClustersPass);
1604 TH1F *fPrimaryAntiProtonsChi2PerClusterTPCPass = new TH1F("fPrimaryAntiProtonsChi2PerClusterTPCPass",
1605 ";x^{2}/N_{clusters} (TPC);Entries",
1607 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsChi2PerClusterTPCPass);
1608 TH1F *fPrimaryAntiProtonsExtCov11Pass = new TH1F("fPrimaryAntiProtonsExtCov11Pass",
1609 ";#sigma_{y} [cm];Entries",
1611 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov11Pass);
1612 TH1F *fPrimaryAntiProtonsExtCov22Pass = new TH1F("fPrimaryAntiProtonsExtCov22Pass",
1613 ";#sigma_{z} [cm];Entries",
1615 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov22Pass);
1616 TH1F *fPrimaryAntiProtonsExtCov33Pass = new TH1F("fPrimaryAntiProtonsExtCov33Pass",
1617 ";#sigma_{sin(#phi)};Entries",
1619 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov33Pass);
1620 TH1F *fPrimaryAntiProtonsExtCov44Pass = new TH1F("fPrimaryAntiProtonsExtCov44Pass",
1621 ";#sigma_{tan(#lambda)};Entries",
1623 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov44Pass);
1624 TH1F *fPrimaryAntiProtonsExtCov55Pass = new TH1F("fPrimaryAntiProtonsExtCov55Pass",
1625 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1627 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov55Pass);
1628 TH1F *fPrimaryAntiProtonsSigmaToVertexPass = new TH1F("fPrimaryAntiProtonsSigmaToVertexPass",
1629 ";#sigma_{Vertex};Entries",
1631 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsSigmaToVertexPass);
1632 TH1F *fPrimaryAntiProtonsSigmaToVertexTPCPass = new TH1F("fPrimaryAntiProtonsSigmaToVertexTPCPass",
1633 ";#sigma_{Vertex};Entries",
1635 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsSigmaToVertexTPCPass);
1636 TH1F *fPrimaryAntiProtonsITSRefitPass = new TH1F("fPrimaryAntiProtonsITSRefitPass",
1638 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsITSRefitPass);
1639 TH1F *fPrimaryAntiProtonsTPCRefitPass = new TH1F("fPrimaryAntiProtonsTPCRefitPass",
1641 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsTPCRefitPass);
1642 TH1F *fPrimaryAntiProtonsESDpidPass = new TH1F("fPrimaryAntiProtonsESDpidPass",
1644 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsESDpidPass);
1645 TH1F *fPrimaryAntiProtonsTPCpidPass = new TH1F("fPrimaryAntiProtonsTPCpidPass",
1647 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsTPCpidPass);
1649 //Rejected primary antiprotons
1650 gDirectory->cd("../");
1651 TDirectory *dirAntiProtonsPrimaryRejected = gDirectory->mkdir("Rejected");
1652 dirAntiProtonsPrimaryRejected->cd();
1654 TH1F *fPrimaryAntiProtonsITSClustersReject = new TH1F("fPrimaryAntiProtonsITSClustersReject",
1655 ";N_{clusters} (ITS);Entries",
1657 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsITSClustersReject);
1658 TH1F *fPrimaryAntiProtonsChi2PerClusterITSReject = new TH1F("fPrimaryAntiProtonsChi2PerClusterITSReject",
1659 ";x^{2}/N_{clusters} (ITS);Entries",
1661 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsChi2PerClusterITSReject);
1662 TH1F *fPrimaryAntiProtonsTPCClustersReject = new TH1F("fPrimaryAntiProtonsTPCClustersReject",
1663 ";N_{clusters} (TPC);Entries",
1665 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsTPCClustersReject);
1666 TH1F *fPrimaryAntiProtonsChi2PerClusterTPCReject = new TH1F("fPrimaryAntiProtonsChi2PerClusterTPCReject",
1667 ";x^{2}/N_{clusters} (TPC);Entries",
1669 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsChi2PerClusterTPCReject);
1670 TH1F *fPrimaryAntiProtonsExtCov11Reject = new TH1F("fPrimaryAntiProtonsExtCov11Reject",
1671 ";#sigma_{y} [cm];Entries",
1673 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov11Reject);
1674 TH1F *fPrimaryAntiProtonsExtCov22Reject = new TH1F("fPrimaryAntiProtonsExtCov22Reject",
1675 ";#sigma_{z} [cm];Entries",
1677 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov22Reject);
1678 TH1F *fPrimaryAntiProtonsExtCov33Reject = new TH1F("fPrimaryAntiProtonsExtCov33Reject",
1679 ";#sigma_{sin(#phi)};Entries",
1681 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov33Reject);
1682 TH1F *fPrimaryAntiProtonsExtCov44Reject = new TH1F("fPrimaryAntiProtonsExtCov44Reject",
1683 ";#sigma_{tan(#lambda)};Entries",
1685 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov44Reject);
1686 TH1F *fPrimaryAntiProtonsExtCov55Reject = new TH1F("fPrimaryAntiProtonsExtCov55Reject",
1687 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1689 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov55Reject);
1690 TH1F *fPrimaryAntiProtonsSigmaToVertexReject = new TH1F("fPrimaryAntiProtonsSigmaToVertexReject",
1691 ";#sigma_{Vertex};Entries",
1693 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsSigmaToVertexReject);
1694 TH1F *fPrimaryAntiProtonsSigmaToVertexTPCReject = new TH1F("fPrimaryAntiProtonsSigmaToVertexTPCReject",
1695 ";#sigma_{Vertex};Entries",
1697 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsSigmaToVertexTPCReject);
1698 TH1F *fPrimaryAntiProtonsITSRefitReject = new TH1F("fPrimaryAntiProtonsITSRefitReject",
1700 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsITSRefitReject);
1701 TH1F *fPrimaryAntiProtonsTPCRefitReject = new TH1F("fPrimaryAntiProtonsTPCRefitReject",
1703 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsTPCRefitReject);
1704 TH1F *fPrimaryAntiProtonsESDpidReject = new TH1F("fPrimaryAntiProtonsESDpidReject",
1706 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsESDpidReject);
1707 TH1F *fPrimaryAntiProtonsTPCpidReject = new TH1F("fPrimaryAntiProtonsTPCpidReject",
1709 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsTPCpidReject);
1711 //________________________________________________________________//
1712 gDirectory->cd("../../");
1714 TDirectory *dirAntiProtonsSecondary = gDirectory->mkdir("Secondaries");
1715 dirAntiProtonsSecondary->cd();
1716 TDirectory *dirAntiProtonsSecondaryAccepted = gDirectory->mkdir("Accepted");
1717 dirAntiProtonsSecondaryAccepted->cd();
1719 //Accepted secondary antiprotons
1720 TH1F *fSecondaryAntiProtonsITSClustersPass = new TH1F("fSecondaryAntiProtonsITSClustersPass",
1721 ";N_{clusters} (ITS);Entries",
1723 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsITSClustersPass);
1724 TH1F *fSecondaryAntiProtonsChi2PerClusterITSPass = new TH1F("fSecondaryAntiProtonsChi2PerClusterITSPass",
1725 ";x^{2}/N_{clusters} (ITS);Entries",
1727 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsChi2PerClusterITSPass);
1728 TH1F *fSecondaryAntiProtonsTPCClustersPass = new TH1F("fSecondaryAntiProtonsTPCClustersPass",
1729 ";N_{clusters} (TPC);Entries",
1731 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsTPCClustersPass);
1732 TH1F *fSecondaryAntiProtonsChi2PerClusterTPCPass = new TH1F("fSecondaryAntiProtonsChi2PerClusterTPCPass",
1733 ";x^{2}/N_{clusters} (TPC);Entries",
1735 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsChi2PerClusterTPCPass);
1736 TH1F *fSecondaryAntiProtonsExtCov11Pass = new TH1F("fSecondaryAntiProtonsExtCov11Pass",
1737 ";#sigma_{y} [cm];Entries",
1739 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov11Pass);
1740 TH1F *fSecondaryAntiProtonsExtCov22Pass = new TH1F("fSecondaryAntiProtonsExtCov22Pass",
1741 ";#sigma_{z} [cm];Entries",
1743 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov22Pass);
1744 TH1F *fSecondaryAntiProtonsExtCov33Pass = new TH1F("fSecondaryAntiProtonsExtCov33Pass",
1745 ";#sigma_{sin(#phi)};Entries",
1747 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov33Pass);
1748 TH1F *fSecondaryAntiProtonsExtCov44Pass = new TH1F("fSecondaryAntiProtonsExtCov44Pass",
1749 ";#sigma_{tan(#lambda)};Entries",
1751 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov44Pass);
1752 TH1F *fSecondaryAntiProtonsExtCov55Pass = new TH1F("fSecondaryAntiProtonsExtCov55Pass",
1753 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1755 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov55Pass);
1756 TH1F *fSecondaryAntiProtonsSigmaToVertexPass = new TH1F("fSecondaryAntiProtonsSigmaToVertexPass",
1757 ";#sigma_{Vertex};Entries",
1759 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsSigmaToVertexPass);
1760 TH1F *fSecondaryAntiProtonsSigmaToVertexTPCPass = new TH1F("fSecondaryAntiProtonsSigmaToVertexTPCPass",
1761 ";#sigma_{Vertex};Entries",
1763 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsSigmaToVertexTPCPass);
1764 TH1F *fSecondaryAntiProtonsITSRefitPass = new TH1F("fSecondaryAntiProtonsITSRefitPass",
1766 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsITSRefitPass);
1767 TH1F *fSecondaryAntiProtonsTPCRefitPass = new TH1F("fSecondaryAntiProtonsTPCRefitPass",
1769 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsTPCRefitPass);
1770 TH1F *fSecondaryAntiProtonsESDpidPass = new TH1F("fSecondaryAntiProtonsESDpidPass",
1772 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsESDpidPass);
1773 TH1F *fSecondaryAntiProtonsTPCpidPass = new TH1F("fSecondaryAntiProtonsTPCpidPass",
1775 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsTPCpidPass);
1777 //Rejected secondary antiprotons
1778 gDirectory->cd("../");
1779 TDirectory *dirAntiProtonsSecondaryRejected = gDirectory->mkdir("Rejected");
1780 dirAntiProtonsSecondaryRejected->cd();
1782 TH1F *fSecondaryAntiProtonsITSClustersReject = new TH1F("fSecondaryAntiProtonsITSClustersReject",
1783 ";N_{clusters} (ITS);Entries",
1785 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsITSClustersReject);
1786 TH1F *fSecondaryAntiProtonsChi2PerClusterITSReject = new TH1F("fSecondaryAntiProtonsChi2PerClusterITSReject",
1787 ";x^{2}/N_{clusters} (ITS);Entries",
1789 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsChi2PerClusterITSReject);
1790 TH1F *fSecondaryAntiProtonsTPCClustersReject = new TH1F("fSecondaryAntiProtonsTPCClustersReject",
1791 ";N_{clusters} (TPC);Entries",
1793 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsTPCClustersReject);
1794 TH1F *fSecondaryAntiProtonsChi2PerClusterTPCReject = new TH1F("fSecondaryAntiProtonsChi2PerClusterTPCReject",
1795 ";x^{2}/N_{clusters} (TPC);Entries",
1797 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsChi2PerClusterTPCReject);
1798 TH1F *fSecondaryAntiProtonsExtCov11Reject = new TH1F("fSecondaryAntiProtonsExtCov11Reject",
1799 ";#sigma_{y} [cm];Entries",
1801 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov11Reject);
1802 TH1F *fSecondaryAntiProtonsExtCov22Reject = new TH1F("fSecondaryAntiProtonsExtCov22Reject",
1803 ";#sigma_{z} [cm];Entries",
1805 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov22Reject);
1806 TH1F *fSecondaryAntiProtonsExtCov33Reject = new TH1F("fSecondaryAntiProtonsExtCov33Reject",
1807 ";#sigma_{sin(#phi)};Entries",
1809 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov33Reject);
1810 TH1F *fSecondaryAntiProtonsExtCov44Reject = new TH1F("fSecondaryAntiProtonsExtCov44Reject",
1811 ";#sigma_{tan(#lambda)};Entries",
1813 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov44Reject);
1814 TH1F *fSecondaryAntiProtonsExtCov55Reject = new TH1F("fSecondaryAntiProtonsExtCov55Reject",
1815 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1817 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov55Reject);
1818 TH1F *fSecondaryAntiProtonsSigmaToVertexReject = new TH1F("fSecondaryAntiProtonsSigmaToVertexReject",
1819 ";#sigma_{Vertex};Entries",
1821 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsSigmaToVertexReject);
1822 TH1F *fSecondaryAntiProtonsSigmaToVertexTPCReject = new TH1F("fSecondaryAntiProtonsSigmaToVertexTPCReject",
1823 ";#sigma_{Vertex};Entries",
1825 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsSigmaToVertexTPCReject);
1826 TH1F *fSecondaryAntiProtonsITSRefitReject = new TH1F("fSecondaryAntiProtonsITSRefitReject",
1828 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsITSRefitReject);
1829 TH1F *fSecondaryAntiProtonsTPCRefitReject = new TH1F("fSecondaryAntiProtonsTPCRefitReject",
1831 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsTPCRefitReject);
1832 TH1F *fSecondaryAntiProtonsESDpidReject = new TH1F("fSecondaryAntiProtonsESDpidReject",
1834 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsESDpidReject);
1835 TH1F *fSecondaryAntiProtonsTPCpidReject = new TH1F("fSecondaryAntiProtonsTPCpidReject",
1837 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsTPCpidReject);
1841 //____________________________________________________________________//
1842 void AliProtonAnalysis::RunQA(AliStack *stack, AliESDEvent *fESD) {
1844 Int_t nGoodTracks = fESD->GetNumberOfTracks();
1845 for(Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
1846 AliESDtrack* track = fESD->GetTrack(iTracks);
1847 Int_t label = TMath::Abs(track->GetLabel());
1848 Double_t Pt = 0.0, P = 0.0;
1849 Double_t probability[5];
1852 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
1853 if(!tpcTrack) continue;
1854 Pt = tpcTrack->Pt();
1858 track->GetTPCpid(probability);
1860 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
1861 rcc += probability[i]*GetParticleFraction(i,P);
1862 if(rcc == 0.0) continue;
1864 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
1865 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
1866 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
1867 if(fParticleType == 4) {
1868 if(IsAccepted(track, stack)) {
1869 if(label <= stack->GetNprimary()) {
1870 if(track->Charge() > 0)
1871 ((TH2F *)(fQA2DList->At(0)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1872 else if(track->Charge() < 0)
1873 ((TH2F *)(fQA2DList->At(1)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1874 }//primary particles
1875 else if(label > stack->GetNprimary()) {
1876 if(track->Charge() > 0)
1877 ((TH2F *)(fQA2DList->At(2)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1878 else if(track->Charge() < 0)
1879 ((TH2F *)(fQA2DList->At(3)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1880 }//secondary particles
1884 else if(!fUseTPCOnly) {
1889 track->GetESDpid(probability);
1891 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
1892 rcc += probability[i]*GetParticleFraction(i,P);
1893 if(rcc == 0.0) continue;
1895 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
1896 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
1897 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
1898 if(fParticleType == 4) {
1899 if(IsAccepted(track, stack)) {
1900 if(label <= stack->GetNprimary()) {
1901 if(track->Charge() > 0)
1902 ((TH2F *)(fQA2DList->At(0)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1903 else if(track->Charge() < 0)
1904 ((TH2F *)(fQA2DList->At(1)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1905 }//primary particles
1906 else if(label > stack->GetNprimary()) {
1907 if(track->Charge() > 0)
1908 ((TH2F *)(fQA2DList->At(2)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1909 else if(track->Charge() < 0)
1910 ((TH2F *)(fQA2DList->At(3)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1911 }//secondary particles
1914 }//combined tracking