]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/SPECTRA/AliProtonAnalysis.cxx
Reading properly the corrections' container
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / AliProtonAnalysis.cxx
CommitLineData
734d2c12 1/**************************************************************************
2 * Author: Panos Christakoglou. *
3 * Contributors are mentioned in the code where appropriate. *
4 * *
5 * Permission to use, copy, modify and distribute this software and its *
6 * documentation strictly for non-commercial purposes is hereby granted *
7 * without fee, provided that the above copyright notice appears in all *
8 * copies and that both the copyright notice and this permission notice *
9 * appear in the supporting documentation. The authors make no claims *
10 * about the suitability of this software for any purpose. It is *
11 * provided "as is" without express or implied warranty. *
12 **************************************************************************/
13
14/* $Id$ */
15
16//-----------------------------------------------------------------
17// AliProtonAnalysis class
18// This is the class to deal with the proton analysis
19// Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
20//-----------------------------------------------------------------
21#include <Riostream.h>
22#include <TFile.h>
23#include <TSystem.h>
aafecd8b 24#include <TF1.h>
734d2c12 25#include <TH2F.h>
26#include <TH1D.h>
3f6d0c08 27#include <TH1I.h>
e4358d7f 28#include <TParticle.h>
734d2c12 29
30#include "AliProtonAnalysis.h"
31
2b748670 32#include <AliExternalTrackParam.h>
ee4ca40d 33#include <AliAODEvent.h>
734d2c12 34#include <AliESDEvent.h>
35#include <AliLog.h>
ee4ca40d 36#include <AliPID.h>
e4358d7f 37#include <AliStack.h>
39f2a708 38#include <AliCFContainer.h>
39#include <AliCFEffGrid.h>
40#include <AliCFEffGrid.h>
e4358d7f 41
734d2c12 42ClassImp(AliProtonAnalysis)
43
44//____________________________________________________________________//
45AliProtonAnalysis::AliProtonAnalysis() :
46 TObject(),
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),
f24a70b0 52 fMaxSigmaToVertex(0), fMaxSigmaToVertexTPC(0),
734d2c12 53 fMinTPCClustersFlag(kFALSE), fMinITSClustersFlag(kFALSE),
54 fMaxChi2PerTPCClusterFlag(kFALSE), fMaxChi2PerITSClusterFlag(kFALSE),
55 fMaxCov11Flag(kFALSE), fMaxCov22Flag(kFALSE), fMaxCov33Flag(kFALSE), fMaxCov44Flag(kFALSE), fMaxCov55Flag(kFALSE),
f24a70b0 56 fMaxSigmaToVertexFlag(kFALSE), fMaxSigmaToVertexTPCFlag(kFALSE),
734d2c12 57 fITSRefitFlag(kFALSE), fTPCRefitFlag(kFALSE),
f24a70b0 58 fESDpidFlag(kFALSE), fTPCpidFlag(kFALSE),
ef1a8dbd 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),
aafecd8b 69 fFunctionProbabilityFlag(kFALSE),
70 fElectronFunction(0), fMuonFunction(0),
71 fPionFunction(0), fKaonFunction(0), fProtonFunction(0),
39f2a708 72 fUseTPCOnly(kFALSE), fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
cdb3530f 73 fCorrectionListProtons2D(0), fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
74 fCorrectionListAntiProtons2D(0), fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0) {
734d2c12 75 //Default constructor
76 for(Int_t i = 0; i < 5; i++) fPartFrac[i] = 0.0;
77}
78
79//____________________________________________________________________//
80AliProtonAnalysis::AliProtonAnalysis(Int_t nbinsY, Float_t fLowY, Float_t fHighY,Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt) :
81 TObject(),
82 fNBinsY(nbinsY), fMinY(fLowY), fMaxY(fHighY),
83 fNBinsPt(nbinsPt), fMinPt(fLowPt), fMaxPt(fHighPt),
aafecd8b 84 fMinTPCClusters(0), fMinITSClusters(0),
85 fMaxChi2PerTPCCluster(0), fMaxChi2PerITSCluster(0),
86 fMaxCov11(0), fMaxCov22(0), fMaxCov33(0), fMaxCov44(0), fMaxCov55(0),
f24a70b0 87 fMaxSigmaToVertex(0), fMaxSigmaToVertexTPC(0),
aafecd8b 88 fMinTPCClustersFlag(kFALSE), fMinITSClustersFlag(kFALSE),
89 fMaxChi2PerTPCClusterFlag(kFALSE), fMaxChi2PerITSClusterFlag(kFALSE),
90 fMaxCov11Flag(kFALSE), fMaxCov22Flag(kFALSE), fMaxCov33Flag(kFALSE), fMaxCov44Flag(kFALSE), fMaxCov55Flag(kFALSE),
f24a70b0 91 fMaxSigmaToVertexFlag(kFALSE), fMaxSigmaToVertexTPCFlag(kFALSE),
aafecd8b 92 fITSRefitFlag(kFALSE), fTPCRefitFlag(kFALSE),
f24a70b0 93 fESDpidFlag(kFALSE), fTPCpidFlag(kFALSE),
ef1a8dbd 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),
aafecd8b 104 fFunctionProbabilityFlag(kFALSE),
105 fElectronFunction(0), fMuonFunction(0),
106 fPionFunction(0), fKaonFunction(0), fProtonFunction(0),
39f2a708 107 fUseTPCOnly(kFALSE), fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0),
cdb3530f 108 fCorrectionListProtons2D(0), fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
109 fCorrectionListAntiProtons2D(0), fEfficiencyListAntiProtons1D(0), fCorrectionListAntiProtons1D(0) {
734d2c12 110 //Default constructor
111
3f6d0c08 112 fHistEvents = new TH1I("fHistEvents","Analyzed events",1,0,1);
113
734d2c12 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);
119
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);
125}
126
127//____________________________________________________________________//
128AliProtonAnalysis::~AliProtonAnalysis() {
129 //Default destructor
39f2a708 130 if(fHistEvents) delete fHistEvents;
131 if(fHistYPtProtons) delete fHistYPtProtons;
132 if(fHistYPtAntiProtons) delete fHistYPtAntiProtons;
ef1a8dbd 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;
cdb3530f 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;
734d2c12 149}
150
151//____________________________________________________________________//
ef1a8dbd 152void AliProtonAnalysis::InitAnalysisHistograms(Int_t nbinsY, Float_t fLowY, Float_t fHighY,
153 Int_t nbinsPt, Float_t fLowPt, Float_t fHighPt) {
734d2c12 154 fNBinsY = nbinsY;
155 fMinY = fLowY;
156 fMaxY = fHighY;
157 fNBinsPt = nbinsPt;
158 fMinPt = fLowPt;
159 fMaxPt = fHighPt;
160
3f6d0c08 161 fHistEvents = new TH1I("fHistEvents","Anallyzed events",1,0,1);
162
734d2c12 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);
168
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);
174}
175
176//____________________________________________________________________//
2b748670 177Bool_t AliProtonAnalysis::ReadFromFile(const char* filename) {
178 Bool_t status = kTRUE;
179
734d2c12 180 TFile *file = TFile::Open(filename);
2b748670 181 if(!file) {
182 cout<<"Could not find the input file "<<filename<<endl;
183 status = kFALSE;
184 }
185
e4358d7f 186 TList *list = (TList *)file->Get("outputList1");
2b748670 187 if(list) {
188 cout<<"Retrieving objects from the list "<<list->GetName()<<"..."<<endl;
189 fHistYPtProtons = (TH2F *)list->At(0);
190 fHistYPtAntiProtons = (TH2F *)list->At(1);
3f6d0c08 191 fHistEvents = (TH1I *)list->At(2);
2b748670 192 }
193 else if(!list) {
194 cout<<"Retrieving objects from the file... "<<endl;
195 fHistYPtProtons = (TH2F *)file->Get("fHistYPtProtons");
196 fHistYPtAntiProtons = (TH2F *)file->Get("fHistYPtAntiProtons");
3f6d0c08 197 fHistEvents = (TH1I *)file->Get("fHistEvents");
2b748670 198 }
3f6d0c08 199 if((!fHistYPtProtons)||(!fHistYPtAntiProtons)||(!fHistEvents)) {
2b748670 200 cout<<"Input containers were not found!!!"<<endl;
201 status = kFALSE;
202 }
203 else {
204 fHistYPtProtons->Sumw2();
205 fHistYPtAntiProtons->Sumw2();
206 }
207
208 return status;
734d2c12 209}
210
211//____________________________________________________________________//
212TH1D *AliProtonAnalysis::GetProtonYHistogram() {
3f6d0c08 213 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
734d2c12 214 TH1D *fYProtons = (TH1D *)fHistYPtProtons->ProjectionX("fYProtons",0,fHistYPtProtons->GetYaxis()->GetNbins(),"e");
215 fYProtons->SetStats(kFALSE);
3f6d0c08 216 fYProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
734d2c12 217 fYProtons->SetTitle("dN/dy protons");
218 fYProtons->SetMarkerStyle(kFullCircle);
219 fYProtons->SetMarkerColor(4);
3f6d0c08 220 if(nAnalyzedEvents > 0)
221 fYProtons->Scale(1./nAnalyzedEvents);
734d2c12 222
223 return fYProtons;
224}
225
226//____________________________________________________________________//
227TH1D *AliProtonAnalysis::GetAntiProtonYHistogram() {
3f6d0c08 228 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
734d2c12 229 TH1D *fYAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionX("fYAntiProtons",0,fHistYPtAntiProtons->GetYaxis()->GetNbins(),"e");
230 fYAntiProtons->SetStats(kFALSE);
3f6d0c08 231 fYAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dy)");
734d2c12 232 fYAntiProtons->SetTitle("dN/dy antiprotons");
233 fYAntiProtons->SetMarkerStyle(kFullCircle);
234 fYAntiProtons->SetMarkerColor(4);
3f6d0c08 235 if(nAnalyzedEvents > 0)
236 fYAntiProtons->Scale(1./nAnalyzedEvents);
734d2c12 237
238 return fYAntiProtons;
239}
240
241//____________________________________________________________________//
242TH1D *AliProtonAnalysis::GetProtonPtHistogram() {
3f6d0c08 243 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
734d2c12 244 TH1D *fPtProtons = (TH1D *)fHistYPtProtons->ProjectionY("fPtProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"e");
245 fPtProtons->SetStats(kFALSE);
3f6d0c08 246 fPtProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
734d2c12 247 fPtProtons->SetTitle("dN/dPt protons");
248 fPtProtons->SetMarkerStyle(kFullCircle);
249 fPtProtons->SetMarkerColor(4);
3f6d0c08 250 if(nAnalyzedEvents > 0)
251 fPtProtons->Scale(1./nAnalyzedEvents);
734d2c12 252
253 return fPtProtons;
254}
255
256//____________________________________________________________________//
257TH1D *AliProtonAnalysis::GetAntiProtonPtHistogram() {
3f6d0c08 258 Int_t nAnalyzedEvents = GetNumberOfAnalyzedEvents();
734d2c12 259 TH1D *fPtAntiProtons = (TH1D *)fHistYPtAntiProtons->ProjectionY("fPtAntiProtons",0,fHistYPtProtons->GetXaxis()->GetNbins(),"e");
260 fPtAntiProtons->SetStats(kFALSE);
3f6d0c08 261 fPtAntiProtons->GetYaxis()->SetTitle("(1/N_{events})(dN/dP_{T})");
734d2c12 262 fPtAntiProtons->SetTitle("dN/dPt antiprotons");
263 fPtAntiProtons->SetMarkerStyle(kFullCircle);
264 fPtAntiProtons->SetMarkerColor(4);
3f6d0c08 265 if(nAnalyzedEvents > 0)
266 fPtAntiProtons->Scale(1./nAnalyzedEvents);
734d2c12 267
268 return fPtAntiProtons;
269}
270
271//____________________________________________________________________//
272TH1D *AliProtonAnalysis::GetYRatioHistogram() {
273 TH1D *fYProtons = GetProtonYHistogram();
274 TH1D *fYAntiProtons = GetAntiProtonYHistogram();
275
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);
285
286 return hRatioY;
287}
288
289//____________________________________________________________________//
290TH1D *AliProtonAnalysis::GetPtRatioHistogram() {
291 TH1D *fPtProtons = GetProtonPtHistogram();
292 TH1D *fPtAntiProtons = GetAntiProtonPtHistogram();
293
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);
303
304 return hRatioPt;
305}
306
307//____________________________________________________________________//
308TH1D *AliProtonAnalysis::GetYAsymmetryHistogram() {
309 TH1D *fYProtons = GetProtonYHistogram();
310 TH1D *fYAntiProtons = GetAntiProtonYHistogram();
311
312 TH1D *hsum = new TH1D("hsumY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
313 hsum->Add(fYProtons,fYAntiProtons,1.0,1.0);
314
315 TH1D *hdiff = new TH1D("hdiffY","",fYProtons->GetNbinsX(),fYProtons->GetXaxis()->GetXmin(),fYProtons->GetXaxis()->GetXmax());
316 hdiff->Add(fYProtons,fYAntiProtons,1.0,-1.0);
317
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);
327
328 return hAsymmetryY;
329}
330
331//____________________________________________________________________//
332TH1D *AliProtonAnalysis::GetPtAsymmetryHistogram() {
333 TH1D *fPtProtons = GetProtonPtHistogram();
334 TH1D *fPtAntiProtons = GetAntiProtonPtHistogram();
335
336 TH1D *hsum = new TH1D("hsumPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
337 hsum->Add(fPtProtons,fPtAntiProtons,1.0,1.0);
338
339 TH1D *hdiff = new TH1D("hdiffPt","",fPtProtons->GetNbinsX(),fPtProtons->GetXaxis()->GetXmin(),fPtProtons->GetXaxis()->GetXmax());
340 hdiff->Add(fPtProtons,fPtAntiProtons,1.0,-1.0);
341
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);
351
352 return hAsymmetryPt;
353}
354
aafecd8b 355//____________________________________________________________________//
356Double_t AliProtonAnalysis::GetParticleFraction(Int_t i, Double_t p) {
8b8b0b7a 357 Double_t partFrac=0;
aafecd8b 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);
364 }
365 else partFrac = fPartFrac[i];
366
367 return partFrac;
368}
369
734d2c12 370//____________________________________________________________________//
371void AliProtonAnalysis::Analyze(AliESDEvent* fESD) {
e4358d7f 372 //Main analysis part - ESD
3f6d0c08 373 fHistEvents->Fill(0); //number of analyzed events
2b748670 374 Double_t Pt = 0.0, P = 0.0;
734d2c12 375 Int_t nGoodTracks = fESD->GetNumberOfTracks();
376 for(Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
377 AliESDtrack* track = fESD->GetTrack(iTracks);
2b748670 378 Double_t probability[5];
379
380 if(IsAccepted(track)) {
381 if(fUseTPCOnly) {
382 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
383 if(!tpcTrack) continue;
384 Pt = tpcTrack->Pt();
385 P = tpcTrack->P();
386
387 //pid
388 track->GetTPCpid(probability);
389 Double_t rcc = 0.0;
390 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
391 rcc += probability[i]*GetParticleFraction(i,P);
392 if(rcc == 0.0) continue;
393 Double_t w[5];
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);
402 }//proton check
403 }//TPC only tracks
404 else if(!fUseTPCOnly) {
405 Pt = track->Pt();
406 P = track->P();
734d2c12 407
2b748670 408 //pid
409 track->GetESDpid(probability);
410 Double_t rcc = 0.0;
411 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
412 rcc += probability[i]*GetParticleFraction(i,P);
413 if(rcc == 0.0) continue;
414 Double_t w[5];
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);
424 }//proton check
425 }//combined tracking
734d2c12 426 }//cuts
427 }//track loop
428}
429
ee4ca40d 430//____________________________________________________________________//
431void AliProtonAnalysis::Analyze(AliAODEvent* fAOD) {
e4358d7f 432 //Main analysis part - AOD
3f6d0c08 433 fHistEvents->Fill(0); //number of analyzed events
ee4ca40d 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();
439
440 //pid
441 Double_t probability[10];
442 track->GetPID(probability);
443 Double_t rcc = 0.0;
444 for(Int_t i = 0; i < AliPID::kSPECIESN; i++) rcc += probability[i]*GetParticleFraction(i,P);
445 if(rcc == 0.0) continue;
738619fd 446 Double_t w[10];
ee4ca40d 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);
452 }//proton check
453 }//track loop
454}
455
e4358d7f 456//____________________________________________________________________//
457void AliProtonAnalysis::Analyze(AliStack* stack) {
458 //Main analysis part - MC
3f6d0c08 459 fHistEvents->Fill(0); //number of analyzed events
e4358d7f 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(),
466 particle->Py(),
467 particle->Pz()),
468 particle->Pt());
469 if(pdgcode == -2212) fHistYPtAntiProtons->Fill(Rapidity(particle->Px(),
470 particle->Py(),
471 particle->Pz()),
472 particle->Pt());
473 }//particle loop
474}
475
734d2c12 476//____________________________________________________________________//
477Bool_t AliProtonAnalysis::IsAccepted(AliESDtrack* track) {
478 // Checks if the track is excluded from the cuts
2b748670 479 Double_t Pt = 0.0, Px = 0.0, Py = 0.0, Pz = 0.0;
480 if(fUseTPCOnly) {
481 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
482 if(!tpcTrack) {
483 Pt = 0.0; Px = 0.0; Py = 0.0; Pz = 0.0;
484 }
485 else {
486 Pt = tpcTrack->Pt();
487 Px = tpcTrack->Px();
488 Py = tpcTrack->Py();
489 Pz = tpcTrack->Pz();
490 }
491 }
492 else{
493 Pt = track->Pt();
494 Px = track->Px();
495 Py = track->Py();
496 Pz = track->Pz();
497 }
498
734d2c12 499 Int_t fIdxInt[200];
500 Int_t nClustersITS = track->GetITSclusters(fIdxInt);
501 Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
502
503 Float_t chi2PerClusterITS = -1;
ef1a8dbd 504 if (nClustersITS!=0)
505 chi2PerClusterITS = track->GetITSchi2()/Float_t(nClustersITS);
506 Float_t chi2PerClusterTPC = -1;
507 if (nClustersTPC!=0)
508 chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);
509
510 Double_t extCov[15];
511 track->GetExternalCovariance(extCov);
512
513 if(fMinITSClustersFlag)
514 if(nClustersITS < fMinITSClusters) return kFALSE;
f24a70b0 515 if(fMaxChi2PerITSClusterFlag)
516 if(chi2PerClusterITS > fMaxChi2PerITSCluster) return kFALSE;
ef1a8dbd 517 if(fMinTPCClustersFlag)
518 if(nClustersTPC < fMinTPCClusters) return kFALSE;
519 if(fMaxChi2PerTPCClusterFlag)
520 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) return kFALSE;
ef1a8dbd 521 if(fMaxCov11Flag)
522 if(extCov[0] > fMaxCov11) return kFALSE;
523 if(fMaxCov22Flag)
524 if(extCov[2] > fMaxCov22) return kFALSE;
525 if(fMaxCov33Flag)
526 if(extCov[5] > fMaxCov33) return kFALSE;
527 if(fMaxCov44Flag)
528 if(extCov[9] > fMaxCov44) return kFALSE;
529 if(fMaxCov55Flag)
530 if(extCov[14] > fMaxCov55) return kFALSE;
531 if(fMaxSigmaToVertexFlag)
532 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) return kFALSE;
f24a70b0 533 if(fMaxSigmaToVertexTPCFlag)
534 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) return kFALSE;
ef1a8dbd 535 if(fITSRefitFlag)
536 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
537 if(fTPCRefitFlag)
538 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
f24a70b0 539 if(fESDpidFlag)
540 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) return kFALSE;
541 if(fTPCpidFlag)
542 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) return kFALSE;
ef1a8dbd 543
544 if((Pt < fMinPt) || (Pt > fMaxPt)) return kFALSE;
545 if((Rapidity(Px,Py,Pz) < fMinY) || (Rapidity(Px,Py,Pz) > fMaxY)) return kFALSE;
546
547 return kTRUE;
548}
549
550//____________________________________________________________________//
551Bool_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());
556
557 Double_t Pt = 0.0, Px = 0.0, Py = 0.0, Pz = 0.0;
558 if(fUseTPCOnly) {
559 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
560 if(!tpcTrack) {
561 Pt = 0.0; Px = 0.0; Py = 0.0; Pz = 0.0;
562 }
563 else {
564 Pt = tpcTrack->Pt();
565 Px = tpcTrack->Px();
566 Py = tpcTrack->Py();
567 Pz = tpcTrack->Pz();
568 }
569 }
570 else{
571 Pt = track->Pt();
572 Px = track->Px();
573 Py = track->Py();
574 Pz = track->Pz();
575 }
576
577 Int_t fIdxInt[200];
578 Int_t nClustersITS = track->GetITSclusters(fIdxInt);
579 Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
580
581 Float_t chi2PerClusterITS = -1;
582 if (nClustersITS!=0)
583 chi2PerClusterITS = track->GetITSchi2()/Float_t(nClustersITS);
734d2c12 584 Float_t chi2PerClusterTPC = -1;
585 if (nClustersTPC!=0)
586 chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);
587
588 Double_t extCov[15];
589 track->GetExternalCovariance(extCov);
f24a70b0 590
591 //protons
592 if(track->Charge() > 0) {
593 //Primaries
594 if(label <= nPrimaries) {
595 if(fMinITSClustersFlag) {
596 if(nClustersITS < fMinITSClusters) {
597 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
598 status = kFALSE;
599 }
600 else if(nClustersITS >= fMinITSClusters)
601 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
602 }//ITS clusters
603 if(fMaxChi2PerITSClusterFlag) {
604 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
605 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
606 status = kFALSE;
607 }
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);
614 status = kFALSE;
615 }
616 else if(nClustersTPC >= fMinTPCClusters)
617 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
618 }//TPC clusters
619 if(fMaxChi2PerTPCClusterFlag) {
620 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
621 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
622 status = kFALSE;
623 }
624 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
625 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
626 }//chi2 per TPC cluster
627 if(fMaxCov11Flag) {
628 if(extCov[0] > fMaxCov11) {
629 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
630 status = kFALSE;
631 }
632 else if(extCov[0] <= fMaxCov11)
633 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
634 }//cov11
635 if(fMaxCov22Flag) {
636 if(extCov[2] > fMaxCov22) {
637 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
638 status = kFALSE;
639 }
640 else if(extCov[2] <= fMaxCov22)
641 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
642 }//cov11
643 if(fMaxCov33Flag) {
644 if(extCov[5] > fMaxCov33) {
645 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
646 status = kFALSE;
647 }
648 else if(extCov[5] <= fMaxCov33)
649 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
650 }//cov11
651 if(fMaxCov44Flag) {
652 if(extCov[9] > fMaxCov44) {
653 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
654 status = kFALSE;
655 }
656 else if(extCov[9] <= fMaxCov44)
657 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
658 }//cov11
659 if(fMaxCov55Flag) {
660 if(extCov[14] > fMaxCov55) {
661 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
662 status = kFALSE;
663 }
664 else if(extCov[14] <= fMaxCov55)
665 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
666 }//cov55
667 if(fMaxSigmaToVertexFlag) {
668 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
669 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
670 status = kFALSE;
671 }
672 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
673 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
674 }//sigma to vertex
675 if(fMaxSigmaToVertexTPCFlag) {
676 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
677 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
678 status = kFALSE;
679 }
680 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
681 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
682 }//sigma to vertex TPC
683 if(fITSRefitFlag) {
684 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
685 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(11)))->Fill(0);
686 status = kFALSE;
687 }
688 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
689 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(11)))->Fill(0);
690 }//ITS refit
691 if(fTPCRefitFlag) {
692 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
693 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(12)))->Fill(0);
694 status = kFALSE;
695 }
696 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
697 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(12)))->Fill(0);
698 }//TPC refit
699 if(fESDpidFlag) {
700 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
701 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(13)))->Fill(0);
702 status = kFALSE;
703 }
704 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
705 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(13)))->Fill(0);
706 }//ESD pid
707 if(fTPCpidFlag) {
708 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
709 ((TH1F *)(fQAPrimaryProtonsRejectedList->At(13)))->Fill(0);
710 status = kFALSE;
711 }
712 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
713 ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(13)))->Fill(0);
714 }//TPC pid
715 }//primary particle cut
716
717 //Secondaries
718 if(label > nPrimaries) {
719 if(fMinITSClustersFlag) {
720 if(nClustersITS < fMinITSClusters) {
721 ((TH1F *)(fQASecondaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
722 status = kFALSE;
723 }
724 else if(nClustersITS >= fMinITSClusters)
725 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
726 }//ITS clusters
727 if(fMaxChi2PerITSClusterFlag) {
728 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
729 ((TH1F *)(fQASecondaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
730 status = kFALSE;
731 }
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);
738 status = kFALSE;
739 }
740 else if(nClustersTPC >= fMinTPCClusters)
741 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
742 }//TPC clusters
743 if(fMaxChi2PerTPCClusterFlag) {
744 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
745 ((TH1F *)(fQASecondaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
746 status = kFALSE;
747 }
748 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
749 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
750 }//chi2 per TPC cluster
751 if(fMaxCov11Flag) {
752 if(extCov[0] > fMaxCov11) {
753 ((TH1F *)(fQASecondaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
754 status = kFALSE;
755 }
756 else if(extCov[0] <= fMaxCov11)
757 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
758 }//cov11
759 if(fMaxCov22Flag) {
760 if(extCov[2] > fMaxCov22) {
761 ((TH1F *)(fQASecondaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
762 status = kFALSE;
763 }
764 else if(extCov[2] <= fMaxCov22)
765 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
766 }//cov11
767 if(fMaxCov33Flag) {
768 if(extCov[5] > fMaxCov33) {
769 ((TH1F *)(fQASecondaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
770 status = kFALSE;
771 }
772 else if(extCov[5] <= fMaxCov33)
773 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
774 }//cov11
775 if(fMaxCov44Flag) {
776 if(extCov[9] > fMaxCov44) {
777 ((TH1F *)(fQASecondaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
778 status = kFALSE;
779 }
780 else if(extCov[9] <= fMaxCov44)
781 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
782 }//cov11
783 if(fMaxCov55Flag) {
784 if(extCov[14] > fMaxCov55) {
785 ((TH1F *)(fQASecondaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
786 status = kFALSE;
787 }
788 else if(extCov[14] <= fMaxCov55)
789 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
790 }//cov55
791 if(fMaxSigmaToVertexFlag) {
792 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
793 ((TH1F *)(fQASecondaryProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
794 status = kFALSE;
795 }
796 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
797 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
798 }//sigma to vertex
799 if(fMaxSigmaToVertexTPCFlag) {
800 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
801 ((TH1F *)(fQASecondaryProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
802 status = kFALSE;
803 }
804 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
805 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
806 }//sigma to vertex TPC
807 if(fITSRefitFlag) {
808 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
809 ((TH1F *)(fQASecondaryProtonsRejectedList->At(11)))->Fill(0);
810 status = kFALSE;
811 }
812 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
813 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(11)))->Fill(0);
814 }//ITS refit
815 if(fTPCRefitFlag) {
816 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
817 ((TH1F *)(fQASecondaryProtonsRejectedList->At(12)))->Fill(0);
818 status = kFALSE;
819 }
820 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
821 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(12)))->Fill(0);
822 }//TPC refit
823 if(fESDpidFlag) {
824 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
825 ((TH1F *)(fQASecondaryProtonsRejectedList->At(13)))->Fill(0);
826 status = kFALSE;
827 }
828 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
829 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(13)))->Fill(0);
830 }//ESD pid
831 if(fTPCpidFlag) {
832 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
833 ((TH1F *)(fQASecondaryProtonsRejectedList->At(13)))->Fill(0);
834 status = kFALSE;
835 }
836 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
837 ((TH1F *)(fQASecondaryProtonsAcceptedList->At(13)))->Fill(0);
838 }//TPC pid
839 }//secondary particle cut
840 }//protons
734d2c12 841
f24a70b0 842 //antiprotons
843 if(track->Charge() < 0) {
844 //Primaries
845 if(label <= nPrimaries) {
846 if(fMinITSClustersFlag) {
847 if(nClustersITS < fMinITSClusters) {
848 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(0)))->Fill(nClustersITS);
849 status = kFALSE;
850 }
851 else if(nClustersITS >= fMinITSClusters)
852 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(0)))->Fill(nClustersITS);
853 }//ITS clusters
854 if(fMaxChi2PerITSClusterFlag) {
855 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
856 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
857 status = kFALSE;
858 }
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);
865 status = kFALSE;
866 }
867 else if(nClustersTPC >= fMinTPCClusters)
868 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
869 }//TPC clusters
870 if(fMaxChi2PerTPCClusterFlag) {
871 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
872 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
873 status = kFALSE;
874 }
875 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
876 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
877 }//chi2 per TPC cluster
878 if(fMaxCov11Flag) {
879 if(extCov[0] > fMaxCov11) {
880 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(4)))->Fill(extCov[0]);
881 status = kFALSE;
882 }
883 else if(extCov[0] <= fMaxCov11)
884 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(4)))->Fill(extCov[0]);
885 }//cov11
886 if(fMaxCov22Flag) {
887 if(extCov[2] > fMaxCov22) {
888 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(5)))->Fill(extCov[2]);
889 status = kFALSE;
890 }
891 else if(extCov[2] <= fMaxCov22)
892 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(5)))->Fill(extCov[2]);
893 }//cov11
894 if(fMaxCov33Flag) {
895 if(extCov[5] > fMaxCov33) {
896 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(6)))->Fill(extCov[5]);
897 status = kFALSE;
898 }
899 else if(extCov[5] <= fMaxCov33)
900 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(6)))->Fill(extCov[5]);
901 }//cov11
902 if(fMaxCov44Flag) {
903 if(extCov[9] > fMaxCov44) {
904 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(7)))->Fill(extCov[9]);
905 status = kFALSE;
906 }
907 else if(extCov[9] <= fMaxCov44)
908 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(7)))->Fill(extCov[9]);
909 }//cov11
910 if(fMaxCov55Flag) {
911 if(extCov[14] > fMaxCov55) {
912 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(8)))->Fill(extCov[14]);
913 status = kFALSE;
914 }
915 else if(extCov[14] <= fMaxCov55)
916 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(8)))->Fill(extCov[14]);
917 }//cov55
918 if(fMaxSigmaToVertexFlag) {
919 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
920 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
921 status = kFALSE;
922 }
923 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
924 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
925 }//sigma to vertex
926 if(fMaxSigmaToVertexTPCFlag) {
927 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
928 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
929 status = kFALSE;
930 }
931 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
932 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
933 }//sigma to vertex TPC
934 if(fITSRefitFlag) {
935 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
936 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(11)))->Fill(0);
937 status = kFALSE;
938 }
939 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
940 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(11)))->Fill(0);
941 }//ITS refit
942 if(fTPCRefitFlag) {
943 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
944 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(12)))->Fill(0);
945 status = kFALSE;
946 }
947 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
948 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(12)))->Fill(0);
949 }//TPC refit
950 if(fESDpidFlag) {
951 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
952 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(13)))->Fill(0);
953 status = kFALSE;
954 }
955 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
956 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(13)))->Fill(0);
957 }//ESD pid
958 if(fTPCpidFlag) {
959 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
960 ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(13)))->Fill(0);
961 status = kFALSE;
962 }
963 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
964 ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(13)))->Fill(0);
965 }//TPC pid
966 }//primary particle cut
967
968 //Secondaries
969 if(label > nPrimaries) {
970 if(fMinITSClustersFlag) {
971 if(nClustersITS < fMinITSClusters) {
972 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(0)))->Fill(nClustersITS);
973 status = kFALSE;
974 }
975 else if(nClustersITS >= fMinITSClusters)
976 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(0)))->Fill(nClustersITS);
977 }//ITS clusters
978 if(fMaxChi2PerITSClusterFlag) {
979 if(chi2PerClusterITS > fMaxChi2PerITSCluster) {
980 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
981 status = kFALSE;
982 }
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);
989 status = kFALSE;
990 }
991 else if(nClustersTPC >= fMinTPCClusters)
992 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
993 }//TPC clusters
994 if(fMaxChi2PerTPCClusterFlag) {
995 if(chi2PerClusterTPC > fMaxChi2PerTPCCluster) {
996 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
997 status = kFALSE;
998 }
999 else if(chi2PerClusterTPC <= fMaxChi2PerTPCCluster)
1000 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
1001 }//chi2 per TPC cluster
1002 if(fMaxCov11Flag) {
1003 if(extCov[0] > fMaxCov11) {
1004 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(4)))->Fill(extCov[0]);
1005 status = kFALSE;
1006 }
1007 else if(extCov[0] <= fMaxCov11)
1008 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(4)))->Fill(extCov[0]);
1009 }//cov11
1010 if(fMaxCov22Flag) {
1011 if(extCov[2] > fMaxCov22) {
1012 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(5)))->Fill(extCov[2]);
1013 status = kFALSE;
1014 }
1015 else if(extCov[2] <= fMaxCov22)
1016 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(5)))->Fill(extCov[2]);
1017 }//cov11
1018 if(fMaxCov33Flag) {
1019 if(extCov[5] > fMaxCov33) {
1020 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(6)))->Fill(extCov[5]);
1021 status = kFALSE;
1022 }
1023 else if(extCov[5] <= fMaxCov33)
1024 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(6)))->Fill(extCov[5]);
1025 }//cov11
1026 if(fMaxCov44Flag) {
1027 if(extCov[9] > fMaxCov44) {
1028 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(7)))->Fill(extCov[9]);
1029 status = kFALSE;
1030 }
1031 else if(extCov[9] <= fMaxCov44)
1032 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(7)))->Fill(extCov[9]);
1033 }//cov11
1034 if(fMaxCov55Flag) {
1035 if(extCov[14] > fMaxCov55) {
1036 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(8)))->Fill(extCov[14]);
1037 status = kFALSE;
1038 }
1039 else if(extCov[14] <= fMaxCov55)
1040 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(8)))->Fill(extCov[14]);
1041 }//cov55
1042 if(fMaxSigmaToVertexFlag) {
1043 if(GetSigmaToVertex(track) > fMaxSigmaToVertex) {
1044 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(9)))->Fill(GetSigmaToVertex(track));
1045 status = kFALSE;
1046 }
1047 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertex)
1048 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(9)))->Fill(GetSigmaToVertex(track));
1049 }//sigma to vertex
1050 if(fMaxSigmaToVertexTPCFlag) {
1051 if(GetSigmaToVertex(track) > fMaxSigmaToVertexTPC) {
1052 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(10)))->Fill(GetSigmaToVertex(track));
1053 status = kFALSE;
1054 }
1055 else if(GetSigmaToVertex(track) <= fMaxSigmaToVertexTPC)
1056 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(10)))->Fill(GetSigmaToVertex(track));
1057 }//sigma to vertex TPC
1058 if(fITSRefitFlag) {
1059 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
1060 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(11)))->Fill(0);
1061 status = kFALSE;
1062 }
1063 else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
1064 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(11)))->Fill(0);
1065 }//ITS refit
1066 if(fTPCRefitFlag) {
1067 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
1068 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(12)))->Fill(0);
1069 status = kFALSE;
1070 }
1071 else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
1072 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(12)))->Fill(0);
1073 }//TPC refit
1074 if(fESDpidFlag) {
1075 if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
1076 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(13)))->Fill(0);
1077 status = kFALSE;
1078 }
1079 else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
1080 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(13)))->Fill(0);
1081 }//ESD pid
1082 if(fTPCpidFlag) {
1083 if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
1084 ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(13)))->Fill(0);
1085 status = kFALSE;
1086 }
1087 else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
1088 ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(13)))->Fill(0);
1089 }//TPC pid
1090 }//secondary particle cut
1091 }//antiprotons
1092
1093 if((Pt < fMinPt) || (Pt > fMaxPt)) status = kFALSE;
1094 if((Rapidity(Px,Py,Pz) < fMinY) || (Rapidity(Px,Py,Pz) > fMaxY)) status = kFALSE;
734d2c12 1095
f24a70b0 1096 return status;
734d2c12 1097}
1098
1099//____________________________________________________________________//
1100Float_t AliProtonAnalysis::GetSigmaToVertex(AliESDtrack* esdTrack) {
1101 // Calculates the number of sigma to the vertex.
1102
1103 Float_t b[2];
1104 Float_t bRes[2];
1105 Float_t bCov[3];
f2eeda10 1106 if(fUseTPCOnly)
1107 esdTrack->GetImpactParametersTPC(b,bCov);
1108 else
1109 esdTrack->GetImpactParameters(b,bCov);
1110
734d2c12 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;
1114 }
1115 bRes[0] = TMath::Sqrt(bCov[0]);
1116 bRes[1] = TMath::Sqrt(bCov[2]);
1117
1118 if (bRes[0] == 0 || bRes[1] ==0) return -1;
1119
1120 Float_t d = TMath::Sqrt(TMath::Power(b[0]/bRes[0],2) + TMath::Power(b[1]/bRes[1],2));
1121
1122 if (TMath::Exp(-d * d / 2) < 1e-10) return 1000;
1123
1124 d = TMath::ErfInverse(1 - TMath::Exp(-d * d / 2)) * TMath::Sqrt(2);
1125
1126 return d;
1127}
1128
3f6d0c08 1129//____________________________________________________________________//
2b748670 1130Double_t AliProtonAnalysis::Rapidity(Double_t Px, Double_t Py, Double_t Pz) {
3f6d0c08 1131 //returns the rapidity of the proton - to be removed
734d2c12 1132 Double_t fMass = 9.38270000000000048e-01;
1133
2b748670 1134 Double_t P = TMath::Sqrt(TMath::Power(Px,2) +
1135 TMath::Power(Py,2) +
1136 TMath::Power(Pz,2));
734d2c12 1137 Double_t energy = TMath::Sqrt(P*P + fMass*fMass);
1138 Double_t y = -999;
2b748670 1139 if(energy != Pz)
1140 y = 0.5*TMath::Log((energy + Pz)/(energy - Pz));
734d2c12 1141
1142 return y;
1143}
3f6d0c08 1144
1145//____________________________________________________________________//
1146Bool_t AliProtonAnalysis::PrintMean(TH1 *hist, Double_t edge) {
1147 //calculates the mean value of the ratio/asymmetry within \pm edge
1148 Double_t sum = 0.0;
1149 Int_t nentries = 0;
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) {
1155 sum += y;
1156 nentries += 1;
1157 }
1158 }
1159 Double_t mean = 0.0;
1160 if(nentries != 0)
1161 mean = sum/nentries;
1162
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);
1169 nentries += 1;
1170 }
1171 }
1172
1173 Double_t error = 0.0;
1174 if(nentries != 0)
1175 error = TMath::Sqrt(sum)/nentries;
1176
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;
1183
1184 return 0;
1185}
1186
1187//____________________________________________________________________//
1188Bool_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) {
1196 sum += y;
1197 sumerror += TMath::Power(hist->GetBinError(i+1),2);
1198 }
1199 }
1200
1201 error = TMath::Sqrt(sumerror);
1202
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;
1209
1210 return 0;
1211}
1212
39f2a708 1213//____________________________________________________________________//
1214Bool_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;
1219
1220 TFile *file = TFile::Open(filename);
1221 if(!file) {
1222 cout<<"Could not find the input CORRFW file "<<filename<<endl;
1223 status = kFALSE;
1224 }
1225
cdb3530f 1226 //________________________________________//
1227 //Protons
1228 fCorrectionListProtons2D = new TList();
1229 fEfficiencyListProtons1D = new TList();
1230 fCorrectionListProtons1D = new TList();
1231
1232 AliCFContainer *corrfwContainerProtons = (AliCFContainer*) (file->Get("containerProtons"));
1233 if(!corrfwContainerProtons) {
1234 cout<<"CORRFW container for protons not found!"<<endl;
39f2a708 1235 status = kFALSE;
1236 }
1237
cdb3530f 1238 Int_t nSteps = corrfwContainerProtons->GetNStep();
39f2a708 1239 TH2D *gYPt[4];
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;
9b168f47 1243 AliCFEffGrid *effProtonsStep0Step1 = new AliCFEffGrid("eff10",
1244 "effProtonsStep0Step1",
1245 *corrfwContainerProtons);
1246 effProtonsStep0Step1->CalculateEfficiency(1,0); //eff= step1/step0
1247 gYPt[0] = effProtonsStep0Step1->Project(iRap,iPt);
1248 fCorrectionListProtons2D->Add(gYPt[0]);
1249
1250 AliCFEffGrid *effProtonsStep0Step2 = new AliCFEffGrid("eff20",
1251 "effProtonsStep0Step2",
1252 *corrfwContainerProtons);
1253 effProtonsStep0Step2->CalculateEfficiency(2,0); //eff= step2/step0
1254 gYPt[1] = effProtonsStep0Step2->Project(iRap,iPt);
1255 fCorrectionListProtons2D->Add(gYPt[1]);
1256
1257 AliCFEffGrid *effProtonsStep0Step3 = new AliCFEffGrid("eff30",
1258 "effProtonsStep0Step3",
1259 *corrfwContainerProtons);
1260 effProtonsStep0Step3->CalculateEfficiency(3,0); //eff= step1/step0
1261 gYPt[2] = effProtonsStep0Step3->Project(iRap,iPt);
1262 fCorrectionListProtons2D->Add(gYPt[2]);
1263
1264 TH1D *gEfficiency[2][3]; //efficiency as a function of pT and of y (raws-[2])
1265 TH1D *gCorrection[2][3]; //efficiency as a function of pT and of y (raws-[2])
39f2a708 1266 TString gTitle = 0;
cdb3530f 1267 //Get the projection of the efficiency maps
9b168f47 1268 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1269 gEfficiency[iParameter][0] = effProtonsStep0Step1->Project(iParameter);
1270 gTitle = "ProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1271 gTitle += "_Step0_Step1";
1272 gEfficiency[iParameter][0]->SetName(gTitle.Data());
1273 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][0]);
1274 gTitle = "ProtonsCorrection_Parameter"; gTitle += iParameter+1;
1275 gTitle += "_Step0_Step1";
1276 gCorrection[iParameter][0] = new TH1D(gTitle.Data(),
1277 gTitle.Data(),
1278 gEfficiency[iParameter][0]->GetNbinsX(),
1279 gEfficiency[iParameter][0]->GetXaxis()->GetXmin(),
1280 gEfficiency[iParameter][0]->GetXaxis()->GetXmax());
1281 //initialisation of the correction
1282 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][0]->GetNbinsX(); iBin++)
1283 gCorrection[iParameter][0]->SetBinContent(iBin,1.0);
1284
1285 gEfficiency[iParameter][1] = effProtonsStep0Step2->Project(iParameter);
1286 gTitle = "ProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1287 gTitle += "_Step0_Step2";
1288 gEfficiency[iParameter][1]->SetName(gTitle.Data());
1289 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][1]);
1290 gTitle = "ProtonsCorrection_Parameter"; gTitle += iParameter+1;
1291 gTitle += "_Step0_Step2";
1292 gCorrection[iParameter][1] = new TH1D(gTitle.Data(),
1293 gTitle.Data(),
1294 gEfficiency[iParameter][1]->GetNbinsX(),
1295 gEfficiency[iParameter][1]->GetXaxis()->GetXmin(),
1296 gEfficiency[iParameter][1]->GetXaxis()->GetXmax());
1297 //initialisation of the correction
1298 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][1]->GetNbinsX(); iBin++)
1299 gCorrection[iParameter][1]->SetBinContent(iBin,1.0);
1300
1301 gEfficiency[iParameter][2] = effProtonsStep0Step3->Project(iParameter);
1302 gTitle = "ProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1303 gTitle += "_Step0_Step3";
1304 gEfficiency[iParameter][2]->SetName(gTitle.Data());
1305 fEfficiencyListProtons1D->Add(gEfficiency[iParameter][2]);
1306 gTitle = "ProtonsCorrection_Parameter"; gTitle += iParameter+1;
1307 gTitle += "_Step0_Step3";
1308 gCorrection[iParameter][2] = new TH1D(gTitle.Data(),
1309 gTitle.Data(),
1310 gEfficiency[iParameter][2]->GetNbinsX(),
1311 gEfficiency[iParameter][2]->GetXaxis()->GetXmin(),
1312 gEfficiency[iParameter][2]->GetXaxis()->GetXmax());
1313 //initialisation of the correction
1314 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][2]->GetNbinsX(); iBin++)
1315 gCorrection[iParameter][2]->SetBinContent(iBin,1.0);
cdb3530f 1316 }//parameter loop
1317 //Calculate the 1D correction parameters as a function of y and pT
1318 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1319 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1320 gCorrection[iParameter][iStep-1]->Divide(gEfficiency[iParameter][iStep-1]);
1321 fCorrectionListProtons1D->Add(gCorrection[iParameter][iStep-1]);
1322 }
1323 }
1324
1325 //________________________________________//
1326 //AntiProtons
1327 fCorrectionListAntiProtons2D = new TList();
1328 fEfficiencyListAntiProtons1D = new TList();
1329 fCorrectionListAntiProtons1D = new TList();
1330
1331 AliCFContainer *corrfwContainerAntiProtons = (AliCFContainer*) (file->Get("containerAntiProtons"));
1332 if(!corrfwContainerAntiProtons) {
1333 cout<<"CORRFW container for antiprotons not found!"<<endl;
1334 status = kFALSE;
1335 }
1336
1337 nSteps = corrfwContainerAntiProtons->GetNStep();
1338 //currently the GRID is formed by the y-pT parameters
1339 //Add Vz as a next step
9b168f47 1340 AliCFEffGrid *effAntiProtonsStep0Step1 = new AliCFEffGrid("eff10",
1341 "effAntiProtonsStep0Step1",
1342 *corrfwContainerAntiProtons);
1343 effAntiProtonsStep0Step1->CalculateEfficiency(1,0); //eff= step1/step0
1344 gYPt[0] = effAntiProtonsStep0Step1->Project(iRap,iPt);
1345 fCorrectionListAntiProtons2D->Add(gYPt[0]);
1346
1347 AliCFEffGrid *effAntiProtonsStep0Step2 = new AliCFEffGrid("eff20",
1348 "effAntiProtonsStep0Step2",
1349 *corrfwContainerAntiProtons);
1350 effAntiProtonsStep0Step2->CalculateEfficiency(2,0); //eff= step2/step0
1351 gYPt[1] = effAntiProtonsStep0Step2->Project(iRap,iPt);
1352 fCorrectionListAntiProtons2D->Add(gYPt[1]);
1353
1354 AliCFEffGrid *effAntiProtonsStep0Step3 = new AliCFEffGrid("eff30",
1355 "effAntiProtonsStep0Step3",
1356 *corrfwContainerAntiProtons);
1357 effAntiProtonsStep0Step3->CalculateEfficiency(3,0); //eff= step1/step0
1358 gYPt[2] = effAntiProtonsStep0Step3->Project(iRap,iPt);
1359 fCorrectionListAntiProtons2D->Add(gYPt[2]);
cdb3530f 1360
39f2a708 1361 //Get the projection of the efficiency maps
9b168f47 1362 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1363 gEfficiency[iParameter][0] = effAntiProtonsStep0Step1->Project(iParameter);
1364 gTitle = "AntiProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1365 gTitle += "_Step0_Step1";
1366 gEfficiency[iParameter][0]->SetName(gTitle.Data());
1367 fEfficiencyListAntiProtons1D->Add(gEfficiency[iParameter][0]);
1368 gTitle = "AntiProtonsCorrection_Parameter"; gTitle += iParameter+1;
1369 gTitle += "_Step0_Step1";
1370 gCorrection[iParameter][0] = new TH1D(gTitle.Data(),
1371 gTitle.Data(),
1372 gEfficiency[iParameter][0]->GetNbinsX(),
1373 gEfficiency[iParameter][0]->GetXaxis()->GetXmin(),
1374 gEfficiency[iParameter][0]->GetXaxis()->GetXmax());
1375 //initialisation of the correction
1376 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][0]->GetNbinsX(); iBin++)
1377 gCorrection[iParameter][0]->SetBinContent(iBin,1.0);
1378
1379 gEfficiency[iParameter][1] = effAntiProtonsStep0Step2->Project(iParameter);
1380 gTitle = "AntiProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1381 gTitle += "_Step0_Step2";
1382 gEfficiency[iParameter][1]->SetName(gTitle.Data());
1383 fEfficiencyListAntiProtons1D->Add(gEfficiency[iParameter][1]);
1384 gTitle = "AntiProtonsCorrection_Parameter"; gTitle += iParameter+1;
1385 gTitle += "_Step0_Step2";
1386 gCorrection[iParameter][1] = new TH1D(gTitle.Data(),
1387 gTitle.Data(),
1388 gEfficiency[iParameter][1]->GetNbinsX(),
1389 gEfficiency[iParameter][1]->GetXaxis()->GetXmin(),
1390 gEfficiency[iParameter][1]->GetXaxis()->GetXmax());
1391 //initialisation of the correction
1392 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][1]->GetNbinsX(); iBin++)
1393 gCorrection[iParameter][1]->SetBinContent(iBin,1.0);
1394
1395 gEfficiency[iParameter][2] = effAntiProtonsStep0Step3->Project(iParameter);
1396 gTitle = "AntiProtonsEfficiency_Parameter"; gTitle += iParameter+1;
1397 gTitle += "_Step0_Step3";
1398 gEfficiency[iParameter][2]->SetName(gTitle.Data());
1399 fEfficiencyListAntiProtons1D->Add(gEfficiency[iParameter][2]);
1400 gTitle = "AntiProtonsCorrection_Parameter"; gTitle += iParameter+1;
1401 gTitle += "_Step0_Step3";
1402 gCorrection[iParameter][2] = new TH1D(gTitle.Data(),
1403 gTitle.Data(),
1404 gEfficiency[iParameter][2]->GetNbinsX(),
1405 gEfficiency[iParameter][2]->GetXaxis()->GetXmin(),
1406 gEfficiency[iParameter][2]->GetXaxis()->GetXmax());
1407 //initialisation of the correction
1408 for(Int_t iBin = 1; iBin <= gEfficiency[iParameter][2]->GetNbinsX(); iBin++)
1409 gCorrection[iParameter][2]->SetBinContent(iBin,1.0);
39f2a708 1410 }//parameter loop
1411 //Calculate the 1D correction parameters as a function of y and pT
1412 for(Int_t iParameter = 0; iParameter < 2; iParameter++) {
1413 for(Int_t iStep = 1; iStep < nSteps; iStep++) {
1414 gCorrection[iParameter][iStep-1]->Divide(gEfficiency[iParameter][iStep-1]);
cdb3530f 1415 fCorrectionListAntiProtons1D->Add(gCorrection[iParameter][iStep-1]);
39f2a708 1416 }
1417 }
ef1a8dbd 1418
1419 return status;
39f2a708 1420}
1421
ef1a8dbd 1422//____________________________________________________________________//
1423void AliProtonAnalysis::InitQA() {
1424 //Initializes the QA histograms and builds the directory structure
7b59a00b 1425 if(!fQAHistograms) SetQAOn();
1426
ef1a8dbd 1427 //2D histograms
1428 TDirectory *dir2D = gDirectory->mkdir("2D");
1429 fGlobalQAList->Add(dir2D); dir2D->cd();
1430 TH2F *gHistYPtPrimaryProtonsPass = new TH2F("gHistYPtPrimaryProtonsPass",
1431 ";y;P_{T} [GeV/c]",
1432 fNBinsY,fMinY,fMaxY,
1433 fNBinsPt,fMinPt,fMaxPt);
1434 gHistYPtPrimaryProtonsPass->SetStats(kTRUE);
1435 gHistYPtPrimaryProtonsPass->GetXaxis()->SetTitleColor(1);
1436 fQA2DList->Add(gHistYPtPrimaryProtonsPass);
1437 TH2F *gHistYPtPrimaryAntiProtonsPass = new TH2F("gHistYPtAntiPrimaryProtonsPass",
1438 ";y;P_{T} [GeV/c]",
1439 fNBinsY,fMinY,fMaxY,
1440 fNBinsPt,fMinPt,fMaxPt);
1441 gHistYPtPrimaryAntiProtonsPass->SetStats(kTRUE);
1442 gHistYPtPrimaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1443 fQA2DList->Add(gHistYPtPrimaryAntiProtonsPass);
1444 TH2F *gHistYPtSecondaryProtonsPass = new TH2F("gHistYPtSecondaryAntiProtonsPass",
1445 ";y;P_{T} [GeV/c]",
1446 fNBinsY,fMinY,fMaxY,
1447 fNBinsPt,fMinPt,fMaxPt);
1448 gHistYPtSecondaryProtonsPass->SetStats(kTRUE);
1449 gHistYPtSecondaryProtonsPass->GetXaxis()->SetTitleColor(1);
1450 fQA2DList->Add(gHistYPtSecondaryProtonsPass);
1451 TH2F *gHistYPtSecondaryAntiAntiProtonsPass = new TH2F("gHistYPtAntiSecondaryAntiProtonsPass",
1452 ";y;P_{T} [GeV/c]",
1453 fNBinsY,fMinY,fMaxY,
1454 fNBinsPt,fMinPt,fMaxPt);
1455 gHistYPtSecondaryAntiAntiProtonsPass->SetStats(kTRUE);
1456 gHistYPtSecondaryAntiAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1457 fQA2DList->Add(gHistYPtSecondaryAntiAntiProtonsPass);
1458
1459 gDirectory->cd("../");
1460 //protons
1461 TDirectory *dirProtons = gDirectory->mkdir("Protons");
1462 fGlobalQAList->Add(dirProtons); dirProtons->cd();
1463
1464 //________________________________________________________________//
1465 TDirectory *dirProtonsPrimary = gDirectory->mkdir("Primaries");
1466 dirProtonsPrimary->cd();
1467 TDirectory *dirProtonsPrimaryAccepted = gDirectory->mkdir("Accepted");
1468 dirProtonsPrimaryAccepted->cd();
1469
1470 //Accepted primary protons
1471 TH1F *fPrimaryProtonsITSClustersPass = new TH1F("fPrimaryProtonsITSClustersPass",
1472 ";N_{clusters} (ITS);Entries",
1473 7,0,7);
1474 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsITSClustersPass);
1475 TH1F *fPrimaryProtonsChi2PerClusterITSPass = new TH1F("fPrimaryProtonsChi2PerClusterITSPass",
1476 ";x^{2}/N_{clusters} (ITS);Entries",
1477 100,0,4);
1478 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsChi2PerClusterITSPass);
1479 TH1F *fPrimaryProtonsTPCClustersPass = new TH1F("fPrimaryProtonsTPCClustersPass",
1480 ";N_{clusters} (TPC);Entries",
1481 100,0,200);
1482 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsTPCClustersPass);
1483 TH1F *fPrimaryProtonsChi2PerClusterTPCPass = new TH1F("fPrimaryProtonsChi2PerClusterTPCPass",
1484 ";x^{2}/N_{clusters} (TPC);Entries",
1485 100,0,4);
1486 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsChi2PerClusterTPCPass);
1487 TH1F *fPrimaryProtonsExtCov11Pass = new TH1F("fPrimaryProtonsExtCov11Pass",
1488 ";#sigma_{y} [cm];Entries",
1489 100,0,4);
1490 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov11Pass);
1491 TH1F *fPrimaryProtonsExtCov22Pass = new TH1F("fPrimaryProtonsExtCov22Pass",
1492 ";#sigma_{z} [cm];Entries",
1493 100,0,4);
1494 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov22Pass);
1495 TH1F *fPrimaryProtonsExtCov33Pass = new TH1F("fPrimaryProtonsExtCov33Pass",
1496 ";#sigma_{sin(#phi)};Entries",
1497 100,0,4);
1498 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov33Pass);
1499 TH1F *fPrimaryProtonsExtCov44Pass = new TH1F("fPrimaryProtonsExtCov44Pass",
1500 ";#sigma_{tan(#lambda)};Entries",
1501 100,0,4);
1502 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov44Pass);
1503 TH1F *fPrimaryProtonsExtCov55Pass = new TH1F("fPrimaryProtonsExtCov55Pass",
1504 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1505 100,0,4);
1506 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsExtCov55Pass);
1507 TH1F *fPrimaryProtonsSigmaToVertexPass = new TH1F("fPrimaryProtonsSigmaToVertexPass",
1508 ";#sigma_{Vertex};Entries",
1509 100,0,10);
1510 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsSigmaToVertexPass);
1511 TH1F *fPrimaryProtonsSigmaToVertexTPCPass = new TH1F("fPrimaryProtonsSigmaToVertexTPCPass",
1512 ";#sigma_{Vertex};Entries",
1513 100,0,10);
1514 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsSigmaToVertexTPCPass);
1515 TH1F *fPrimaryProtonsITSRefitPass = new TH1F("fPrimaryProtonsITSRefitPass",
1516 "",10,-1,1);
1517 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsITSRefitPass);
1518 TH1F *fPrimaryProtonsTPCRefitPass = new TH1F("fPrimaryProtonsTPCRefitPass",
1519 "",10,-1,1);
1520 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsTPCRefitPass);
1521 TH1F *fPrimaryProtonsESDpidPass = new TH1F("fPrimaryProtonsESDpidPass",
1522 "",10,-1,1);
1523 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsESDpidPass);
1524 TH1F *fPrimaryProtonsTPCpidPass = new TH1F("fPrimaryProtonsTPCpidPass",
1525 "",10,-1,1);
1526 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsTPCpidPass);
1527
1528 //Rejected primary protons
1529 gDirectory->cd("../");
1530 TDirectory *dirProtonsPrimaryRejected = gDirectory->mkdir("Rejected");
1531 dirProtonsPrimaryRejected->cd();
1532
1533 TH1F *fPrimaryProtonsITSClustersReject = new TH1F("fPrimaryProtonsITSClustersReject",
1534 ";N_{clusters} (ITS);Entries",
1535 7,0,7);
1536 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsITSClustersReject);
1537 TH1F *fPrimaryProtonsChi2PerClusterITSReject = new TH1F("fPrimaryProtonsChi2PerClusterITSReject",
1538 ";x^{2}/N_{clusters} (ITS);Entries",
1539 100,0,4);
1540 fQAPrimaryProtonsAcceptedList->Add(fPrimaryProtonsChi2PerClusterITSReject);
1541 TH1F *fPrimaryProtonsTPCClustersReject = new TH1F("fPrimaryProtonsTPCClustersReject",
1542 ";N_{clusters} (TPC);Entries",
1543 100,0,200);
1544 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsTPCClustersReject);
1545 TH1F *fPrimaryProtonsChi2PerClusterTPCReject = new TH1F("fPrimaryProtonsChi2PerClusterTPCReject",
1546 ";x^{2}/N_{clusters} (TPC);Entries",
1547 100,0,4);
1548 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsChi2PerClusterTPCReject);
1549 TH1F *fPrimaryProtonsExtCov11Reject = new TH1F("fPrimaryProtonsExtCov11Reject",
1550 ";#sigma_{y} [cm];Entries",
1551 100,0,4);
1552 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov11Reject);
1553 TH1F *fPrimaryProtonsExtCov22Reject = new TH1F("fPrimaryProtonsExtCov22Reject",
1554 ";#sigma_{z} [cm];Entries",
1555 100,0,4);
1556 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov22Reject);
1557 TH1F *fPrimaryProtonsExtCov33Reject = new TH1F("fPrimaryProtonsExtCov33Reject",
1558 ";#sigma_{sin(#phi)};Entries",
1559 100,0,4);
1560 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov33Reject);
1561 TH1F *fPrimaryProtonsExtCov44Reject = new TH1F("fPrimaryProtonsExtCov44Reject",
1562 ";#sigma_{tan(#lambda)};Entries",
1563 100,0,4);
1564 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov44Reject);
1565 TH1F *fPrimaryProtonsExtCov55Reject = new TH1F("fPrimaryProtonsExtCov55Reject",
1566 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1567 100,0,4);
1568 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsExtCov55Reject);
1569 TH1F *fPrimaryProtonsSigmaToVertexReject = new TH1F("fPrimaryProtonsSigmaToVertexReject",
1570 ";#sigma_{Vertex};Entries",
1571 100,0,10);
1572 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsSigmaToVertexReject);
1573 TH1F *fPrimaryProtonsSigmaToVertexTPCReject = new TH1F("fPrimaryProtonsSigmaToVertexTPCReject",
1574 ";#sigma_{Vertex};Entries",
1575 100,0,10);
1576 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsSigmaToVertexTPCReject);
1577 TH1F *fPrimaryProtonsITSRefitReject = new TH1F("fPrimaryProtonsITSRefitReject",
1578 "",10,-1,1);
1579 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsITSRefitReject);
1580 TH1F *fPrimaryProtonsTPCRefitReject = new TH1F("fPrimaryProtonsTPCRefitReject",
1581 "",10,-1,1);
1582 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsTPCRefitReject);
1583 TH1F *fPrimaryProtonsESDpidReject = new TH1F("fPrimaryProtonsESDpidReject",
1584 "",10,-1,1);
1585 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsESDpidReject);
1586 TH1F *fPrimaryProtonsTPCpidReject = new TH1F("fPrimaryProtonsTPCpidReject",
1587 "",10,-1,1);
1588 fQAPrimaryProtonsRejectedList->Add(fPrimaryProtonsTPCpidReject);
1589
1590 //________________________________________________________________//
1591 gDirectory->cd("../../");
1592
1593 TDirectory *dirProtonsSecondary = gDirectory->mkdir("Secondaries");
1594 dirProtonsSecondary->cd();
1595 TDirectory *dirProtonsSecondaryAccepted = gDirectory->mkdir("Accepted");
1596 dirProtonsSecondaryAccepted->cd();
1597
1598 //Accepted secondary protons
1599 TH1F *fSecondaryProtonsITSClustersPass = new TH1F("fSecondaryProtonsITSClustersPass",
1600 ";N_{clusters} (ITS);Entries",
1601 7,0,7);
1602 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsITSClustersPass);
1603 TH1F *fSecondaryProtonsChi2PerClusterITSPass = new TH1F("fSecondaryProtonsChi2PerClusterITSPass",
1604 ";x^{2}/N_{clusters} (ITS);Entries",
1605 100,0,4);
1606 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsChi2PerClusterITSPass);
1607 TH1F *fSecondaryProtonsTPCClustersPass = new TH1F("fSecondaryProtonsTPCClustersPass",
1608 ";N_{clusters} (TPC);Entries",
1609 100,0,200);
1610 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsTPCClustersPass);
1611 TH1F *fSecondaryProtonsChi2PerClusterTPCPass = new TH1F("fSecondaryProtonsChi2PerClusterTPCPass",
1612 ";x^{2}/N_{clusters} (TPC);Entries",
1613 100,0,4);
1614 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsChi2PerClusterTPCPass);
1615 TH1F *fSecondaryProtonsExtCov11Pass = new TH1F("fSecondaryProtonsExtCov11Pass",
1616 ";#sigma_{y} [cm];Entries",
1617 100,0,4);
1618 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov11Pass);
1619 TH1F *fSecondaryProtonsExtCov22Pass = new TH1F("fSecondaryProtonsExtCov22Pass",
1620 ";#sigma_{z} [cm];Entries",
1621 100,0,4);
1622 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov22Pass);
1623 TH1F *fSecondaryProtonsExtCov33Pass = new TH1F("fSecondaryProtonsExtCov33Pass",
1624 ";#sigma_{sin(#phi)};Entries",
1625 100,0,4);
1626 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov33Pass);
1627 TH1F *fSecondaryProtonsExtCov44Pass = new TH1F("fSecondaryProtonsExtCov44Pass",
1628 ";#sigma_{tan(#lambda)};Entries",
1629 100,0,4);
1630 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov44Pass);
1631 TH1F *fSecondaryProtonsExtCov55Pass = new TH1F("fSecondaryProtonsExtCov55Pass",
1632 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1633 100,0,4);
1634 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsExtCov55Pass);
1635 TH1F *fSecondaryProtonsSigmaToVertexPass = new TH1F("fSecondaryProtonsSigmaToVertexPass",
1636 ";#sigma_{Vertex};Entries",
1637 100,0,10);
1638 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsSigmaToVertexPass);
1639 TH1F *fSecondaryProtonsSigmaToVertexTPCPass = new TH1F("fSecondaryProtonsSigmaToVertexTPCPass",
1640 ";#sigma_{Vertex};Entries",
1641 100,0,10);
1642 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsSigmaToVertexTPCPass);
1643 TH1F *fSecondaryProtonsITSRefitPass = new TH1F("fSecondaryProtonsITSRefitPass",
1644 "",10,-1,1);
1645 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsITSRefitPass);
1646 TH1F *fSecondaryProtonsTPCRefitPass = new TH1F("fSecondaryProtonsTPCRefitPass",
1647 "",10,-1,1);
1648 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsTPCRefitPass);
1649 TH1F *fSecondaryProtonsESDpidPass = new TH1F("fSecondaryProtonsESDpidPass",
1650 "",10,-1,1);
1651 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsESDpidPass);
1652 TH1F *fSecondaryProtonsTPCpidPass = new TH1F("fSecondaryProtonsTPCpidPass",
1653 "",10,-1,1);
1654 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsTPCpidPass);
1655
1656 //Rejected secondary protons
1657 gDirectory->cd("../");
1658 TDirectory *dirProtonsSecondaryRejected = gDirectory->mkdir("Rejected");
1659 dirProtonsSecondaryRejected->cd();
1660
1661 TH1F *fSecondaryProtonsITSClustersReject = new TH1F("fSecondaryProtonsITSClustersReject",
1662 ";N_{clusters} (ITS);Entries",
1663 7,0,7);
1664 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsITSClustersReject);
1665 TH1F *fSecondaryProtonsChi2PerClusterITSReject = new TH1F("fSecondaryProtonsChi2PerClusterITSReject",
1666 ";x^{2}/N_{clusters} (ITS);Entries",
1667 100,0,4);
1668 fQASecondaryProtonsAcceptedList->Add(fSecondaryProtonsChi2PerClusterITSReject);
1669 TH1F *fSecondaryProtonsTPCClustersReject = new TH1F("fSecondaryProtonsTPCClustersReject",
1670 ";N_{clusters} (TPC);Entries",
1671 100,0,200);
1672 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsTPCClustersReject);
1673 TH1F *fSecondaryProtonsChi2PerClusterTPCReject = new TH1F("fSecondaryProtonsChi2PerClusterTPCReject",
1674 ";x^{2}/N_{clusters} (TPC);Entries",
1675 100,0,4);
1676 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsChi2PerClusterTPCReject);
1677 TH1F *fSecondaryProtonsExtCov11Reject = new TH1F("fSecondaryProtonsExtCov11Reject",
1678 ";#sigma_{y} [cm];Entries",
1679 100,0,4);
1680 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov11Reject);
1681 TH1F *fSecondaryProtonsExtCov22Reject = new TH1F("fSecondaryProtonsExtCov22Reject",
1682 ";#sigma_{z} [cm];Entries",
1683 100,0,4);
1684 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov22Reject);
1685 TH1F *fSecondaryProtonsExtCov33Reject = new TH1F("fSecondaryProtonsExtCov33Reject",
1686 ";#sigma_{sin(#phi)};Entries",
1687 100,0,4);
1688 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov33Reject);
1689 TH1F *fSecondaryProtonsExtCov44Reject = new TH1F("fSecondaryProtonsExtCov44Reject",
1690 ";#sigma_{tan(#lambda)};Entries",
1691 100,0,4);
1692 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov44Reject);
1693 TH1F *fSecondaryProtonsExtCov55Reject = new TH1F("fSecondaryProtonsExtCov55Reject",
1694 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1695 100,0,4);
1696 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsExtCov55Reject);
1697 TH1F *fSecondaryProtonsSigmaToVertexReject = new TH1F("fSecondaryProtonsSigmaToVertexReject",
1698 ";#sigma_{Vertex};Entries",
1699 100,0,10);
1700 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsSigmaToVertexReject);
1701 TH1F *fSecondaryProtonsSigmaToVertexTPCReject = new TH1F("fSecondaryProtonsSigmaToVertexTPCReject",
1702 ";#sigma_{Vertex};Entries",
1703 100,0,10);
1704 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsSigmaToVertexTPCReject);
1705 TH1F *fSecondaryProtonsITSRefitReject = new TH1F("fSecondaryProtonsITSRefitReject",
1706 "",10,-1,1);
1707 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsITSRefitReject);
1708 TH1F *fSecondaryProtonsTPCRefitReject = new TH1F("fSecondaryProtonsTPCRefitReject",
1709 "",10,-1,1);
1710 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsTPCRefitReject);
1711 TH1F *fSecondaryProtonsESDpidReject = new TH1F("fSecondaryProtonsESDpidReject",
1712 "",10,-1,1);
1713 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsESDpidReject);
1714 TH1F *fSecondaryProtonsTPCpidReject = new TH1F("fSecondaryProtonsTPCpidReject",
1715 "",10,-1,1);
1716 fQASecondaryProtonsRejectedList->Add(fSecondaryProtonsTPCpidReject);
1717
1718
1719 gDirectory->cd("../../../");
1720
1721 //antiprotons
1722 TDirectory *dirAntiProtons = gDirectory->mkdir("AntiProtons");
1723 fGlobalQAList->Add(dirAntiProtons); dirAntiProtons->cd();
1724
1725 //________________________________________________________________//
1726 TDirectory *dirAntiProtonsPrimary = gDirectory->mkdir("Primaries");
1727 dirAntiProtonsPrimary->cd();
1728 TDirectory *dirAntiProtonsPrimaryAccepted = gDirectory->mkdir("Accepted");
1729 dirAntiProtonsPrimaryAccepted->cd();
1730
1731 //Accepted primary antiprotons
1732 TH1F *fPrimaryAntiProtonsITSClustersPass = new TH1F("fPrimaryAntiProtonsITSClustersPass",
1733 ";N_{clusters} (ITS);Entries",
1734 7,0,7);
1735 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsITSClustersPass);
1736 TH1F *fPrimaryAntiProtonsChi2PerClusterITSPass = new TH1F("fPrimaryAntiProtonsChi2PerClusterITSPass",
1737 ";x^{2}/N_{clusters} (ITS);Entries",
1738 100,0,4);
1739 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsChi2PerClusterITSPass);
1740 TH1F *fPrimaryAntiProtonsTPCClustersPass = new TH1F("fPrimaryAntiProtonsTPCClustersPass",
1741 ";N_{clusters} (TPC);Entries",
1742 100,0,200);
1743 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsTPCClustersPass);
1744 TH1F *fPrimaryAntiProtonsChi2PerClusterTPCPass = new TH1F("fPrimaryAntiProtonsChi2PerClusterTPCPass",
1745 ";x^{2}/N_{clusters} (TPC);Entries",
1746 100,0,4);
1747 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsChi2PerClusterTPCPass);
1748 TH1F *fPrimaryAntiProtonsExtCov11Pass = new TH1F("fPrimaryAntiProtonsExtCov11Pass",
1749 ";#sigma_{y} [cm];Entries",
1750 100,0,4);
1751 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov11Pass);
1752 TH1F *fPrimaryAntiProtonsExtCov22Pass = new TH1F("fPrimaryAntiProtonsExtCov22Pass",
1753 ";#sigma_{z} [cm];Entries",
1754 100,0,4);
1755 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov22Pass);
1756 TH1F *fPrimaryAntiProtonsExtCov33Pass = new TH1F("fPrimaryAntiProtonsExtCov33Pass",
1757 ";#sigma_{sin(#phi)};Entries",
1758 100,0,4);
1759 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov33Pass);
1760 TH1F *fPrimaryAntiProtonsExtCov44Pass = new TH1F("fPrimaryAntiProtonsExtCov44Pass",
1761 ";#sigma_{tan(#lambda)};Entries",
1762 100,0,4);
1763 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov44Pass);
1764 TH1F *fPrimaryAntiProtonsExtCov55Pass = new TH1F("fPrimaryAntiProtonsExtCov55Pass",
1765 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1766 100,0,4);
1767 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsExtCov55Pass);
1768 TH1F *fPrimaryAntiProtonsSigmaToVertexPass = new TH1F("fPrimaryAntiProtonsSigmaToVertexPass",
1769 ";#sigma_{Vertex};Entries",
1770 100,0,10);
1771 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsSigmaToVertexPass);
1772 TH1F *fPrimaryAntiProtonsSigmaToVertexTPCPass = new TH1F("fPrimaryAntiProtonsSigmaToVertexTPCPass",
1773 ";#sigma_{Vertex};Entries",
1774 100,0,10);
1775 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsSigmaToVertexTPCPass);
1776 TH1F *fPrimaryAntiProtonsITSRefitPass = new TH1F("fPrimaryAntiProtonsITSRefitPass",
1777 "",10,-1,1);
1778 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsITSRefitPass);
1779 TH1F *fPrimaryAntiProtonsTPCRefitPass = new TH1F("fPrimaryAntiProtonsTPCRefitPass",
1780 "",10,-1,1);
1781 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsTPCRefitPass);
1782 TH1F *fPrimaryAntiProtonsESDpidPass = new TH1F("fPrimaryAntiProtonsESDpidPass",
1783 "",10,-1,1);
1784 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsESDpidPass);
1785 TH1F *fPrimaryAntiProtonsTPCpidPass = new TH1F("fPrimaryAntiProtonsTPCpidPass",
1786 "",10,-1,1);
1787 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsTPCpidPass);
1788
1789 //Rejected primary antiprotons
1790 gDirectory->cd("../");
1791 TDirectory *dirAntiProtonsPrimaryRejected = gDirectory->mkdir("Rejected");
1792 dirAntiProtonsPrimaryRejected->cd();
1793
1794 TH1F *fPrimaryAntiProtonsITSClustersReject = new TH1F("fPrimaryAntiProtonsITSClustersReject",
1795 ";N_{clusters} (ITS);Entries",
1796 7,0,7);
1797 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsITSClustersReject);
1798 TH1F *fPrimaryAntiProtonsChi2PerClusterITSReject = new TH1F("fPrimaryAntiProtonsChi2PerClusterITSReject",
1799 ";x^{2}/N_{clusters} (ITS);Entries",
1800 100,0,4);
1801 fQAPrimaryAntiProtonsAcceptedList->Add(fPrimaryAntiProtonsChi2PerClusterITSReject);
1802 TH1F *fPrimaryAntiProtonsTPCClustersReject = new TH1F("fPrimaryAntiProtonsTPCClustersReject",
1803 ";N_{clusters} (TPC);Entries",
1804 100,0,200);
1805 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsTPCClustersReject);
1806 TH1F *fPrimaryAntiProtonsChi2PerClusterTPCReject = new TH1F("fPrimaryAntiProtonsChi2PerClusterTPCReject",
1807 ";x^{2}/N_{clusters} (TPC);Entries",
1808 100,0,4);
1809 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsChi2PerClusterTPCReject);
1810 TH1F *fPrimaryAntiProtonsExtCov11Reject = new TH1F("fPrimaryAntiProtonsExtCov11Reject",
1811 ";#sigma_{y} [cm];Entries",
1812 100,0,4);
1813 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov11Reject);
1814 TH1F *fPrimaryAntiProtonsExtCov22Reject = new TH1F("fPrimaryAntiProtonsExtCov22Reject",
1815 ";#sigma_{z} [cm];Entries",
1816 100,0,4);
1817 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov22Reject);
1818 TH1F *fPrimaryAntiProtonsExtCov33Reject = new TH1F("fPrimaryAntiProtonsExtCov33Reject",
1819 ";#sigma_{sin(#phi)};Entries",
1820 100,0,4);
1821 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov33Reject);
1822 TH1F *fPrimaryAntiProtonsExtCov44Reject = new TH1F("fPrimaryAntiProtonsExtCov44Reject",
1823 ";#sigma_{tan(#lambda)};Entries",
1824 100,0,4);
1825 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov44Reject);
1826 TH1F *fPrimaryAntiProtonsExtCov55Reject = new TH1F("fPrimaryAntiProtonsExtCov55Reject",
1827 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1828 100,0,4);
1829 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsExtCov55Reject);
1830 TH1F *fPrimaryAntiProtonsSigmaToVertexReject = new TH1F("fPrimaryAntiProtonsSigmaToVertexReject",
1831 ";#sigma_{Vertex};Entries",
1832 100,0,10);
1833 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsSigmaToVertexReject);
1834 TH1F *fPrimaryAntiProtonsSigmaToVertexTPCReject = new TH1F("fPrimaryAntiProtonsSigmaToVertexTPCReject",
1835 ";#sigma_{Vertex};Entries",
1836 100,0,10);
1837 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsSigmaToVertexTPCReject);
1838 TH1F *fPrimaryAntiProtonsITSRefitReject = new TH1F("fPrimaryAntiProtonsITSRefitReject",
1839 "",10,-1,1);
1840 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsITSRefitReject);
1841 TH1F *fPrimaryAntiProtonsTPCRefitReject = new TH1F("fPrimaryAntiProtonsTPCRefitReject",
1842 "",10,-1,1);
1843 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsTPCRefitReject);
1844 TH1F *fPrimaryAntiProtonsESDpidReject = new TH1F("fPrimaryAntiProtonsESDpidReject",
1845 "",10,-1,1);
1846 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsESDpidReject);
1847 TH1F *fPrimaryAntiProtonsTPCpidReject = new TH1F("fPrimaryAntiProtonsTPCpidReject",
1848 "",10,-1,1);
1849 fQAPrimaryAntiProtonsRejectedList->Add(fPrimaryAntiProtonsTPCpidReject);
1850
1851 //________________________________________________________________//
1852 gDirectory->cd("../../");
1853
1854 TDirectory *dirAntiProtonsSecondary = gDirectory->mkdir("Secondaries");
1855 dirAntiProtonsSecondary->cd();
1856 TDirectory *dirAntiProtonsSecondaryAccepted = gDirectory->mkdir("Accepted");
1857 dirAntiProtonsSecondaryAccepted->cd();
1858
1859 //Accepted secondary antiprotons
1860 TH1F *fSecondaryAntiProtonsITSClustersPass = new TH1F("fSecondaryAntiProtonsITSClustersPass",
1861 ";N_{clusters} (ITS);Entries",
1862 7,0,7);
1863 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsITSClustersPass);
1864 TH1F *fSecondaryAntiProtonsChi2PerClusterITSPass = new TH1F("fSecondaryAntiProtonsChi2PerClusterITSPass",
1865 ";x^{2}/N_{clusters} (ITS);Entries",
1866 100,0,4);
1867 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsChi2PerClusterITSPass);
1868 TH1F *fSecondaryAntiProtonsTPCClustersPass = new TH1F("fSecondaryAntiProtonsTPCClustersPass",
1869 ";N_{clusters} (TPC);Entries",
1870 100,0,200);
1871 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsTPCClustersPass);
1872 TH1F *fSecondaryAntiProtonsChi2PerClusterTPCPass = new TH1F("fSecondaryAntiProtonsChi2PerClusterTPCPass",
1873 ";x^{2}/N_{clusters} (TPC);Entries",
1874 100,0,4);
1875 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsChi2PerClusterTPCPass);
1876 TH1F *fSecondaryAntiProtonsExtCov11Pass = new TH1F("fSecondaryAntiProtonsExtCov11Pass",
1877 ";#sigma_{y} [cm];Entries",
1878 100,0,4);
1879 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov11Pass);
1880 TH1F *fSecondaryAntiProtonsExtCov22Pass = new TH1F("fSecondaryAntiProtonsExtCov22Pass",
1881 ";#sigma_{z} [cm];Entries",
1882 100,0,4);
1883 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov22Pass);
1884 TH1F *fSecondaryAntiProtonsExtCov33Pass = new TH1F("fSecondaryAntiProtonsExtCov33Pass",
1885 ";#sigma_{sin(#phi)};Entries",
1886 100,0,4);
1887 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov33Pass);
1888 TH1F *fSecondaryAntiProtonsExtCov44Pass = new TH1F("fSecondaryAntiProtonsExtCov44Pass",
1889 ";#sigma_{tan(#lambda)};Entries",
1890 100,0,4);
1891 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov44Pass);
1892 TH1F *fSecondaryAntiProtonsExtCov55Pass = new TH1F("fSecondaryAntiProtonsExtCov55Pass",
1893 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1894 100,0,4);
1895 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsExtCov55Pass);
1896 TH1F *fSecondaryAntiProtonsSigmaToVertexPass = new TH1F("fSecondaryAntiProtonsSigmaToVertexPass",
1897 ";#sigma_{Vertex};Entries",
1898 100,0,10);
1899 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsSigmaToVertexPass);
1900 TH1F *fSecondaryAntiProtonsSigmaToVertexTPCPass = new TH1F("fSecondaryAntiProtonsSigmaToVertexTPCPass",
1901 ";#sigma_{Vertex};Entries",
1902 100,0,10);
1903 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsSigmaToVertexTPCPass);
1904 TH1F *fSecondaryAntiProtonsITSRefitPass = new TH1F("fSecondaryAntiProtonsITSRefitPass",
1905 "",10,-1,1);
1906 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsITSRefitPass);
1907 TH1F *fSecondaryAntiProtonsTPCRefitPass = new TH1F("fSecondaryAntiProtonsTPCRefitPass",
1908 "",10,-1,1);
1909 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsTPCRefitPass);
1910 TH1F *fSecondaryAntiProtonsESDpidPass = new TH1F("fSecondaryAntiProtonsESDpidPass",
1911 "",10,-1,1);
1912 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsESDpidPass);
1913 TH1F *fSecondaryAntiProtonsTPCpidPass = new TH1F("fSecondaryAntiProtonsTPCpidPass",
1914 "",10,-1,1);
1915 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsTPCpidPass);
1916
1917 //Rejected secondary antiprotons
1918 gDirectory->cd("../");
1919 TDirectory *dirAntiProtonsSecondaryRejected = gDirectory->mkdir("Rejected");
1920 dirAntiProtonsSecondaryRejected->cd();
1921
1922 TH1F *fSecondaryAntiProtonsITSClustersReject = new TH1F("fSecondaryAntiProtonsITSClustersReject",
1923 ";N_{clusters} (ITS);Entries",
1924 7,0,7);
1925 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsITSClustersReject);
1926 TH1F *fSecondaryAntiProtonsChi2PerClusterITSReject = new TH1F("fSecondaryAntiProtonsChi2PerClusterITSReject",
1927 ";x^{2}/N_{clusters} (ITS);Entries",
1928 100,0,4);
1929 fQASecondaryAntiProtonsAcceptedList->Add(fSecondaryAntiProtonsChi2PerClusterITSReject);
1930 TH1F *fSecondaryAntiProtonsTPCClustersReject = new TH1F("fSecondaryAntiProtonsTPCClustersReject",
1931 ";N_{clusters} (TPC);Entries",
1932 100,0,200);
1933 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsTPCClustersReject);
1934 TH1F *fSecondaryAntiProtonsChi2PerClusterTPCReject = new TH1F("fSecondaryAntiProtonsChi2PerClusterTPCReject",
1935 ";x^{2}/N_{clusters} (TPC);Entries",
1936 100,0,4);
1937 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsChi2PerClusterTPCReject);
1938 TH1F *fSecondaryAntiProtonsExtCov11Reject = new TH1F("fSecondaryAntiProtonsExtCov11Reject",
1939 ";#sigma_{y} [cm];Entries",
1940 100,0,4);
1941 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov11Reject);
1942 TH1F *fSecondaryAntiProtonsExtCov22Reject = new TH1F("fSecondaryAntiProtonsExtCov22Reject",
1943 ";#sigma_{z} [cm];Entries",
1944 100,0,4);
1945 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov22Reject);
1946 TH1F *fSecondaryAntiProtonsExtCov33Reject = new TH1F("fSecondaryAntiProtonsExtCov33Reject",
1947 ";#sigma_{sin(#phi)};Entries",
1948 100,0,4);
1949 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov33Reject);
1950 TH1F *fSecondaryAntiProtonsExtCov44Reject = new TH1F("fSecondaryAntiProtonsExtCov44Reject",
1951 ";#sigma_{tan(#lambda)};Entries",
1952 100,0,4);
1953 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov44Reject);
1954 TH1F *fSecondaryAntiProtonsExtCov55Reject = new TH1F("fSecondaryAntiProtonsExtCov55Reject",
1955 ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1956 100,0,4);
1957 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsExtCov55Reject);
1958 TH1F *fSecondaryAntiProtonsSigmaToVertexReject = new TH1F("fSecondaryAntiProtonsSigmaToVertexReject",
1959 ";#sigma_{Vertex};Entries",
1960 100,0,10);
1961 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsSigmaToVertexReject);
1962 TH1F *fSecondaryAntiProtonsSigmaToVertexTPCReject = new TH1F("fSecondaryAntiProtonsSigmaToVertexTPCReject",
1963 ";#sigma_{Vertex};Entries",
1964 100,0,10);
1965 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsSigmaToVertexTPCReject);
1966 TH1F *fSecondaryAntiProtonsITSRefitReject = new TH1F("fSecondaryAntiProtonsITSRefitReject",
1967 "",10,-1,1);
1968 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsITSRefitReject);
1969 TH1F *fSecondaryAntiProtonsTPCRefitReject = new TH1F("fSecondaryAntiProtonsTPCRefitReject",
1970 "",10,-1,1);
1971 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsTPCRefitReject);
1972 TH1F *fSecondaryAntiProtonsESDpidReject = new TH1F("fSecondaryAntiProtonsESDpidReject",
1973 "",10,-1,1);
1974 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsESDpidReject);
1975 TH1F *fSecondaryAntiProtonsTPCpidReject = new TH1F("fSecondaryAntiProtonsTPCpidReject",
1976 "",10,-1,1);
1977 fQASecondaryAntiProtonsRejectedList->Add(fSecondaryAntiProtonsTPCpidReject);
1978
1979}
1980
1981//____________________________________________________________________//
1982void AliProtonAnalysis::RunQA(AliStack *stack, AliESDEvent *fESD) {
1983 //Runs the QA code
1984 Int_t nGoodTracks = fESD->GetNumberOfTracks();
1985 for(Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
1986 AliESDtrack* track = fESD->GetTrack(iTracks);
1987 Int_t label = TMath::Abs(track->GetLabel());
1988 Double_t Pt = 0.0, P = 0.0;
1989 Double_t probability[5];
1990
f24a70b0 1991 if(fUseTPCOnly) {
1992 AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
1993 if(!tpcTrack) continue;
1994 Pt = tpcTrack->Pt();
1995 P = tpcTrack->P();
1996
1997 //pid
1998 track->GetTPCpid(probability);
1999 Double_t rcc = 0.0;
2000 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
2001 rcc += probability[i]*GetParticleFraction(i,P);
2002 if(rcc == 0.0) continue;
2003 Double_t w[5];
2004 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
2005 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
2006 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
2007 if(fParticleType == 4) {
2008 if(IsAccepted(track, stack)) {
2009 if(label <= stack->GetNprimary()) {
ef1a8dbd 2010 if(track->Charge() > 0)
2011 ((TH2F *)(fQA2DList->At(0)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
2012 else if(track->Charge() < 0)
2013 ((TH2F *)(fQA2DList->At(1)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
2014 }//primary particles
2015 else if(label > stack->GetNprimary()) {
2016 if(track->Charge() > 0)
2017 ((TH2F *)(fQA2DList->At(2)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
2018 else if(track->Charge() < 0)
2019 ((TH2F *)(fQA2DList->At(3)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
2020 }//secondary particles
f24a70b0 2021 }//cuts
2022 }//proton check
2023 }//TPC only tracks
2024 else if(!fUseTPCOnly) {
2025 Pt = track->Pt();
2026 P = track->P();
2027
2028 //pid
2029 track->GetESDpid(probability);
2030 Double_t rcc = 0.0;
2031 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
2032 rcc += probability[i]*GetParticleFraction(i,P);
2033 if(rcc == 0.0) continue;
2034 Double_t w[5];
2035 for(Int_t i = 0; i < AliPID::kSPECIES; i++)
2036 w[i] = probability[i]*GetParticleFraction(i,P)/rcc;
2037 Long64_t fParticleType = TMath::LocMax(AliPID::kSPECIES,w);
2038 if(fParticleType == 4) {
2039 if(IsAccepted(track, stack)) {
ef1a8dbd 2040 if(label <= stack->GetNprimary()) {
2041 if(track->Charge() > 0)
2042 ((TH2F *)(fQA2DList->At(0)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
2043 else if(track->Charge() < 0)
2044 ((TH2F *)(fQA2DList->At(1)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
2045 }//primary particles
2046 else if(label > stack->GetNprimary()) {
2047 if(track->Charge() > 0)
2048 ((TH2F *)(fQA2DList->At(2)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
2049 else if(track->Charge() < 0)
2050 ((TH2F *)(fQA2DList->At(3)))->Fill(Rapidity(track->Px(),track->Py(),track->Pz()),Pt);
2051 }//secondary particles
f24a70b0 2052 }//cuts
2053 }//proton check
2054 }//combined tracking
ef1a8dbd 2055 }//track loop
2056
2057}
39f2a708 2058
2059
2060
2061
2062
2063
2064
3f6d0c08 2065
2066