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