d7e2e06c3cae28b109b8944a93ed50287fe1020c
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / AntiprotonToProton / AliProtonQAAnalysis.cxx
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: AliProtonQAAnalysis.cxx 29114 2008-10-03 16:49:02Z pchrist $ */
15
16 //-----------------------------------------------------------------
17 //                 AliProtonQAAnalysis class
18 //   This is the class to deal with the proton analysis
19 //   Origin: Panos Christakoglou | Panos.Christakoglou@cern.ch
20 //-----------------------------------------------------------------
21 #include <Riostream.h>
22 #include <TSystem.h>
23 #include <TF1.h>
24 #include <TH2D.h>
25 #include <TH3F.h>
26 #include <TH1D.h>
27 #include <TArrayI.h>
28 #include <TParticle.h>
29
30 #include "AliProtonQAAnalysis.h"
31 #include "AliProtonAnalysisBase.h"
32
33 #include <AliExternalTrackParam.h>
34 #include <AliESDEvent.h>
35 #include <AliLog.h>
36 #include <AliPID.h>
37 #include <AliStack.h>
38 #include <AliESDVertex.h>
39 #include <AliGenEventHeader.h>
40 #include <AliMCEvent.h>
41
42 ClassImp(AliProtonQAAnalysis)
43
44 //____________________________________________________________________//
45 AliProtonQAAnalysis::AliProtonQAAnalysis() : 
46   TObject(), fProtonAnalysisBase(0),
47   fNBinsY(0), fMinY(0), fMaxY(0), fY(0),
48   fNBinsPt(0), fMinPt(0), fMaxPt(0), fPt(0), fUseAsymmetricBinning(kFALSE),
49   fGlobalQAList(0), fQAVertexList(0), fQA2DList(0),
50   fQAPrimaryProtonsAcceptedList(0),
51   fQAPrimaryProtonsRejectedList(0),
52   fQASecondaryProtonsAcceptedList(0),
53   fQASecondaryProtonsRejectedList(0),
54   fQAPrimaryAntiProtonsAcceptedList(0),
55   fQAPrimaryAntiProtonsRejectedList(0),
56   fQASecondaryAntiProtonsAcceptedList(0),
57   fQASecondaryAntiProtonsRejectedList(0),
58   fPDGList(0), fMCProcessesList(0),
59   fRunMCAnalysis(kFALSE),
60   fMCProcessIdFlag(kFALSE), fMCProcessId(0),
61   fMotherParticlePDGCodeFlag(kFALSE), fMotherParticlePDGCode(0),
62   fAcceptedCutList(0), fRejectedCutList(0),
63   fAcceptedDCAList(0), fRejectedDCAList(0),
64   fRunEfficiencyAnalysis(kFALSE),
65   fUseCutsInEfficiency(kFALSE),
66   fEfficiencyList(0), fCutEfficiencyList(0) {
67   //Default constructor
68 }
69
70 //____________________________________________________________________//
71 AliProtonQAAnalysis::~AliProtonQAAnalysis() {
72   //Default destructor
73   if(fProtonAnalysisBase) delete fProtonAnalysisBase;
74   if(fGlobalQAList) delete fGlobalQAList;
75   if(fQAVertexList) delete fQAVertexList;
76   if(fQA2DList) delete fQA2DList;
77   if(fQAPrimaryProtonsAcceptedList) delete fQAPrimaryProtonsAcceptedList;
78   if(fQAPrimaryProtonsRejectedList) delete fQAPrimaryProtonsRejectedList;
79   if(fQASecondaryProtonsAcceptedList) delete fQASecondaryProtonsAcceptedList;
80   if(fQASecondaryProtonsRejectedList) delete fQASecondaryProtonsRejectedList;
81   if(fQAPrimaryAntiProtonsAcceptedList) 
82     delete fQAPrimaryAntiProtonsAcceptedList;
83   if(fQAPrimaryAntiProtonsRejectedList) 
84     delete fQAPrimaryAntiProtonsRejectedList;
85   if(fQASecondaryAntiProtonsAcceptedList) 
86     delete fQASecondaryAntiProtonsAcceptedList;
87   if(fQASecondaryAntiProtonsRejectedList) 
88     delete fQASecondaryAntiProtonsRejectedList; 
89
90   if(fPDGList) delete fPDGList;
91   if(fMCProcessesList) delete fMCProcessesList;
92   
93   if(fAcceptedCutList) delete fAcceptedCutList;
94   if(fRejectedCutList) delete fRejectedCutList;
95   if(fAcceptedDCAList) delete fAcceptedDCAList;
96   if(fRejectedDCAList) delete fRejectedDCAList;
97  
98   if(fEfficiencyList) delete fEfficiencyList;
99   if(fCutEfficiencyList) delete fCutEfficiencyList;
100 }
101
102 //____________________________________________________________________//
103 void AliProtonQAAnalysis::FillQA(AliStack *const stack,
104                                  AliESDEvent *esd,
105                                  const AliESDVertex *vertex, 
106                                  AliESDtrack* track) {
107   // Checks if the track is excluded from the cuts
108   Int_t nPrimaries = stack->GetNprimary();
109   Int_t label = TMath::Abs(track->GetLabel());
110
111   Double_t gPt = 0.0, gPx = 0.0, gPy = 0.0, gPz = 0.0;
112   Double_t dca[2] = {0.0,0.0}, cov[3] = {0.0,0.0,0.0};  //The impact parameters and their covariance.
113
114   if((fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kTPC)||(fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kHybrid)) {
115     AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
116     if(!tpcTrack) {
117       gPt = 0.0; gPx = 0.0; gPy = 0.0; gPz = 0.0;
118       dca[0] = -100.; dca[1] = -100.;
119       cov[0] = -100.; cov[1] = -100.; cov[2] = -100.;
120     }
121     else {
122       gPt = tpcTrack->Pt();
123       gPx = tpcTrack->Px();
124       gPy = tpcTrack->Py();
125       gPz = tpcTrack->Pz();
126       tpcTrack->PropagateToDCA(vertex,
127                                esd->GetMagneticField(),
128                                100.,dca,cov);
129     }
130   }
131   else{
132     gPt = track->Pt();
133     gPx = track->Px();
134     gPy = track->Py();
135     gPz = track->Pz();
136     track->PropagateToDCA(vertex,
137                           esd->GetMagneticField(),
138                           100.,dca,cov);
139   }
140
141   //TParticle *particle = stack->Particle(label);
142   //if(particle) {
143   //Int_t pdgcode = particle->GetPdgCode();
144   //Int_t gProcess = particle->GetUniqueID();
145   Int_t  fIdxInt[200];
146   Int_t nClustersITS = track->GetITSclusters(fIdxInt);
147   Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
148   
149   Float_t chi2PerClusterITS = -1;
150   if (nClustersITS!=0)
151     chi2PerClusterITS = track->GetITSchi2()/Float_t(nClustersITS);
152   Float_t chi2PerClusterTPC = -1;
153   if (nClustersTPC!=0)
154     chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);
155   
156   Double_t extCov[15];
157     track->GetExternalCovariance(extCov);
158     
159     //protons
160     if(track->Charge() > 0) {
161       //Primaries
162       if(label <= nPrimaries) {
163         if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
164           if(nClustersITS < fProtonAnalysisBase->GetMinITSClusters()) {
165             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
166           }
167           else if(nClustersITS >= fProtonAnalysisBase->GetMinITSClusters()) 
168             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
169         }//ITS clusters
170         if(fProtonAnalysisBase->IsUsedMaxChi2PerITSCluster()) {
171           if(chi2PerClusterITS > fProtonAnalysisBase->GetMaxChi2PerITSCluster()) {
172             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
173           }
174           else if(chi2PerClusterITS <= fProtonAnalysisBase->GetMaxChi2PerITSCluster())
175             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
176         }//chi2 per ITS cluster
177         if(fProtonAnalysisBase->IsUsedMinTPCClusters()) {
178           if(nClustersTPC < fProtonAnalysisBase->GetMinTPCClusters()) {
179             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(2)))->Fill(nClustersTPC);
180           }
181           else if(nClustersTPC >= fProtonAnalysisBase->GetMinTPCClusters()) {
182             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
183           }
184         }//TPC clusters
185         if(fProtonAnalysisBase->IsUsedMaxChi2PerTPCCluster()) {
186           if(chi2PerClusterTPC > fProtonAnalysisBase->GetMaxChi2PerTPCCluster()) {
187             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
188           }
189           else if(chi2PerClusterTPC <= fProtonAnalysisBase->GetMaxChi2PerTPCCluster())
190             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
191         }//chi2 per TPC cluster
192         if(fProtonAnalysisBase->IsUsedMaxCov11()) {
193           if(extCov[0] > fProtonAnalysisBase->GetMaxCov11()) {
194             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
195           }
196           else if(extCov[0] <= fProtonAnalysisBase->GetMaxCov11())
197             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
198         }//cov11
199         if(fProtonAnalysisBase->IsUsedMaxCov22()) {
200           if(extCov[2] > fProtonAnalysisBase->GetMaxCov22()) {
201             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
202           }
203           else if(extCov[2] <= fProtonAnalysisBase->GetMaxCov22())
204             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
205         }//cov11
206         if(fProtonAnalysisBase->IsUsedMaxCov33()) {
207           if(extCov[5] > fProtonAnalysisBase->GetMaxCov33()) {
208             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
209           }
210           else if(extCov[5] <= fProtonAnalysisBase->GetMaxCov33())
211             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
212         }//cov11
213         if(fProtonAnalysisBase->IsUsedMaxCov44()) {
214           if(extCov[9] > fProtonAnalysisBase->GetMaxCov44()) {
215             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
216           }
217           else if(extCov[9] <= fProtonAnalysisBase->GetMaxCov44())
218             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
219         }//cov11
220         if(fProtonAnalysisBase->IsUsedMaxCov55()) {
221           if(extCov[14] > fProtonAnalysisBase->GetMaxCov55()) {
222             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
223           }
224           else if(extCov[14] <= fProtonAnalysisBase->GetMaxCov55())
225             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
226         }//cov55
227         if(fProtonAnalysisBase->IsUsedMaxSigmaToVertex()) {
228           if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertex()) {
229             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
230           }
231           else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertex())
232             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
233         }//sigma to vertex
234         if(fProtonAnalysisBase->IsUsedMaxSigmaToVertexTPC()) {
235           if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertexTPC()) {
236             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
237           }
238           else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertexTPC())
239             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
240         }//sigma to vertex TPC
241         if(fProtonAnalysisBase->IsUsedMaxDCAXY()) {
242           if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
243             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(11)))->Fill(TMath::Abs(dca[0]));
244           }
245           else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
246             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(11)))->Fill(TMath::Abs(dca[0]));
247         }//DCA xy global tracking
248         if(fProtonAnalysisBase->IsUsedMaxDCAXYTPC()) {
249           if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXYTPC()) {
250             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(12)))->Fill(TMath::Abs(dca[0]));
251           }
252           else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXYTPC())
253             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(12)))->Fill(TMath::Abs(dca[0]));
254         }//DCA xy TPC tracking
255         if(fProtonAnalysisBase->IsUsedMaxDCAZ()) {
256           if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
257             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(13)))->Fill(TMath::Abs(dca[1]));
258           }
259           else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
260             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(13)))->Fill(TMath::Abs(dca[1]));
261         }//DCA z global tracking
262         if(fProtonAnalysisBase->IsUsedMaxDCAZTPC()) {
263           if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZTPC()) {
264             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(14)))->Fill(TMath::Abs(dca[1]));
265           }
266           else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZTPC())
267             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(14)))->Fill(TMath::Abs(dca[1]));
268         }//DCA z TPC tracking
269         if(fProtonAnalysisBase->IsUsedMaxConstrainChi2()) {
270           if(track->GetConstrainedChi2() > 0) {
271             if(TMath::Log(track->GetConstrainedChi2()) > fProtonAnalysisBase->GetMaxConstrainChi2()) {
272               ((TH1F *)(fQAPrimaryProtonsRejectedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
273             }
274             else if(TMath::Log(track->GetConstrainedChi2()) <= fProtonAnalysisBase->GetMaxConstrainChi2())
275               ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
276           }
277         }//constrain chi2 - vertex
278         if(fProtonAnalysisBase->IsUsedITSRefit()) {
279           if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
280             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(16)))->Fill(0);
281           }
282           else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
283             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(16)))->Fill(0);
284         }//ITS refit
285         if(fProtonAnalysisBase->IsUsedTPCRefit()) {
286           if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
287             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(17)))->Fill(0);
288           }
289           else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
290             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(17)))->Fill(0);
291         }//TPC refit
292         if(fProtonAnalysisBase->IsUsedESDpid()) {
293           if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
294             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(18)))->Fill(0);
295           }
296           else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
297             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(18)))->Fill(0);
298         }//ESD pid
299         if(fProtonAnalysisBase->IsUsedTPCpid()) {
300           if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
301             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(19)))->Fill(0);
302         }
303           else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
304             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(19)))->Fill(0);
305         }//TPC pid
306         if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
307           if(!track->HasPointOnITSLayer(0)) {
308             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(20)))->Fill(0);
309           }
310           else if(track->HasPointOnITSLayer(0))
311             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(20)))->Fill(0);
312         }//point on SPD1
313         if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
314           if(!track->HasPointOnITSLayer(1)) {
315             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(21)))->Fill(0);
316           }
317           else if(track->HasPointOnITSLayer(1))
318             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(21)))->Fill(0);
319         }//point on SPD2
320         if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
321           if(!track->HasPointOnITSLayer(2)) {
322             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(22)))->Fill(0);
323           }
324           else if(track->HasPointOnITSLayer(2))
325             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(22)))->Fill(0);
326         }//point on SDD1
327         if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
328           if(!track->HasPointOnITSLayer(3)) {
329             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(23)))->Fill(0);
330           }
331           else if(track->HasPointOnITSLayer(3))
332             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(23)))->Fill(0);
333         }//point on SDD2
334         if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
335           if(!track->HasPointOnITSLayer(4)) {
336             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(24)))->Fill(0);
337           }
338           else if(track->HasPointOnITSLayer(4))
339             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(24)))->Fill(0);
340         }//point on SSD1
341         if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
342           if(!track->HasPointOnITSLayer(5)) {
343             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(25)))->Fill(0);
344           }
345           else if(track->HasPointOnITSLayer(5))
346             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(25)))->Fill(0);
347         }//point on SSD2
348         if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
349           if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
350             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(26)))->Fill(track->GetTPCsignalN());
351         }
352           if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
353             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(26)))->Fill(track->GetTPCsignalN());
354         }//number of TPC points for the dE/dx
355         
356         /*if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
357           ((TH2F *)(fQAPrimaryProtonsRejectedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
358         }
359         else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
360           ((TH2F *)(fQAPrimaryProtonsAcceptedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
361         if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
362           ((TH2F *)(fQAPrimaryProtonsRejectedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));
363         }
364         else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
365         ((TH2F *)(fQAPrimaryProtonsAcceptedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));*/
366       }//primary particle cut
367       
368       //Secondaries
369       if(label > nPrimaries) {
370         if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
371           if(nClustersITS < fProtonAnalysisBase->GetMinITSClusters()) {
372             ((TH1F *)(fQASecondaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
373           }
374           else if(nClustersITS >= fProtonAnalysisBase->GetMinITSClusters()) 
375             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
376         }//ITS clusters
377         if(fProtonAnalysisBase->IsUsedMaxChi2PerITSCluster()) {
378           if(chi2PerClusterITS > fProtonAnalysisBase->GetMaxChi2PerITSCluster()) {
379             ((TH1F *)(fQASecondaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
380           }
381           else if(chi2PerClusterITS <= fProtonAnalysisBase->GetMaxChi2PerITSCluster())
382             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
383         }//chi2 per ITS cluster
384         if(fProtonAnalysisBase->IsUsedMinTPCClusters()) {
385           if(nClustersTPC < fProtonAnalysisBase->GetMinTPCClusters()) {
386             //cout<<"Secondary proton rejected"<<endl;
387             ((TH1F *)(fQASecondaryProtonsRejectedList->At(2)))->Fill(nClustersTPC);
388           }
389           else if(nClustersTPC >= fProtonAnalysisBase->GetMinTPCClusters()) {
390             //cout<<"Secondary proton accepted"<<endl;
391             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
392           }
393         }//TPC clusters
394         if(fProtonAnalysisBase->IsUsedMaxChi2PerTPCCluster()) {
395           if(chi2PerClusterTPC > fProtonAnalysisBase->GetMaxChi2PerTPCCluster()) {
396             ((TH1F *)(fQASecondaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
397           }
398           else if(chi2PerClusterTPC <= fProtonAnalysisBase->GetMaxChi2PerTPCCluster())
399             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
400         }//chi2 per TPC cluster
401         if(fProtonAnalysisBase->IsUsedMaxCov11()) {
402           if(extCov[0] > fProtonAnalysisBase->GetMaxCov11()) {
403             ((TH1F *)(fQASecondaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
404           }
405           else if(extCov[0] <= fProtonAnalysisBase->GetMaxCov11())
406             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
407         }//cov11
408         if(fProtonAnalysisBase->IsUsedMaxCov22()) {
409           if(extCov[2] > fProtonAnalysisBase->GetMaxCov22()) {
410             ((TH1F *)(fQASecondaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
411           }
412           else if(extCov[2] <= fProtonAnalysisBase->GetMaxCov22())
413             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
414         }//cov11
415         if(fProtonAnalysisBase->IsUsedMaxCov33()) {
416           if(extCov[5] > fProtonAnalysisBase->GetMaxCov33()) {
417             ((TH1F *)(fQASecondaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
418           }
419           else if(extCov[5] <= fProtonAnalysisBase->GetMaxCov33())
420             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
421         }//cov11
422         if(fProtonAnalysisBase->IsUsedMaxCov44()) {
423           if(extCov[9] > fProtonAnalysisBase->GetMaxCov44()) {
424             ((TH1F *)(fQASecondaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
425           }
426           else if(extCov[9] <= fProtonAnalysisBase->GetMaxCov44())
427             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
428         }//cov11
429         if(fProtonAnalysisBase->IsUsedMaxCov55()) {
430           if(extCov[14] > fProtonAnalysisBase->GetMaxCov55()) {
431             ((TH1F *)(fQASecondaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
432           }
433           else if(extCov[14] <= fProtonAnalysisBase->GetMaxCov55())
434             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
435         }//cov55
436         if(fProtonAnalysisBase->IsUsedMaxSigmaToVertex()) {
437           if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertex()) {
438             ((TH1F *)(fQASecondaryProtonsRejectedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
439           }
440           else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertex())
441             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
442         }//sigma to vertex
443         if(fProtonAnalysisBase->IsUsedMaxSigmaToVertexTPC()) {
444           if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertexTPC()) {
445             ((TH1F *)(fQASecondaryProtonsRejectedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
446           }
447           else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertexTPC())
448             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
449         }//sigma to vertex TPC
450         if(fProtonAnalysisBase->IsUsedMaxDCAXY()) {
451           if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
452             ((TH1F *)(fQASecondaryProtonsRejectedList->At(11)))->Fill(TMath::Abs(dca[0]));
453           }
454           else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
455             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(11)))->Fill(TMath::Abs(dca[0]));
456         }//DCA xy global tracking
457         if(fProtonAnalysisBase->IsUsedMaxDCAXYTPC()) {
458           if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXYTPC()) {
459             ((TH1F *)(fQASecondaryProtonsRejectedList->At(12)))->Fill(TMath::Abs(dca[0]));
460           }
461           else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXYTPC())
462             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(12)))->Fill(TMath::Abs(dca[0]));
463         }//DCA xy TPC tracking
464         if(fProtonAnalysisBase->IsUsedMaxDCAZ()) {
465           if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
466             ((TH1F *)(fQASecondaryProtonsRejectedList->At(13)))->Fill(TMath::Abs(dca[1]));
467           }
468           else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
469             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(13)))->Fill(TMath::Abs(dca[1]));
470         }//DCA z global tracking
471         if(fProtonAnalysisBase->IsUsedMaxDCAZTPC()) {
472           if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZTPC()) {
473             ((TH1F *)(fQASecondaryProtonsRejectedList->At(14)))->Fill(TMath::Abs(dca[1]));
474           }
475           else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZTPC())
476             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(14)))->Fill(TMath::Abs(dca[1]));
477         }//DCA z TPC tracking
478         if(fProtonAnalysisBase->IsUsedMaxConstrainChi2()) {
479           if(track->GetConstrainedChi2() > 0) {
480             if(TMath::Log(track->GetConstrainedChi2()) > fProtonAnalysisBase->GetMaxConstrainChi2()) {
481               ((TH1F *)(fQASecondaryProtonsRejectedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
482             }
483             else if(TMath::Log(track->GetConstrainedChi2()) <= fProtonAnalysisBase->GetMaxConstrainChi2())
484               ((TH1F *)(fQASecondaryProtonsAcceptedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
485           }
486         }//constrain chi2 - vertex
487         if(fProtonAnalysisBase->IsUsedITSRefit()) {
488           if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
489             ((TH1F *)(fQASecondaryProtonsRejectedList->At(16)))->Fill(0);
490           }
491           else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
492             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(16)))->Fill(0);
493         }//ITS refit
494         if(fProtonAnalysisBase->IsUsedTPCRefit()) {
495           if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
496             ((TH1F *)(fQASecondaryProtonsRejectedList->At(17)))->Fill(0);
497           }
498           else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
499             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(17)))->Fill(0);
500         }//TPC refit
501         if(fProtonAnalysisBase->IsUsedESDpid()) {
502           if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
503             ((TH1F *)(fQASecondaryProtonsRejectedList->At(18)))->Fill(0);
504           }
505           else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
506             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(18)))->Fill(0);
507         }//ESD pid
508         if(fProtonAnalysisBase->IsUsedTPCpid()) {
509           if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
510             ((TH1F *)(fQASecondaryProtonsRejectedList->At(19)))->Fill(0);
511           }
512           else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
513             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(19)))->Fill(0);
514         }//TPC pid
515         if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
516           if(!track->HasPointOnITSLayer(0)) {
517             ((TH1F *)(fQASecondaryProtonsRejectedList->At(20)))->Fill(0);
518           }
519           else if(track->HasPointOnITSLayer(0))
520             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(20)))->Fill(0);
521         }//point on SPD1
522         if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
523           if(!track->HasPointOnITSLayer(1)) {
524             ((TH1F *)(fQASecondaryProtonsRejectedList->At(21)))->Fill(0);
525           }
526           else if(track->HasPointOnITSLayer(1))
527             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(21)))->Fill(0);
528         }//point on SPD2
529         if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
530           if(!track->HasPointOnITSLayer(2)) {
531             ((TH1F *)(fQASecondaryProtonsRejectedList->At(22)))->Fill(0);
532           }
533           else if(track->HasPointOnITSLayer(2))
534             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(22)))->Fill(0);
535         }//point on SDD1
536         if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
537           if(!track->HasPointOnITSLayer(3)) {
538             ((TH1F *)(fQASecondaryProtonsRejectedList->At(23)))->Fill(0);
539           }
540           else if(track->HasPointOnITSLayer(3))
541             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(23)))->Fill(0);
542         }//point on SDD2
543         if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
544           if(!track->HasPointOnITSLayer(4)) {
545             ((TH1F *)(fQASecondaryProtonsRejectedList->At(24)))->Fill(0);
546           }
547           else if(track->HasPointOnITSLayer(4))
548             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(24)))->Fill(0);
549         }//point on SSD1
550         if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
551           if(!track->HasPointOnITSLayer(5)) {
552             ((TH1F *)(fQASecondaryProtonsRejectedList->At(25)))->Fill(0);
553           }
554           else if(track->HasPointOnITSLayer(5))
555             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(25)))->Fill(0);
556         }//point on SSD2
557         if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
558           if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
559             ((TH1F *)(fQASecondaryProtonsRejectedList->At(26)))->Fill(track->GetTPCsignalN());
560           }
561           if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
562             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(26)))->Fill(track->GetTPCsignalN());
563         }//number of TPC points for the dE/dx
564
565         /*if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
566           if(gProcess == 4)
567             ((TH2F *)(fQASecondaryProtonsRejectedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
568           if(gProcess == 13)
569             ((TH2F *)(fQASecondaryProtonsRejectedList->At(29)))->Fill(gPt,TMath::Abs(dca[0]));
570         }
571         else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY()) {
572           if(gProcess == 4)
573             ((TH2F *)(fQASecondaryProtonsAcceptedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
574           if(gProcess == 13)
575             ((TH2F *)(fQASecondaryProtonsAcceptedList->At(29)))->Fill(gPt,TMath::Abs(dca[0]));
576         }
577         if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
578           if(gProcess == 4)
579             ((TH2F *)(fQASecondaryProtonsRejectedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));
580           if(gProcess == 13)
581             ((TH2F *)(fQASecondaryProtonsRejectedList->At(30)))->Fill(gPt,TMath::Abs(dca[1]));
582         }
583         else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ()) {
584           if(gProcess == 4)
585             ((TH2F *)(fQASecondaryProtonsAcceptedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));
586           if(gProcess == 13)
587             ((TH2F *)(fQASecondaryProtonsAcceptedList->At(30)))->Fill(gPt,TMath::Abs(dca[1]));
588             }*/
589       }//secondary particle cut
590     }//protons
591     
592     //antiprotons
593     if(track->Charge() < 0) {
594       //Primaries
595       if(label <= nPrimaries) {
596         if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
597         if(nClustersITS < fProtonAnalysisBase->GetMinITSClusters()) {
598           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(0)))->Fill(nClustersITS);
599         }
600         else if(nClustersITS >= fProtonAnalysisBase->GetMinITSClusters()) 
601           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(0)))->Fill(nClustersITS);
602       }//ITS clusters
603       if(fProtonAnalysisBase->IsUsedMaxChi2PerITSCluster()) {
604         if(chi2PerClusterITS > fProtonAnalysisBase->GetMaxChi2PerITSCluster()) {
605           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
606         }
607         else if(chi2PerClusterITS <= fProtonAnalysisBase->GetMaxChi2PerITSCluster())
608           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
609       }//chi2 per ITS cluster
610       if(fProtonAnalysisBase->IsUsedMinTPCClusters()) {
611         if(nClustersTPC < fProtonAnalysisBase->GetMinTPCClusters()) {
612           //cout<<"Primary antiproton rejected"<<endl;
613           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(2)))->Fill(nClustersTPC);
614         }
615         else if(nClustersTPC >= fProtonAnalysisBase->GetMinTPCClusters()) {
616           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
617         }
618       }//TPC clusters
619       if(fProtonAnalysisBase->IsUsedMaxChi2PerTPCCluster()) {
620         if(chi2PerClusterTPC > fProtonAnalysisBase->GetMaxChi2PerTPCCluster()) {
621           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
622         }
623         else if(chi2PerClusterTPC <= fProtonAnalysisBase->GetMaxChi2PerTPCCluster())
624           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
625       }//chi2 per TPC cluster
626       if(fProtonAnalysisBase->IsUsedMaxCov11()) {
627         if(extCov[0] > fProtonAnalysisBase->GetMaxCov11()) {
628           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(4)))->Fill(extCov[0]);
629         }
630         else if(extCov[0] <= fProtonAnalysisBase->GetMaxCov11())
631           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(4)))->Fill(extCov[0]);
632       }//cov11
633       if(fProtonAnalysisBase->IsUsedMaxCov22()) {
634         if(extCov[2] > fProtonAnalysisBase->GetMaxCov22()) {
635           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(5)))->Fill(extCov[2]);
636         }
637         else if(extCov[2] <= fProtonAnalysisBase->GetMaxCov22())
638           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(5)))->Fill(extCov[2]);
639       }//cov11
640       if(fProtonAnalysisBase->IsUsedMaxCov33()) {
641         if(extCov[5] > fProtonAnalysisBase->GetMaxCov33()) {
642           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(6)))->Fill(extCov[5]);
643         }
644         else if(extCov[5] <= fProtonAnalysisBase->GetMaxCov33())
645           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(6)))->Fill(extCov[5]);
646       }//cov11
647       if(fProtonAnalysisBase->IsUsedMaxCov44()) {
648         if(extCov[9] > fProtonAnalysisBase->GetMaxCov44()) {
649           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(7)))->Fill(extCov[9]);
650         }
651         else if(extCov[9] <= fProtonAnalysisBase->GetMaxCov44())
652           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(7)))->Fill(extCov[9]);
653       }//cov11
654       if(fProtonAnalysisBase->IsUsedMaxCov55()) {
655         if(extCov[14] > fProtonAnalysisBase->GetMaxCov55()) {
656           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(8)))->Fill(extCov[14]);
657         }
658         else if(extCov[14] <= fProtonAnalysisBase->GetMaxCov55())
659           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(8)))->Fill(extCov[14]);
660       }//cov55
661       if(fProtonAnalysisBase->IsUsedMaxSigmaToVertex()) {
662         if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertex()) {
663           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
664         }
665         else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertex())
666           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
667       }//sigma to vertex
668       if(fProtonAnalysisBase->IsUsedMaxSigmaToVertexTPC()) {
669         if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertexTPC()) {
670           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
671         }
672         else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertexTPC())
673           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
674       }//sigma to vertex TPC
675       if(fProtonAnalysisBase->IsUsedMaxDCAXY()) {
676         if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
677           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(11)))->Fill(TMath::Abs(dca[0]));
678         }
679         else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
680           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(11)))->Fill(TMath::Abs(dca[0]));
681       }//DCA xy global tracking
682       if(fProtonAnalysisBase->IsUsedMaxDCAXYTPC()) {
683         if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXYTPC()) {
684           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(12)))->Fill(TMath::Abs(dca[0]));
685         }
686         else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXYTPC())
687           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(12)))->Fill(TMath::Abs(dca[0]));
688       }//DCA xy TPC tracking
689       if(fProtonAnalysisBase->IsUsedMaxDCAZ()) {
690         if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
691           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(13)))->Fill(TMath::Abs(dca[1]));
692         }
693         else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
694           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(13)))->Fill(TMath::Abs(dca[1]));
695       }//DCA z global tracking
696       if(fProtonAnalysisBase->IsUsedMaxDCAZTPC()) {
697         if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZTPC()) {
698           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(14)))->Fill(TMath::Abs(dca[1]));
699         }
700         else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZTPC())
701           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(14)))->Fill(TMath::Abs(dca[1]));
702       }//DCA z TPC tracking
703       if(fProtonAnalysisBase->IsUsedMaxConstrainChi2()) {
704         if(track->GetConstrainedChi2() > 0) {
705           if(TMath::Log(track->GetConstrainedChi2()) > fProtonAnalysisBase->GetMaxConstrainChi2()) {
706             ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
707           }
708           else if(TMath::Log(track->GetConstrainedChi2()) <= fProtonAnalysisBase->GetMaxConstrainChi2())
709             ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
710         }
711       }//constrain chi2 - vertex
712       if(fProtonAnalysisBase->IsUsedITSRefit()) {
713         if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
714           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(16)))->Fill(0);
715         }
716         else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
717           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(16)))->Fill(0);
718       }//ITS refit
719       if(fProtonAnalysisBase->IsUsedTPCRefit()) {
720         if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
721           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(17)))->Fill(0);
722         }
723         else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
724           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(17)))->Fill(0);
725       }//TPC refit
726       if(fProtonAnalysisBase->IsUsedESDpid()) {
727         if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
728           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(18)))->Fill(0);
729         }
730         else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
731           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(18)))->Fill(0);
732       }//ESD pid
733       if(fProtonAnalysisBase->IsUsedTPCpid()) {
734         if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
735           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(19)))->Fill(0);
736         }
737         else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
738           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(19)))->Fill(0);
739       }//TPC pid
740       if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
741         if(!track->HasPointOnITSLayer(0)) {
742           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(20)))->Fill(0);
743         }
744         else if(track->HasPointOnITSLayer(0))
745           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(20)))->Fill(0);
746       }//point on SPD1
747       if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
748         if(!track->HasPointOnITSLayer(1)) {
749           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(21)))->Fill(0);
750         }
751         else if(track->HasPointOnITSLayer(1))
752           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(21)))->Fill(0);
753       }//point on SPD2
754       if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
755         if(!track->HasPointOnITSLayer(2)) {
756           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(22)))->Fill(0);
757         }
758         else if(track->HasPointOnITSLayer(2))
759           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(22)))->Fill(0);
760       }//point on SDD1
761       if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
762         if(!track->HasPointOnITSLayer(3)) {
763           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(23)))->Fill(0);
764         }
765         else if(track->HasPointOnITSLayer(3))
766           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(23)))->Fill(0);
767       }//point on SDD2
768       if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
769         if(!track->HasPointOnITSLayer(4)) {
770           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(24)))->Fill(0);
771         }
772         else if(track->HasPointOnITSLayer(4))
773           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(24)))->Fill(0);
774       }//point on SSD1
775       if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
776         if(!track->HasPointOnITSLayer(5)) {
777           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(25)))->Fill(0);
778         }
779         else if(track->HasPointOnITSLayer(5))
780           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(25)))->Fill(0);
781       }//point on SSD2
782       if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
783         if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
784           ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(26)))->Fill(track->GetTPCsignalN());
785         }
786         if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
787           ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(26)))->Fill(track->GetTPCsignalN());
788       }//number of TPC points for the dE/dx
789
790       /*if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
791         ((TH2F *)(fQAPrimaryAntiProtonsRejectedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
792       }
793       else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
794         ((TH2F *)(fQAPrimaryAntiProtonsAcceptedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
795       if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
796         ((TH2F *)(fQAPrimaryAntiProtonsRejectedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));
797       }
798       else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
799       ((TH2F *)(fQAPrimaryAntiProtonsAcceptedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));*/
800     }//primary particle cut
801
802     //Secondaries
803     if(label > nPrimaries) {
804       if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
805         if(nClustersITS < fProtonAnalysisBase->GetMinITSClusters()) {
806           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(0)))->Fill(nClustersITS);
807         }
808         else if(nClustersITS >= fProtonAnalysisBase->GetMinITSClusters()) 
809           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(0)))->Fill(nClustersITS);
810       }//ITS clusters
811       if(fProtonAnalysisBase->IsUsedMaxChi2PerITSCluster()) {
812         if(chi2PerClusterITS > fProtonAnalysisBase->GetMaxChi2PerITSCluster()) {
813           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
814         }
815         else if(chi2PerClusterITS <= fProtonAnalysisBase->GetMaxChi2PerITSCluster())
816           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
817       }//chi2 per ITS cluster
818       if(fProtonAnalysisBase->IsUsedMinTPCClusters()) {
819         if(nClustersTPC < fProtonAnalysisBase->GetMinTPCClusters()) {
820           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(2)))->Fill(nClustersTPC);
821         }
822         else if(nClustersTPC >= fProtonAnalysisBase->GetMinTPCClusters()) {
823           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
824         }
825       }//TPC clusters
826       if(fProtonAnalysisBase->IsUsedMaxChi2PerTPCCluster()) {
827         if(chi2PerClusterTPC > fProtonAnalysisBase->GetMaxChi2PerTPCCluster()) {
828           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
829         }
830         else if(chi2PerClusterTPC <= fProtonAnalysisBase->GetMaxChi2PerTPCCluster())
831           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
832       }//chi2 per TPC cluster
833       if(fProtonAnalysisBase->IsUsedMaxCov11()) {
834         if(extCov[0] > fProtonAnalysisBase->GetMaxCov11()) {
835           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(4)))->Fill(extCov[0]);
836         }
837         else if(extCov[0] <= fProtonAnalysisBase->GetMaxCov11())
838           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(4)))->Fill(extCov[0]);
839       }//cov11
840       if(fProtonAnalysisBase->IsUsedMaxCov22()) {
841         if(extCov[2] > fProtonAnalysisBase->GetMaxCov22()) {
842           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(5)))->Fill(extCov[2]);
843         }
844         else if(extCov[2] <= fProtonAnalysisBase->GetMaxCov22())
845           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(5)))->Fill(extCov[2]);
846       }//cov11
847       if(fProtonAnalysisBase->IsUsedMaxCov33()) {
848         if(extCov[5] > fProtonAnalysisBase->GetMaxCov33()) {
849           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(6)))->Fill(extCov[5]);
850         }
851         else if(extCov[5] <= fProtonAnalysisBase->GetMaxCov33())
852           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(6)))->Fill(extCov[5]);
853       }//cov11
854       if(fProtonAnalysisBase->IsUsedMaxCov44()) {
855         if(extCov[9] > fProtonAnalysisBase->GetMaxCov44()) {
856           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(7)))->Fill(extCov[9]);
857         }
858         else if(extCov[9] <= fProtonAnalysisBase->GetMaxCov44())
859           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(7)))->Fill(extCov[9]);
860       }//cov11
861       if(fProtonAnalysisBase->IsUsedMaxCov55()) {
862         if(extCov[14] > fProtonAnalysisBase->GetMaxCov55()) {
863           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(8)))->Fill(extCov[14]);
864         }
865         else if(extCov[14] <= fProtonAnalysisBase->GetMaxCov55())
866           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(8)))->Fill(extCov[14]);
867       }//cov55
868       if(fProtonAnalysisBase->IsUsedMaxSigmaToVertex()) {
869         if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertex()) {
870           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
871         }
872         else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertex())
873           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
874       }//sigma to vertex
875       if(fProtonAnalysisBase->IsUsedMaxSigmaToVertexTPC()) {
876         if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertexTPC()) {
877           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
878         }
879         else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertexTPC())
880           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
881       }//sigma to vertex TPC
882       if(fProtonAnalysisBase->IsUsedMaxDCAXY()) {
883         if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
884           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(11)))->Fill(TMath::Abs(dca[0]));
885         }
886         else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
887           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(11)))->Fill(TMath::Abs(dca[0]));
888       }//DCA xy global tracking
889       if(fProtonAnalysisBase->IsUsedMaxDCAXYTPC()) {
890         if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXYTPC()) {
891           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(12)))->Fill(TMath::Abs(dca[0]));
892         }
893         else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXYTPC())
894           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(12)))->Fill(TMath::Abs(dca[0]));
895       }//DCA xy TPC tracking
896       if(fProtonAnalysisBase->IsUsedMaxDCAZ()) {
897         if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
898           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(13)))->Fill(TMath::Abs(dca[1]));
899         }
900         else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
901           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(13)))->Fill(TMath::Abs(dca[1]));
902       }//DCA z global tracking
903       if(fProtonAnalysisBase->IsUsedMaxDCAZTPC()) {
904         if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZTPC()) {
905           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(14)))->Fill(TMath::Abs(dca[1]));
906         }
907         else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZTPC())
908           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(14)))->Fill(TMath::Abs(dca[1]));
909       }//DCA z TPC tracking
910       if(fProtonAnalysisBase->IsUsedMaxConstrainChi2()) {
911         if(track->GetConstrainedChi2() > 0) {
912           if(TMath::Log(track->GetConstrainedChi2()) > fProtonAnalysisBase->GetMaxConstrainChi2()) {
913             ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
914           }
915           else if(TMath::Log(track->GetConstrainedChi2()) <= fProtonAnalysisBase->GetMaxConstrainChi2())
916             ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
917         }
918       }//constrain chi2 - vertex
919       if(fProtonAnalysisBase->IsUsedITSRefit()) {
920         if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
921           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(16)))->Fill(0);
922         }
923         else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
924           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(16)))->Fill(0);
925       }//ITS refit
926       if(fProtonAnalysisBase->IsUsedTPCRefit()) {
927         if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
928           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(17)))->Fill(0);
929         }
930         else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
931           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(17)))->Fill(0);
932       }//TPC refit
933       if(fProtonAnalysisBase->IsUsedESDpid()) {
934         if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
935           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(18)))->Fill(0);
936         }
937         else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
938           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(18)))->Fill(0);
939       }//ESD pid
940       if(fProtonAnalysisBase->IsUsedTPCpid()) {
941         if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
942           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(19)))->Fill(0);
943         }
944         else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
945           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(19)))->Fill(0);
946       }//TPC pid
947       if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
948         if(!track->HasPointOnITSLayer(0)) {
949           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(20)))->Fill(0);
950         }
951         else if(track->HasPointOnITSLayer(0))
952           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(20)))->Fill(0);
953       }//point on SPD1
954       if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
955         if(!track->HasPointOnITSLayer(1)) {
956           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(21)))->Fill(0);
957         }
958         else if(track->HasPointOnITSLayer(1))
959           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(21)))->Fill(0);
960       }//point on SPD2
961       if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
962         if(!track->HasPointOnITSLayer(2)) {
963           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(22)))->Fill(0);
964         }
965         else if(track->HasPointOnITSLayer(2))
966           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(22)))->Fill(0);
967       }//point on SDD1
968       if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
969         if(!track->HasPointOnITSLayer(3)) {
970           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(23)))->Fill(0);
971         }
972         else if(track->HasPointOnITSLayer(3))
973           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(23)))->Fill(0);
974       }//point on SDD2
975       if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
976         if(!track->HasPointOnITSLayer(4)) {
977           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(24)))->Fill(0);
978         }
979         else if(track->HasPointOnITSLayer(4))
980           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(24)))->Fill(0);
981       }//point on SSD1
982       if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
983         if(!track->HasPointOnITSLayer(5)) {
984           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(25)))->Fill(0);
985         }
986         else if(track->HasPointOnITSLayer(5))
987           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(25)))->Fill(0);
988       }//point on SSD2
989       if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
990         if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
991           ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(26)))->Fill(track->GetTPCsignalN());
992         }
993         if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
994           ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(26)))->Fill(track->GetTPCsignalN());
995       }//number of TPC points for the dE/dx
996
997       /*if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
998         if(gProcess == 4)
999           ((TH2F *)(fQASecondaryAntiProtonsRejectedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
1000         if(gProcess == 13)
1001           ((TH2F *)(fQASecondaryAntiProtonsRejectedList->At(29)))->Fill(gPt,TMath::Abs(dca[0]));
1002       }
1003       else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY()) {
1004         if(gProcess == 4)
1005           ((TH2F *)(fQASecondaryAntiProtonsAcceptedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
1006         if(gProcess == 13)
1007           ((TH2F *)(fQASecondaryAntiProtonsAcceptedList->At(29)))->Fill(gPt,TMath::Abs(dca[0]));
1008       }
1009       if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
1010         if(gProcess == 4)
1011           ((TH2F *)(fQASecondaryAntiProtonsRejectedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));
1012         if(gProcess == 13)
1013           ((TH2F *)(fQASecondaryAntiProtonsRejectedList->At(30)))->Fill(gPt,TMath::Abs(dca[1]));
1014       }
1015       else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ()) {
1016         if(gProcess == 4)
1017           ((TH2F *)(fQASecondaryAntiProtonsAcceptedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));
1018         if(gProcess == 13)
1019           ((TH2F *)(fQASecondaryAntiProtonsAcceptedList->At(30)))->Fill(gPt,TMath::Abs(dca[1]));
1020           }*/
1021     }//secondary particle cut
1022   }//antiprotons
1023     //}//if TParticle
1024 }
1025
1026 //____________________________________________________________________//
1027 void AliProtonQAAnalysis::SetRunQAAnalysis() {
1028   //initializes the QA lists
1029   //fQAHistograms = kTRUE;
1030   fGlobalQAList = new TList();
1031
1032   fQA2DList = new TList();
1033   fQA2DList->SetName("fQA2DList");
1034   fGlobalQAList->Add(fQA2DList);
1035   
1036   fQAPrimaryProtonsAcceptedList = new TList();
1037   fQAPrimaryProtonsAcceptedList->SetName("fQAPrimaryProtonsAcceptedList");
1038   fGlobalQAList->Add(fQAPrimaryProtonsAcceptedList);
1039   
1040   fQAPrimaryProtonsRejectedList = new TList();
1041   fQAPrimaryProtonsRejectedList->SetName("fQAPrimaryProtonsRejectedList");
1042   fGlobalQAList->Add(fQAPrimaryProtonsRejectedList);
1043   
1044   fQASecondaryProtonsAcceptedList = new TList();
1045   fQASecondaryProtonsAcceptedList->SetName("fQASecondaryProtonsAcceptedList");
1046   fGlobalQAList->Add(fQASecondaryProtonsAcceptedList);
1047   
1048   fQASecondaryProtonsRejectedList = new TList();
1049   fQASecondaryProtonsRejectedList->SetName("fQASecondaryProtonsRejectedList");
1050   fGlobalQAList->Add(fQASecondaryProtonsRejectedList);
1051   
1052   fQAPrimaryAntiProtonsAcceptedList = new TList();
1053   fQAPrimaryAntiProtonsAcceptedList->SetName("fQAPrimaryAntiProtonsAcceptedList");
1054   fGlobalQAList->Add(fQAPrimaryAntiProtonsAcceptedList);
1055   
1056   fQAPrimaryAntiProtonsRejectedList = new TList();
1057   fQAPrimaryAntiProtonsRejectedList->SetName("fQAPrimaryAntiProtonsRejectedList");
1058   fGlobalQAList->Add(fQAPrimaryAntiProtonsRejectedList);
1059   
1060   fQASecondaryAntiProtonsAcceptedList = new TList();
1061   fQASecondaryAntiProtonsAcceptedList->SetName("fQASecondaryAntiProtonsAcceptedList");
1062   fGlobalQAList->Add(fQASecondaryAntiProtonsAcceptedList);
1063   
1064   fQASecondaryAntiProtonsRejectedList = new TList();
1065   fQASecondaryAntiProtonsRejectedList->SetName("fQASecondaryAntiProtonsRejectedList");
1066   fGlobalQAList->Add(fQASecondaryAntiProtonsRejectedList);
1067 }
1068
1069 //____________________________________________________________________//
1070 void AliProtonQAAnalysis::SetQAYPtBins(Int_t nbinsY, 
1071                                        Double_t minY, Double_t maxY,
1072                                        Int_t nbinsPt, 
1073                                        Double_t minPt, Double_t maxPt) {
1074   //Initializes the QA binning
1075   fNBinsY = nbinsY;
1076   fMinY = minY; fMaxY = maxY;
1077   fNBinsPt = nbinsPt;
1078   fMinPt = minPt; fMaxPt = maxPt;
1079   InitQA();
1080   InitCutLists();
1081   InitVertexQA();
1082   if(fRunMCAnalysis) InitMCAnalysis();
1083   if(fRunEfficiencyAnalysis) InitEfficiencyAnalysis();
1084 }
1085
1086 //____________________________________________________________________//
1087 void AliProtonQAAnalysis::SetQAYPtBins(Int_t nbinsY, Double_t *gY,
1088                                        Int_t nbinsPt, Double_t *gPt) {
1089   //Initializes the QA binning - asymmetric binning case
1090   fUseAsymmetricBinning = kTRUE;
1091   fNBinsY = nbinsY;
1092   for(Int_t i = 0; i < nbinsY; i++) fY[i] = gY[i];
1093   fMinY = gY[0]; fMaxY = gY[nbinsPt];
1094   fNBinsPt = nbinsPt;
1095   for(Int_t i = 0; i < nbinsPt; i++) fPt[i] = gPt[i];
1096   fMinPt = gPt[0]; fMaxPt = gPt[nbinsPt];
1097   InitQA();
1098   InitCutLists();
1099   InitVertexQA();
1100   if(fRunMCAnalysis) InitMCAnalysis();
1101   if(fRunEfficiencyAnalysis) InitEfficiencyAnalysis();
1102 }
1103
1104 //____________________________________________________________________//
1105 void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
1106   //Initialization of the efficiency list - reconstruction & PID & cut 
1107   //efficiency
1108   //Adding each monitored object in the list
1109   fEfficiencyList = new TList();
1110
1111   //MC primary protons and antiprotons for the reconstruction efficiency
1112   TH2D *gHistMCYPtProtons = 0x0;
1113   if(fUseAsymmetricBinning)
1114     gHistMCYPtProtons = new TH2D("gHistMCYPtProtons",
1115                                  ";;P_{T} [GeV/c]",
1116                                  fNBinsY,fY,fNBinsPt,fPt);
1117   else
1118     gHistMCYPtProtons = new TH2D("gHistMCYPtProtons",
1119                                  ";;P_{T} [GeV/c]",
1120                                  fNBinsY,fMinY,fMaxY,
1121                                  fNBinsPt,fMinPt,fMaxPt);
1122   if(fProtonAnalysisBase->GetEtaMode()) 
1123     gHistMCYPtProtons->GetXaxis()->SetTitle("#eta");
1124   else 
1125     gHistMCYPtProtons->GetXaxis()->SetTitle("y");
1126   gHistMCYPtProtons->SetStats(kTRUE);
1127   gHistMCYPtProtons->GetXaxis()->SetTitleColor(1);
1128   fEfficiencyList->Add(gHistMCYPtProtons);
1129   TH2D *gHistMCYPtAntiProtons = 0x0;
1130   if(fUseAsymmetricBinning)
1131     gHistMCYPtAntiProtons = new TH2D("gHistMCYPtAntiProtons",
1132                                      ";;P_{T} [GeV/c]",
1133                                      fNBinsY,fY,fNBinsPt,fPt);
1134   else
1135     gHistMCYPtAntiProtons = new TH2D("gHistMCYPtAntiProtons",
1136                                      ";y;P_{T} [GeV/c]",
1137                                      fNBinsY,fMinY,fMaxY,
1138                                      fNBinsPt,fMinPt,fMaxPt);
1139   if(fProtonAnalysisBase->GetEtaMode()) 
1140     gHistMCYPtAntiProtons->GetXaxis()->SetTitle("#eta");
1141   else 
1142     gHistMCYPtAntiProtons->GetXaxis()->SetTitle("y");
1143   gHistMCYPtAntiProtons->SetStats(kTRUE);
1144   gHistMCYPtAntiProtons->GetXaxis()->SetTitleColor(1);
1145   fEfficiencyList->Add(gHistMCYPtAntiProtons);
1146
1147   //MC secondary protons and antiprotons that come from weak decay for the reconstruction efficiency
1148   TH2D *gHistMCYPtProtonsFromWeak = 0x0;
1149   if(fUseAsymmetricBinning)
1150     gHistMCYPtProtonsFromWeak = new TH2D("gHistMCYPtProtonsFromWeak",
1151                                          ";;P_{T} [GeV/c]",
1152                                          fNBinsY,fY,fNBinsPt,fPt);
1153   else
1154     gHistMCYPtProtonsFromWeak = new TH2D("gHistMCYPtProtonsFromWeak",
1155                                          ";;P_{T} [GeV/c]",
1156                                          fNBinsY,fMinY,fMaxY,
1157                                          fNBinsPt,fMinPt,fMaxPt);
1158   if(fProtonAnalysisBase->GetEtaMode()) 
1159     gHistMCYPtProtonsFromWeak->GetXaxis()->SetTitle("#eta");
1160   else 
1161     gHistMCYPtProtonsFromWeak->GetXaxis()->SetTitle("y");
1162   gHistMCYPtProtonsFromWeak->SetStats(kTRUE);
1163   gHistMCYPtProtonsFromWeak->GetXaxis()->SetTitleColor(1);
1164   fEfficiencyList->Add(gHistMCYPtProtonsFromWeak);
1165   TH2D *gHistMCYPtAntiProtonsFromWeak = 0x0;
1166   if(fUseAsymmetricBinning)
1167     gHistMCYPtAntiProtonsFromWeak = new TH2D("gHistMCYPtAntiProtonsFromWeak",
1168                                              ";;P_{T} [GeV/c]",
1169                                              fNBinsY,fY,fNBinsPt,fPt);
1170   else
1171     gHistMCYPtAntiProtonsFromWeak = new TH2D("gHistMCYPtAntiProtonsFromWeak",
1172                                              ";y;P_{T} [GeV/c]",
1173                                              fNBinsY,fMinY,fMaxY,
1174                                              fNBinsPt,fMinPt,fMaxPt);
1175   if(fProtonAnalysisBase->GetEtaMode()) 
1176     gHistMCYPtAntiProtonsFromWeak->GetXaxis()->SetTitle("#eta");
1177   else 
1178     gHistMCYPtAntiProtonsFromWeak->GetXaxis()->SetTitle("y");
1179   gHistMCYPtAntiProtonsFromWeak->SetStats(kTRUE);
1180   gHistMCYPtAntiProtonsFromWeak->GetXaxis()->SetTitleColor(1);
1181   fEfficiencyList->Add(gHistMCYPtAntiProtonsFromWeak);
1182
1183   //MC secondary protons and antiprotons that come from hadronic interactions for the reconstruction efficiency
1184   TH2D *gHistMCYPtProtonsFromHadronic = 0x0;
1185   if(fUseAsymmetricBinning)
1186     gHistMCYPtProtonsFromHadronic = new TH2D("gHistMCYPtProtonsFromHadronic",
1187                                              ";;P_{T} [GeV/c]",
1188                                              fNBinsY,fY,fNBinsPt,fPt);
1189   else
1190     gHistMCYPtProtonsFromHadronic = new TH2D("gHistMCYPtProtonsFromHadronic",
1191                                              ";;P_{T} [GeV/c]",
1192                                              fNBinsY,fMinY,fMaxY,
1193                                              fNBinsPt,fMinPt,fMaxPt);
1194   if(fProtonAnalysisBase->GetEtaMode()) 
1195     gHistMCYPtProtonsFromHadronic->GetXaxis()->SetTitle("#eta");
1196   else 
1197     gHistMCYPtProtonsFromHadronic->GetXaxis()->SetTitle("y");
1198   gHistMCYPtProtonsFromHadronic->SetStats(kTRUE);
1199   gHistMCYPtProtonsFromHadronic->GetXaxis()->SetTitleColor(1);
1200   fEfficiencyList->Add(gHistMCYPtProtonsFromHadronic);
1201   TH2D *gHistMCYPtAntiProtonsFromHadronic = 0x0;
1202   if(fUseAsymmetricBinning)
1203   gHistMCYPtAntiProtonsFromHadronic = new TH2D("gHistMCYPtAntiProtonsFromHadronic",
1204                                                ";;P_{T} [GeV/c]",
1205                                                fNBinsY,fY,fNBinsPt,fPt);
1206   else
1207     gHistMCYPtAntiProtonsFromHadronic = new TH2D("gHistMCYPtAntiProtonsFromHadronic",
1208                                                  ";y;P_{T} [GeV/c]",
1209                                                  fNBinsY,fMinY,fMaxY,
1210                                                  fNBinsPt,fMinPt,fMaxPt);
1211   if(fProtonAnalysisBase->GetEtaMode()) 
1212     gHistMCYPtAntiProtonsFromHadronic->GetXaxis()->SetTitle("#eta");
1213   else 
1214     gHistMCYPtAntiProtonsFromHadronic->GetXaxis()->SetTitle("y");
1215   gHistMCYPtAntiProtonsFromHadronic->SetStats(kTRUE);
1216   gHistMCYPtAntiProtonsFromHadronic->GetXaxis()->SetTitleColor(1);
1217   fEfficiencyList->Add(gHistMCYPtAntiProtonsFromHadronic);
1218   
1219   //ESD primary protons and antiprotons for the reconstruction efficiency
1220   TH2D *gHistESDYPtProtons = 0x0;
1221   if(fUseAsymmetricBinning)
1222     gHistESDYPtProtons = new TH2D("gHistESDYPtProtons",
1223                                   ";;P_{T} [GeV/c]",
1224                                   fNBinsY,fY,fNBinsPt,fPt);
1225   else
1226     gHistESDYPtProtons = new TH2D("gHistESDYPtProtons",
1227                                   ";;P_{T} [GeV/c]",
1228                                   fNBinsY,fMinY,fMaxY,
1229                                   fNBinsPt,fMinPt,fMaxPt);
1230   if(fProtonAnalysisBase->GetEtaMode()) 
1231     gHistESDYPtProtons->GetXaxis()->SetTitle("#eta");
1232   else 
1233     gHistESDYPtProtons->GetXaxis()->SetTitle("y");
1234   gHistESDYPtProtons->SetStats(kTRUE);
1235   gHistESDYPtProtons->GetXaxis()->SetTitleColor(1);
1236   fEfficiencyList->Add(gHistESDYPtProtons);
1237   TH2D *gHistESDYPtAntiProtons = 0x0;
1238   if(fUseAsymmetricBinning)
1239     gHistESDYPtAntiProtons = new TH2D("gHistESDYPtAntiProtons",
1240                                       ";;P_{T} [GeV/c]",
1241                                       fNBinsY,fY,fNBinsPt,fPt);
1242   else
1243     gHistESDYPtAntiProtons = new TH2D("gHistESDYPtAntiProtons",
1244                                       ";;P_{T} [GeV/c]",
1245                                       fNBinsY,fMinY,fMaxY,
1246                                       fNBinsPt,fMinPt,fMaxPt);
1247   if(fProtonAnalysisBase->GetEtaMode()) 
1248     gHistESDYPtAntiProtons->GetXaxis()->SetTitle("#eta");
1249   else 
1250     gHistESDYPtAntiProtons->GetXaxis()->SetTitle("y");
1251   gHistESDYPtAntiProtons->SetStats(kTRUE);
1252   gHistESDYPtAntiProtons->GetXaxis()->SetTitleColor(1);
1253   fEfficiencyList->Add(gHistESDYPtAntiProtons);
1254
1255   //ESD (anti)protons from weak decays for the reconstruction efficiency
1256   TH2D *gHistESDYPtProtonsFromWeak = 0x0;
1257   if(fUseAsymmetricBinning)
1258   gHistESDYPtProtonsFromWeak = new TH2D("gHistESDYPtProtonsFromWeak",
1259                                         ";;P_{T} [GeV/c]",
1260                                         fNBinsY,fY,fNBinsPt,fPt);
1261   else
1262     gHistESDYPtProtonsFromWeak = new TH2D("gHistESDYPtProtonsFromWeak",
1263                                           ";;P_{T} [GeV/c]",
1264                                           fNBinsY,fMinY,fMaxY,
1265                                           fNBinsPt,fMinPt,fMaxPt);
1266   if(fProtonAnalysisBase->GetEtaMode()) 
1267     gHistESDYPtProtonsFromWeak->GetXaxis()->SetTitle("#eta");
1268   else 
1269     gHistESDYPtProtonsFromWeak->GetXaxis()->SetTitle("y");
1270   gHistESDYPtProtonsFromWeak->SetStats(kTRUE);
1271   gHistESDYPtProtonsFromWeak->GetXaxis()->SetTitleColor(1);
1272   fEfficiencyList->Add(gHistESDYPtProtonsFromWeak);
1273   TH2D *gHistESDYPtAntiProtonsFromWeak = 0x0;
1274   if(fUseAsymmetricBinning)
1275     gHistESDYPtAntiProtonsFromWeak = new TH2D("gHistESDYPtAntiProtonsFromWeak",
1276                                               ";;P_{T} [GeV/c]",
1277                                               fNBinsY,fY,fNBinsPt,fPt);
1278   else
1279     gHistESDYPtAntiProtonsFromWeak = new TH2D("gHistESDYPtAntiProtonsFromWeak",
1280                                               ";;P_{T} [GeV/c]",
1281                                               fNBinsY,fMinY,fMaxY,
1282                                               fNBinsPt,fMinPt,fMaxPt);
1283   if(fProtonAnalysisBase->GetEtaMode()) 
1284     gHistESDYPtAntiProtonsFromWeak->GetXaxis()->SetTitle("#eta");
1285   else 
1286     gHistESDYPtAntiProtonsFromWeak->GetXaxis()->SetTitle("y");
1287   gHistESDYPtAntiProtonsFromWeak->SetStats(kTRUE);
1288   gHistESDYPtAntiProtonsFromWeak->GetXaxis()->SetTitleColor(1);
1289   fEfficiencyList->Add(gHistESDYPtAntiProtonsFromWeak);
1290
1291   //ESD (anti)protons from hadronic interactions for the reconstruction efficiency
1292   TH2D *gHistESDYPtProtonsFromHadronic = 0x0;
1293   if(fUseAsymmetricBinning)
1294     gHistESDYPtProtonsFromHadronic = new TH2D("gHistESDYPtProtonsFromHadronic",
1295                                               ";;P_{T} [GeV/c]",
1296                                               fNBinsY,fY,fNBinsPt,fPt);
1297   else
1298     gHistESDYPtProtonsFromHadronic = new TH2D("gHistESDYPtProtonsFromHadronic",
1299                                               ";;P_{T} [GeV/c]",
1300                                               fNBinsY,fMinY,fMaxY,
1301                                               fNBinsPt,fMinPt,fMaxPt);
1302   if(fProtonAnalysisBase->GetEtaMode()) 
1303     gHistESDYPtProtonsFromHadronic->GetXaxis()->SetTitle("#eta");
1304   else 
1305     gHistESDYPtProtonsFromHadronic->GetXaxis()->SetTitle("y");
1306   gHistESDYPtProtonsFromHadronic->SetStats(kTRUE);
1307   gHistESDYPtProtonsFromHadronic->GetXaxis()->SetTitleColor(1);
1308   fEfficiencyList->Add(gHistESDYPtProtonsFromHadronic);
1309   TH2D *gHistESDYPtAntiProtonsFromHadronic = 0x0;
1310   if(fUseAsymmetricBinning)
1311     gHistESDYPtAntiProtonsFromHadronic = new TH2D("gHistESDYPtAntiProtonsFromHadronic",
1312                                                   ";;P_{T} [GeV/c]",
1313                                                   fNBinsY,fY,fNBinsPt,fPt);
1314   else
1315     gHistESDYPtAntiProtonsFromHadronic = new TH2D("gHistESDYPtAntiProtonsFromHadronic",
1316                                                   ";;P_{T} [GeV/c]",
1317                                                   fNBinsY,fMinY,fMaxY,
1318                                                   fNBinsPt,fMinPt,fMaxPt);
1319   if(fProtonAnalysisBase->GetEtaMode()) 
1320     gHistESDYPtAntiProtonsFromHadronic->GetXaxis()->SetTitle("#eta");
1321   else 
1322     gHistESDYPtAntiProtonsFromHadronic->GetXaxis()->SetTitle("y");
1323   gHistESDYPtAntiProtonsFromHadronic->SetStats(kTRUE);
1324   gHistESDYPtAntiProtonsFromHadronic->GetXaxis()->SetTitleColor(1);
1325   fEfficiencyList->Add(gHistESDYPtAntiProtonsFromHadronic);
1326   
1327   //ESD reconstructed tracks that were initially protons for the PID efficiency
1328   TH3D *gHistESDInitYPtProtons = 0x0;
1329   if(fUseAsymmetricBinning) {
1330     Double_t gNPoints[51];
1331     for(Int_t i = 0; i < 51; i++)
1332       gNPoints[i] = i*4; 
1333   gHistESDInitYPtProtons = new TH3D("gHistESDInitYPtProtons",
1334                                     ";;P_{T} [GeV/c];N_{points}",
1335                                     fNBinsY,fY,fNBinsPt,fPt,50,gNPoints);
1336   }
1337   else
1338     gHistESDInitYPtProtons = new TH3D("gHistESDInitYPtProtons",
1339                                       ";;P_{T} [GeV/c];N_{points}",
1340                                       fNBinsY,fMinY,fMaxY,
1341                                       fNBinsPt,fMinPt,fMaxPt,
1342                                       50,0,200);
1343   if(fProtonAnalysisBase->GetEtaMode()) 
1344     gHistESDInitYPtProtons->GetXaxis()->SetTitle("#eta");
1345   else 
1346     gHistESDInitYPtProtons->GetXaxis()->SetTitle("y");
1347   gHistESDInitYPtProtons->SetStats(kTRUE);
1348   gHistESDInitYPtProtons->GetXaxis()->SetTitleColor(1);
1349   fEfficiencyList->Add(gHistESDInitYPtProtons);
1350   
1351   //ESD reconstructed tracks that were initially protons and were identified as protons for the PID efficiency
1352   TH3D *gHistESDIdYPtProtons = 0x0;
1353   if(fUseAsymmetricBinning) {
1354     Double_t gNPoints[51];
1355     for(Int_t i = 0; i < 51; i++)
1356       gNPoints[i] = i*4; 
1357     gHistESDIdYPtProtons = new TH3D("gHistESDIdYPtProtons",
1358                                     ";;P_{T} [GeV/c];N_{points}",
1359                                     fNBinsY,fY,fNBinsPt,fPt,50,gNPoints);
1360   }
1361   else
1362     gHistESDIdYPtProtons = new TH3D("gHistESDIdYPtProtons",
1363                                     ";;P_{T} [GeV/c];N_{points}",
1364                                     fNBinsY,fMinY,fMaxY,
1365                                     fNBinsPt,fMinPt,fMaxPt,
1366                                     50,0,200);
1367   if(fProtonAnalysisBase->GetEtaMode()) 
1368     gHistESDIdYPtProtons->GetXaxis()->SetTitle("#eta");
1369   else 
1370     gHistESDIdYPtProtons->GetXaxis()->SetTitle("y");
1371   gHistESDIdYPtProtons->SetStats(kTRUE);
1372   gHistESDIdYPtProtons->GetXaxis()->SetTitleColor(1);
1373   fEfficiencyList->Add(gHistESDIdYPtProtons);
1374  
1375   //ESD reconstructed tracks that were identified as protons for the PID contamination
1376   TH3D *gHistESDRecIdYPtProtons = 0x0;
1377   if(fUseAsymmetricBinning) {
1378     Double_t gNPoints[51];
1379     for(Int_t i = 0; i < 51; i++)
1380       gNPoints[i] = i*4; 
1381     gHistESDRecIdYPtProtons = new TH3D("gHistESDRecIdYPtProtons",
1382                                        ";;P_{T} [GeV/c];N_{points}",
1383                                        fNBinsY,fY,fNBinsPt,fPt,50,gNPoints);
1384   }
1385   else
1386     gHistESDRecIdYPtProtons = new TH3D("gHistESDRecIdYPtProtons",
1387                                        ";;P_{T} [GeV/c];N_{points}",
1388                                        fNBinsY,fMinY,fMaxY,
1389                                        fNBinsPt,fMinPt,fMaxPt,
1390                                        50,0,200);
1391   if(fProtonAnalysisBase->GetEtaMode()) 
1392     gHistESDRecIdYPtProtons->GetXaxis()->SetTitle("#eta");
1393   else 
1394     gHistESDRecIdYPtProtons->GetXaxis()->SetTitle("y");
1395   gHistESDRecIdYPtProtons->SetStats(kTRUE);
1396   gHistESDRecIdYPtProtons->GetXaxis()->SetTitleColor(1);
1397   fEfficiencyList->Add(gHistESDRecIdYPtProtons);
1398
1399   //ESD reconstructed tracks that were identified as protons but were initially not protons for the PID contamination
1400   TH3D *gHistESDContamYPtProtons = 0x0;
1401   if(fUseAsymmetricBinning) {
1402     Double_t gNPoints[51];
1403     for(Int_t i = 0; i < 51; i++)
1404       gNPoints[i] = i*4; 
1405     gHistESDContamYPtProtons = new TH3D("gHistESDContamYPtProtons",
1406                                         ";;P_{T} [GeV/c];N_{points}",
1407                                         fNBinsY,fY,fNBinsPt,fPt,50,gNPoints);
1408   }
1409   else
1410     gHistESDContamYPtProtons = new TH3D("gHistESDContamYPtProtons",
1411                                         ";;P_{T} [GeV/c];N_{points}",
1412                                         fNBinsY,fMinY,fMaxY,
1413                                         fNBinsPt,fMinPt,fMaxPt,
1414                                         50,0,200);
1415   if(fProtonAnalysisBase->GetEtaMode()) 
1416     gHistESDContamYPtProtons->GetXaxis()->SetTitle("#eta");
1417   else 
1418     gHistESDContamYPtProtons->GetXaxis()->SetTitle("y");
1419   gHistESDContamYPtProtons->SetStats(kTRUE);
1420   gHistESDContamYPtProtons->GetXaxis()->SetTitleColor(1);
1421   fEfficiencyList->Add(gHistESDContamYPtProtons);
1422
1423   //==============//
1424   //Cut efficiency//
1425   //==============//
1426   fCutEfficiencyList = new TList();
1427   //Reconstructed primary tracks that were identified as protons
1428   TH2D *gHistESDYPtProtonsTotal = 0x0;
1429   if(fUseAsymmetricBinning)
1430     gHistESDYPtProtonsTotal = new TH2D("gHistESDYPtProtonsTotal",
1431                                        ";;P_{T} [GeV/c]",
1432                                        fNBinsY,fY,fNBinsPt,fPt);
1433   else
1434     gHistESDYPtProtonsTotal = new TH2D("gHistESDYPtProtonsTotal",
1435                                        ";;P_{T} [GeV/c]",
1436                                        fNBinsY,fMinY,fMaxY,
1437                                        fNBinsPt,fMinPt,fMaxPt);
1438   if(fProtonAnalysisBase->GetEtaMode()) 
1439     gHistESDYPtProtonsTotal->GetXaxis()->SetTitle("#eta");
1440   else 
1441     gHistESDYPtProtonsTotal->GetXaxis()->SetTitle("y");
1442   gHistESDYPtProtonsTotal->SetStats(kTRUE);
1443   gHistESDYPtProtonsTotal->GetXaxis()->SetTitleColor(1);
1444   fCutEfficiencyList->Add(gHistESDYPtProtonsTotal);
1445
1446   //Reconstructed primary tracks that were identified as antiprotons
1447   TH2D *gHistESDYPtAntiProtonsTotal = 0x0;
1448   if(fUseAsymmetricBinning)
1449     gHistESDYPtAntiProtonsTotal = new TH2D("gHistESDYPtAntiProtonsTotal",
1450                                            ";;P_{T} [GeV/c]",
1451                                            fNBinsY,fY,fNBinsPt,fPt);
1452   else
1453     gHistESDYPtAntiProtonsTotal = new TH2D("gHistESDYPtAntiProtonsTotal",
1454                                            ";;P_{T} [GeV/c]",
1455                                            fNBinsY,fMinY,fMaxY,
1456                                            fNBinsPt,fMinPt,fMaxPt);
1457   if(fProtonAnalysisBase->GetEtaMode()) 
1458     gHistESDYPtAntiProtonsTotal->GetXaxis()->SetTitle("#eta");
1459   else 
1460     gHistESDYPtAntiProtonsTotal->GetXaxis()->SetTitle("y");
1461   gHistESDYPtAntiProtonsTotal->SetStats(kTRUE);
1462   gHistESDYPtAntiProtonsTotal->GetXaxis()->SetTitleColor(1);
1463   fCutEfficiencyList->Add(gHistESDYPtAntiProtonsTotal);
1464   
1465   //Reconstructed, survived primary tracks that were identified as protons
1466   TH2D *gHistESDYPtProtonsSurvived = 0x0;
1467   if(fUseAsymmetricBinning)
1468     gHistESDYPtProtonsSurvived = new TH2D("gHistESDYPtProtonsSurvived",
1469                                           ";;P_{T} [GeV/c]",
1470                                           fNBinsY,fY,fNBinsPt,fPt);
1471   else
1472     gHistESDYPtProtonsSurvived = new TH2D("gHistESDYPtProtonsSurvived",
1473                                           ";;P_{T} [GeV/c]",
1474                                           fNBinsY,fMinY,fMaxY,
1475                                           fNBinsPt,fMinPt,fMaxPt);
1476   if(fProtonAnalysisBase->GetEtaMode()) 
1477     gHistESDYPtProtonsSurvived->GetXaxis()->SetTitle("#eta");
1478   else 
1479     gHistESDYPtProtonsSurvived->GetXaxis()->SetTitle("y");
1480   gHistESDYPtProtonsSurvived->SetStats(kTRUE);
1481   gHistESDYPtProtonsSurvived->GetXaxis()->SetTitleColor(1);
1482   fCutEfficiencyList->Add(gHistESDYPtProtonsSurvived);
1483   
1484   //Reconstructed, survived primary tracks that were identified as antiprotons
1485   TH2D *gHistESDYPtAntiProtonsSurvived = 0x0;
1486   if(fUseAsymmetricBinning)
1487     gHistESDYPtAntiProtonsSurvived = new TH2D("gHistESDYPtAntiProtonsSurvived",
1488                                               ";;P_{T} [GeV/c]",
1489                                               fNBinsY,fY,fNBinsPt,fPt);
1490   else
1491     gHistESDYPtAntiProtonsSurvived = new TH2D("gHistESDYPtAntiProtonsSurvived",
1492                                               ";;P_{T} [GeV/c]",
1493                                               fNBinsY,fMinY,fMaxY,
1494                                               fNBinsPt,fMinPt,fMaxPt);
1495   if(fProtonAnalysisBase->GetEtaMode()) 
1496     gHistESDYPtAntiProtonsSurvived->GetXaxis()->SetTitle("#eta");
1497   else 
1498     gHistESDYPtAntiProtonsSurvived->GetXaxis()->SetTitle("y");
1499   gHistESDYPtAntiProtonsSurvived->SetStats(kTRUE);
1500   gHistESDYPtAntiProtonsSurvived->GetXaxis()->SetTitleColor(1);
1501   fCutEfficiencyList->Add(gHistESDYPtAntiProtonsSurvived);
1502 }
1503
1504 //____________________________________________________________________//
1505 void AliProtonQAAnalysis::InitCutLists() {
1506   //Initialization of the cut lists
1507   //Adding each monitored object in each list
1508
1509   //Accepted cut list
1510   fAcceptedCutList = new TList();
1511   TH1F *gPrimaryProtonsClustersOnITSLayers = new TH1F("gPrimaryProtonsClustersOnITSLayers",";ITS Layer;Entries",6,0.5,6.5);
1512   fAcceptedCutList->Add(gPrimaryProtonsClustersOnITSLayers);
1513   TH1F *gPrimaryAntiProtonsClustersOnITSLayers = new TH1F("gPrimaryAntiProtonsClustersOnITSLayers",";ITS Layer;Entries",6,0.5,6.5);
1514   fAcceptedCutList->Add(gPrimaryAntiProtonsClustersOnITSLayers);
1515   TH1F *gSecondaryProtonsClustersOnITSLayers = new TH1F("gSecondaryProtonsClustersOnITSLayers",";ITS Layer;Entries",6,0.5,6.5);
1516   fAcceptedCutList->Add(gSecondaryProtonsClustersOnITSLayers);
1517   TH1F *gSecondaryAntiProtonsClustersOnITSLayers = new TH1F("gSecondaryAntiProtonsClustersOnITSLayers",";ITS Layer;Entries",6,0.5,6.5);
1518   fAcceptedCutList->Add(gSecondaryAntiProtonsClustersOnITSLayers);
1519
1520   TH1F *gPrimaryProtonsNClustersITS = new TH1F("gPrimaryProtonsNClustersITS",";ITS Layer;Entries",6,0.5,6.5);
1521   fAcceptedCutList->Add(gPrimaryProtonsNClustersITS);
1522   TH1F *gPrimaryAntiProtonsNClustersITS = new TH1F("gPrimaryAntiProtonsNClustersITS",";ITS Layer;Entries",6,0.5,6.5);
1523   fAcceptedCutList->Add(gPrimaryAntiProtonsNClustersITS);
1524   TH1F *gSecondaryProtonsNClustersITS = new TH1F("gSecondaryProtonsNClustersITS",";ITS Layer;Entries",6,0.5,6.5);
1525   fAcceptedCutList->Add(gSecondaryProtonsNClustersITS);
1526   TH1F *gSecondaryAntiProtonsNClustersITS = new TH1F("gSecondaryAntiProtonsNClustersITS",";ITS Layer;Entries",6,0.5,6.5);
1527   fAcceptedCutList->Add(gSecondaryAntiProtonsNClustersITS);
1528
1529   TH1F *gPrimaryProtonsChi2PerClusterITS = new TH1F("gPrimaryProtonsChi2PerClusterITS",
1530                                                     ";x^{2}/N_{clusters} (ITS);Entries",
1531                                                     100,0,20);
1532   fAcceptedCutList->Add(gPrimaryProtonsChi2PerClusterITS);
1533   TH1F *gPrimaryAntiProtonsChi2PerClusterITS = new TH1F("gPrimaryAntiProtonsChi2PerClusterITS",
1534                                                         ";x^{2}/N_{clusters} (ITS);Entries",
1535                                                         100,0,20);
1536   fAcceptedCutList->Add(gPrimaryAntiProtonsChi2PerClusterITS);
1537   TH1F *gSecondaryProtonsChi2PerClusterITS = new TH1F("gSecondaryProtonsChi2PerClusterITS",
1538                                                       ";x^{2}/N_{clusters} (ITS);Entries",
1539                                                       100,0,20);
1540   fAcceptedCutList->Add(gSecondaryProtonsChi2PerClusterITS);
1541   TH1F *gSecondaryAntiProtonsChi2PerClusterITS = new TH1F("gSecondaryAntiProtonsChi2PerClusterITS",
1542                                                           ";x^{2}/N_{clusters} (ITS);Entries",
1543                                                           100,0,20);
1544   fAcceptedCutList->Add(gSecondaryAntiProtonsChi2PerClusterITS);
1545
1546   TH1F *gPrimaryProtonsConstrainChi2 = new TH1F("gPrimaryProtonsConstrainChi2",
1547                                                 ";Log_{10}(#chi^{2});Entries",
1548                                                 100,-10,10);
1549   fAcceptedCutList->Add(gPrimaryProtonsConstrainChi2);
1550   TH1F *gPrimaryAntiProtonsConstrainChi2 = new TH1F("gPrimaryAntiProtonsConstrainChi2",
1551                                                     ";Log_{10}(#chi^{2});Entries",
1552                                                     100,-10,10);
1553   fAcceptedCutList->Add(gPrimaryAntiProtonsConstrainChi2);
1554   TH1F *gSecondaryProtonsConstrainChi2 = new TH1F("gSecondaryProtonsConstrainChi2",
1555                                                   ";Log_{10}(#chi^{2});Entries",
1556                                                   100,-10,10);
1557   fAcceptedCutList->Add(gSecondaryProtonsConstrainChi2);
1558   TH1F *gSecondaryAntiProtonsConstrainChi2 = new TH1F("gSecondaryAntiProtonsConstrainChi2",
1559                                                       ";Log_{10}(#chi^{2});Entries",
1560                                                       100,-10,10);
1561   fAcceptedCutList->Add(gSecondaryAntiProtonsConstrainChi2);
1562
1563   TH1F *gPrimaryProtonsTPCClusters = new TH1F("gPrimaryProtonsTPCClusters",
1564                                               ";N_{clusters} (TPC);Entries",
1565                                               100,0,200);
1566   fAcceptedCutList->Add(gPrimaryProtonsTPCClusters);
1567   TH1F *gPrimaryAntiProtonsTPCClusters = new TH1F("gPrimaryAntiProtonsTPCClusters",
1568                                                   ";N_{clusters} (TPC);Entries",
1569                                                   100,0,200);
1570   fAcceptedCutList->Add(gPrimaryAntiProtonsTPCClusters);
1571   TH1F *gSecondaryProtonsTPCClusters = new TH1F("gSecondaryProtonsTPCClusters",
1572                                                 ";N_{clusters} (TPC);Entries",
1573                                                 100,0,200);
1574   fAcceptedCutList->Add(gSecondaryProtonsTPCClusters);
1575   TH1F *gSecondaryAntiProtonsTPCClusters = new TH1F("gSecondaryAntiProtonsTPCClusters",
1576                                                     ";N_{clusters} (TPC);Entries",
1577                                                     100,0,200);
1578   fAcceptedCutList->Add(gSecondaryAntiProtonsTPCClusters);
1579
1580   TH1F *gPrimaryProtonsChi2PerClusterTPC = new TH1F("gPrimaryProtonsChi2PerClusterTPC",
1581                                                     ";x^{2}/N_{clusters} (TPC);Entries",
1582                                                     100,0,4);
1583   fAcceptedCutList->Add(gPrimaryProtonsChi2PerClusterTPC);
1584   TH1F *gPrimaryAntiProtonsChi2PerClusterTPC = new TH1F("gPrimaryAntiProtonsChi2PerClusterTPC",
1585                                                         ";x^{2}/N_{clusters} (TPC);Entries",
1586                                                         100,0,4);
1587   fAcceptedCutList->Add(gPrimaryAntiProtonsChi2PerClusterTPC);
1588   TH1F *gSecondaryProtonsChi2PerClusterTPC = new TH1F("gSecondaryProtonsChi2PerClusterTPC",
1589                                                       ";x^{2}/N_{clusters} (TPC);Entries",
1590                                                       100,0,4);
1591   fAcceptedCutList->Add(gSecondaryProtonsChi2PerClusterTPC);
1592   TH1F *gSecondaryAntiProtonsChi2PerClusterTPC = new TH1F("gSecondaryAntiProtonsChi2PerClusterTPC",
1593                                                           ";x^{2}/N_{clusters} (TPC);Entries",
1594                                                           100,0,4);
1595   fAcceptedCutList->Add(gSecondaryAntiProtonsChi2PerClusterTPC);
1596
1597   TH1F *gPrimaryProtonsExtCov11 = new TH1F("gPrimaryProtonsExtCov11",
1598                                            ";#sigma_{y} [cm];Entries",
1599                                            100,0,4);
1600   fAcceptedCutList->Add(gPrimaryProtonsExtCov11);
1601   TH1F *gPrimaryAntiProtonsExtCov11 = new TH1F("gPrimaryAntiProtonsExtCov11",
1602                                                ";#sigma_{y} [cm];Entries",
1603                                                100,0,4);
1604   fAcceptedCutList->Add(gPrimaryAntiProtonsExtCov11);
1605   TH1F *gSecondaryProtonsExtCov11 = new TH1F("gSecondaryProtonsExtCov11",
1606                                              ";#sigma_{y} [cm];Entries",
1607                                              100,0,4);
1608   fAcceptedCutList->Add(gSecondaryProtonsExtCov11);
1609   TH1F *gSecondaryAntiProtonsExtCov11 = new TH1F("gSecondaryAntiProtonsExtCov11",
1610                                                  ";#sigma_{y} [cm];Entries",
1611                                                  100,0,4);
1612   fAcceptedCutList->Add(gSecondaryAntiProtonsExtCov11);
1613
1614
1615   TH1F *gPrimaryProtonsExtCov22 = new TH1F("gPrimaryProtonsExtCov22",
1616                                            ";#sigma_{z} [cm];Entries",
1617                                            100,0,4);
1618   fAcceptedCutList->Add(gPrimaryProtonsExtCov22);
1619   TH1F *gPrimaryAntiProtonsExtCov22 = new TH1F("gPrimaryAntiProtonsExtCov22",
1620                                                ";#sigma_{z} [cm];Entries",
1621                                                100,0,4);
1622   fAcceptedCutList->Add(gPrimaryAntiProtonsExtCov22);
1623   TH1F *gSecondaryProtonsExtCov22 = new TH1F("gSecondaryProtonsExtCov22",
1624                                              ";#sigma_{z} [cm];Entries",
1625                                              100,0,4);
1626   fAcceptedCutList->Add(gSecondaryProtonsExtCov22);
1627   TH1F *gSecondaryAntiProtonsExtCov22 = new TH1F("gSecondaryAntiProtonsExtCov22",
1628                                                  ";#sigma_{z} [cm];Entries",
1629                                                  100,0,4);
1630   fAcceptedCutList->Add(gSecondaryAntiProtonsExtCov22);
1631
1632
1633   TH1F *gPrimaryProtonsExtCov33 = new TH1F("gPrimaryProtonsExtCov33",
1634                                            ";#sigma_{sin(#phi)};Entries",
1635                                            100,0,4);
1636   fAcceptedCutList->Add(gPrimaryProtonsExtCov33);
1637   TH1F *gPrimaryAntiProtonsExtCov33 = new TH1F("gPrimaryAntiProtonsExtCov33",
1638                                                ";#sigma_{sin(#phi)};Entries",
1639                                                100,0,4);
1640   fAcceptedCutList->Add(gPrimaryAntiProtonsExtCov33);
1641   TH1F *gSecondaryProtonsExtCov33 = new TH1F("gSecondaryProtonsExtCov33",
1642                                              ";#sigma_{sin(#phi)};Entries",
1643                                              100,0,4);
1644   fAcceptedCutList->Add(gSecondaryProtonsExtCov33);
1645   TH1F *gSecondaryAntiProtonsExtCov33 = new TH1F("gSecondaryAntiProtonsExtCov33",
1646                                                  ";#sigma_{sin(#phi)};Entries",
1647                                                  100,0,4);
1648   fAcceptedCutList->Add(gSecondaryAntiProtonsExtCov33);
1649
1650
1651   TH1F *gPrimaryProtonsExtCov44 = new TH1F("gPrimaryProtonsExtCov44",
1652                                            ";#sigma_{tan(#lambda)};Entries",
1653                                            100,0,4);
1654   fAcceptedCutList->Add(gPrimaryProtonsExtCov44);
1655   TH1F *gPrimaryAntiProtonsExtCov44 = new TH1F("gPrimaryAntiProtonsExtCov44",
1656                                                ";#sigma_{tan(#lambda)};Entries",
1657                                                100,0,4);
1658   fAcceptedCutList->Add(gPrimaryAntiProtonsExtCov44);
1659   TH1F *gSecondaryProtonsExtCov44 = new TH1F("gSecondaryProtonsExtCov44",
1660                                              ";#sigma_{tan(#lambda)};Entries",
1661                                              100,0,4);
1662   fAcceptedCutList->Add(gSecondaryProtonsExtCov44);
1663   TH1F *gSecondaryAntiProtonsExtCov44 = new TH1F("gSecondaryAntiProtonsExtCov44",
1664                                                  ";#sigma_{tan(#lambda)};Entries",
1665                                                  100,0,4);
1666   fAcceptedCutList->Add(gSecondaryAntiProtonsExtCov44);
1667
1668
1669   TH1F *gPrimaryProtonsExtCov55 = new TH1F("gPrimaryProtonsExtCov55",
1670                                            ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1671                                            100,0,4);
1672   fAcceptedCutList->Add(gPrimaryProtonsExtCov55);
1673   TH1F *gPrimaryAntiProtonsExtCov55 = new TH1F("gPrimaryAntiProtonsExtCov55",
1674                                                ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1675                                                100,0,4);
1676   fAcceptedCutList->Add(gPrimaryAntiProtonsExtCov55);
1677   TH1F *gSecondaryProtonsExtCov55 = new TH1F("gSecondaryProtonsExtCov55",
1678                                              ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1679                                              100,0,4);
1680   fAcceptedCutList->Add(gSecondaryProtonsExtCov55);
1681   TH1F *gSecondaryAntiProtonsExtCov55 = new TH1F("gSecondaryAntiProtonsExtCov55",
1682                                                  ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
1683                                                  100,0,4);
1684   fAcceptedCutList->Add(gSecondaryAntiProtonsExtCov55);
1685   //eta-phi-Nclusters
1686   TH3D *gHistEtaPhiNClustersPrimaryProtonsPass = new TH3D("gHistEtaPhiNClustersPrimaryProtonsPass",
1687                                                           "Accepted primary protons;#eta;#phi;N_{clusters}(TPC)",
1688                                                           fNBinsY,fMinY,fMaxY,
1689                                                           100,0,360,
1690                                                           100,0,200);
1691   gHistEtaPhiNClustersPrimaryProtonsPass->SetStats(kTRUE);
1692   gHistEtaPhiNClustersPrimaryProtonsPass->GetXaxis()->SetTitleColor(1);
1693   fAcceptedCutList->Add(gHistEtaPhiNClustersPrimaryProtonsPass);//eta-phi of primary accepted ESD protons
1694   TH3D *gHistEtaPhiNClustersPrimaryAntiProtonsPass = new TH3D("gHistEtaPhiNClustersPrimaryAntiProtonsPass",
1695                                                               "Accepted primary antiprotons;#eta;#phi;N_{clusters}(TPC)",
1696                                                               fNBinsY,fMinY,fMaxY,
1697                                                               100,0,360,
1698                                                               100,0,200);
1699   gHistEtaPhiNClustersPrimaryAntiProtonsPass->SetStats(kTRUE);
1700   gHistEtaPhiNClustersPrimaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1701   fAcceptedCutList->Add(gHistEtaPhiNClustersPrimaryAntiProtonsPass);//eta-phi of primary accepted ESD antiprotons
1702   TH3D *gHistEtaPhiNClustersSecondaryProtonsPass = new TH3D("gHistEtaPhiNClustersSecondaryProtonsPass",
1703                                                             "Accepted secondary protons;#eta;#phi;N_{clusters}(TPC)",
1704                                                             fNBinsY,fMinY,fMaxY,
1705                                                             100,0,360,
1706                                                             100,0,200);
1707   gHistEtaPhiNClustersSecondaryProtonsPass->SetStats(kTRUE);
1708   gHistEtaPhiNClustersSecondaryProtonsPass->GetXaxis()->SetTitleColor(1);
1709   fAcceptedCutList->Add(gHistEtaPhiNClustersSecondaryProtonsPass);//eta-phi of secondary accepted ESD protons
1710   TH3D *gHistEtaPhiNClustersSecondaryAntiProtonsPass = new TH3D("gHistEtaPhiNClustersSecondaryAntiProtonsPass",
1711                                                                 "Accepted secondary antiprotons;#eta;#phi;N_{clusters}(TPC)",
1712                                                                 fNBinsY,fMinY,fMaxY,
1713                                                                 100,0,360,
1714                                                                 100,0,200);
1715   gHistEtaPhiNClustersSecondaryAntiProtonsPass->SetStats(kTRUE);
1716   gHistEtaPhiNClustersSecondaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1717   fAcceptedCutList->Add(gHistEtaPhiNClustersSecondaryAntiProtonsPass);//eta-phi of secondary accepted ESD antiprotons
1718   //eta-phi-chi^2 per TPC cluster
1719   TH3D *gHistEtaPhiChi2PerTPCClusterPrimaryProtonsPass = new TH3D("gHistEtaPhiChi2PerTPCClusterPrimaryProtonsPass",
1720                                                                   "Accepted primary protons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
1721                                                                   fNBinsY,fMinY,fMaxY,
1722                                                                   100,0,360,
1723                                                                   100,0,4);
1724   gHistEtaPhiChi2PerTPCClusterPrimaryProtonsPass->SetStats(kTRUE);
1725   gHistEtaPhiChi2PerTPCClusterPrimaryProtonsPass->GetXaxis()->SetTitleColor(1);
1726   fAcceptedCutList->Add(gHistEtaPhiChi2PerTPCClusterPrimaryProtonsPass);//eta-phi of primary accepted ESD protons
1727   TH3D *gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsPass = new TH3D("gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsPass",
1728                                                                       "Accepted primary antiprotons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
1729                                                                       fNBinsY,fMinY,fMaxY,
1730                                                                       100,0,360,
1731                                                                       100,0,4);
1732   gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsPass->SetStats(kTRUE);
1733   gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1734   fAcceptedCutList->Add(gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsPass);//eta-phi of primary accepted ESD antiprotons
1735   TH3D *gHistEtaPhiChi2PerTPCClusterSecondaryProtonsPass = new TH3D("gHistEtaPhiChi2PerTPCClusterSecondaryProtonsPass",
1736                                                                     "Accepted secondary protons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
1737                                                                     fNBinsY,fMinY,fMaxY,
1738                                                                     100,0,360,
1739                                                                     100,0,4);
1740   gHistEtaPhiChi2PerTPCClusterSecondaryProtonsPass->SetStats(kTRUE);
1741   gHistEtaPhiChi2PerTPCClusterSecondaryProtonsPass->GetXaxis()->SetTitleColor(1);
1742   fAcceptedCutList->Add(gHistEtaPhiChi2PerTPCClusterSecondaryProtonsPass);//eta-phi of secondary accepted ESD protons
1743   TH3D *gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsPass = new TH3D("gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsPass",
1744                                                                         "Accepted secondary antiprotons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
1745                                                                         fNBinsY,fMinY,fMaxY,
1746                                                                         100,0,360,
1747                                                                         100,0,4);
1748   gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsPass->SetStats(kTRUE);
1749   gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1750   fAcceptedCutList->Add(gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsPass);//eta-phi of secondary accepted ESD antiprotons
1751   //eta-phi-number of TPC points for the dE/dx
1752   TH3D *gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass = new TH3D("gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass",
1753                                                                   "Accepted primary protons;#eta;#phi;N_{points}(TPC)",
1754                                                                   fNBinsY,fMinY,fMaxY,
1755                                                                   100,0,360,
1756                                                                   100,0,200);
1757   gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass->SetStats(kTRUE);
1758   gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass->GetXaxis()->SetTitleColor(1);
1759   fAcceptedCutList->Add(gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass);//eta-phi of primary accepted ESD protons
1760   TH3D *gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass = new TH3D("gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass",
1761                                                                       "Accepted primary antiprotons;#eta;#phi;N_{points}(TPC)",
1762                                                                       fNBinsY,fMinY,fMaxY,
1763                                                                       100,0,360,
1764                                                                       100,0,200);
1765   gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass->SetStats(kTRUE);
1766   gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1767   fAcceptedCutList->Add(gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass);//eta-phi of primary accepted ESD antiprotons
1768   TH3D *gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass = new TH3D("gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass",
1769                                                                     "Accepted secondary protons;#eta;#phi;N_{points}(TPC)",
1770                                                                     fNBinsY,fMinY,fMaxY,
1771                                                                     100,0,360,
1772                                                                     100,0,200);
1773   gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass->SetStats(kTRUE);
1774   gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass->GetXaxis()->SetTitleColor(1);
1775   fAcceptedCutList->Add(gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass);//eta-phi of secondary accepted ESD protons
1776   TH3D *gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass = new TH3D("gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass",
1777                                                                         "Accepted secondary antiprotons;#eta;#phi;N_{points}(TPC)",
1778                                                                         fNBinsY,fMinY,fMaxY,
1779                                                                         100,0,360,
1780                                                                         100,0,200);
1781   gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass->SetStats(kTRUE);
1782   gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
1783   fAcceptedCutList->Add(gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass);//eta-phi of secondary accepted ESD antiprotons
1784
1785   TH1F *gPrimaryProtonsNPointsTPCdEdx = new TH1F("gPrimaryProtonsNPointsTPCdEdx",
1786                                               ";N_{points} (TPC-dE/dx);Entries",
1787                                               100,0,200);
1788   fAcceptedCutList->Add(gPrimaryProtonsNPointsTPCdEdx);
1789   TH1F *gPrimaryAntiProtonsNPointsTPCdEdx = new TH1F("gPrimaryAntiProtonsNPointsTPCdEdx",
1790                                                   ";N_{points} (TPC-dE/dx);Entries",
1791                                                   100,0,200);
1792   fAcceptedCutList->Add(gPrimaryAntiProtonsNPointsTPCdEdx);
1793   TH1F *gSecondaryProtonsNPointsTPCdEdx = new TH1F("gSecondaryProtonsNPointsTPCdEdx",
1794                                                 ";N_{points} (TPC-dE/dx);Entries",
1795                                                 100,0,200);
1796   fAcceptedCutList->Add(gSecondaryProtonsNPointsTPCdEdx);
1797   TH1F *gSecondaryAntiProtonsNPointsTPCdEdx = new TH1F("gSecondaryAntiProtonsNPointsTPCdEdx",
1798                                                     ";N_{points} (TPC-dE/dx);Entries",
1799                                                     100,0,200);
1800   fAcceptedCutList->Add(gSecondaryAntiProtonsNPointsTPCdEdx);
1801   
1802   //Rejected cut list
1803   fRejectedCutList = new TList();
1804   //eta-phi-Nclusters
1805   TH3D *gHistEtaPhiNClustersPrimaryProtonsReject = new TH3D("gHistEtaPhiNClustersPrimaryProtonsReject",
1806                                                           "Rejected primary protons;#eta;#phi;N_{clusters}(TPC)",
1807                                                           fNBinsY,fMinY,fMaxY,
1808                                                           100,0,360,
1809                                                           100,0,200);
1810   gHistEtaPhiNClustersPrimaryProtonsReject->SetStats(kTRUE);
1811   gHistEtaPhiNClustersPrimaryProtonsReject->GetXaxis()->SetTitleColor(1);
1812   fRejectedCutList->Add(gHistEtaPhiNClustersPrimaryProtonsReject);//eta-phi of primary rejected ESD protons
1813   TH3D *gHistEtaPhiNClustersPrimaryAntiProtonsReject = new TH3D("gHistEtaPhiNClustersPrimaryAntiProtonsReject",
1814                                                               "Rejected primary antiprotons;#eta;#phi;N_{clusters}(TPC)",
1815                                                               fNBinsY,fMinY,fMaxY,
1816                                                               100,0,360,
1817                                                               100,0,200);
1818   gHistEtaPhiNClustersPrimaryAntiProtonsReject->SetStats(kTRUE);
1819   gHistEtaPhiNClustersPrimaryAntiProtonsReject->GetXaxis()->SetTitleColor(1);
1820   fRejectedCutList->Add(gHistEtaPhiNClustersPrimaryAntiProtonsReject);//eta-phi of primary rejected ESD antiprotons
1821   TH3D *gHistEtaPhiNClustersSecondaryProtonsReject = new TH3D("gHistEtaPhiNClustersSecondaryProtonsReject",
1822                                                             "Rejected secondary protons;#eta;#phi;N_{clusters}(TPC)",
1823                                                             fNBinsY,fMinY,fMaxY,
1824                                                             100,0,360,
1825                                                             100,0,200);
1826   gHistEtaPhiNClustersSecondaryProtonsReject->SetStats(kTRUE);
1827   gHistEtaPhiNClustersSecondaryProtonsReject->GetXaxis()->SetTitleColor(1);
1828   fRejectedCutList->Add(gHistEtaPhiNClustersSecondaryProtonsReject);//eta-phi of secondary rejected ESD protons
1829   TH3D *gHistEtaPhiNClustersSecondaryAntiProtonsReject = new TH3D("gHistEtaPhiNClustersSecondaryAntiProtonsReject",
1830                                                                 "Rejected secondary antiprotons;#eta;#phi;N_{clusters}(TPC)",
1831                                                                 fNBinsY,fMinY,fMaxY,
1832                                                                 100,0,360,
1833                                                                 100,0,200);
1834   gHistEtaPhiNClustersSecondaryAntiProtonsReject->SetStats(kTRUE);
1835   gHistEtaPhiNClustersSecondaryAntiProtonsReject->GetXaxis()->SetTitleColor(1);
1836   fRejectedCutList->Add(gHistEtaPhiNClustersSecondaryAntiProtonsReject);//eta-phi of secondary rejected ESD antiprotons
1837   //eta-phi-chi^2 per TPC cluster
1838   TH3D *gHistEtaPhiChi2PerTPCClusterPrimaryProtonsReject = new TH3D("gHistEtaPhiChi2PerTPCClusterPrimaryProtonsReject",
1839                                                                   "Rejected primary protons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
1840                                                                   fNBinsY,fMinY,fMaxY,
1841                                                                   100,0,360,
1842                                                                   100,0,4);
1843   gHistEtaPhiChi2PerTPCClusterPrimaryProtonsReject->SetStats(kTRUE);
1844   gHistEtaPhiChi2PerTPCClusterPrimaryProtonsReject->GetXaxis()->SetTitleColor(1);
1845   fRejectedCutList->Add(gHistEtaPhiChi2PerTPCClusterPrimaryProtonsReject);//eta-phi of primary rejected ESD protons
1846   TH3D *gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsReject = new TH3D("gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsReject",
1847                                                                       "Rejected primary antiprotons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
1848                                                                       fNBinsY,fMinY,fMaxY,
1849                                                                       100,0,360,
1850                                                                       100,0,4);
1851   gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsReject->SetStats(kTRUE);
1852   gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsReject->GetXaxis()->SetTitleColor(1);
1853   fRejectedCutList->Add(gHistEtaPhiChi2PerTPCClusterPrimaryAntiProtonsReject);//eta-phi of primary rejected ESD antiprotons
1854   TH3D *gHistEtaPhiChi2PerTPCClusterSecondaryProtonsReject = new TH3D("gHistEtaPhiChi2PerTPCClusterSecondaryProtonsReject",
1855                                                                     "Rejected secondary protons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
1856                                                                     fNBinsY,fMinY,fMaxY,
1857                                                                     100,0,360,
1858                                                                     100,0,4);
1859   gHistEtaPhiChi2PerTPCClusterSecondaryProtonsReject->SetStats(kTRUE);
1860   gHistEtaPhiChi2PerTPCClusterSecondaryProtonsReject->GetXaxis()->SetTitleColor(1);
1861   fRejectedCutList->Add(gHistEtaPhiChi2PerTPCClusterSecondaryProtonsReject);//eta-phi of secondary rejected ESD protons
1862   TH3D *gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsReject = new TH3D("gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsReject",
1863                                                                         "Rejected secondary antiprotons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
1864                                                                         fNBinsY,fMinY,fMaxY,
1865                                                                         100,0,360,
1866                                                                         100,0,4);
1867   gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsReject->SetStats(kTRUE);
1868   gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsReject->GetXaxis()->SetTitleColor(1);
1869   fRejectedCutList->Add(gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsReject);//eta-phi of secondary rejected ESD antiprotons
1870   //eta-phi-number of TPC points for the dE/dx
1871   TH3D *gHistEtaPhiTPCdEdxNPointsPrimaryProtonsReject = new TH3D("gHistEtaPhiTPCdEdxNPointsPrimaryProtonsReject",
1872                                                                   "Rejected primary protons;#eta;#phi;N_{points}(TPC)",
1873                                                                   fNBinsY,fMinY,fMaxY,
1874                                                                   100,0,360,
1875                                                                   100,0,200);
1876   gHistEtaPhiTPCdEdxNPointsPrimaryProtonsReject->SetStats(kTRUE);
1877   gHistEtaPhiTPCdEdxNPointsPrimaryProtonsReject->GetXaxis()->SetTitleColor(1);
1878   fRejectedCutList->Add(gHistEtaPhiTPCdEdxNPointsPrimaryProtonsReject);//eta-phi of primary rejected ESD protons
1879   TH3D *gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsReject = new TH3D("gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsReject",
1880                                                                       "Rejected primary antiprotons;#eta;#phi;N_{points}(TPC)",
1881                                                                       fNBinsY,fMinY,fMaxY,
1882                                                                       100,0,360,
1883                                                                       100,0,200);
1884   gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsReject->SetStats(kTRUE);
1885   gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsReject->GetXaxis()->SetTitleColor(1);
1886   fRejectedCutList->Add(gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsReject);//eta-phi of primary rejected ESD antiprotons
1887   TH3D *gHistEtaPhiTPCdEdxNPointsSecondaryProtonsReject = new TH3D("gHistEtaPhiTPCdEdxNPointsSecondaryProtonsReject",
1888                                                                     "Rejected secondary protons;#eta;#phi;N_{points}(TPC)",
1889                                                                     fNBinsY,fMinY,fMaxY,
1890                                                                     100,0,360,
1891                                                                     100,0,200);
1892   gHistEtaPhiTPCdEdxNPointsSecondaryProtonsReject->SetStats(kTRUE);
1893   gHistEtaPhiTPCdEdxNPointsSecondaryProtonsReject->GetXaxis()->SetTitleColor(1);
1894   fRejectedCutList->Add(gHistEtaPhiTPCdEdxNPointsSecondaryProtonsReject);//eta-phi of secondary rejected ESD protons
1895   TH3D *gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsReject = new TH3D("gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsReject",
1896                                                                         "Rejected secondary antiprotons;#eta;#phi;N_{points}(TPC)",
1897                                                                         fNBinsY,fMinY,fMaxY,
1898                                                                         100,0,360,
1899                                                                         100,0,200);
1900   gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsReject->SetStats(kTRUE);
1901   gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsReject->GetXaxis()->SetTitleColor(1);
1902   fRejectedCutList->Add(gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsReject);//eta-phi of secondary rejected ESD antiprotons
1903
1904   //DCA list
1905   fAcceptedDCAList = new TList();
1906   TH1F *gPrimaryProtonsDCAXY = new TH1F("gPrimaryProtonsDCAXY",
1907                                         ";DCA_{xy} [cm];Entries",
1908                                         100,0,20);
1909   fAcceptedDCAList->Add(gPrimaryProtonsDCAXY);
1910   TH1F *gPrimaryAntiProtonsDCAXY = new TH1F("gPrimaryAntiProtonsDCAXY",
1911                                             ";DCA_{xy} [cm];Entries",
1912                                             100,0,20);
1913   fAcceptedDCAList->Add(gPrimaryAntiProtonsDCAXY);
1914   TH1F *gSecondaryProtonsDCAXY = new TH1F("gSecondaryProtonsDCAXY",
1915                                           ";DCA_{xy} [cm];Entries",
1916                                           100,0,20);
1917   fAcceptedDCAList->Add(gSecondaryProtonsDCAXY);
1918   TH1F *gSecondaryAntiProtonsDCAXY = new TH1F("gSecondaryAntiProtonsDCAXY",
1919                                               ";DCA_{xy} [cm];Entries",
1920                                               100,0,20);
1921
1922   fAcceptedDCAList->Add(gSecondaryAntiProtonsDCAXY);
1923   TH1F *gPrimaryProtonsDCAZ = new TH1F("gPrimaryProtonsDCAZ",
1924                                        ";DCA_{z} [cm];Entries",
1925                                        100,0,20);
1926   fAcceptedDCAList->Add(gPrimaryProtonsDCAZ);
1927   TH1F *gPrimaryAntiProtonsDCAZ = new TH1F("gPrimaryAntiProtonsDCAZ",
1928                                            ";DCA_{z} [cm];Entries",
1929                                            100,0,20);
1930   fAcceptedDCAList->Add(gPrimaryAntiProtonsDCAZ);
1931   TH1F *gSecondaryProtonsDCAZ = new TH1F("gSecondaryProtonsDCAZ",
1932                                          ";DCA_{z} [cm];Entries",
1933                                          100,0,20);
1934   fAcceptedDCAList->Add(gSecondaryProtonsDCAZ);
1935   TH1F *gSecondaryAntiProtonsDCAZ = new TH1F("gSecondaryAntiProtonsDCAZ",
1936                                              ";DCA_{z} [cm];Entries",
1937                                              100,0,20);
1938   fAcceptedDCAList->Add(gSecondaryAntiProtonsDCAZ);
1939
1940   TH1F *gPrimaryProtonsSigmaToVertex = new TH1F("gPrimaryProtonsSigmaToVertex",
1941                                                 ";#sigma_{Vertex};Entries",
1942                                                 100,0,10);
1943   fAcceptedDCAList->Add(gPrimaryProtonsSigmaToVertex);
1944   TH1F *gPrimaryAntiProtonsSigmaToVertex = new TH1F("gPrimaryAntiProtonsSigmaToVertex",
1945                                                     ";#sigma_{Vertex};Entries",
1946                                                     100,0,10);
1947   fAcceptedDCAList->Add(gPrimaryAntiProtonsSigmaToVertex);
1948   TH1F *gSecondaryProtonsSigmaToVertex = new TH1F("gSecondaryProtonsSigmaToVertex",
1949                                                   ";#sigma_{Vertex};Entries",
1950                                                   100,0,10);
1951   fAcceptedDCAList->Add(gSecondaryProtonsSigmaToVertex);
1952   TH1F *gSecondaryAntiProtonsSigmaToVertex = new TH1F("gSecondaryAntiProtonsSigmaToVertex",
1953                                                       ";#sigma_{Vertex};Entries",
1954                                                       100,0,10);
1955   fAcceptedDCAList->Add(gSecondaryAntiProtonsSigmaToVertex);
1956
1957   //3D DCA vs pT plots
1958   TH3F *gHistPrimaryProtonsDCAxyEtaPt = new TH3F("gHistPrimaryProtonsDCAxyEtaPt",
1959                                                  ";#eta;P_{T} [GeV/c];dca_{xy} [cm]",
1960                                                  9,-0.9,0.9,
1961                                                  6,0.45,1.05,
1962                                                  100,0,10);
1963   gHistPrimaryProtonsDCAxyEtaPt->SetStats(kFALSE);
1964   fAcceptedDCAList->Add(gHistPrimaryProtonsDCAxyEtaPt);
1965   TH3F *gHistPrimaryAntiProtonsDCAxyEtaPt = new TH3F("gHistPrimaryAntiProtonsDCAxyEtaPt",
1966                                                      ";#eta;P_{T} [GeV/c];dca_{xy} [cm]",
1967                                                      9,-0.9,0.9,
1968                                                      6,0.45,1.05,
1969                                                      100,0,10);
1970   gHistPrimaryAntiProtonsDCAxyEtaPt->SetStats(kFALSE);
1971   fAcceptedDCAList->Add(gHistPrimaryAntiProtonsDCAxyEtaPt);
1972   TH3F *gHistSecondaryProtonsFromWeakDCAxyEtaPt = new TH3F("gHistSecondaryProtonsFromWeakDCAxyEtaPt",
1973                                                            ";#eta;P_{T} [GeV/c];dca_{xy} [cm]",
1974                                                            9,-0.9,0.9,
1975                                                            6,0.45,1.05,
1976                                                            100,0,10);
1977   gHistSecondaryProtonsFromWeakDCAxyEtaPt->SetStats(kFALSE);
1978   fAcceptedDCAList->Add(gHistSecondaryProtonsFromWeakDCAxyEtaPt);
1979   TH3F *gHistSecondaryAntiProtonsFromWeakDCAxyEtaPt = new TH3F("gHistSecondaryAntiProtonsFromWeakDCAxyEtaPt",
1980                                                                ";#eta;P_{T} [GeV/c];dca_{xy} [cm]",
1981                                                                9,-0.9,0.9,
1982                                                                6,0.45,1.05,
1983                                                                100,0,10);
1984   gHistSecondaryAntiProtonsFromWeakDCAxyEtaPt->SetStats(kFALSE);
1985   fAcceptedDCAList->Add(gHistSecondaryAntiProtonsFromWeakDCAxyEtaPt);
1986   TH3F *gHistSecondaryProtonsFromHadronicDCAxyEtaPt = new TH3F("gHistSecondaryProtonsFromHadronicDCAxyEtaPt",
1987                                                                ";#eta;P_{T} [GeV/c];dca_{xy} [cm]",
1988                                                                9,-0.9,0.9,
1989                                                                6,0.45,1.05,
1990                                                                100,0,10);
1991   gHistSecondaryProtonsFromHadronicDCAxyEtaPt->SetStats(kFALSE);
1992   fAcceptedDCAList->Add(gHistSecondaryProtonsFromHadronicDCAxyEtaPt);
1993   TH3F *gHistSecondaryAntiProtonsFromHadronicDCAxyEtaPt = new TH3F("gHistSecondaryAntiProtonsFromHadronicDCAxyEtaPt",
1994                                                                    ";#eta;P_{T} [GeV/c];dca_{xy} [cm]",
1995                                                                    9,-0.9,0.9,
1996                                                                    6,0.45,1.05,
1997                                                                    100,0,10);
1998   gHistSecondaryAntiProtonsFromHadronicDCAxyEtaPt->SetStats(kFALSE);
1999   fAcceptedDCAList->Add(gHistSecondaryAntiProtonsFromHadronicDCAxyEtaPt);
2000   
2001   TH3F *gHistPrimaryProtonsDCAzEtaPt = new TH3F("gHistPrimaryProtonsDCAzEtaPt",
2002                                                 ";#eta;P_{T} [GeV/c];dca_{z} [cm]",
2003                                                 9,-0.9,0.9,
2004                                                 6,0.45,1.05,
2005                                                 100,0,10);
2006   gHistPrimaryProtonsDCAzEtaPt->SetStats(kFALSE);
2007   fAcceptedDCAList->Add(gHistPrimaryProtonsDCAzEtaPt);
2008   TH3F *gHistPrimaryAntiProtonsDCAzEtaPt = new TH3F("gHistPrimaryAntiProtonsDCAzEtaPt",
2009                                                     ";#eta;P_{T} [GeV/c];dca_{z} [cm]",
2010                                                     9,-0.9,0.9,
2011                                                     6,0.45,1.05,
2012                                                     100,0,10);
2013   gHistPrimaryAntiProtonsDCAzEtaPt->SetStats(kFALSE);
2014   fAcceptedDCAList->Add(gHistPrimaryAntiProtonsDCAzEtaPt);
2015   TH3F *gHistSecondaryProtonsFromWeakDCAzEtaPt = new TH3F("gHistSecondaryProtonsFromWeakDCAzEtaPt",
2016                                                           ";#eta;P_{T} [GeV/c];dca_{z} [cm]",
2017                                                           9,-0.9,0.9,
2018                                                           6,0.45,1.05,
2019                                                           100,0,10);
2020   gHistSecondaryProtonsFromWeakDCAzEtaPt->SetStats(kFALSE);
2021   fAcceptedDCAList->Add(gHistSecondaryProtonsFromWeakDCAzEtaPt);
2022   TH3F *gHistSecondaryAntiProtonsFromWeakDCAzEtaPt = new TH3F("gHistSecondaryAntiProtonsFromWeakDCAzEtaPt",
2023                                                               ";#eta;P_{T} [GeV/c];dca_{z} [cm]",
2024                                                               9,-0.9,0.9,
2025                                                               6,0.45,1.05,
2026                                                               100,0,10);
2027   gHistSecondaryAntiProtonsFromWeakDCAzEtaPt->SetStats(kFALSE);
2028   fAcceptedDCAList->Add(gHistSecondaryAntiProtonsFromWeakDCAzEtaPt);
2029   TH3F *gHistSecondaryProtonsFromHadronicDCAzEtaPt = new TH3F("gHistSecondaryProtonsFromHadronicDCAzEtaPt",
2030                                                               ";#eta;P_{T} [GeV/c];dca_{z} [cm]",
2031                                                               9,-0.9,0.9,
2032                                                               6,0.45,1.05,
2033                                                               100,0,10);
2034   gHistSecondaryProtonsFromHadronicDCAzEtaPt->SetStats(kFALSE);
2035   fAcceptedDCAList->Add(gHistSecondaryProtonsFromHadronicDCAzEtaPt);
2036   TH3F *gHistSecondaryAntiProtonsFromHadronicDCAzEtaPt = new TH3F("gHistSecondaryAntiProtonsFromHadronicDCAzEtaPt",
2037                                                                   ";#eta;P_{T} [GeV/c];dca_{z} [cm]",
2038                                                                   9,-0.9,0.9,
2039                                                                   6,0.45,1.05,
2040                                                                   100,0,10);
2041   gHistSecondaryAntiProtonsFromHadronicDCAzEtaPt->SetStats(kFALSE);
2042   fAcceptedDCAList->Add(gHistSecondaryAntiProtonsFromHadronicDCAzEtaPt);
2043 }
2044
2045 //____________________________________________________________________//
2046 void AliProtonQAAnalysis::InitVertexQA() {
2047   //Initializes the Vertex QA histograms
2048   fQAVertexList = new TList();
2049   fQAVertexList->SetName("fQAVertexList");
2050
2051   //Gen. multiplicity bins
2052   //Float_t xBins[24] = {0,1,2,4,6,8,10,15,20,30,40,50,75,100,
2053   //200,300,400,500,750,1000,1500,2000,2500,3000};
2054   //MC primary multiplicity (vertex efficiency calculation)
2055   TH1F *gHistMCPrimaryVz = new TH1F("gHistMCPrimaryVz",
2056                                     ";V_{z} (gen.) [cm];Entries",
2057                                     40,-20.,20.);
2058   fQAVertexList->Add(gHistMCPrimaryVz);
2059   //TH1F *gHistMCPrimaryMultiplicity = new TH1F("gHistMCPrimaryMultiplicity",
2060   //";N_{prim. gen.};Entries",
2061   //23,xBins);
2062   //fQAVertexList->Add(gHistMCPrimaryMultiplicity);
2063   
2064   //TPC
2065   TH1F *gHistTPCVz = new TH1F("gHistTPCVz",
2066                               ";V_{z} (gen.) [cm];Entries",
2067                               40,-20.,20.);
2068   fQAVertexList->Add(gHistTPCVz);
2069   //TH1F *gHistMCPrimaryMultiplicityTPC = new TH1F("gHistMCPrimaryMultiplicityTPC",
2070   //"Vertex TPC;N_{prim. gen.};Entries",
2071   //23,xBins);
2072   //fQAVertexList->Add(gHistMCPrimaryMultiplicityTPC);
2073   TH2F *gHistTPCESDVxN = new TH2F("gHistTPCESDVxN",
2074                                  "Primary vertex TPC;V_{x} [cm];N_{contributors}",
2075                                  100,-10.,10.,1000,0,5000);
2076   fQAVertexList->Add(gHistTPCESDVxN);
2077   TH2F *gHistTPCESDVyN = new TH2F("gHistTPCESDVyN",
2078                                  "Primary vertex TPC;V_{y} [cm];N_{contributors}",
2079                                  100,-10.,10.,1000,0,5000);
2080   fQAVertexList->Add(gHistTPCESDVyN);
2081   TH2F *gHistTPCESDVzN = new TH2F("gHistTPCESDVzN",
2082                                  "Primary vertex TPC;V_{z} [cm];N_{contributors}",
2083                                  100,-20.,20.,1000,0,5000);
2084   fQAVertexList->Add(gHistTPCESDVzN);
2085   TH1F *gHistTPCDiffVx = new TH1F("gHistTPCDiffVx",
2086                                   ";V_{x}(rec.) - V_{x}(true) [#mu m];Entries",
2087                                   100,-10000.,10000.);
2088   fQAVertexList->Add(gHistTPCDiffVx);
2089   TH1F *gHistTPCDiffVy = new TH1F("gHistTPCDiffVy",
2090                                   ";V_{y}(rec.) - V_{y}(true) [#mu m];Entries",
2091                                   100,-10000.,10000.);
2092   fQAVertexList->Add(gHistTPCDiffVy);
2093   TH1F *gHistTPCDiffVz = new TH1F("gHistTPCDiffVz",
2094                                   ";V_{z}(rec.) - V_{z}(true) [#mu m];Entries",
2095                                   100,-10000.,10000.);
2096   fQAVertexList->Add(gHistTPCDiffVz);
2097   TH1F *gHistTPCResolutionVx = new TH1F("gHistTPCResolutionVx",
2098                                         ";#sigma_{x} [#mu m];Entries",
2099                                         100,0.,1000000.);
2100   fQAVertexList->Add(gHistTPCResolutionVx);
2101   TH1F *gHistTPCResolutionVy = new TH1F("gHistTPCResolutionVy",
2102                                         ";#sigma_{y} [#mu m];Entries",
2103                                         100,0.,1000000.);
2104   fQAVertexList->Add(gHistTPCResolutionVy);
2105   TH1F *gHistTPCResolutionVz = new TH1F("gHistTPCResolutionVz",
2106                                         ";#sigma_{z} [#mu m];Entries",
2107                                         100,0.,6000.);
2108   fQAVertexList->Add(gHistTPCResolutionVz);
2109   
2110   //SPD
2111   TH1F *gHistSPDVz = new TH1F("gHistSPDVz",
2112                               ";V_{z} (gen.) [cm];Entries",
2113                               40,-20.,20.);
2114   fQAVertexList->Add(gHistSPDVz);
2115   //TH1F *gHistMCPrimaryMultiplicitySPD = new TH1F("gHistMCPrimaryMultiplicitySPD",
2116   //"Vertex SPD;N_{prim. gen.};Entries",
2117   //23,xBins);
2118   //fQAVertexList->Add(gHistMCPrimaryMultiplicitySPD);
2119   TH2F *gHistSPDESDVxN = new TH2F("gHistSPDESDVxN",
2120                                  "Primary vertex SPD;V_{x} [cm];N_{contributors}",
2121                                  100,-10.,10.,1000,0,5000);
2122   fQAVertexList->Add(gHistSPDESDVxN);
2123   TH2F *gHistSPDESDVyN = new TH2F("gHistSPDESDVyN",
2124                                  "Primary vertex SPD;V_{y} [cm];N_{contributors}",
2125                                  100,-10.,10.,1000,0,5000);
2126   fQAVertexList->Add(gHistSPDESDVyN);
2127   TH2F *gHistSPDESDVzN = new TH2F("gHistSPDESDVzN",
2128                                  "Primary vertex SPD;V_{z} [cm];N_{contributors}",
2129                                  100,-20.,20.,1000,0,5000);
2130   fQAVertexList->Add(gHistSPDESDVzN);
2131   TH1F *gHistSPDDiffVx = new TH1F("gHistSPDDiffVx",
2132                                   ";V_{x}(rec.) - V_{x}(true) [#mu m];Entries",
2133                                   100,-10000.,10000.);
2134   fQAVertexList->Add(gHistSPDDiffVx);
2135   TH1F *gHistSPDDiffVy = new TH1F("gHistSPDDiffVy",
2136                                   ";V_{y}(rec.) - V_{y}(true) [#mu m];Entries",
2137                                   100,-10000.,10000.);
2138   fQAVertexList->Add(gHistSPDDiffVy);
2139   TH1F *gHistSPDDiffVz = new TH1F("gHistSPDDiffVz",
2140                                   ";V_{z}(rec.) - V_{z}(true) [#mu m];Entries",
2141                                   100,-10000.,10000.);
2142   fQAVertexList->Add(gHistSPDDiffVz);
2143   TH1F *gHistSPDResolutionVx = new TH1F("gHistSPDResolutionVx",
2144                                         ";#sigma_{x} [#mu m];Entries",
2145                                         100,0.,1000.);
2146   fQAVertexList->Add(gHistSPDResolutionVx);
2147   TH1F *gHistSPDResolutionVy = new TH1F("gHistSPDResolutionVy",
2148                                         ";#sigma_{y} [#mu m];Entries",
2149                                         100,0.,1000.);
2150   fQAVertexList->Add(gHistSPDResolutionVy);
2151   TH1F *gHistSPDResolutionVz = new TH1F("gHistSPDResolutionVz",
2152                                         ";#sigma_{z} [#mu m];Entries",
2153                                         100,0.,500.);
2154   fQAVertexList->Add(gHistSPDResolutionVz);
2155   
2156   //Tracks
2157   TH1F *gHistTracksVz = new TH1F("gHistTracksVz",
2158                                  ";V_{z} (gen.) [cm];Entries",
2159                                  40,-20.,20.);
2160   fQAVertexList->Add(gHistTracksVz);
2161   //TH1F *gHistMCPrimaryMultiplicityTracks = new TH1F("gHistMCPrimaryMultiplicityTracks",
2162   //"Vertex Tracks;N_{prim. gen.};Entries",
2163   //23,xBins);
2164   //fQAVertexList->Add(gHistMCPrimaryMultiplicityTracks);
2165   TH2F *gHistTracksESDVxN = new TH2F("gHistTracksESDVxN",
2166                                      "Primary vertex Tracks;V_{x} [cm];N_{contributors}",
2167                                      100,-10.,10.,1000,0,5000);
2168   fQAVertexList->Add(gHistTracksESDVxN);
2169   TH2F *gHistTracksESDVyN = new TH2F("gHistTracksESDVyN",
2170                                     "Primary vertex Tracks;V_{y} [cm];N_{contributors}",
2171                                     100,-10.,10.,1000,0,5000);
2172   fQAVertexList->Add(gHistTracksESDVyN);
2173   TH2F *gHistTracksESDVzN = new TH2F("gHistTracksESDVzN",
2174                                     "Primary vertex Tracks;V_{z} [cm];N_{contributors}",
2175                                     100,-20.,20.,1000,0,5000);
2176   fQAVertexList->Add(gHistTracksESDVzN);
2177   TH1F *gHistTracksDiffVx = new TH1F("gHistTracksDiffVx",
2178                                      ";V_{x}(rec.) - V_{x}(true) [#mu m];Entries",
2179                                      100,-10000.,10000.);
2180   fQAVertexList->Add(gHistTracksDiffVx);
2181   TH1F *gHistTracksDiffVy = new TH1F("gHistTracksDiffVy",
2182                                      ";V_{y}(rec.) - V_{y}(true) [#mu m];Entries",
2183                                      100,-10000.,10000.);
2184   fQAVertexList->Add(gHistTracksDiffVy);
2185   TH1F *gHistTracksDiffVz = new TH1F("gHistTracksDiffVz",
2186                                      ";V_{z}(rec.) - V_{z}(true) [#mu m];Entries",
2187                                      100,-10000.,10000.);
2188   fQAVertexList->Add(gHistTracksDiffVz);
2189   TH1F *gHistTracksResolutionVx = new TH1F("gHistTracksResolutionVx",
2190                                            ";#sigma_{x} [#mu m];Entries",
2191                                            100,0.,5000.);
2192   fQAVertexList->Add(gHistTracksResolutionVx);
2193   TH1F *gHistTracksResolutionVy = new TH1F("gHistTracksResolutionVy",
2194                                            ";#sigma_{y} [#mu m];Entries",
2195                                            100,0.,5000.);
2196   fQAVertexList->Add(gHistTracksResolutionVy);
2197   TH1F *gHistTracksResolutionVz = new TH1F("gHistTracksResolutionVz",
2198                                            ";#sigma_{z} [#mu m];Entries",
2199                                            100,0.,1000.);
2200   fQAVertexList->Add(gHistTracksResolutionVz);
2201 }
2202
2203 //____________________________________________________________________//
2204 void AliProtonQAAnalysis::InitQA() {
2205   //Initializes the QA histograms
2206   //if(!fQAHistograms) 
2207   SetRunQAAnalysis();
2208
2209   //2D histograms
2210   //TDirectory *dir2D = gDirectory->mkdir("2D");
2211   //fGlobalQAList->Add(dir2D); dir2D->cd();
2212   TH2D *gHistYPtPrimaryProtonsPass = 0x0;
2213   if(fUseAsymmetricBinning)
2214   gHistYPtPrimaryProtonsPass = new TH2D("gHistYPtPrimaryProtonsPass",
2215                                         ";;P_{T} [GeV/c]",
2216                                         fNBinsY,fY,fNBinsPt,fPt);
2217   else
2218     gHistYPtPrimaryProtonsPass = new TH2D("gHistYPtPrimaryProtonsPass",
2219                                           ";;P_{T} [GeV/c]",
2220                                           fNBinsY,fMinY,fMaxY,
2221                                           fNBinsPt,fMinPt,fMaxPt);
2222   if(fProtonAnalysisBase->GetEtaMode()) 
2223     gHistYPtPrimaryProtonsPass->GetXaxis()->SetTitle("#eta");
2224   else 
2225     gHistYPtPrimaryProtonsPass->GetXaxis()->SetTitle("y");
2226   gHistYPtPrimaryProtonsPass->SetStats(kTRUE);
2227   gHistYPtPrimaryProtonsPass->GetXaxis()->SetTitleColor(1);
2228   fQA2DList->Add(gHistYPtPrimaryProtonsPass);//y-pT of primary accepted ESD protons
2229   TH2D *gHistYPtPrimaryProtonsReject = 0x0;
2230   if(fUseAsymmetricBinning)
2231     gHistYPtPrimaryProtonsReject = new TH2D("gHistYPtPrimaryProtonsReject",
2232                                             ";;P_{T} [GeV/c]",
2233                                             fNBinsY,fY,fNBinsPt,fPt);
2234   else
2235     gHistYPtPrimaryProtonsReject = new TH2D("gHistYPtPrimaryProtonsReject",
2236                                             ";;P_{T} [GeV/c]",
2237                                             fNBinsY,fMinY,fMaxY,
2238                                             fNBinsPt,fMinPt,fMaxPt);
2239   if(fProtonAnalysisBase->GetEtaMode()) 
2240     gHistYPtPrimaryProtonsReject->GetXaxis()->SetTitle("#eta");
2241   else 
2242     gHistYPtPrimaryProtonsReject->GetXaxis()->SetTitle("y");
2243   gHistYPtPrimaryProtonsReject->SetStats(kTRUE);
2244   gHistYPtPrimaryProtonsReject->GetXaxis()->SetTitleColor(1);
2245   fQA2DList->Add(gHistYPtPrimaryProtonsReject);//y-pT of primary rejected ESD protons
2246
2247   TH2D *gHistYPtSecondaryProtonsPass = 0x0;
2248   if(fUseAsymmetricBinning)
2249     gHistYPtSecondaryProtonsPass = new TH2D("gHistYPtSecondaryProtonsPass",
2250                                             ";;P_{T} [GeV/c]",
2251                                             fNBinsY,fY,fNBinsPt,fPt);
2252   else
2253     gHistYPtSecondaryProtonsPass = new TH2D("gHistYPtSecondaryProtonsPass",
2254                                             ";;P_{T} [GeV/c]",
2255                                             fNBinsY,fMinY,fMaxY,
2256                                             fNBinsPt,fMinPt,fMaxPt);
2257   if(fProtonAnalysisBase->GetEtaMode()) 
2258     gHistYPtSecondaryProtonsPass->GetXaxis()->SetTitle("#eta");
2259   else 
2260     gHistYPtSecondaryProtonsPass->GetXaxis()->SetTitle("y");
2261   gHistYPtSecondaryProtonsPass->SetStats(kTRUE);
2262   gHistYPtSecondaryProtonsPass->GetXaxis()->SetTitleColor(1);
2263   fQA2DList->Add(gHistYPtSecondaryProtonsPass);//y-pT of secondary accepted ESD protons
2264   TH2D *gHistYPtSecondaryProtonsReject = 0x0;
2265   if(fUseAsymmetricBinning)
2266     gHistYPtSecondaryProtonsReject = new TH2D("gHistYPtSecondaryProtonsReject",
2267                                               ";;P_{T} [GeV/c]",
2268                                               fNBinsY,fY,fNBinsPt,fPt);
2269   else
2270     gHistYPtSecondaryProtonsReject = new TH2D("gHistYPtSecondaryProtonsReject",
2271                                               ";;P_{T} [GeV/c]",
2272                                               fNBinsY,fMinY,fMaxY,
2273                                               fNBinsPt,fMinPt,fMaxPt);
2274   if(fProtonAnalysisBase->GetEtaMode()) 
2275     gHistYPtSecondaryProtonsReject->GetXaxis()->SetTitle("#eta");
2276   else 
2277     gHistYPtSecondaryProtonsReject->GetXaxis()->SetTitle("y");
2278   gHistYPtSecondaryProtonsReject->SetStats(kTRUE);
2279   gHistYPtSecondaryProtonsReject->GetXaxis()->SetTitleColor(1);
2280   fQA2DList->Add(gHistYPtSecondaryProtonsReject);//y-pT of secondary rejected ESD protons
2281
2282   TH2D *gHistYPtPrimaryAntiProtonsPass = 0x0;
2283   if(fUseAsymmetricBinning)
2284     gHistYPtPrimaryAntiProtonsPass = new TH2D("gHistYPtPrimaryAntiProtonsPass",
2285                                               ";;P_{T} [GeV/c]",
2286                                               fNBinsY,fY,fNBinsPt,fPt);
2287   else
2288     gHistYPtPrimaryAntiProtonsPass = new TH2D("gHistYPtPrimaryAntiProtonsPass",
2289                                               ";;P_{T} [GeV/c]",
2290                                               fNBinsY,fMinY,fMaxY,
2291                                               fNBinsPt,fMinPt,fMaxPt);
2292   if(fProtonAnalysisBase->GetEtaMode()) 
2293     gHistYPtPrimaryAntiProtonsPass->GetXaxis()->SetTitle("#eta");
2294   else 
2295     gHistYPtPrimaryAntiProtonsPass->GetXaxis()->SetTitle("y");
2296   gHistYPtPrimaryAntiProtonsPass->SetStats(kTRUE);
2297   gHistYPtPrimaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
2298   fQA2DList->Add(gHistYPtPrimaryAntiProtonsPass);//y-pT of primary accepted ESD antiprotons
2299   TH2D *gHistYPtPrimaryAntiProtonsReject = 0x0;
2300   if(fUseAsymmetricBinning)
2301     gHistYPtPrimaryAntiProtonsReject = new TH2D("gHistYPtPrimaryAntiProtonsReject",
2302                                                 ";;P_{T} [GeV/c]",
2303                                                 fNBinsY,fY,fNBinsPt,fPt);
2304   else
2305     gHistYPtPrimaryAntiProtonsReject = new TH2D("gHistYPtPrimaryAntiProtonsReject",
2306                                                 ";;P_{T} [GeV/c]",
2307                                                 fNBinsY,fMinY,fMaxY,
2308                                                 fNBinsPt,fMinPt,fMaxPt);
2309   if(fProtonAnalysisBase->GetEtaMode()) 
2310     gHistYPtPrimaryAntiProtonsReject->GetXaxis()->SetTitle("#eta");
2311   else 
2312     gHistYPtPrimaryAntiProtonsReject->GetXaxis()->SetTitle("y");
2313   gHistYPtPrimaryAntiProtonsReject->SetStats(kTRUE);
2314   gHistYPtPrimaryAntiProtonsReject->GetXaxis()->SetTitleColor(1);
2315   fQA2DList->Add(gHistYPtPrimaryAntiProtonsReject);//y-pT of primary rejected ESD antiprotons
2316
2317   TH2D *gHistYPtSecondaryAntiProtonsPass = 0x0;
2318   if(fUseAsymmetricBinning)
2319   gHistYPtSecondaryAntiProtonsPass = new TH2D("gHistYPtSecondaryAntiProtonsPass",
2320                                               ";;P_{T} [GeV/c]",
2321                                               fNBinsY,fY,fNBinsPt,fPt);
2322   else
2323     gHistYPtSecondaryAntiProtonsPass = new TH2D("gHistYPtSecondaryAntiProtonsPass",
2324                                                 ";;P_{T} [GeV/c]",
2325                                                 fNBinsY,fMinY,fMaxY,
2326                                                 fNBinsPt,fMinPt,fMaxPt);
2327   if(fProtonAnalysisBase->GetEtaMode()) 
2328     gHistYPtSecondaryAntiProtonsPass->GetXaxis()->SetTitle("#eta");
2329   else 
2330     gHistYPtSecondaryAntiProtonsPass->GetXaxis()->SetTitle("y");
2331   gHistYPtSecondaryAntiProtonsPass->SetStats(kTRUE);
2332   gHistYPtSecondaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
2333   fQA2DList->Add(gHistYPtSecondaryAntiProtonsPass);//y-pT of secondary accepted ESD antiprotons
2334   TH2D *gHistYPtSecondaryAntiProtonsReject = 0x0;
2335   if(fUseAsymmetricBinning)
2336   gHistYPtSecondaryAntiProtonsReject = new TH2D("gHistYPtSecondaryAntiProtonsReject",
2337                                                 ";;P_{T} [GeV/c]",
2338                                                 fNBinsY,fY,fNBinsPt,fPt);
2339   else
2340     gHistYPtSecondaryAntiProtonsReject = new TH2D("gHistYPtSecondaryAntiProtonsReject",
2341                                                   ";;P_{T} [GeV/c]",
2342                                                   fNBinsY,fMinY,fMaxY,
2343                                                   fNBinsPt,fMinPt,fMaxPt);
2344   if(fProtonAnalysisBase->GetEtaMode()) 
2345     gHistYPtSecondaryAntiProtonsReject->GetXaxis()->SetTitle("#eta");
2346   else 
2347     gHistYPtSecondaryAntiProtonsReject->GetXaxis()->SetTitle("y");
2348   gHistYPtSecondaryAntiProtonsReject->SetStats(kTRUE);
2349   gHistYPtSecondaryAntiProtonsReject->GetXaxis()->SetTitleColor(1);
2350   fQA2DList->Add(gHistYPtSecondaryAntiProtonsReject);//y-pT of secondary rejected ESD antiprotons
2351
2352   TH2D *gHistYPtPrimaryProtonsMC = 0x0;
2353   if(fUseAsymmetricBinning)
2354     gHistYPtPrimaryProtonsMC = new TH2D("gHistYPtPrimaryProtonsMC",
2355                                         ";;P_{T} [GeV/c]",
2356                                         fNBinsY,fY,fNBinsPt,fPt);
2357   else
2358     gHistYPtPrimaryProtonsMC = new TH2D("gHistYPtPrimaryProtonsMC",
2359                                         ";;P_{T} [GeV/c]",
2360                                         fNBinsY,fMinY,fMaxY,
2361                                         fNBinsPt,fMinPt,fMaxPt);
2362   if(fProtonAnalysisBase->GetEtaMode()) 
2363     gHistYPtPrimaryProtonsMC->GetXaxis()->SetTitle("#eta");
2364   else 
2365     gHistYPtPrimaryProtonsMC->GetXaxis()->SetTitle("y");
2366   gHistYPtPrimaryProtonsMC->SetStats(kTRUE);
2367   gHistYPtPrimaryProtonsMC->GetXaxis()->SetTitleColor(1);
2368   fQA2DList->Add(gHistYPtPrimaryProtonsMC);//y-pT of primary MC protons
2369   TH2D *gHistYPtPrimaryAntiProtonsMC = 0x0;
2370   if(fUseAsymmetricBinning)
2371     gHistYPtPrimaryAntiProtonsMC = new TH2D("gHistYPtPrimaryAntiProtonsMC",
2372                                             ";;P_{T} [GeV/c]",
2373                                             fNBinsY,fY,fNBinsPt,fPt);
2374   else
2375     gHistYPtPrimaryAntiProtonsMC = new TH2D("gHistYPtPrimaryAntiProtonsMC",
2376                                             ";;P_{T} [GeV/c]",
2377                                             fNBinsY,fMinY,fMaxY,
2378                                             fNBinsPt,fMinPt,fMaxPt);
2379   if(fProtonAnalysisBase->GetEtaMode()) 
2380     gHistYPtPrimaryAntiProtonsMC->GetXaxis()->SetTitle("#eta");
2381   else 
2382     gHistYPtPrimaryAntiProtonsMC->GetXaxis()->SetTitle("y");
2383   gHistYPtPrimaryAntiProtonsMC->SetStats(kTRUE);
2384   gHistYPtPrimaryAntiProtonsMC->GetXaxis()->SetTitleColor(1);
2385   fQA2DList->Add(gHistYPtPrimaryAntiProtonsMC);//y-pT of primary MC antiprotons
2386
2387   TH3F *gHistYPtPDGProtonsPass = 0x0;
2388   if(fUseAsymmetricBinning) {
2389     Double_t gPDG[15] = {-0.5,0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,10.5,11.5,12.5,13.5};
2390     gHistYPtPDGProtonsPass = new TH3F("gHistYPtPDGProtonsPass",
2391                                       ";;P_{T} [GeV/c];PDG",
2392                                       fNBinsY,fY,fNBinsPt,fPt,14,gPDG);
2393   }
2394   else
2395     gHistYPtPDGProtonsPass = new TH3F("gHistYPtPDGProtonsPass",
2396                                       ";;P_{T} [GeV/c];PDG",
2397                                       fNBinsY,fMinY,fMaxY,
2398                                       fNBinsPt,fMinPt,fMaxPt,
2399                                       14,-0.5,13.5);
2400   if(fProtonAnalysisBase->GetEtaMode()) 
2401     gHistYPtPDGProtonsPass->GetXaxis()->SetTitle("#eta");
2402   else 
2403     gHistYPtPDGProtonsPass->GetXaxis()->SetTitle("y");
2404   fQA2DList->Add(gHistYPtPDGProtonsPass);//composition of secondary protons
2405   TH3F *gHistYPtPDGAntiProtonsPass = 0x0;
2406   if(fUseAsymmetricBinning) {
2407     Double_t gPDG[15] = {-0.5,0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5,10.5,11.5,12.5,13.5};
2408     gHistYPtPDGAntiProtonsPass = new TH3F("gHistYPtPDGAntiProtonsPass",
2409                                           ";;P_{T} [GeV/c];PDG",
2410                                           fNBinsY,fY,fNBinsPt,fPt,14,gPDG);
2411   }
2412   else
2413     gHistYPtPDGAntiProtonsPass = new TH3F("gHistYPtPDGAntiProtonsPass",
2414                                           ";;P_{T} [GeV/c];PDG",
2415                                           fNBinsY,fMinY,fMaxY,
2416                                           fNBinsPt,fMinPt,fMaxPt,
2417                                           14,-0.5,13.5);
2418   if(fProtonAnalysisBase->GetEtaMode()) 
2419     gHistYPtPDGAntiProtonsPass->GetXaxis()->SetTitle("#eta");
2420   else 
2421     gHistYPtPDGAntiProtonsPass->GetXaxis()->SetTitle("y");
2422   fQA2DList->Add(gHistYPtPDGAntiProtonsPass);//composition of secondary antiprotons
2423
2424   /*gDirectory->cd("../");
2425   //protons
2426   TDirectory *dirProtons = gDirectory->mkdir("Protons");
2427   fGlobalQAList->Add(dirProtons); dirProtons->cd();*/
2428   
2429   //________________________________________________________________//
2430   /*TDirectory *dirProtonsPrimary = gDirectory->mkdir("Primaries");
2431   dirProtonsPrimary->cd();
2432   TDirectory *dirProtonsPrimaryAccepted = gDirectory->mkdir("Accepted");
2433   dirProtonsPrimaryAccepted->cd();*/
2434
2435   //Accepted primary protons
2436   TH1F *gPrimaryProtonsITSClustersPass = new TH1F("gPrimaryProtonsITSClustersPass",
2437                                             ";N_{clusters} (ITS);Entries",
2438                                             7,0,7);
2439   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsITSClustersPass);
2440   TH1F *gPrimaryProtonsChi2PerClusterITSPass = new TH1F("gPrimaryProtonsChi2PerClusterITSPass",
2441                                                   ";x^{2}/N_{clusters} (ITS);Entries",
2442                                                   100,0,4);
2443   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsChi2PerClusterITSPass);
2444   TH1F *gPrimaryProtonsTPCClustersPass = new TH1F("gPrimaryProtonsTPCClustersPass",
2445                                             ";N_{clusters} (TPC);Entries",
2446                                             100,0,200);
2447   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsTPCClustersPass);
2448   TH1F *gPrimaryProtonsChi2PerClusterTPCPass = new TH1F("gPrimaryProtonsChi2PerClusterTPCPass",
2449                                                   ";x^{2}/N_{clusters} (TPC);Entries",
2450                                                   100,0,4);
2451   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsChi2PerClusterTPCPass);
2452   TH1F *gPrimaryProtonsExtCov11Pass = new TH1F("gPrimaryProtonsExtCov11Pass",
2453                                          ";#sigma_{y} [cm];Entries",
2454                                          100,0,4);
2455   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsExtCov11Pass);
2456   TH1F *gPrimaryProtonsExtCov22Pass = new TH1F("gPrimaryProtonsExtCov22Pass",
2457                                          ";#sigma_{z} [cm];Entries",
2458                                          100,0,4);
2459   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsExtCov22Pass);
2460   TH1F *gPrimaryProtonsExtCov33Pass = new TH1F("gPrimaryProtonsExtCov33Pass",
2461                                          ";#sigma_{sin(#phi)};Entries",
2462                                          100,0,4);
2463   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsExtCov33Pass);
2464   TH1F *gPrimaryProtonsExtCov44Pass = new TH1F("gPrimaryProtonsExtCov44Pass",
2465                                          ";#sigma_{tan(#lambda)};Entries",
2466                                          100,0,4);
2467   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsExtCov44Pass);
2468   TH1F *gPrimaryProtonsExtCov55Pass = new TH1F("gPrimaryProtonsExtCov55Pass",
2469                                          ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2470                                          100,0,4);
2471   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsExtCov55Pass);
2472   TH1F *gPrimaryProtonsSigmaToVertexPass = new TH1F("gPrimaryProtonsSigmaToVertexPass",
2473                                              ";#sigma_{Vertex};Entries",
2474                                              100,0,10);
2475   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsSigmaToVertexPass);
2476   TH1F *gPrimaryProtonsSigmaToVertexTPCPass = new TH1F("gPrimaryProtonsSigmaToVertexTPCPass",
2477                                              ";#sigma_{Vertex};Entries",
2478                                              100,0,10);
2479   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsSigmaToVertexTPCPass);
2480   TH1F *gPrimaryProtonsDCAXYPass = new TH1F("gPrimaryProtonsDCAXYPass",
2481                                              ";DCA_{xy} [cm];Entries",
2482                                              100,0,20);
2483   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsDCAXYPass);
2484   TH1F *gPrimaryProtonsDCAXYTPCPass = new TH1F("gPrimaryProtonsDCAXYTPCPass",
2485                                                ";DCA_{xy} [cm];Entries",
2486                                                100,0,20);
2487   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsDCAXYTPCPass);
2488   TH1F *gPrimaryProtonsDCAZPass = new TH1F("gPrimaryProtonsDCAZPass",
2489                                            ";DCA_{z} [cm];Entries",
2490                                            100,0,20);
2491   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsDCAZPass);
2492   TH1F *gPrimaryProtonsDCAZTPCPass = new TH1F("gPrimaryProtonsDCAZTPCPass",
2493                                               ";DCA_{z} [cm];Entries",
2494                                               100,0,20);
2495   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsDCAZTPCPass);
2496   TH1F *gPrimaryProtonsConstrainChi2Pass = new TH1F("gPrimaryProtonsConstrainChi2Pass",
2497                                                     ";Log_{10}(#chi^{2});Entries",
2498                                                     100,-10,10);
2499   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsConstrainChi2Pass);
2500   TH1F *gPrimaryProtonsITSRefitPass = new TH1F("gPrimaryProtonsITSRefitPass",
2501                                                "",10,-1,1);
2502   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsITSRefitPass);
2503   TH1F *gPrimaryProtonsTPCRefitPass = new TH1F("gPrimaryProtonsTPCRefitPass",
2504                                                "",10,-1,1);
2505   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsTPCRefitPass);
2506   TH1F *gPrimaryProtonsESDpidPass = new TH1F("gPrimaryProtonsESDpidPass",
2507                                              "",10,-1,1);
2508   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsESDpidPass);
2509   TH1F *gPrimaryProtonsTPCpidPass = new TH1F("gPrimaryProtonsTPCpidPass",
2510                                              "",10,-1,1);
2511   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsTPCpidPass);
2512   TH1F *gPrimaryProtonsPointOnITSLayer1Pass = new TH1F("gPrimaryProtonsPointOnITSLayer1Pass",
2513                                              "",10,-1,1);
2514   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsPointOnITSLayer1Pass);
2515   TH1F *gPrimaryProtonsPointOnITSLayer2Pass = new TH1F("gPrimaryProtonsPointOnITSLayer2Pass",
2516                                              "",10,-1,1);
2517   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsPointOnITSLayer2Pass);
2518   TH1F *gPrimaryProtonsPointOnITSLayer3Pass = new TH1F("gPrimaryProtonsPointOnITSLayer3Pass",
2519                                              "",10,-1,1);
2520   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsPointOnITSLayer3Pass);
2521   TH1F *gPrimaryProtonsPointOnITSLayer4Pass = new TH1F("gPrimaryProtonsPointOnITSLayer4Pass",
2522                                              "",10,-1,1);
2523   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsPointOnITSLayer4Pass);
2524   TH1F *gPrimaryProtonsPointOnITSLayer5Pass = new TH1F("gPrimaryProtonsPointOnITSLayer5Pass",
2525                                              "",10,-1,1);
2526   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsPointOnITSLayer5Pass);
2527   TH1F *gPrimaryProtonsPointOnITSLayer6Pass = new TH1F("gPrimaryProtonsPointOnITSLayer6Pass",
2528                                              "",10,-1,1);
2529   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsPointOnITSLayer6Pass);
2530   TH1F *gPrimaryProtonsNumberOfTPCdEdxPointsPass = new TH1F("gPrimaryProtonsNumberOfTPCdEdxPointsPass","",100,0,200);
2531   fQAPrimaryProtonsAcceptedList->Add(gPrimaryProtonsNumberOfTPCdEdxPointsPass);
2532
2533   //Rejected primary protons
2534   /*gDirectory->cd("../");
2535   TDirectory *dirProtonsPrimaryRejected = gDirectory->mkdir("Rejected");
2536   dirProtonsPrimaryRejected->cd();*/
2537
2538   TH1F *gPrimaryProtonsITSClustersReject = new TH1F("gPrimaryProtonsITSClustersReject",
2539                                                     ";N_{clusters} (ITS);Entries",
2540                                                     7,0,7);
2541   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsITSClustersReject);
2542   TH1F *gPrimaryProtonsChi2PerClusterITSReject = new TH1F("gPrimaryProtonsChi2PerClusterITSReject",
2543                                                           ";x^{2}/N_{clusters} (ITS);Entries",
2544                                                           100,0,4);
2545   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsChi2PerClusterITSReject);
2546   TH1F *gPrimaryProtonsTPCClustersReject = new TH1F("gPrimaryProtonsTPCClustersReject",
2547                                             ";N_{clusters} (TPC);Entries",
2548                                             100,0,200);
2549   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsTPCClustersReject);
2550   TH1F *gPrimaryProtonsChi2PerClusterTPCReject = new TH1F("gPrimaryProtonsChi2PerClusterTPCReject",
2551                                                   ";x^{2}/N_{clusters} (TPC);Entries",
2552                                                   100,0,4);
2553   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsChi2PerClusterTPCReject);
2554   TH1F *gPrimaryProtonsExtCov11Reject = new TH1F("gPrimaryProtonsExtCov11Reject",
2555                                          ";#sigma_{y} [cm];Entries",
2556                                          100,0,4);
2557   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsExtCov11Reject);
2558   TH1F *gPrimaryProtonsExtCov22Reject = new TH1F("gPrimaryProtonsExtCov22Reject",
2559                                          ";#sigma_{z} [cm];Entries",
2560                                          100,0,4);
2561   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsExtCov22Reject);
2562   TH1F *gPrimaryProtonsExtCov33Reject = new TH1F("gPrimaryProtonsExtCov33Reject",
2563                                          ";#sigma_{sin(#phi)};Entries",
2564                                          100,0,4);
2565   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsExtCov33Reject);
2566   TH1F *gPrimaryProtonsExtCov44Reject = new TH1F("gPrimaryProtonsExtCov44Reject",
2567                                          ";#sigma_{tan(#lambda)};Entries",
2568                                          100,0,4);
2569   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsExtCov44Reject);
2570   TH1F *gPrimaryProtonsExtCov55Reject = new TH1F("gPrimaryProtonsExtCov55Reject",
2571                                          ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2572                                          100,0,4);
2573   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsExtCov55Reject);
2574   TH1F *gPrimaryProtonsSigmaToVertexReject = new TH1F("gPrimaryProtonsSigmaToVertexReject",
2575                                              ";#sigma_{Vertex};Entries",
2576                                              100,0,10);
2577   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsSigmaToVertexReject);
2578   TH1F *gPrimaryProtonsSigmaToVertexTPCReject = new TH1F("gPrimaryProtonsSigmaToVertexTPCReject",
2579                                              ";#sigma_{Vertex};Entries",
2580                                              100,0,10);
2581   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsSigmaToVertexTPCReject);
2582   TH1F *gPrimaryProtonsDCAXYReject = new TH1F("gPrimaryProtonsDCAXYReject",
2583                                               ";DCA_{xy} [cm];Entries",
2584                                               100,0,20);
2585   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsDCAXYReject);
2586   TH1F *gPrimaryProtonsDCAXYTPCReject = new TH1F("gPrimaryProtonsDCAXYTPCReject",
2587                                                  ";DCA_{xy} [cm];Entries",
2588                                                  100,0,20);
2589   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsDCAXYTPCReject);
2590   TH1F *gPrimaryProtonsDCAZReject = new TH1F("gPrimaryProtonsDCAZReject",
2591                                              ";DCA_{z} [cm];Entries",
2592                                              100,0,20);
2593   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsDCAZReject);
2594   TH1F *gPrimaryProtonsDCAZTPCReject = new TH1F("gPrimaryProtonsDCAZTPCReject",
2595                                                 ";DCA_{z} [cm];Entries",
2596                                                 100,0,20);
2597   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsDCAZTPCReject);
2598   TH1F *gPrimaryProtonsConstrainChi2Reject = new TH1F("gPrimaryProtonsConstrainChi2Reject",
2599                                                     ";Log_{10}(#chi^{2});Entries",
2600                                                     100,-10,10);
2601   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsConstrainChi2Reject);
2602   TH1F *gPrimaryProtonsITSRefitReject = new TH1F("gPrimaryProtonsITSRefitReject",
2603                                                  "",10,-1,1);
2604   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsITSRefitReject);
2605   TH1F *gPrimaryProtonsTPCRefitReject = new TH1F("gPrimaryProtonsTPCRefitReject",
2606                                                  "",10,-1,1);
2607   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsTPCRefitReject);
2608   TH1F *gPrimaryProtonsESDpidReject = new TH1F("gPrimaryProtonsESDpidReject",
2609                                                "",10,-1,1);
2610   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsESDpidReject);
2611   TH1F *gPrimaryProtonsTPCpidReject = new TH1F("gPrimaryProtonsTPCpidReject",
2612                                                "",10,-1,1);
2613   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsTPCpidReject);
2614   TH1F *gPrimaryProtonsPointOnITSLayer1Reject = new TH1F("gPrimaryProtonsPointOnITSLayer1Reject",
2615                                              "",10,-1,1);
2616   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsPointOnITSLayer1Reject);
2617   TH1F *gPrimaryProtonsPointOnITSLayer2Reject = new TH1F("gPrimaryProtonsPointOnITSLayer2Reject",
2618                                              "",10,-1,1);
2619   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsPointOnITSLayer2Reject);
2620   TH1F *gPrimaryProtonsPointOnITSLayer3Reject = new TH1F("gPrimaryProtonsPointOnITSLayer3Reject",
2621                                              "",10,-1,1);
2622   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsPointOnITSLayer3Reject);
2623   TH1F *gPrimaryProtonsPointOnITSLayer4Reject = new TH1F("gPrimaryProtonsPointOnITSLayer4Reject",
2624                                              "",10,-1,1);
2625   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsPointOnITSLayer4Reject);
2626   TH1F *gPrimaryProtonsPointOnITSLayer5Reject = new TH1F("gPrimaryProtonsPointOnITSLayer5Reject",
2627                                              "",10,-1,1);
2628   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsPointOnITSLayer5Reject);
2629   TH1F *gPrimaryProtonsPointOnITSLayer6Reject = new TH1F("gPrimaryProtonsPointOnITSLayer6Reject",
2630                                              "",10,-1,1);
2631   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsPointOnITSLayer6Reject);
2632   TH1F *gPrimaryProtonsNumberOfTPCdEdxPointsReject = new TH1F("gPrimaryProtonsNumberOfTPCdEdxPointsReject","",100,0,200);
2633   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsNumberOfTPCdEdxPointsReject);
2634   //________________________________________________________________//
2635   /*gDirectory->cd("../../");
2636
2637   TDirectory *dirProtonsSecondary = gDirectory->mkdir("Secondaries");
2638   dirProtonsSecondary->cd();
2639   TDirectory *dirProtonsSecondaryAccepted = gDirectory->mkdir("Accepted");
2640   dirProtonsSecondaryAccepted->cd();*/
2641
2642   //Accepted secondary protons
2643   TH1F *gSecondaryProtonsITSClustersPass = new TH1F("gSecondaryProtonsITSClustersPass",
2644                                                     ";N_{clusters} (ITS);Entries",
2645                                                     7,0,7);
2646   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsITSClustersPass);
2647   TH1F *gSecondaryProtonsChi2PerClusterITSPass = new TH1F("gSecondaryProtonsChi2PerClusterITSPass",
2648                                                           ";x^{2}/N_{clusters} (ITS);Entries",
2649                                                           100,0,4);
2650   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsChi2PerClusterITSPass);
2651   TH1F *gSecondaryProtonsTPCClustersPass = new TH1F("gSecondaryProtonsTPCClustersPass",
2652                                             ";N_{clusters} (TPC);Entries",
2653                                             100,0,200);
2654   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsTPCClustersPass);
2655   TH1F *gSecondaryProtonsChi2PerClusterTPCPass = new TH1F("gSecondaryProtonsChi2PerClusterTPCPass",
2656                                                   ";x^{2}/N_{clusters} (TPC);Entries",
2657                                                   100,0,4);
2658   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsChi2PerClusterTPCPass);
2659   TH1F *gSecondaryProtonsExtCov11Pass = new TH1F("gSecondaryProtonsExtCov11Pass",
2660                                          ";#sigma_{y} [cm];Entries",
2661                                          100,0,4);
2662   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsExtCov11Pass);
2663   TH1F *gSecondaryProtonsExtCov22Pass = new TH1F("gSecondaryProtonsExtCov22Pass",
2664                                          ";#sigma_{z} [cm];Entries",
2665                                          100,0,4);
2666   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsExtCov22Pass);
2667   TH1F *gSecondaryProtonsExtCov33Pass = new TH1F("gSecondaryProtonsExtCov33Pass",
2668                                          ";#sigma_{sin(#phi)};Entries",
2669                                          100,0,4);
2670   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsExtCov33Pass);
2671   TH1F *gSecondaryProtonsExtCov44Pass = new TH1F("gSecondaryProtonsExtCov44Pass",
2672                                          ";#sigma_{tan(#lambda)};Entries",
2673                                          100,0,4);
2674   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsExtCov44Pass);
2675   TH1F *gSecondaryProtonsExtCov55Pass = new TH1F("gSecondaryProtonsExtCov55Pass",
2676                                          ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2677                                          100,0,4);
2678   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsExtCov55Pass);
2679   TH1F *gSecondaryProtonsSigmaToVertexPass = new TH1F("gSecondaryProtonsSigmaToVertexPass",
2680                                              ";#sigma_{Vertex};Entries",
2681                                              100,0,10);
2682   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsSigmaToVertexPass);
2683   TH1F *gSecondaryProtonsSigmaToVertexTPCPass = new TH1F("gSecondaryProtonsSigmaToVertexTPCPass",
2684                                              ";#sigma_{Vertex};Entries",
2685                                              100,0,10);
2686   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsSigmaToVertexTPCPass);
2687   TH1F *gSecondaryProtonsDCAXYPass = new TH1F("gSecondaryProtonsDCAXYPass",
2688                                               ";DCA_{xy} [cm];Entries",
2689                                               100,0,20);
2690   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsDCAXYPass);
2691   TH1F *gSecondaryProtonsDCAXYTPCPass = new TH1F("gSecondaryProtonsDCAXYTPCPass",
2692                                                  ";DCA_{xy} [cm];Entries",
2693                                                  100,0,20);
2694   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsDCAXYTPCPass);
2695   TH1F *gSecondaryProtonsDCAZPass = new TH1F("gSecondaryProtonsDCAZPass",
2696                                              ";DCA_{z} [cm];Entries",
2697                                              100,0,20);
2698   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsDCAZPass);
2699   TH1F *gSecondaryProtonsDCAZTPCPass = new TH1F("gSecondaryProtonsDCAZTPCPass",
2700                                                 ";DCA_{z} [cm];Entries",
2701                                                 100,0,20);
2702   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsDCAZTPCPass);
2703   TH1F *gSecondaryProtonsConstrainChi2Pass = new TH1F("gSecondaryProtonsConstrainChi2Pass",
2704                                                     ";Log_{10}(#chi^{2});Entries",
2705                                                     100,-10,10);
2706   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsConstrainChi2Pass);
2707   TH1F *gSecondaryProtonsITSRefitPass = new TH1F("gSecondaryProtonsITSRefitPass",
2708                                                  "",10,-1,1);
2709   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsITSRefitPass);
2710   TH1F *gSecondaryProtonsTPCRefitPass = new TH1F("gSecondaryProtonsTPCRefitPass",
2711                                                  "",10,-1,1);
2712   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsTPCRefitPass);
2713   TH1F *gSecondaryProtonsESDpidPass = new TH1F("gSecondaryProtonsESDpidPass",
2714                                                "",10,-1,1);
2715   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsESDpidPass);
2716   TH1F *gSecondaryProtonsTPCpidPass = new TH1F("gSecondaryProtonsTPCpidPass",
2717                                                "",10,-1,1);
2718   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsTPCpidPass);
2719   TH1F *gSecondaryProtonsPointOnITSLayer1Pass = new TH1F("gSecondaryProtonsPointOnITSLayer1Pass",
2720                                                          "",10,-1,1);
2721   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsPointOnITSLayer1Pass);
2722   TH1F *gSecondaryProtonsPointOnITSLayer2Pass = new TH1F("gSecondaryProtonsPointOnITSLayer2Pass",
2723                                                          "",10,-1,1);
2724   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsPointOnITSLayer2Pass);
2725   TH1F *gSecondaryProtonsPointOnITSLayer3Pass = new TH1F("gSecondaryProtonsPointOnITSLayer3Pass",
2726                                                          "",10,-1,1);
2727   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsPointOnITSLayer3Pass);
2728   TH1F *gSecondaryProtonsPointOnITSLayer4Pass = new TH1F("gSecondaryProtonsPointOnITSLayer4Pass",
2729                                                          "",10,-1,1);
2730   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsPointOnITSLayer4Pass);
2731   TH1F *gSecondaryProtonsPointOnITSLayer5Pass = new TH1F("gSecondaryProtonsPointOnITSLayer5Pass",
2732                                                          "",10,-1,1);
2733   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsPointOnITSLayer5Pass);
2734   TH1F *gSecondaryProtonsPointOnITSLayer6Pass = new TH1F("gSecondaryProtonsPointOnITSLayer6Pass",
2735                                                          "",10,-1,1);
2736   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsPointOnITSLayer6Pass);
2737   TH1F *gSecondaryProtonsNumberOfTPCdEdxPointsPass = new TH1F("gSecondaryProtonsNumberOfTPCdEdxPointsPass","",100,0,200);
2738   fQASecondaryProtonsAcceptedList->Add(gSecondaryProtonsNumberOfTPCdEdxPointsPass);
2739
2740   //Rejected secondary protons
2741   /*gDirectory->cd("../");
2742   TDirectory *dirProtonsSecondaryRejected = gDirectory->mkdir("Rejected");
2743   dirProtonsSecondaryRejected->cd();*/
2744
2745   TH1F *gSecondaryProtonsITSClustersReject = new TH1F("gSecondaryProtonsITSClustersReject",
2746                                                       ";N_{clusters} (ITS);Entries",
2747                                                       7,0,7);
2748   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsITSClustersReject);
2749   TH1F *gSecondaryProtonsChi2PerClusterITSReject = new TH1F("gSecondaryProtonsChi2PerClusterITSReject",
2750                                                             ";x^{2}/N_{clusters} (ITS);Entries",
2751                                                             100,0,4);
2752   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsChi2PerClusterITSReject);
2753   TH1F *gSecondaryProtonsTPCClustersReject = new TH1F("gSecondaryProtonsTPCClustersReject",
2754                                             ";N_{clusters} (TPC);Entries",
2755                                             100,0,200);
2756   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsTPCClustersReject);
2757   TH1F *gSecondaryProtonsChi2PerClusterTPCReject = new TH1F("gSecondaryProtonsChi2PerClusterTPCReject",
2758                                                   ";x^{2}/N_{clusters} (TPC);Entries",
2759                                                   100,0,4);
2760   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsChi2PerClusterTPCReject);
2761   TH1F *gSecondaryProtonsExtCov11Reject = new TH1F("gSecondaryProtonsExtCov11Reject",
2762                                          ";#sigma_{y} [cm];Entries",
2763                                          100,0,4);
2764   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsExtCov11Reject);
2765   TH1F *gSecondaryProtonsExtCov22Reject = new TH1F("gSecondaryProtonsExtCov22Reject",
2766                                          ";#sigma_{z} [cm];Entries",
2767                                          100,0,4);
2768   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsExtCov22Reject);
2769   TH1F *gSecondaryProtonsExtCov33Reject = new TH1F("gSecondaryProtonsExtCov33Reject",
2770                                          ";#sigma_{sin(#phi)};Entries",
2771                                          100,0,4);
2772   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsExtCov33Reject);
2773   TH1F *gSecondaryProtonsExtCov44Reject = new TH1F("gSecondaryProtonsExtCov44Reject",
2774                                          ";#sigma_{tan(#lambda)};Entries",
2775                                          100,0,4);
2776   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsExtCov44Reject);
2777   TH1F *gSecondaryProtonsExtCov55Reject = new TH1F("gSecondaryProtonsExtCov55Reject",
2778                                          ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2779                                          100,0,4);
2780   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsExtCov55Reject);
2781   TH1F *gSecondaryProtonsSigmaToVertexReject = new TH1F("gSecondaryProtonsSigmaToVertexReject",
2782                                              ";#sigma_{Vertex};Entries",
2783                                              100,0,10);
2784   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsSigmaToVertexReject);
2785   TH1F *gSecondaryProtonsSigmaToVertexTPCReject = new TH1F("gSecondaryProtonsSigmaToVertexTPCReject",
2786                                                            ";#sigma_{Vertex};Entries",
2787                                                            100,0,10);
2788   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsSigmaToVertexTPCReject);
2789   TH1F *gSecondaryProtonsDCAXYReject = new TH1F("gSecondaryProtonsDCAXYReject",
2790                                                 ";DCA_{xy} [cm];Entries",
2791                                                 100,0,20);
2792   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsDCAXYReject);
2793   TH1F *gSecondaryProtonsDCAXYTPCReject = new TH1F("gSecondaryProtonsDCAXYTPCReject",
2794                                                    ";DCA_{xy} [cm];Entries",
2795                                                    100,0,20);
2796   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsDCAXYTPCReject);
2797   TH1F *gSecondaryProtonsDCAZReject = new TH1F("gSecondaryProtonsDCAZReject",
2798                                                ";DCA_{z} [cm];Entries",
2799                                                100,0,20);
2800   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsDCAZReject);
2801   TH1F *gSecondaryProtonsDCAZTPCReject = new TH1F("gSecondaryProtonsDCAZTPCReject",
2802                                                   ";DCA_{z} [cm];Entries",
2803                                                   100,0,20);
2804   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsDCAZTPCReject);
2805   TH1F *gSecondaryProtonsConstrainChi2Reject = new TH1F("gSecondaryProtonsConstrainChi2Reject",
2806                                                         ";Log_{10}(#chi^{2});Entries",
2807                                                         100,-10,10);
2808   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsConstrainChi2Reject);
2809   TH1F *gSecondaryProtonsITSRefitReject = new TH1F("gSecondaryProtonsITSRefitReject",
2810                                                    "",10,-1,1);
2811   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsITSRefitReject);
2812   TH1F *gSecondaryProtonsTPCRefitReject = new TH1F("gSecondaryProtonsTPCRefitReject",
2813                                                    "",10,-1,1);
2814   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsTPCRefitReject);
2815   TH1F *gSecondaryProtonsESDpidReject = new TH1F("gSecondaryProtonsESDpidReject",
2816                                                  "",10,-1,1);
2817   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsESDpidReject);
2818   TH1F *gSecondaryProtonsTPCpidReject = new TH1F("gSecondaryProtonsTPCpidReject",
2819                                                  "",10,-1,1);
2820   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsTPCpidReject);
2821   TH1F *gSecondaryProtonsPointOnITSLayer1Reject = new TH1F("gSecondaryProtonsPointOnITSLayer1Reject",
2822                                                            "",10,-1,1);
2823   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsPointOnITSLayer1Reject);
2824   TH1F *gSecondaryProtonsPointOnITSLayer2Reject = new TH1F("gSecondaryProtonsPointOnITSLayer2Reject",
2825                                                            "",10,-1,1);
2826   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsPointOnITSLayer2Reject);
2827   TH1F *gSecondaryProtonsPointOnITSLayer3Reject = new TH1F("gSecondaryProtonsPointOnITSLayer3Reject",
2828                                                            "",10,-1,1);
2829   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsPointOnITSLayer3Reject);
2830   TH1F *gSecondaryProtonsPointOnITSLayer4Reject = new TH1F("gSecondaryProtonsPointOnITSLayer4Reject",
2831                                                            "",10,-1,1);
2832   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsPointOnITSLayer4Reject);
2833   TH1F *gSecondaryProtonsPointOnITSLayer5Reject = new TH1F("gSecondaryProtonsPointOnITSLayer5Reject",
2834                                                            "",10,-1,1);
2835   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsPointOnITSLayer5Reject);
2836   TH1F *gSecondaryProtonsPointOnITSLayer6Reject = new TH1F("gSecondaryProtonsPointOnITSLayer6Reject",
2837                                                            "",10,-1,1);
2838   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsPointOnITSLayer6Reject);
2839   TH1F *gSecondaryProtonsNumberOfTPCdEdxPointsReject = new TH1F("gSecondaryProtonsNumberOfTPCdEdxPointsReject","",100,0,200);
2840   fQASecondaryProtonsRejectedList->Add(gSecondaryProtonsNumberOfTPCdEdxPointsReject);  
2841
2842   /*gDirectory->cd("../../../");
2843
2844   //antiprotons
2845   TDirectory *dirAntiProtons = gDirectory->mkdir("AntiProtons");
2846   fGlobalQAList->Add(dirAntiProtons); dirAntiProtons->cd();*/
2847   
2848   //________________________________________________________________//
2849   /*TDirectory *dirAntiProtonsPrimary = gDirectory->mkdir("Primaries");
2850   dirAntiProtonsPrimary->cd();
2851   TDirectory *dirAntiProtonsPrimaryAccepted = gDirectory->mkdir("Accepted");
2852   dirAntiProtonsPrimaryAccepted->cd();*/
2853   
2854   //Accepted primary antiprotons
2855   TH1F *gPrimaryAntiProtonsITSClustersPass = new TH1F("gPrimaryAntiProtonsITSClustersPass",
2856                                                       ";N_{clusters} (ITS);Entries",
2857                                                       7,0,7);
2858   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsITSClustersPass);
2859   TH1F *gPrimaryAntiProtonsChi2PerClusterITSPass = new TH1F("gPrimaryAntiProtonsChi2PerClusterITSPass",
2860                                                             ";x^{2}/N_{clusters} (ITS);Entries",
2861                                                             100,0,4);
2862   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsChi2PerClusterITSPass);
2863   TH1F *gPrimaryAntiProtonsTPCClustersPass = new TH1F("gPrimaryAntiProtonsTPCClustersPass",
2864                                                       ";N_{clusters} (TPC);Entries",
2865                                                       100,0,200);
2866   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsTPCClustersPass);
2867   TH1F *gPrimaryAntiProtonsChi2PerClusterTPCPass = new TH1F("gPrimaryAntiProtonsChi2PerClusterTPCPass",
2868                                                             ";x^{2}/N_{clusters} (TPC);Entries",
2869                                                             100,0,4);
2870   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsChi2PerClusterTPCPass);
2871   TH1F *gPrimaryAntiProtonsExtCov11Pass = new TH1F("gPrimaryAntiProtonsExtCov11Pass",
2872                                                    ";#sigma_{y} [cm];Entries",
2873                                                    100,0,4);
2874   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsExtCov11Pass);
2875   TH1F *gPrimaryAntiProtonsExtCov22Pass = new TH1F("gPrimaryAntiProtonsExtCov22Pass",
2876                                                    ";#sigma_{z} [cm];Entries",
2877                                                    100,0,4);
2878   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsExtCov22Pass);
2879   TH1F *gPrimaryAntiProtonsExtCov33Pass = new TH1F("gPrimaryAntiProtonsExtCov33Pass",
2880                                                    ";#sigma_{sin(#phi)};Entries",
2881                                                    100,0,4);
2882   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsExtCov33Pass);
2883   TH1F *gPrimaryAntiProtonsExtCov44Pass = new TH1F("gPrimaryAntiProtonsExtCov44Pass",
2884                                                    ";#sigma_{tan(#lambda)};Entries",
2885                                                    100,0,4);
2886   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsExtCov44Pass);
2887   TH1F *gPrimaryAntiProtonsExtCov55Pass = new TH1F("gPrimaryAntiProtonsExtCov55Pass",
2888                                                    ";#sigma_{1/P_{T}} [GeV/c]^{-1};Entries",
2889                                                    100,0,4);
2890   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsExtCov55Pass);
2891   TH1F *gPrimaryAntiProtonsSigmaToVertexPass = new TH1F("gPrimaryAntiProtonsSigmaToVertexPass",
2892                                                         ";#sigma_{Vertex};Entries",
2893                                                         100,0,10);
2894   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsSigmaToVertexPass);
2895   TH1F *gPrimaryAntiProtonsSigmaToVertexTPCPass = new TH1F("gPrimaryAntiProtonsSigmaToVertexTPCPass",
2896                                                            ";#sigma_{Vertex};Entries",
2897                                                            100,0,10);
2898   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsSigmaToVertexTPCPass);
2899   TH1F *gPrimaryAntiProtonsDCAXYPass = new TH1F("gPrimaryAntiProtonsDCAXYPass",
2900                                                 ";DCA_{xy} [cm];Entries",
2901                                                 100,0,20);
2902   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsDCAXYPass);
2903   TH1F *gPrimaryAntiProtonsDCAXYTPCPass = new TH1F("gPrimaryAntiProtonsDCAXYTPCPass",
2904                                                    ";DCA_{xy} [cm];Entries",
2905                                                    100,0,20);
2906   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsDCAXYTPCPass);
2907   TH1F *gPrimaryAntiProtonsDCAZPass = new TH1F("gPrimaryAntiProtonsDCAZPass",
2908                                                ";DCA_{z} [cm];Entries",