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 fCorrectionListProtons2D(0), fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
74 fCorrectionListAntiProtons2D(0), fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0) {
76 for(Int_t i = 0; i < 5; i++) fPartFrac[i] = 0.0;
79 //____________________________________________________________________//
80 AliProtonAnalysis::AliProtonAnalysis(Int_t nbinsY, Float_t fLowY, Float_t fHighY,Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt) :
82 fNBinsY(nbinsY), fMinY(fLowY), fMaxY(fHighY),
83 fNBinsPt(nbinsPt), fMinPt(fLowPt), fMaxPt(fHighPt),
84 fMinTPCClusters(0), fMinITSClusters(0),
85 fMaxChi2PerTPCCluster(0), fMaxChi2PerITSCluster(0),
86 fMaxCov11(0), fMaxCov22(0), fMaxCov33(0), fMaxCov44(0), fMaxCov55(0),
87 fMaxSigmaToVertex(0), fMaxSigmaToVertexTPC(0),
88 fMinTPCClustersFlag(kFALSE), fMinITSClustersFlag(kFALSE),
89 fMaxChi2PerTPCClusterFlag(kFALSE), fMaxChi2PerITSClusterFlag(kFALSE),
90 fMaxCov11Flag(kFALSE), fMaxCov22Flag(kFALSE), fMaxCov33Flag(kFALSE), fMaxCov44Flag(kFALSE), fMaxCov55Flag(kFALSE),
91 fMaxSigmaToVertexFlag(kFALSE), fMaxSigmaToVertexTPCFlag(kFALSE),
92 fITSRefitFlag(kFALSE), fTPCRefitFlag(kFALSE),
93 fESDpidFlag(kFALSE), fTPCpidFlag(kFALSE),
94 fQAHistograms(kFALSE),
95 fGlobalQAList(0), fQA2DList(0),
96 fQAPrimaryProtonsAcceptedList(0),
97 fQAPrimaryProtonsRejectedList(0),
98 fQASecondaryProtonsAcceptedList(0),
99 fQASecondaryProtonsRejectedList(0),
100 fQAPrimaryAntiProtonsAcceptedList(0),
101 fQAPrimaryAntiProtonsRejectedList(0),
102 fQASecondaryAntiProtonsAcceptedList(0),
103 fQASecondaryAntiProtonsRejectedList(0),
104 fFunctionProbabilityFlag(kFALSE),
105 fElectronFunction(0), fMuonFunction(0),
106 fPionFunction(0), fKaonFunction(0), fProtonFunction(0),
107 fUseTPCOnly(kFALSE), fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
108 fCorrectionListProtons2D(0), fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
109 fCorrectionListAntiProtons2D(0), fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0) {
110 //Default constructor
112 fHistEvents = new TH1I("fHistEvents","Analyzed events",1,0,1);
114 fHistYPtProtons = new TH2F("fHistYPtProtons","y-Pt Protons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
115 fHistYPtProtons->SetStats(kTRUE);
116 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
117 fHistYPtProtons->GetXaxis()->SetTitle("y");
118 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
120 fHistYPtAntiProtons = new TH2F("fHistYPtAntiProtons","y-Pt Antiprotons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
121 fHistYPtAntiProtons->SetStats(kTRUE);
122 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
123 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
124 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
127 //____________________________________________________________________//
128 AliProtonAnalysis::~AliProtonAnalysis() {
130 if(fHistEvents) delete fHistEvents;
131 if(fHistYPtProtons) delete fHistYPtProtons;
132 if(fHistYPtAntiProtons) delete fHistYPtAntiProtons;
133 if(fGlobalQAList) delete fGlobalQAList;
134 if(fQA2DList) delete fQA2DList;
135 if(fQAPrimaryProtonsAcceptedList) delete fQAPrimaryProtonsAcceptedList;
136 if(fQAPrimaryProtonsRejectedList) delete fQAPrimaryProtonsRejectedList;
137 if(fQASecondaryProtonsAcceptedList) delete fQASecondaryProtonsAcceptedList;
138 if(fQASecondaryProtonsRejectedList) delete fQASecondaryProtonsRejectedList;
139 if(fQAPrimaryAntiProtonsAcceptedList) delete fQAPrimaryAntiProtonsAcceptedList;
140 if(fQAPrimaryAntiProtonsRejectedList) delete fQAPrimaryAntiProtonsRejectedList;
141 if(fQASecondaryAntiProtonsAcceptedList) delete fQASecondaryAntiProtonsAcceptedList;
142 if(fQASecondaryAntiProtonsRejectedList) delete fQASecondaryAntiProtonsRejectedList;
143 if(fCorrectionListProtons2D) delete fCorrectionListProtons2D;
144 if(fEfficiencyListProtons1D) delete fEfficiencyListProtons1D;
145 if(fCorrectionListProtons1D) delete fCorrectionListProtons1D;
146 if(fCorrectionListAntiProtons2D) delete fCorrectionListAntiProtons2D;
147 if(fEfficiencyListAntiProtons1D) delete fEfficiencyListAntiProtons1D;
148 if(fCorrectionListAntiProtons1D) delete fCorrectionListAntiProtons1D;
151 //____________________________________________________________________//
152 void AliProtonAnalysis::InitAnalysisHistograms(Int_t nbinsY, Float_t fLowY, Float_t fHighY,
153 Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt) {
161 fHistEvents = new TH1I("fHistEvents","Anallyzed events",1,0,1);
163 fHistYPtProtons = new TH2F("fHistYPtProtons","y-Pt Protons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
164 fHistYPtProtons->SetStats(kTRUE);
165 fHistYPtProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
166 fHistYPtProtons->GetXaxis()->SetTitle("y");
167 fHistYPtProtons->GetXaxis()->SetTitleColor(1);
169 fHistYPtAntiProtons = new TH2F("fHistYPtAntiProtons","y-Pt Antiprotons",fNBinsY,fMinY,fMaxY,fNBinsPt,fMinPt,fMaxPt);
170 fHistYPtAntiProtons->SetStats(kTRUE);
171 fHistYPtAntiProtons->GetYaxis()->SetTitle("P_{T} [GeV]");
172 fHistYPtAntiProtons->GetXaxis()->SetTitle("y");
173 fHistYPtAntiProtons->GetXaxis()->SetTitleColor(1);
176 //____________________________________________________________________//
177 Bool_t AliProtonAnalysis::ReadFromFile(const char* filename) {
178 Bool_t status = kTRUE;
180 TFile *file = TFile::Open(filename);
182 cout<<"Could not find the input file "<<filename<<endl;
186 TList *list = (TList *)file->Get("outputList1");
188 cout<<"Retrieving objects from the list "<<list->GetName()<<"..."<<endl;
189 fHistYPtProtons = (TH2F *)list->At(0);
190 fHistYPtAntiProtons = (TH2F *)list->At(1);
191 fHistEvents = (TH1I *)list->At(2);
194 cout<<"Retrieving objects from the file... "<<endl;
195 fHistYPtProtons = (TH2F *)file->Get("fHistYPtProtons");
196 fHistYPtAntiProtons = (TH2F *)file->Get("fHistYPtAntiProtons");
197 fHistEvents = (TH1I *)file->Get("fHistEvents");
199 if((!fHistYPtProtons)||(!fHistYPtAntiProtons)||(!fHistEvents)) {
200 cout<<"Input containers were not found!!!"<<endl;
204 fHistYPtProtons->Sumw2();
205 fHistYPtAntiProtons->Sumw2();
211 //____________________________________________________________________//
212 TH1D *AliProtonAnalysis::GetProtonYHistogram() {
213 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
214 TH1D *fYProtons = (TH1D *)fHistYPtProtons->ProjectionX("fYProtons",0,fHistYPtProtons->GetYaxis()->GetNbins(),"e");
215 fYProtons->SetStats(kFALSE);
216 fYProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
217 fYProtons->SetTitle("dN/dy protons");
218 fYProtons->SetMarkerStyle(kFullCircle);
219 fYProtons->SetMarkerColor(4);
220 if(nAnalyzedEvents > 0)
221 fYProtons->Scale(1./nAnalyzedEvents);
226 //____________________________________________________________________//
227 TH1D *AliProtonAnalysis::GetAntiProtonYHistogram() {
228 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
229 TH1D *fYAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionX("fYAntiProtons",0,fHistYPtAntiProtons->GetYaxis()->GetNbins(),"e");
230 fYAntiProtons->SetStats(kFALSE);
231 fYAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
232 fYAntiProtons->SetTitle("dN/dy antiprotons");
233 fYAntiProtons->SetMarkerStyle(kFullCircle);
234 fYAntiProtons->SetMarkerColor(4);
235 if(nAnalyzedEvents > 0)
236 fYAntiProtons->Scale(1./nAnalyzedEvents);
238 return fYAntiProtons;
241 //____________________________________________________________________//
242 TH1D *AliProtonAnalysis::GetProtonPtHistogram() {
243 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
244 TH1D *fPtProtons = (TH1D *)fHistYPtProtons->ProjectionY("fPtProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"e");
245 fPtProtons->SetStats(kFALSE);
246 fPtProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
247 fPtProtons->SetTitle("dN/dPt protons");
248 fPtProtons->SetMarkerStyle(kFullCircle);
249 fPtProtons->SetMarkerColor(4);
250 if(nAnalyzedEvents > 0)
251 fPtProtons->Scale(1./nAnalyzedEvents);
256 //____________________________________________________________________//
257 TH1D *AliProtonAnalysis::GetAntiProtonPtHistogram() {
258 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
259 TH1D *fPtAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionY("fPtAntiProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"e");
260 fPtAntiProtons->SetStats(kFALSE);
261 fPtAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
262 fPtAntiProtons->SetTitle("dN/dPt antiprotons");
263 fPtAntiProtons->SetMarkerStyle(kFullCircle);
264 fPtAntiProtons->SetMarkerColor(4);
265 if(nAnalyzedEvents > 0)
266 fPtAntiProtons->Scale(1./nAnalyzedEvents);
268 return fPtAntiProtons;
271 //____________________________________________________________________//
272 TH1D *AliProtonAnalysis::GetYRatioHistogram() {
273 TH1D *fYProtons = GetProtonYHistogram();
274 TH1D *fYAntiProtons = GetAntiProtonYHistogram();
276 TH1D *hRatioY = new TH1D("hRatioY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
277 hRatioY->Divide(fYAntiProtons,fYProtons,1.0,1.0);
278 hRatioY->SetMarkerStyle(kFullCircle);
279 hRatioY->SetMarkerColor(4);
280 hRatioY->GetYaxis()->SetTitle("#bar{p}/p");
281 hRatioY->GetYaxis()->SetTitleOffset(1.4);
282 hRatioY->GetXaxis()->SetTitle("y");
283 hRatioY->GetXaxis()->SetTitleColor(1);
284 hRatioY->SetStats(kFALSE);
289 //____________________________________________________________________//
290 TH1D *AliProtonAnalysis::GetPtRatioHistogram() {
291 TH1D *fPtProtons = GetProtonPtHistogram();
292 TH1D *fPtAntiProtons = GetAntiProtonPtHistogram();
294 TH1D *hRatioPt = new TH1D("hRatioPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
295 hRatioPt->Divide(fPtAntiProtons,fPtProtons,1.0,1.0);
296 hRatioPt->SetMarkerStyle(kFullCircle);
297 hRatioPt->SetMarkerColor(4);
298 hRatioPt->GetYaxis()->SetTitle("#bar{p}/p");
299 hRatioPt->GetYaxis()->SetTitleOffset(1.4);
300 hRatioPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
301 hRatioPt->GetXaxis()->SetTitleColor(1);
302 hRatioPt->SetStats(kFALSE);
307 //____________________________________________________________________//
308 TH1D *AliProtonAnalysis::GetYAsymmetryHistogram() {
309 TH1D *fYProtons = GetProtonYHistogram();
310 TH1D *fYAntiProtons = GetAntiProtonYHistogram();
312 TH1D *hsum = new TH1D("hsumY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
313 hsum->Add(fYProtons,fYAntiProtons,1.0,1.0);
315 TH1D *hdiff = new TH1D("hdiffY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
316 hdiff->Add(fYProtons,fYAntiProtons,1.0,-1.0);
318 TH1D *hAsymmetryY = new TH1D("hAsymmetryY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
319 hAsymmetryY->Divide(hdiff,hsum,2.0,1.);
320 hAsymmetryY->SetMarkerStyle(kFullCircle);
321 hAsymmetryY->SetMarkerColor(4);
322 hAsymmetryY->GetYaxis()->SetTitle("A_{p}");
323 hAsymmetryY->GetYaxis()->SetTitleOffset(1.4);
324 hAsymmetryY->GetXaxis()->SetTitle("y");
325 hAsymmetryY->GetXaxis()->SetTitleColor(1);
326 hAsymmetryY->SetStats(kFALSE);
331 //____________________________________________________________________//
332 TH1D *AliProtonAnalysis::GetPtAsymmetryHistogram() {
333 TH1D *fPtProtons = GetProtonPtHistogram();
334 TH1D *fPtAntiProtons = GetAntiProtonPtHistogram();
336 TH1D *hsum = new TH1D("hsumPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
337 hsum->Add(fPtProtons,fPtAntiProtons,1.0,1.0);
339 TH1D *hdiff = new TH1D("hdiffPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
340 hdiff->Add(fPtProtons,fPtAntiProtons,1.0,-1.0);
342 TH1D *hAsymmetryPt = new TH1D("hAsymmetryPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
343 hAsymmetryPt->Divide(hdiff,hsum,2.0,1.);
344 hAsymmetryPt->SetMarkerStyle(kFullCircle);
345 hAsymmetryPt->SetMarkerColor(4);
346 hAsymmetryPt->GetYaxis()->SetTitle("A_{p}");
347 hAsymmetryPt->GetYaxis()->SetTitleOffset(1.4);
348 hAsymmetryPt->GetXaxis()->SetTitle("P_{T} [GeV/c]");
349 hAsymmetryPt->GetXaxis()->SetTitleColor(1);
350 hAsymmetryPt->SetStats(kFALSE);
355 //____________________________________________________________________//
356 Double_t AliProtonAnalysis::GetParticleFraction(Int_t i, Double_t p) {
358 if(fFunctionProbabilityFlag) {
359 if(i == 0) partFrac = fElectronFunction->Eval(p);
360 if(i == 1) partFrac = fMuonFunction->Eval(p);
361 if(i == 2) partFrac = fPionFunction->Eval(p);
362 if(i == 3) partFrac = fKaonFunction->Eval(p);
363 if(i == 4) partFrac = fProtonFunction->Eval(p);
365 else partFrac = fPartFrac[i];
370 //____________________________________________________________________//
371 void AliProtonAnalysis::Analyze(AliESDEvent* fESD) {
372 //Main analysis part - ESD
373 fHistEvents->Fill(0); //number of analyzed events
374 Double_t Pt = 0.0, P = 0.0;
375 Int_t nGoodTracks = fESD->GetNumberOfTracks();
376 for(Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
377 AliESDtrack* track = fESD->GetTrack(iTracks);
378 Double_t probability[5];
380 if(IsAccepted(track)) {
382 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
383 if(!tpcTrack) continue;
388 track->GetTPCpid(probability);
390 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
391 rcc += probability[i]*GetParticleFraction(i,P);
392 if(rcc == 0.0) continue;
394 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
395 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
396 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
397 if(fParticleType == 4) {
398 if(tpcTrack->Charge() > 0)
399 fHistYPtProtons->Fill(Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),Pt);
400 else if(tpcTrack->Charge() < 0)
401 fHistYPtAntiProtons->Fill(Rapidity(tpcTrack->Px(),tpcTrack->Py(),tpcTrack->Pz()),Pt);
404 else if(!fUseTPCOnly) {
409 track->GetESDpid(probability);
411 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
412 rcc += probability[i]*GetParticleFraction(i,P);
413 if(rcc == 0.0) continue;
415 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
416 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
417 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
418 if(fParticleType == 4) {
419 //cout<<"(Anti)protons found..."<<endl;
420 if(track->Charge() > 0)
421 fHistYPtProtons->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
422 else if(track->Charge() < 0)
423 fHistYPtAntiProtons->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
430 //____________________________________________________________________//
431 void AliProtonAnalysis::Analyze(AliAODEvent* fAOD) {
432 //Main analysis part - AOD
433 fHistEvents->Fill(0); //number of analyzed events
434 Int_t nGoodTracks = fAOD->GetNumberOfTracks();
435 for(Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
436 AliAODTrack* track = fAOD->GetTrack(iTracks);
437 Double_t Pt = track->Pt();
438 Double_t P = track->P();
441 Double_t probability[10];
442 track->GetPID(probability);
444 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) rcc += probability[i]*GetParticleFraction(i,P);
445 if(rcc == 0.0) continue;
447 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
448 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIESN,w);
449 if(fParticleType == 4) {
450 if(track->Charge() > 0) fHistYPtProtons->Fill(track->Y(fParticleType),Pt);
451 else if(track->Charge() < 0) fHistYPtAntiProtons->Fill(track->Y(fParticleType),Pt);
456 //____________________________________________________________________//
457 void AliProtonAnalysis::Analyze(AliStack* stack) {
458 //Main analysis part - MC
459 fHistEvents->Fill(0); //number of analyzed events
460 for(Int_t i = 0; i < stack->GetNprimary(); i++) {
461 TParticle *particle = stack->Particle(i);
462 if(particle->Pt() < 0.1) continue;
463 if(TMath::Abs(particle->Eta()) > 1.0) continue;
464 Int_t pdgcode = particle->GetPdgCode();
465 if(pdgcode == 2212) fHistYPtProtons->Fill(Rapidity(particle->Px(),
469 if(pdgcode == -2212) fHistYPtAntiProtons->Fill(Rapidity(particle->Px(),
476 //____________________________________________________________________//
477 Bool_t AliProtonAnalysis::IsAccepted(AliESDtrack* track) {
478 // Checks if the track is excluded from the cuts
479 Double_t Pt = 0.0, Px = 0.0, Py = 0.0, Pz = 0.0;
481 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
483 Pt = 0.0; Px = 0.0; Py = 0.0; Pz = 0.0;
500 Int_t nClustersITS = track->GetITSclusters(fIdxInt);
501 Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
503 Float_t chi2PerClusterITS = -1;
505 chi2PerClusterITS = track->GetITSchi2()/Float_t(nClustersITS);
506 Float_t chi2PerClusterTPC = -1;
508 chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);
511 track->GetExternalCovariance(extCov);
513 if(fMinITSClustersFlag)
514 if(nClustersITS < fMinITSClusters) return kFALSE;
515 if(fMaxChi2PerITSClusterFlag)
516 if(chi2PerClusterITS > fMaxChi2PerITSCluster) return kFALSE;
517 if(fMinTPCClustersFlag)
518 if(nClustersTPC < fMinTPCClusters) return kFALSE;
519 if(fMaxChi2PerTPCClusterFlag)
520 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) return kFALSE;
522 if(extCov[0] > fMaxCov11) return kFALSE;
524 if(extCov[2] > fMaxCov22) return kFALSE;
526 if(extCov[5] > fMaxCov33) return kFALSE;
528 if(extCov[9] > fMaxCov44) return kFALSE;
530 if(extCov[14] > fMaxCov55) return kFALSE;
531 if(fMaxSigmaToVertexFlag)
532 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) return kFALSE;
533 if(fMaxSigmaToVertexTPCFlag)
534 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) return kFALSE;
536 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
538 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
540 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) return kFALSE;
542 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) return kFALSE;
544 if((Pt < fMinPt) || (Pt > fMaxPt)) return kFALSE;
545 if((Rapidity(Px,Py,Pz) < fMinY) || (Rapidity(Px,Py,Pz) > fMaxY)) return kFALSE;
550 //____________________________________________________________________//
551 Bool_t AliProtonAnalysis::IsAccepted(AliESDtrack* track, AliStack *stack) {
552 // Checks if the track is excluded from the cuts
553 Bool_t status = kTRUE;
554 Int_t nPrimaries = stack->GetNprimary();
555 Int_t label = TMath::Abs(track->GetLabel());
557 Double_t Pt = 0.0, Px = 0.0, Py = 0.0, Pz = 0.0;
559 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
561 Pt = 0.0; Px = 0.0; Py = 0.0; Pz = 0.0;
578 Int_t nClustersITS = track->GetITSclusters(fIdxInt);
579 Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
581 Float_t chi2PerClusterITS = -1;
583 chi2PerClusterITS = track->GetITSchi2()/Float_t(nClustersITS);
584 Float_t chi2PerClusterTPC = -1;
586 chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);
589 track->GetExternalCovariance(extCov);
592 if(track->Charge() > 0) {
594 if(label <= nPrimaries) {
595 if(fMinITSClustersFlag) {
596 if(nClustersITS < fMinITSClusters) {
597 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
600 else if(nClustersITS >= fMinITSClusters)
601 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
603 if(fMaxChi2PerITSClusterFlag) {
604 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
605 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
608 else if(chi2PerClusterITS <= fMaxChi2PerITSCluster)
609 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
610 }//chi2 per ITS cluster
611 if(fMinTPCClustersFlag) {
612 if(nClustersTPC < fMinTPCClusters) {
613 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(2)))->Fill(nClustersTPC);
616 else if(nClustersTPC >= fMinTPCClusters)
617 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
619 if(fMaxChi2PerTPCClusterFlag) {
620 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
621 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
624 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
625 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
626 }//chi2 per TPC cluster
628 if(extCov[0] > fMaxCov11) {
629 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
632 else if(extCov[0] <= fMaxCov11)
633 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
636 if(extCov[2] > fMaxCov22) {
637 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
640 else if(extCov[2] <= fMaxCov22)
641 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
644 if(extCov[5] > fMaxCov33) {
645 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
648 else if(extCov[5] <= fMaxCov33)
649 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
652 if(extCov[9] > fMaxCov44) {
653 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
656 else if(extCov[9] <= fMaxCov44)
657 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
660 if(extCov[14] > fMaxCov55) {
661 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
664 else if(extCov[14] <= fMaxCov55)
665 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
667 if(fMaxSigmaToVertexFlag) {
668 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
669 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
672 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
673 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
675 if(fMaxSigmaToVertexTPCFlag) {
676 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
677 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
680 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
681 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
682 }//sigma to vertex TPC
684 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
685 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(11)))->Fill(0);
688 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
689 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(11)))->Fill(0);
692 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
693 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(12)))->Fill(0);
696 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
697 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(12)))->Fill(0);
700 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
701 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(13)))->Fill(0);
704 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
705 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(13)))->Fill(0);
708 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
709 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(13)))->Fill(0);
712 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
713 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(13)))->Fill(0);
715 }//primary particle cut
718 if(label > nPrimaries) {
719 if(fMinITSClustersFlag) {
720 if(nClustersITS < fMinITSClusters) {
721 ((TH1F *)(fQASecondaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
724 else if(nClustersITS >= fMinITSClusters)
725 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
727 if(fMaxChi2PerITSClusterFlag) {
728 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
729 ((TH1F *)(fQASecondaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
732 else if(chi2PerClusterITS <= fMaxChi2PerITSCluster)
733 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
734 }//chi2 per ITS cluster
735 if(fMinTPCClustersFlag) {
736 if(nClustersTPC < fMinTPCClusters) {
737 ((TH1F *)(fQASecondaryProtonsRejectedList->At(2)))->Fill(nClustersTPC);
740 else if(nClustersTPC >= fMinTPCClusters)
741 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
743 if(fMaxChi2PerTPCClusterFlag) {
744 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
745 ((TH1F *)(fQASecondaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
748 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
749 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
750 }//chi2 per TPC cluster
752 if(extCov[0] > fMaxCov11) {
753 ((TH1F *)(fQASecondaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
756 else if(extCov[0] <= fMaxCov11)
757 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
760 if(extCov[2] > fMaxCov22) {
761 ((TH1F *)(fQASecondaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
764 else if(extCov[2] <= fMaxCov22)
765 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
768 if(extCov[5] > fMaxCov33) {
769 ((TH1F *)(fQASecondaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
772 else if(extCov[5] <= fMaxCov33)
773 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
776 if(extCov[9] > fMaxCov44) {
777 ((TH1F *)(fQASecondaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
780 else if(extCov[9] <= fMaxCov44)
781 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
784 if(extCov[14] > fMaxCov55) {
785 ((TH1F *)(fQASecondaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
788 else if(extCov[14] <= fMaxCov55)
789 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
791 if(fMaxSigmaToVertexFlag) {
792 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
793 ((TH1F *)(fQASecondaryProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
796 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
797 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
799 if(fMaxSigmaToVertexTPCFlag) {
800 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
801 ((TH1F *)(fQASecondaryProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
804 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
805 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
806 }//sigma to vertex TPC
808 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
809 ((TH1F *)(fQASecondaryProtonsRejectedList->At(11)))->Fill(0);
812 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
813 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(11)))->Fill(0);
816 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
817 ((TH1F *)(fQASecondaryProtonsRejectedList->At(12)))->Fill(0);
820 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
821 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(12)))->Fill(0);
824 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
825 ((TH1F *)(fQASecondaryProtonsRejectedList->At(13)))->Fill(0);
828 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
829 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(13)))->Fill(0);
832 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
833 ((TH1F *)(fQASecondaryProtonsRejectedList->At(13)))->Fill(0);
836 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
837 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(13)))->Fill(0);
839 }//secondary particle cut
843 if(track->Charge() < 0) {
845 if(label <= nPrimaries) {
846 if(fMinITSClustersFlag) {
847 if(nClustersITS < fMinITSClusters) {
848 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(0)))->Fill(nClustersITS);
851 else if(nClustersITS >= fMinITSClusters)
852 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(0)))->Fill(nClustersITS);
854 if(fMaxChi2PerITSClusterFlag) {
855 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
856 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
859 else if(chi2PerClusterITS <= fMaxChi2PerITSCluster)
860 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
861 }//chi2 per ITS cluster
862 if(fMinTPCClustersFlag) {
863 if(nClustersTPC < fMinTPCClusters) {
864 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(2)))->Fill(nClustersTPC);
867 else if(nClustersTPC >= fMinTPCClusters)
868 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
870 if(fMaxChi2PerTPCClusterFlag) {
871 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
872 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
875 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
876 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
877 }//chi2 per TPC cluster
879 if(extCov[0] > fMaxCov11) {
880 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(4)))->Fill(extCov[0]);
883 else if(extCov[0] <= fMaxCov11)
884 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(4)))->Fill(extCov[0]);
887 if(extCov[2] > fMaxCov22) {
888 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(5)))->Fill(extCov[2]);
891 else if(extCov[2] <= fMaxCov22)
892 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(5)))->Fill(extCov[2]);
895 if(extCov[5] > fMaxCov33) {
896 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(6)))->Fill(extCov[5]);
899 else if(extCov[5] <= fMaxCov33)
900 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(6)))->Fill(extCov[5]);
903 if(extCov[9] > fMaxCov44) {
904 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(7)))->Fill(extCov[9]);
907 else if(extCov[9] <= fMaxCov44)
908 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(7)))->Fill(extCov[9]);
911 if(extCov[14] > fMaxCov55) {
912 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(8)))->Fill(extCov[14]);
915 else if(extCov[14] <= fMaxCov55)
916 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(8)))->Fill(extCov[14]);
918 if(fMaxSigmaToVertexFlag) {
919 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
920 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
923 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
924 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
926 if(fMaxSigmaToVertexTPCFlag) {
927 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
928 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
931 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
932 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
933 }//sigma to vertex TPC
935 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
936 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(11)))->Fill(0);
939 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
940 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(11)))->Fill(0);
943 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
944 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(12)))->Fill(0);
947 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
948 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(12)))->Fill(0);
951 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
952 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(13)))->Fill(0);
955 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
956 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(13)))->Fill(0);
959 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
960 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(13)))->Fill(0);
963 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
964 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(13)))->Fill(0);
966 }//primary particle cut
969 if(label > nPrimaries) {
970 if(fMinITSClustersFlag) {
971 if(nClustersITS < fMinITSClusters) {
972 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(0)))->Fill(nClustersITS);
975 else if(nClustersITS >= fMinITSClusters)
976 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(0)))->Fill(nClustersITS);
978 if(fMaxChi2PerITSClusterFlag) {
979 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
980 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
983 else if(chi2PerClusterITS <= fMaxChi2PerITSCluster)
984 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
985 }//chi2 per ITS cluster
986 if(fMinTPCClustersFlag) {
987 if(nClustersTPC < fMinTPCClusters) {
988 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(2)))->Fill(nClustersTPC);
991 else if(nClustersTPC >= fMinTPCClusters)
992 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
994 if(fMaxChi2PerTPCClusterFlag) {
995 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
996 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
999 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
1000 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
1001 }//chi2 per TPC cluster
1003 if(extCov[0] > fMaxCov11) {
1004 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(4)))->Fill(extCov[0]);
1007 else if(extCov[0] <= fMaxCov11)
1008 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(4)))->Fill(extCov[0]);
1011 if(extCov[2] > fMaxCov22) {
1012 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(5)))->Fill(extCov[2]);
1015 else if(extCov[2] <= fMaxCov22)
1016 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(5)))->Fill(extCov[2]);
1019 if(extCov[5] > fMaxCov33) {
1020 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(6)))->Fill(extCov[5]);
1023 else if(extCov[5] <= fMaxCov33)
1024 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(6)))->Fill(extCov[5]);
1027 if(extCov[9] > fMaxCov44) {
1028 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(7)))->Fill(extCov[9]);
1031 else if(extCov[9] <= fMaxCov44)
1032 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(7)))->Fill(extCov[9]);
1035 if(extCov[14] > fMaxCov55) {
1036 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(8)))->Fill(extCov[14]);
1039 else if(extCov[14] <= fMaxCov55)
1040 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(8)))->Fill(extCov[14]);
1042 if(fMaxSigmaToVertexFlag) {
1043 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
1044 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
1047 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
1048 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
1050 if(fMaxSigmaToVertexTPCFlag) {
1051 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
1052 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
1055 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
1056 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
1057 }//sigma to vertex TPC
1059 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
1060 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(11)))->Fill(0);
1063 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
1064 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(11)))->Fill(0);
1067 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
1068 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(12)))->Fill(0);
1071 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
1072 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(12)))->Fill(0);
1075 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
1076 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(13)))->Fill(0);
1079 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
1080 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(13)))->Fill(0);
1083 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
1084 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(13)))->Fill(0);
1087 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
1088 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(13)))->Fill(0);
1090 }//secondary particle cut
1093 if((Pt < fMinPt) || (Pt > fMaxPt)) status = kFALSE;
1094 if((Rapidity(Px,Py,Pz) < fMinY) || (Rapidity(Px,Py,Pz) > fMaxY)) status = kFALSE;
1099 //____________________________________________________________________//
1100 Float_t AliProtonAnalysis::GetSigmaToVertex(AliESDtrack* esdTrack) {
1101 // Calculates the number of sigma to the vertex.
1107 esdTrack->GetImpactParametersTPC(b,bCov);
1109 esdTrack->GetImpactParameters(b,bCov);
1111 if (bCov[0]<=0 || bCov[2]<=0) {
1112 //AliDebug(1, "Estimated b resolution lower or equal zero!");
1113 bCov[0]=0; bCov[2]=0;
1115 bRes[0] = TMath::Sqrt(bCov[0]);
1116 bRes[1] = TMath::Sqrt(bCov[2]);
1118 if (bRes[0] == 0 || bRes[1] ==0) return -1;
1120 Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2));
1122 if (TMath::Exp(-d * d / 2) < 1e-10) return 1000;
1124 d = TMath::ErfInverse(1 - TMath::Exp(-d * d / 2)) * TMath::Sqrt(2);
1129 //____________________________________________________________________//
1130 Double_t AliProtonAnalysis::Rapidity(Double_t Px, Double_t Py, Double_t Pz) {
1131 //returns the rapidity of the proton - to be removed
1132 Double_t fMass = 9.38270000000000048e-01;
1134 Double_t P = TMath::Sqrt(TMath::Power(Px,2) +
1135 TMath::Power(Py,2) +
1136 TMath::Power(Pz,2));
1137 Double_t energy = TMath::Sqrt(P*P + fMass*fMass);
1140 y = 0.5*TMath::Log((energy + Pz)/(energy - Pz));
1145 //____________________________________________________________________//
1146 Bool_t AliProtonAnalysis::PrintMean(TH1 *hist, Double_t edge) {
1147 //calculates the mean value of the ratio/asymmetry within \pm edge
1150 //calculate the mean
1151 for(Int_t i = 0; i < hist->GetXaxis()->GetNbins(); i++) {
1152 Double_t x = hist->GetBinCenter(i+1);
1153 Double_t y = hist->GetBinContent(i+1);
1154 if(TMath::Abs(x) < edge) {
1159 Double_t mean = 0.0;
1161 mean = sum/nentries;
1163 //calculate the error
1164 for(Int_t i = 0; i < hist->GetXaxis()->GetNbins(); i++) {
1165 Double_t x = hist->GetBinCenter(i+1);
1166 Double_t y = hist->GetBinContent(i+1);
1167 if(TMath::Abs(x) < edge) {
1168 sum += TMath::Power((mean - y),2);
1173 Double_t error = 0.0;
1175 error = TMath::Sqrt(sum)/nentries;
1177 cout<<"========================================="<<endl;
1178 cout<<"Input distribution: "<<hist->GetName()<<endl;
1179 cout<<"Interval used: -"<<edge<<" -> "<<edge<<endl;
1180 cout<<"Mean value :"<<mean<<endl;
1181 cout<<"Error: "<<error<<endl;
1182 cout<<"========================================="<<endl;
1187 //____________________________________________________________________//
1188 Bool_t AliProtonAnalysis::PrintYields(TH1 *hist, Double_t edge) {
1189 //calculates the (anti)proton yields within the \pm edge
1190 Double_t sum = 0.0, sumerror = 0.0;
1191 Double_t error = 0.0;
1192 for(Int_t i = 0; i < hist->GetXaxis()->GetNbins(); i++) {
1193 Double_t x = hist->GetBinCenter(i+1);
1194 Double_t y = hist->GetBinContent(i+1);
1195 if(TMath::Abs(x) < edge) {
1197 sumerror += TMath::Power(hist->GetBinError(i+1),2);
1201 error = TMath::Sqrt(sumerror);
1203 cout<<"========================================="<<endl;
1204 cout<<"Input distribution: "<<hist->GetName()<<endl;
1205 cout<<"Interval used: -"<<edge<<" -> "<<edge<<endl;
1206 cout<<"Yields :"<<sum<<endl;
1207 cout<<"Error: "<<error<<endl;
1208 cout<<"========================================="<<endl;
1213 //____________________________________________________________________//
1214 Bool_t AliProtonAnalysis::ReadCorrectionContainer(const char* filename) {
1215 // Reads the outout of the correction framework task
1216 // Creates the correction maps
1217 // Puts the results in the different TList objects
1218 Bool_t status = kTRUE;
1220 TFile *file = TFile::Open(filename);
1222 cout<<"Could not find the input CORRFW file "<<filename<<endl;
1226 //________________________________________//
1228 fCorrectionListProtons2D = new TList();
1229 fEfficiencyListProtons1D = new TList();
1230 fCorrectionListProtons1D = new TList();
1232 AliCFContainer *corrfwContainerProtons = (AliCFContainer*) (file->Get("containerProtons"));
1233 if(!corrfwContainerProtons) {
1234 cout<<"CORRFW container for protons not found!"<<endl;
1238 Int_t nSteps = corrfwContainerProtons->GetNStep();
1240 //currently the GRID is formed by the y-pT parameters
1241 //Add Vz as a next step
1242 Int_t iRap = 0, iPt = 1;
1243 for(Int_t iStep = 0; iStep < nSteps; iStep++) {
1244 gYPt[iStep] = corrfwContainerProtons->ShowProjection(iRap,iPt,iStep);
1245 //fCorrectionList2D->Add(gYPt[iStep]);
1248 //construct the efficiency grid from the data container
1250 AliCFEffGrid *efficiency[3]; //The efficiency array has nStep-1 entries!!!
1251 TH1D *gEfficiency[2][3]; //efficiency as a function of pT and of y (raws - [2])
1252 TH1D *gCorrection[2][3]; //efficiency as a function of pT and of y (raws - [2])
1254 //Get the 2D efficiency maps
1255 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1256 gTitle = "EfficiencyProtons_Step0_Step"; gTitle += iStep;
1257 efficiency[iStep] = new AliCFEffGrid(gTitle.Data(),
1258 gTitle.Data(),*corrfwContainerProtons);
1259 efficiency[iStep]->CalculateEfficiency(iStep,0); //eff= step[i]/step0
1260 fCorrectionListProtons2D->Add(efficiency[iStep]);
1262 //Get the projection of the efficiency maps
1263 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1264 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1265 gEfficiency[iParameter][iStep-1] = efficiency[iStep]->Project(iParameter);
1266 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][iStep-1]);
1267 gTitle = "ProtonsCorrection_Parameter"; gTitle += iParameter+1;
1268 gTitle += "_Step0_Step"; gTitle += iStep;
1269 gCorrection[iParameter][iStep-1] = new TH1D(gTitle.Data(),
1271 gEfficiency[iParameter][iStep-1]->GetNbinsX(),
1272 gEfficiency[iParameter][iStep-1]->GetXaxis()->GetXmin(),
1273 gEfficiency[iParameter][iStep-1]->GetXaxis()->GetXmax());
1274 //initialisation of the correction
1275 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][iStep-1]->GetNbinsX(); iBin++)
1276 gCorrection[iParameter][iStep-1]->SetBinContent(iBin,1.0);
1279 //Calculate the 1D correction parameters as a function of y and pT
1280 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1281 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1282 gCorrection[iParameter][iStep-1]->Divide(gEfficiency[iParameter][iStep-1]);
1283 fCorrectionListProtons1D->Add(gCorrection[iParameter][iStep-1]);
1287 //________________________________________//
1289 fCorrectionListAntiProtons2D = new TList();
1290 fEfficiencyListAntiProtons1D = new TList();
1291 fCorrectionListAntiProtons1D = new TList();
1293 AliCFContainer *corrfwContainerAntiProtons = (AliCFContainer*) (file->Get("containerAntiProtons"));
1294 if(!corrfwContainerAntiProtons) {
1295 cout<<"CORRFW container for antiprotons not found!"<<endl;
1299 nSteps = corrfwContainerAntiProtons->GetNStep();
1300 //currently the GRID is formed by the y-pT parameters
1301 //Add Vz as a next step
1303 for(Int_t iStep = 0; iStep < nSteps; iStep++) {
1304 gYPt[iStep] = corrfwContainerAntiProtons->ShowProjection(iRap,iPt,iStep);
1307 //Get the 2D efficiency maps
1308 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1309 gTitle = "EfficiencyAntiProtons_Step0_Step"; gTitle += iStep;
1310 efficiency[iStep] = new AliCFEffGrid(gTitle.Data(),
1311 gTitle.Data(),*corrfwContainerAntiProtons);
1312 efficiency[iStep]->CalculateEfficiency(iStep,0); //eff= step[i]/step0
1313 fCorrectionListAntiProtons2D->Add(efficiency[iStep]);
1315 //Get the projection of the efficiency maps
1316 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1317 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1318 gEfficiency[iParameter][iStep-1] = efficiency[iStep]->Project(iParameter);
1319 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][iStep-1]);
1320 gTitle = "AntiProtonsCorrection_Parameter"; gTitle += iParameter+1;
1321 gTitle += "_Step0_Step"; gTitle += iStep;
1322 gCorrection[iParameter][iStep-1] = new TH1D(gTitle.Data(),
1324 gEfficiency[iParameter][iStep-1]->GetNbinsX(),
1325 gEfficiency[iParameter][iStep-1]->GetXaxis()->GetXmin(),
1326 gEfficiency[iParameter][iStep-1]->GetXaxis()->GetXmax());
1327 //initialisation of the correction
1328 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][iStep-1]->GetNbinsX(); iBin++)
1329 gCorrection[iParameter][iStep-1]->SetBinContent(iBin,1.0);
1332 //Calculate the 1D correction parameters as a function of y and pT
1333 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1334 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1335 gCorrection[iParameter][iStep-1]->Divide(gEfficiency[iParameter][iStep-1]);
1336 fCorrectionListAntiProtons1D->Add(gCorrection[iParameter][iStep-1]);
1343 //____________________________________________________________________//
1344 void AliProtonAnalysis::InitQA() {
1345 //Initializes the QA histograms and builds the directory structure
1346 if(!fQAHistograms) SetQAOn();
1349 TDirectory *dir2D = gDirectory->mkdir("2D");
1350 fGlobalQAList->Add(dir2D); dir2D->cd();
1351 TH2F *gHistYPtPrimaryProtonsPass = new TH2F("gHistYPtPrimaryProtonsPass",
1353 fNBinsY,fMinY,fMaxY,
1354 fNBinsPt,fMinPt,fMaxPt);
1355 gHistYPtPrimaryProtonsPass->SetStats(kTRUE);
1356 gHistYPtPrimaryProtonsPass->GetXaxis()->SetTitleColor(1);
1357 fQA2DList->Add(gHistYPtPrimaryProtonsPass);
1358 TH2F *gHistYPtPrimaryAntiProtonsPass = new TH2F("gHistYPtAntiPrimaryProtonsPass",
1360 fNBinsY,fMinY,fMaxY,
1361 fNBinsPt,fMinPt,fMaxPt);
1362 gHistYPtPrimaryAntiProtonsPass->SetStats(kTRUE);
1363 gHistYPtPrimaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1364 fQA2DList->Add(gHistYPtPrimaryAntiProtonsPass);
1365 TH2F *gHistYPtSecondaryProtonsPass = new TH2F("gHistYPtSecondaryAntiProtonsPass",
1367 fNBinsY,fMinY,fMaxY,
1368 fNBinsPt,fMinPt,fMaxPt);
1369 gHistYPtSecondaryProtonsPass->SetStats(kTRUE);
1370 gHistYPtSecondaryProtonsPass->GetXaxis()->SetTitleColor(1);
1371 fQA2DList->Add(gHistYPtSecondaryProtonsPass);
1372 TH2F *gHistYPtSecondaryAntiAntiProtonsPass = new TH2F("gHistYPtAntiSecondaryAntiProtonsPass",
1374 fNBinsY,fMinY,fMaxY,
1375 fNBinsPt,fMinPt,fMaxPt);
1376 gHistYPtSecondaryAntiAntiProtonsPass->SetStats(kTRUE);
1377 gHistYPtSecondaryAntiAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1378 fQA2DList->Add(gHistYPtSecondaryAntiAntiProtonsPass);
1380 gDirectory->cd("../");
1382 TDirectory *dirProtons = gDirectory->mkdir("Protons");
1383 fGlobalQAList->Add(dirProtons); dirProtons->cd();
1385 //________________________________________________________________//
1386 TDirectory *dirProtonsPrimary = gDirectory->mkdir("Primaries");
1387 dirProtonsPrimary->cd();
1388 TDirectory *dirProtonsPrimaryAccepted = gDirectory->mkdir("Accepted");
1389 dirProtonsPrimaryAccepted->cd();
1391 //Accepted primary protons
1392 TH1F *fPrimaryProtonsITSClustersPass = new TH1F("fPrimaryProtonsITSClustersPass",
1393 ";N_{clusters} (ITS);Entries",
1395 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsITSClustersPass);
1396 TH1F *fPrimaryProtonsChi2PerClusterITSPass = new TH1F("fPrimaryProtonsChi2PerClusterITSPass",
1397 ";x^{2}/N_{clusters} (ITS);Entries",
1399 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsChi2PerClusterITSPass);
1400 TH1F *fPrimaryProtonsTPCClustersPass = new TH1F("fPrimaryProtonsTPCClustersPass",
1401 ";N_{clusters} (TPC);Entries",
1403 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsTPCClustersPass);
1404 TH1F *fPrimaryProtonsChi2PerClusterTPCPass = new TH1F("fPrimaryProtonsChi2PerClusterTPCPass",
1405 ";x^{2}/N_{clusters} (TPC);Entries",
1407 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsChi2PerClusterTPCPass);
1408 TH1F *fPrimaryProtonsExtCov11Pass = new TH1F("fPrimaryProtonsExtCov11Pass",
1409 ";#sigma_{y} [cm];Entries",
1411 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov11Pass);
1412 TH1F *fPrimaryProtonsExtCov22Pass = new TH1F("fPrimaryProtonsExtCov22Pass",
1413 ";#sigma_{z} [cm];Entries",
1415 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov22Pass);
1416 TH1F *fPrimaryProtonsExtCov33Pass = new TH1F("fPrimaryProtonsExtCov33Pass",
1417 ";#sigma_{sin(#phi)};Entries",
1419 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov33Pass);
1420 TH1F *fPrimaryProtonsExtCov44Pass = new TH1F("fPrimaryProtonsExtCov44Pass",
1421 ";#sigma_{tan(#lambda)};Entries",
1423 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov44Pass);
1424 TH1F *fPrimaryProtonsExtCov55Pass = new TH1F("fPrimaryProtonsExtCov55Pass",
1425 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1427 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov55Pass);
1428 TH1F *fPrimaryProtonsSigmaToVertexPass = new TH1F("fPrimaryProtonsSigmaToVertexPass",
1429 ";#sigma_{Vertex};Entries",
1431 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsSigmaToVertexPass);
1432 TH1F *fPrimaryProtonsSigmaToVertexTPCPass = new TH1F("fPrimaryProtonsSigmaToVertexTPCPass",
1433 ";#sigma_{Vertex};Entries",
1435 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsSigmaToVertexTPCPass);
1436 TH1F *fPrimaryProtonsITSRefitPass = new TH1F("fPrimaryProtonsITSRefitPass",
1438 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsITSRefitPass);
1439 TH1F *fPrimaryProtonsTPCRefitPass = new TH1F("fPrimaryProtonsTPCRefitPass",
1441 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsTPCRefitPass);
1442 TH1F *fPrimaryProtonsESDpidPass = new TH1F("fPrimaryProtonsESDpidPass",
1444 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsESDpidPass);
1445 TH1F *fPrimaryProtonsTPCpidPass = new TH1F("fPrimaryProtonsTPCpidPass",
1447 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsTPCpidPass);
1449 //Rejected primary protons
1450 gDirectory->cd("../");
1451 TDirectory *dirProtonsPrimaryRejected = gDirectory->mkdir("Rejected");
1452 dirProtonsPrimaryRejected->cd();
1454 TH1F *fPrimaryProtonsITSClustersReject = new TH1F("fPrimaryProtonsITSClustersReject",
1455 ";N_{clusters} (ITS);Entries",
1457 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsITSClustersReject);
1458 TH1F *fPrimaryProtonsChi2PerClusterITSReject = new TH1F("fPrimaryProtonsChi2PerClusterITSReject",
1459 ";x^{2}/N_{clusters} (ITS);Entries",
1461 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsChi2PerClusterITSReject);
1462 TH1F *fPrimaryProtonsTPCClustersReject = new TH1F("fPrimaryProtonsTPCClustersReject",
1463 ";N_{clusters} (TPC);Entries",
1465 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsTPCClustersReject);
1466 TH1F *fPrimaryProtonsChi2PerClusterTPCReject = new TH1F("fPrimaryProtonsChi2PerClusterTPCReject",
1467 ";x^{2}/N_{clusters} (TPC);Entries",
1469 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsChi2PerClusterTPCReject);
1470 TH1F *fPrimaryProtonsExtCov11Reject = new TH1F("fPrimaryProtonsExtCov11Reject",
1471 ";#sigma_{y} [cm];Entries",
1473 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov11Reject);
1474 TH1F *fPrimaryProtonsExtCov22Reject = new TH1F("fPrimaryProtonsExtCov22Reject",
1475 ";#sigma_{z} [cm];Entries",
1477 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov22Reject);
1478 TH1F *fPrimaryProtonsExtCov33Reject = new TH1F("fPrimaryProtonsExtCov33Reject",
1479 ";#sigma_{sin(#phi)};Entries",
1481 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov33Reject);
1482 TH1F *fPrimaryProtonsExtCov44Reject = new TH1F("fPrimaryProtonsExtCov44Reject",
1483 ";#sigma_{tan(#lambda)};Entries",
1485 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov44Reject);
1486 TH1F *fPrimaryProtonsExtCov55Reject = new TH1F("fPrimaryProtonsExtCov55Reject",
1487 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1489 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov55Reject);
1490 TH1F *fPrimaryProtonsSigmaToVertexReject = new TH1F("fPrimaryProtonsSigmaToVertexReject",
1491 ";#sigma_{Vertex};Entries",
1493 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsSigmaToVertexReject);
1494 TH1F *fPrimaryProtonsSigmaToVertexTPCReject = new TH1F("fPrimaryProtonsSigmaToVertexTPCReject",
1495 ";#sigma_{Vertex};Entries",
1497 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsSigmaToVertexTPCReject);
1498 TH1F *fPrimaryProtonsITSRefitReject = new TH1F("fPrimaryProtonsITSRefitReject",
1500 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsITSRefitReject);
1501 TH1F *fPrimaryProtonsTPCRefitReject = new TH1F("fPrimaryProtonsTPCRefitReject",
1503 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsTPCRefitReject);
1504 TH1F *fPrimaryProtonsESDpidReject = new TH1F("fPrimaryProtonsESDpidReject",
1506 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsESDpidReject);
1507 TH1F *fPrimaryProtonsTPCpidReject = new TH1F("fPrimaryProtonsTPCpidReject",
1509 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsTPCpidReject);
1511 //________________________________________________________________//
1512 gDirectory->cd("../../");
1514 TDirectory *dirProtonsSecondary = gDirectory->mkdir("Secondaries");
1515 dirProtonsSecondary->cd();
1516 TDirectory *dirProtonsSecondaryAccepted = gDirectory->mkdir("Accepted");
1517 dirProtonsSecondaryAccepted->cd();
1519 //Accepted secondary protons
1520 TH1F *fSecondaryProtonsITSClustersPass = new TH1F("fSecondaryProtonsITSClustersPass",
1521 ";N_{clusters} (ITS);Entries",
1523 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsITSClustersPass);
1524 TH1F *fSecondaryProtonsChi2PerClusterITSPass = new TH1F("fSecondaryProtonsChi2PerClusterITSPass",
1525 ";x^{2}/N_{clusters} (ITS);Entries",
1527 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsChi2PerClusterITSPass);
1528 TH1F *fSecondaryProtonsTPCClustersPass = new TH1F("fSecondaryProtonsTPCClustersPass",
1529 ";N_{clusters} (TPC);Entries",
1531 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsTPCClustersPass);
1532 TH1F *fSecondaryProtonsChi2PerClusterTPCPass = new TH1F("fSecondaryProtonsChi2PerClusterTPCPass",
1533 ";x^{2}/N_{clusters} (TPC);Entries",
1535 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsChi2PerClusterTPCPass);
1536 TH1F *fSecondaryProtonsExtCov11Pass = new TH1F("fSecondaryProtonsExtCov11Pass",
1537 ";#sigma_{y} [cm];Entries",
1539 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov11Pass);
1540 TH1F *fSecondaryProtonsExtCov22Pass = new TH1F("fSecondaryProtonsExtCov22Pass",
1541 ";#sigma_{z} [cm];Entries",
1543 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov22Pass);
1544 TH1F *fSecondaryProtonsExtCov33Pass = new TH1F("fSecondaryProtonsExtCov33Pass",
1545 ";#sigma_{sin(#phi)};Entries",
1547 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov33Pass);
1548 TH1F *fSecondaryProtonsExtCov44Pass = new TH1F("fSecondaryProtonsExtCov44Pass",
1549 ";#sigma_{tan(#lambda)};Entries",
1551 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov44Pass);
1552 TH1F *fSecondaryProtonsExtCov55Pass = new TH1F("fSecondaryProtonsExtCov55Pass",
1553 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1555 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov55Pass);
1556 TH1F *fSecondaryProtonsSigmaToVertexPass = new TH1F("fSecondaryProtonsSigmaToVertexPass",
1557 ";#sigma_{Vertex};Entries",
1559 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsSigmaToVertexPass);
1560 TH1F *fSecondaryProtonsSigmaToVertexTPCPass = new TH1F("fSecondaryProtonsSigmaToVertexTPCPass",
1561 ";#sigma_{Vertex};Entries",
1563 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsSigmaToVertexTPCPass);
1564 TH1F *fSecondaryProtonsITSRefitPass = new TH1F("fSecondaryProtonsITSRefitPass",
1566 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsITSRefitPass);
1567 TH1F *fSecondaryProtonsTPCRefitPass = new TH1F("fSecondaryProtonsTPCRefitPass",
1569 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsTPCRefitPass);
1570 TH1F *fSecondaryProtonsESDpidPass = new TH1F("fSecondaryProtonsESDpidPass",
1572 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsESDpidPass);
1573 TH1F *fSecondaryProtonsTPCpidPass = new TH1F("fSecondaryProtonsTPCpidPass",
1575 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsTPCpidPass);
1577 //Rejected secondary protons
1578 gDirectory->cd("../");
1579 TDirectory *dirProtonsSecondaryRejected = gDirectory->mkdir("Rejected");
1580 dirProtonsSecondaryRejected->cd();
1582 TH1F *fSecondaryProtonsITSClustersReject = new TH1F("fSecondaryProtonsITSClustersReject",
1583 ";N_{clusters} (ITS);Entries",
1585 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsITSClustersReject);
1586 TH1F *fSecondaryProtonsChi2PerClusterITSReject = new TH1F("fSecondaryProtonsChi2PerClusterITSReject",
1587 ";x^{2}/N_{clusters} (ITS);Entries",
1589 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsChi2PerClusterITSReject);
1590 TH1F *fSecondaryProtonsTPCClustersReject = new TH1F("fSecondaryProtonsTPCClustersReject",
1591 ";N_{clusters} (TPC);Entries",
1593 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsTPCClustersReject);
1594 TH1F *fSecondaryProtonsChi2PerClusterTPCReject = new TH1F("fSecondaryProtonsChi2PerClusterTPCReject",
1595 ";x^{2}/N_{clusters} (TPC);Entries",
1597 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsChi2PerClusterTPCReject);
1598 TH1F *fSecondaryProtonsExtCov11Reject = new TH1F("fSecondaryProtonsExtCov11Reject",
1599 ";#sigma_{y} [cm];Entries",
1601 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov11Reject);
1602 TH1F *fSecondaryProtonsExtCov22Reject = new TH1F("fSecondaryProtonsExtCov22Reject",
1603 ";#sigma_{z} [cm];Entries",
1605 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov22Reject);
1606 TH1F *fSecondaryProtonsExtCov33Reject = new TH1F("fSecondaryProtonsExtCov33Reject",
1607 ";#sigma_{sin(#phi)};Entries",
1609 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov33Reject);
1610 TH1F *fSecondaryProtonsExtCov44Reject = new TH1F("fSecondaryProtonsExtCov44Reject",
1611 ";#sigma_{tan(#lambda)};Entries",
1613 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov44Reject);
1614 TH1F *fSecondaryProtonsExtCov55Reject = new TH1F("fSecondaryProtonsExtCov55Reject",
1615 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1617 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov55Reject);
1618 TH1F *fSecondaryProtonsSigmaToVertexReject = new TH1F("fSecondaryProtonsSigmaToVertexReject",
1619 ";#sigma_{Vertex};Entries",
1621 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsSigmaToVertexReject);
1622 TH1F *fSecondaryProtonsSigmaToVertexTPCReject = new TH1F("fSecondaryProtonsSigmaToVertexTPCReject",
1623 ";#sigma_{Vertex};Entries",
1625 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsSigmaToVertexTPCReject);
1626 TH1F *fSecondaryProtonsITSRefitReject = new TH1F("fSecondaryProtonsITSRefitReject",
1628 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsITSRefitReject);
1629 TH1F *fSecondaryProtonsTPCRefitReject = new TH1F("fSecondaryProtonsTPCRefitReject",
1631 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsTPCRefitReject);
1632 TH1F *fSecondaryProtonsESDpidReject = new TH1F("fSecondaryProtonsESDpidReject",
1634 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsESDpidReject);
1635 TH1F *fSecondaryProtonsTPCpidReject = new TH1F("fSecondaryProtonsTPCpidReject",
1637 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsTPCpidReject);
1640 gDirectory->cd("../../../");
1643 TDirectory *dirAntiProtons = gDirectory->mkdir("AntiProtons");
1644 fGlobalQAList->Add(dirAntiProtons); dirAntiProtons->cd();
1646 //________________________________________________________________//
1647 TDirectory *dirAntiProtonsPrimary = gDirectory->mkdir("Primaries");
1648 dirAntiProtonsPrimary->cd();
1649 TDirectory *dirAntiProtonsPrimaryAccepted = gDirectory->mkdir("Accepted");
1650 dirAntiProtonsPrimaryAccepted->cd();
1652 //Accepted primary antiprotons
1653 TH1F *fPrimaryAntiProtonsITSClustersPass = new TH1F("fPrimaryAntiProtonsITSClustersPass",
1654 ";N_{clusters} (ITS);Entries",
1656 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsITSClustersPass);
1657 TH1F *fPrimaryAntiProtonsChi2PerClusterITSPass = new TH1F("fPrimaryAntiProtonsChi2PerClusterITSPass",
1658 ";x^{2}/N_{clusters} (ITS);Entries",
1660 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsChi2PerClusterITSPass);
1661 TH1F *fPrimaryAntiProtonsTPCClustersPass = new TH1F("fPrimaryAntiProtonsTPCClustersPass",
1662 ";N_{clusters} (TPC);Entries",
1664 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsTPCClustersPass);
1665 TH1F *fPrimaryAntiProtonsChi2PerClusterTPCPass = new TH1F("fPrimaryAntiProtonsChi2PerClusterTPCPass",
1666 ";x^{2}/N_{clusters} (TPC);Entries",
1668 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsChi2PerClusterTPCPass);
1669 TH1F *fPrimaryAntiProtonsExtCov11Pass = new TH1F("fPrimaryAntiProtonsExtCov11Pass",
1670 ";#sigma_{y} [cm];Entries",
1672 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov11Pass);
1673 TH1F *fPrimaryAntiProtonsExtCov22Pass = new TH1F("fPrimaryAntiProtonsExtCov22Pass",
1674 ";#sigma_{z} [cm];Entries",
1676 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov22Pass);
1677 TH1F *fPrimaryAntiProtonsExtCov33Pass = new TH1F("fPrimaryAntiProtonsExtCov33Pass",
1678 ";#sigma_{sin(#phi)};Entries",
1680 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov33Pass);
1681 TH1F *fPrimaryAntiProtonsExtCov44Pass = new TH1F("fPrimaryAntiProtonsExtCov44Pass",
1682 ";#sigma_{tan(#lambda)};Entries",
1684 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov44Pass);
1685 TH1F *fPrimaryAntiProtonsExtCov55Pass = new TH1F("fPrimaryAntiProtonsExtCov55Pass",
1686 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1688 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov55Pass);
1689 TH1F *fPrimaryAntiProtonsSigmaToVertexPass = new TH1F("fPrimaryAntiProtonsSigmaToVertexPass",
1690 ";#sigma_{Vertex};Entries",
1692 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsSigmaToVertexPass);
1693 TH1F *fPrimaryAntiProtonsSigmaToVertexTPCPass = new TH1F("fPrimaryAntiProtonsSigmaToVertexTPCPass",
1694 ";#sigma_{Vertex};Entries",
1696 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsSigmaToVertexTPCPass);
1697 TH1F *fPrimaryAntiProtonsITSRefitPass = new TH1F("fPrimaryAntiProtonsITSRefitPass",
1699 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsITSRefitPass);
1700 TH1F *fPrimaryAntiProtonsTPCRefitPass = new TH1F("fPrimaryAntiProtonsTPCRefitPass",
1702 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsTPCRefitPass);
1703 TH1F *fPrimaryAntiProtonsESDpidPass = new TH1F("fPrimaryAntiProtonsESDpidPass",
1705 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsESDpidPass);
1706 TH1F *fPrimaryAntiProtonsTPCpidPass = new TH1F("fPrimaryAntiProtonsTPCpidPass",
1708 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsTPCpidPass);
1710 //Rejected primary antiprotons
1711 gDirectory->cd("../");
1712 TDirectory *dirAntiProtonsPrimaryRejected = gDirectory->mkdir("Rejected");
1713 dirAntiProtonsPrimaryRejected->cd();
1715 TH1F *fPrimaryAntiProtonsITSClustersReject = new TH1F("fPrimaryAntiProtonsITSClustersReject",
1716 ";N_{clusters} (ITS);Entries",
1718 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsITSClustersReject);
1719 TH1F *fPrimaryAntiProtonsChi2PerClusterITSReject = new TH1F("fPrimaryAntiProtonsChi2PerClusterITSReject",
1720 ";x^{2}/N_{clusters} (ITS);Entries",
1722 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsChi2PerClusterITSReject);
1723 TH1F *fPrimaryAntiProtonsTPCClustersReject = new TH1F("fPrimaryAntiProtonsTPCClustersReject",
1724 ";N_{clusters} (TPC);Entries",
1726 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsTPCClustersReject);
1727 TH1F *fPrimaryAntiProtonsChi2PerClusterTPCReject = new TH1F("fPrimaryAntiProtonsChi2PerClusterTPCReject",
1728 ";x^{2}/N_{clusters} (TPC);Entries",
1730 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsChi2PerClusterTPCReject);
1731 TH1F *fPrimaryAntiProtonsExtCov11Reject = new TH1F("fPrimaryAntiProtonsExtCov11Reject",
1732 ";#sigma_{y} [cm];Entries",
1734 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov11Reject);
1735 TH1F *fPrimaryAntiProtonsExtCov22Reject = new TH1F("fPrimaryAntiProtonsExtCov22Reject",
1736 ";#sigma_{z} [cm];Entries",
1738 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov22Reject);
1739 TH1F *fPrimaryAntiProtonsExtCov33Reject = new TH1F("fPrimaryAntiProtonsExtCov33Reject",
1740 ";#sigma_{sin(#phi)};Entries",
1742 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov33Reject);
1743 TH1F *fPrimaryAntiProtonsExtCov44Reject = new TH1F("fPrimaryAntiProtonsExtCov44Reject",
1744 ";#sigma_{tan(#lambda)};Entries",
1746 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov44Reject);
1747 TH1F *fPrimaryAntiProtonsExtCov55Reject = new TH1F("fPrimaryAntiProtonsExtCov55Reject",
1748 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1750 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov55Reject);
1751 TH1F *fPrimaryAntiProtonsSigmaToVertexReject = new TH1F("fPrimaryAntiProtonsSigmaToVertexReject",
1752 ";#sigma_{Vertex};Entries",
1754 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsSigmaToVertexReject);
1755 TH1F *fPrimaryAntiProtonsSigmaToVertexTPCReject = new TH1F("fPrimaryAntiProtonsSigmaToVertexTPCReject",
1756 ";#sigma_{Vertex};Entries",
1758 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsSigmaToVertexTPCReject);
1759 TH1F *fPrimaryAntiProtonsITSRefitReject = new TH1F("fPrimaryAntiProtonsITSRefitReject",
1761 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsITSRefitReject);
1762 TH1F *fPrimaryAntiProtonsTPCRefitReject = new TH1F("fPrimaryAntiProtonsTPCRefitReject",
1764 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsTPCRefitReject);
1765 TH1F *fPrimaryAntiProtonsESDpidReject = new TH1F("fPrimaryAntiProtonsESDpidReject",
1767 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsESDpidReject);
1768 TH1F *fPrimaryAntiProtonsTPCpidReject = new TH1F("fPrimaryAntiProtonsTPCpidReject",
1770 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsTPCpidReject);
1772 //________________________________________________________________//
1773 gDirectory->cd("../../");
1775 TDirectory *dirAntiProtonsSecondary = gDirectory->mkdir("Secondaries");
1776 dirAntiProtonsSecondary->cd();
1777 TDirectory *dirAntiProtonsSecondaryAccepted = gDirectory->mkdir("Accepted");
1778 dirAntiProtonsSecondaryAccepted->cd();
1780 //Accepted secondary antiprotons
1781 TH1F *fSecondaryAntiProtonsITSClustersPass = new TH1F("fSecondaryAntiProtonsITSClustersPass",
1782 ";N_{clusters} (ITS);Entries",
1784 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsITSClustersPass);
1785 TH1F *fSecondaryAntiProtonsChi2PerClusterITSPass = new TH1F("fSecondaryAntiProtonsChi2PerClusterITSPass",
1786 ";x^{2}/N_{clusters} (ITS);Entries",
1788 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsChi2PerClusterITSPass);
1789 TH1F *fSecondaryAntiProtonsTPCClustersPass = new TH1F("fSecondaryAntiProtonsTPCClustersPass",
1790 ";N_{clusters} (TPC);Entries",
1792 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsTPCClustersPass);
1793 TH1F *fSecondaryAntiProtonsChi2PerClusterTPCPass = new TH1F("fSecondaryAntiProtonsChi2PerClusterTPCPass",
1794 ";x^{2}/N_{clusters} (TPC);Entries",
1796 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsChi2PerClusterTPCPass);
1797 TH1F *fSecondaryAntiProtonsExtCov11Pass = new TH1F("fSecondaryAntiProtonsExtCov11Pass",
1798 ";#sigma_{y} [cm];Entries",
1800 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov11Pass);
1801 TH1F *fSecondaryAntiProtonsExtCov22Pass = new TH1F("fSecondaryAntiProtonsExtCov22Pass",
1802 ";#sigma_{z} [cm];Entries",
1804 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov22Pass);
1805 TH1F *fSecondaryAntiProtonsExtCov33Pass = new TH1F("fSecondaryAntiProtonsExtCov33Pass",
1806 ";#sigma_{sin(#phi)};Entries",
1808 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov33Pass);
1809 TH1F *fSecondaryAntiProtonsExtCov44Pass = new TH1F("fSecondaryAntiProtonsExtCov44Pass",
1810 ";#sigma_{tan(#lambda)};Entries",
1812 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov44Pass);
1813 TH1F *fSecondaryAntiProtonsExtCov55Pass = new TH1F("fSecondaryAntiProtonsExtCov55Pass",
1814 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1816 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov55Pass);
1817 TH1F *fSecondaryAntiProtonsSigmaToVertexPass = new TH1F("fSecondaryAntiProtonsSigmaToVertexPass",
1818 ";#sigma_{Vertex};Entries",
1820 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsSigmaToVertexPass);
1821 TH1F *fSecondaryAntiProtonsSigmaToVertexTPCPass = new TH1F("fSecondaryAntiProtonsSigmaToVertexTPCPass",
1822 ";#sigma_{Vertex};Entries",
1824 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsSigmaToVertexTPCPass);
1825 TH1F *fSecondaryAntiProtonsITSRefitPass = new TH1F("fSecondaryAntiProtonsITSRefitPass",
1827 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsITSRefitPass);
1828 TH1F *fSecondaryAntiProtonsTPCRefitPass = new TH1F("fSecondaryAntiProtonsTPCRefitPass",
1830 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsTPCRefitPass);
1831 TH1F *fSecondaryAntiProtonsESDpidPass = new TH1F("fSecondaryAntiProtonsESDpidPass",
1833 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsESDpidPass);
1834 TH1F *fSecondaryAntiProtonsTPCpidPass = new TH1F("fSecondaryAntiProtonsTPCpidPass",
1836 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsTPCpidPass);
1838 //Rejected secondary antiprotons
1839 gDirectory->cd("../");
1840 TDirectory *dirAntiProtonsSecondaryRejected = gDirectory->mkdir("Rejected");
1841 dirAntiProtonsSecondaryRejected->cd();
1843 TH1F *fSecondaryAntiProtonsITSClustersReject = new TH1F("fSecondaryAntiProtonsITSClustersReject",
1844 ";N_{clusters} (ITS);Entries",
1846 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsITSClustersReject);
1847 TH1F *fSecondaryAntiProtonsChi2PerClusterITSReject = new TH1F("fSecondaryAntiProtonsChi2PerClusterITSReject",
1848 ";x^{2}/N_{clusters} (ITS);Entries",
1850 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsChi2PerClusterITSReject);
1851 TH1F *fSecondaryAntiProtonsTPCClustersReject = new TH1F("fSecondaryAntiProtonsTPCClustersReject",
1852 ";N_{clusters} (TPC);Entries",
1854 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsTPCClustersReject);
1855 TH1F *fSecondaryAntiProtonsChi2PerClusterTPCReject = new TH1F("fSecondaryAntiProtonsChi2PerClusterTPCReject",
1856 ";x^{2}/N_{clusters} (TPC);Entries",
1858 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsChi2PerClusterTPCReject);
1859 TH1F *fSecondaryAntiProtonsExtCov11Reject = new TH1F("fSecondaryAntiProtonsExtCov11Reject",
1860 ";#sigma_{y} [cm];Entries",
1862 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov11Reject);
1863 TH1F *fSecondaryAntiProtonsExtCov22Reject = new TH1F("fSecondaryAntiProtonsExtCov22Reject",
1864 ";#sigma_{z} [cm];Entries",
1866 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov22Reject);
1867 TH1F *fSecondaryAntiProtonsExtCov33Reject = new TH1F("fSecondaryAntiProtonsExtCov33Reject",
1868 ";#sigma_{sin(#phi)};Entries",
1870 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov33Reject);
1871 TH1F *fSecondaryAntiProtonsExtCov44Reject = new TH1F("fSecondaryAntiProtonsExtCov44Reject",
1872 ";#sigma_{tan(#lambda)};Entries",
1874 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov44Reject);
1875 TH1F *fSecondaryAntiProtonsExtCov55Reject = new TH1F("fSecondaryAntiProtonsExtCov55Reject",
1876 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1878 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov55Reject);
1879 TH1F *fSecondaryAntiProtonsSigmaToVertexReject = new TH1F("fSecondaryAntiProtonsSigmaToVertexReject",
1880 ";#sigma_{Vertex};Entries",
1882 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsSigmaToVertexReject);
1883 TH1F *fSecondaryAntiProtonsSigmaToVertexTPCReject = new TH1F("fSecondaryAntiProtonsSigmaToVertexTPCReject",
1884 ";#sigma_{Vertex};Entries",
1886 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsSigmaToVertexTPCReject);
1887 TH1F *fSecondaryAntiProtonsITSRefitReject = new TH1F("fSecondaryAntiProtonsITSRefitReject",
1889 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsITSRefitReject);
1890 TH1F *fSecondaryAntiProtonsTPCRefitReject = new TH1F("fSecondaryAntiProtonsTPCRefitReject",
1892 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsTPCRefitReject);
1893 TH1F *fSecondaryAntiProtonsESDpidReject = new TH1F("fSecondaryAntiProtonsESDpidReject",
1895 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsESDpidReject);
1896 TH1F *fSecondaryAntiProtonsTPCpidReject = new TH1F("fSecondaryAntiProtonsTPCpidReject",
1898 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsTPCpidReject);
1902 //____________________________________________________________________//
1903 void AliProtonAnalysis::RunQA(AliStack *stack, AliESDEvent *fESD) {
1905 Int_t nGoodTracks = fESD->GetNumberOfTracks();
1906 for(Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
1907 AliESDtrack* track = fESD->GetTrack(iTracks);
1908 Int_t label = TMath::Abs(track->GetLabel());
1909 Double_t Pt = 0.0, P = 0.0;
1910 Double_t probability[5];
1913 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
1914 if(!tpcTrack) continue;
1915 Pt = tpcTrack->Pt();
1919 track->GetTPCpid(probability);
1921 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
1922 rcc += probability[i]*GetParticleFraction(i,P);
1923 if(rcc == 0.0) continue;
1925 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
1926 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
1927 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
1928 if(fParticleType == 4) {
1929 if(IsAccepted(track, stack)) {
1930 if(label <= stack->GetNprimary()) {
1931 if(track->Charge() > 0)
1932 ((TH2F *)(fQA2DList->At(0)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1933 else if(track->Charge() < 0)
1934 ((TH2F *)(fQA2DList->At(1)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1935 }//primary particles
1936 else if(label > stack->GetNprimary()) {
1937 if(track->Charge() > 0)
1938 ((TH2F *)(fQA2DList->At(2)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1939 else if(track->Charge() < 0)
1940 ((TH2F *)(fQA2DList->At(3)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1941 }//secondary particles
1945 else if(!fUseTPCOnly) {
1950 track->GetESDpid(probability);
1952 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
1953 rcc += probability[i]*GetParticleFraction(i,P);
1954 if(rcc == 0.0) continue;
1956 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
1957 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
1958 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
1959 if(fParticleType == 4) {
1960 if(IsAccepted(track, stack)) {
1961 if(label <= stack->GetNprimary()) {
1962 if(track->Charge() > 0)
1963 ((TH2F *)(fQA2DList->At(0)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1964 else if(track->Charge() < 0)
1965 ((TH2F *)(fQA2DList->At(1)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1966 }//primary particles
1967 else if(label > stack->GetNprimary()) {
1968 if(track->Charge() > 0)
1969 ((TH2F *)(fQA2DList->At(2)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1970 else if(track->Charge() < 0)
1971 ((TH2F *)(fQA2DList->At(3)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
1972 }//secondary particles
1975 }//combined tracking