]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/SPECTRA/AliProtonQAAnalysis.cxx
added ration ITS global/TPC
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / AliProtonQAAnalysis.cxx
index 37ec42ffc3a3b531e935026013eae0a3743104b5..d7e2e06c3cae28b109b8944a93ed50287fe1020c 100644 (file)
@@ -44,8 +44,8 @@ ClassImp(AliProtonQAAnalysis)
 //____________________________________________________________________//
 AliProtonQAAnalysis::AliProtonQAAnalysis() : 
   TObject(), fProtonAnalysisBase(0),
-  fNBinsY(0), fMinY(0), fMaxY(0),
-  fNBinsPt(0), fMinPt(0), fMaxPt(0),
+  fNBinsY(0), fMinY(0), fMaxY(0), fY(0),
+  fNBinsPt(0), fMinPt(0), fMaxPt(0), fPt(0), fUseAsymmetricBinning(kFALSE),
   fGlobalQAList(0), fQAVertexList(0), fQA2DList(0),
   fQAPrimaryProtonsAcceptedList(0),
   fQAPrimaryProtonsRejectedList(0),
@@ -63,7 +63,7 @@ AliProtonQAAnalysis::AliProtonQAAnalysis() :
   fAcceptedDCAList(0), fRejectedDCAList(0),
   fRunEfficiencyAnalysis(kFALSE),
   fUseCutsInEfficiency(kFALSE),
-  fEfficiencyList(0) {
+  fEfficiencyList(0), fCutEfficiencyList(0) {
   //Default constructor
 }
 
@@ -96,6 +96,7 @@ AliProtonQAAnalysis::~AliProtonQAAnalysis() {
   if(fRejectedDCAList) delete fRejectedDCAList;
  
   if(fEfficiencyList) delete fEfficiencyList;
+  if(fCutEfficiencyList) delete fCutEfficiencyList;
 }
 
 //____________________________________________________________________//
@@ -137,422 +138,462 @@ void AliProtonQAAnalysis::FillQA(AliStack *const stack,
                          100.,dca,cov);
   }
 
+  //TParticle *particle = stack->Particle(label);
+  //if(particle) {
+  //Int_t pdgcode = particle->GetPdgCode();
+  //Int_t gProcess = particle->GetUniqueID();
   Int_t  fIdxInt[200];
   Int_t nClustersITS = track->GetITSclusters(fIdxInt);
   Int_t nClustersTPC = track->GetTPCclusters(fIdxInt);
-
+  
   Float_t chi2PerClusterITS = -1;
   if (nClustersITS!=0)
     chi2PerClusterITS = track->GetITSchi2()/Float_t(nClustersITS);
   Float_t chi2PerClusterTPC = -1;
   if (nClustersTPC!=0)
     chi2PerClusterTPC = track->GetTPCchi2()/Float_t(nClustersTPC);
-
-  Double_t extCov[15];
-  track->GetExternalCovariance(extCov);
   
-  //protons
-  if(track->Charge() > 0) {
-    //Primaries
-    if(label <= nPrimaries) {
-      if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
-       if(nClustersITS < fProtonAnalysisBase->GetMinITSClusters()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
-       }
-       else if(nClustersITS >= fProtonAnalysisBase->GetMinITSClusters()) 
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
-      }//ITS clusters
-      if(fProtonAnalysisBase->IsUsedMaxChi2PerITSCluster()) {
-       if(chi2PerClusterITS > fProtonAnalysisBase->GetMaxChi2PerITSCluster()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
-       }
-       else if(chi2PerClusterITS <= fProtonAnalysisBase->GetMaxChi2PerITSCluster())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
-      }//chi2 per ITS cluster
-      if(fProtonAnalysisBase->IsUsedMinTPCClusters()) {
-       if(nClustersTPC < fProtonAnalysisBase->GetMinTPCClusters()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(2)))->Fill(nClustersTPC);
-       }
-       else if(nClustersTPC >= fProtonAnalysisBase->GetMinTPCClusters()) {
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
-       }
-      }//TPC clusters
-      if(fProtonAnalysisBase->IsUsedMaxChi2PerTPCCluster()) {
-       if(chi2PerClusterTPC > fProtonAnalysisBase->GetMaxChi2PerTPCCluster()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
-       }
-       else if(chi2PerClusterTPC <= fProtonAnalysisBase->GetMaxChi2PerTPCCluster())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
-      }//chi2 per TPC cluster
-      if(fProtonAnalysisBase->IsUsedMaxCov11()) {
-       if(extCov[0] > fProtonAnalysisBase->GetMaxCov11()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
-       }
-       else if(extCov[0] <= fProtonAnalysisBase->GetMaxCov11())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
-      }//cov11
-      if(fProtonAnalysisBase->IsUsedMaxCov22()) {
-       if(extCov[2] > fProtonAnalysisBase->GetMaxCov22()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
-       }
-       else if(extCov[2] <= fProtonAnalysisBase->GetMaxCov22())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
-      }//cov11
-      if(fProtonAnalysisBase->IsUsedMaxCov33()) {
-       if(extCov[5] > fProtonAnalysisBase->GetMaxCov33()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
-       }
-       else if(extCov[5] <= fProtonAnalysisBase->GetMaxCov33())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
-      }//cov11
-      if(fProtonAnalysisBase->IsUsedMaxCov44()) {
-       if(extCov[9] > fProtonAnalysisBase->GetMaxCov44()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
-       }
-       else if(extCov[9] <= fProtonAnalysisBase->GetMaxCov44())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
-      }//cov11
-      if(fProtonAnalysisBase->IsUsedMaxCov55()) {
-       if(extCov[14] > fProtonAnalysisBase->GetMaxCov55()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
-       }
-       else if(extCov[14] <= fProtonAnalysisBase->GetMaxCov55())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
-      }//cov55
-      if(fProtonAnalysisBase->IsUsedMaxSigmaToVertex()) {
-       if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertex()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
+  Double_t extCov[15];
+    track->GetExternalCovariance(extCov);
+    
+    //protons
+    if(track->Charge() > 0) {
+      //Primaries
+      if(label <= nPrimaries) {
+       if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
+         if(nClustersITS < fProtonAnalysisBase->GetMinITSClusters()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
+         }
+         else if(nClustersITS >= fProtonAnalysisBase->GetMinITSClusters()) 
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
+       }//ITS clusters
+       if(fProtonAnalysisBase->IsUsedMaxChi2PerITSCluster()) {
+         if(chi2PerClusterITS > fProtonAnalysisBase->GetMaxChi2PerITSCluster()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
+         }
+         else if(chi2PerClusterITS <= fProtonAnalysisBase->GetMaxChi2PerITSCluster())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
+       }//chi2 per ITS cluster
+       if(fProtonAnalysisBase->IsUsedMinTPCClusters()) {
+         if(nClustersTPC < fProtonAnalysisBase->GetMinTPCClusters()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(2)))->Fill(nClustersTPC);
+         }
+         else if(nClustersTPC >= fProtonAnalysisBase->GetMinTPCClusters()) {
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
+         }
+       }//TPC clusters
+       if(fProtonAnalysisBase->IsUsedMaxChi2PerTPCCluster()) {
+         if(chi2PerClusterTPC > fProtonAnalysisBase->GetMaxChi2PerTPCCluster()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
+         }
+         else if(chi2PerClusterTPC <= fProtonAnalysisBase->GetMaxChi2PerTPCCluster())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
+       }//chi2 per TPC cluster
+       if(fProtonAnalysisBase->IsUsedMaxCov11()) {
+         if(extCov[0] > fProtonAnalysisBase->GetMaxCov11()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
+         }
+         else if(extCov[0] <= fProtonAnalysisBase->GetMaxCov11())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
+       }//cov11
+       if(fProtonAnalysisBase->IsUsedMaxCov22()) {
+         if(extCov[2] > fProtonAnalysisBase->GetMaxCov22()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
+         }
+         else if(extCov[2] <= fProtonAnalysisBase->GetMaxCov22())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
+       }//cov11
+       if(fProtonAnalysisBase->IsUsedMaxCov33()) {
+         if(extCov[5] > fProtonAnalysisBase->GetMaxCov33()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
+         }
+         else if(extCov[5] <= fProtonAnalysisBase->GetMaxCov33())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
+       }//cov11
+       if(fProtonAnalysisBase->IsUsedMaxCov44()) {
+         if(extCov[9] > fProtonAnalysisBase->GetMaxCov44()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
+         }
+         else if(extCov[9] <= fProtonAnalysisBase->GetMaxCov44())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
+       }//cov11
+       if(fProtonAnalysisBase->IsUsedMaxCov55()) {
+         if(extCov[14] > fProtonAnalysisBase->GetMaxCov55()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
+         }
+         else if(extCov[14] <= fProtonAnalysisBase->GetMaxCov55())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
+       }//cov55
+       if(fProtonAnalysisBase->IsUsedMaxSigmaToVertex()) {
+         if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertex()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
+         }
+         else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertex())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
+       }//sigma to vertex
+       if(fProtonAnalysisBase->IsUsedMaxSigmaToVertexTPC()) {
+         if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertexTPC()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
+         }
+         else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertexTPC())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
+       }//sigma to vertex TPC
+       if(fProtonAnalysisBase->IsUsedMaxDCAXY()) {
+         if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(11)))->Fill(TMath::Abs(dca[0]));
+         }
+         else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(11)))->Fill(TMath::Abs(dca[0]));
+       }//DCA xy global tracking
+       if(fProtonAnalysisBase->IsUsedMaxDCAXYTPC()) {
+         if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXYTPC()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(12)))->Fill(TMath::Abs(dca[0]));
+         }
+         else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXYTPC())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(12)))->Fill(TMath::Abs(dca[0]));
+       }//DCA xy TPC tracking
+       if(fProtonAnalysisBase->IsUsedMaxDCAZ()) {
+         if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(13)))->Fill(TMath::Abs(dca[1]));
+         }
+         else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(13)))->Fill(TMath::Abs(dca[1]));
+       }//DCA z global tracking
+       if(fProtonAnalysisBase->IsUsedMaxDCAZTPC()) {
+         if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZTPC()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(14)))->Fill(TMath::Abs(dca[1]));
+         }
+         else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZTPC())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(14)))->Fill(TMath::Abs(dca[1]));
+       }//DCA z TPC tracking
+       if(fProtonAnalysisBase->IsUsedMaxConstrainChi2()) {
+         if(track->GetConstrainedChi2() > 0) {
+           if(TMath::Log(track->GetConstrainedChi2()) > fProtonAnalysisBase->GetMaxConstrainChi2()) {
+             ((TH1F *)(fQAPrimaryProtonsRejectedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
+           }
+           else if(TMath::Log(track->GetConstrainedChi2()) <= fProtonAnalysisBase->GetMaxConstrainChi2())
+             ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
+         }
+       }//constrain chi2 - vertex
+       if(fProtonAnalysisBase->IsUsedITSRefit()) {
+         if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(16)))->Fill(0);
+         }
+         else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(16)))->Fill(0);
+       }//ITS refit
+       if(fProtonAnalysisBase->IsUsedTPCRefit()) {
+         if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(17)))->Fill(0);
+         }
+         else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(17)))->Fill(0);
+       }//TPC refit
+       if(fProtonAnalysisBase->IsUsedESDpid()) {
+         if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(18)))->Fill(0);
+         }
+         else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(18)))->Fill(0);
+       }//ESD pid
+       if(fProtonAnalysisBase->IsUsedTPCpid()) {
+         if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(19)))->Fill(0);
        }
-       else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertex())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
-      }//sigma to vertex
-      if(fProtonAnalysisBase->IsUsedMaxSigmaToVertexTPC()) {
-       if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertexTPC()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
+         else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(19)))->Fill(0);
+       }//TPC pid
+       if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
+         if(!track->HasPointOnITSLayer(0)) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(20)))->Fill(0);
+         }
+         else if(track->HasPointOnITSLayer(0))
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(20)))->Fill(0);
+       }//point on SPD1
+       if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
+         if(!track->HasPointOnITSLayer(1)) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(21)))->Fill(0);
+         }
+         else if(track->HasPointOnITSLayer(1))
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(21)))->Fill(0);
+       }//point on SPD2
+       if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
+         if(!track->HasPointOnITSLayer(2)) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(22)))->Fill(0);
+         }
+         else if(track->HasPointOnITSLayer(2))
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(22)))->Fill(0);
+       }//point on SDD1
+       if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
+         if(!track->HasPointOnITSLayer(3)) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(23)))->Fill(0);
+         }
+         else if(track->HasPointOnITSLayer(3))
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(23)))->Fill(0);
+       }//point on SDD2
+       if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
+         if(!track->HasPointOnITSLayer(4)) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(24)))->Fill(0);
+         }
+         else if(track->HasPointOnITSLayer(4))
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(24)))->Fill(0);
+       }//point on SSD1
+       if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
+         if(!track->HasPointOnITSLayer(5)) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(25)))->Fill(0);
+         }
+         else if(track->HasPointOnITSLayer(5))
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(25)))->Fill(0);
+       }//point on SSD2
+       if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
+         if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
+           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(26)))->Fill(track->GetTPCsignalN());
        }
-       else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertexTPC())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
-      }//sigma to vertex TPC
-      if(fProtonAnalysisBase->IsUsedMaxDCAXY()) {
-       if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(11)))->Fill(TMath::Abs(dca[0]));
+         if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
+           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(26)))->Fill(track->GetTPCsignalN());
+       }//number of TPC points for the dE/dx
+       
+       /*if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
+         ((TH2F *)(fQAPrimaryProtonsRejectedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
        }
        else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(11)))->Fill(TMath::Abs(dca[0]));
-      }//DCA xy global tracking
-      if(fProtonAnalysisBase->IsUsedMaxDCAXYTPC()) {
-       if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXYTPC()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(12)))->Fill(TMath::Abs(dca[0]));
-       }
-       else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXYTPC())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(12)))->Fill(TMath::Abs(dca[0]));
-      }//DCA xy TPC tracking
-      if(fProtonAnalysisBase->IsUsedMaxDCAZ()) {
+         ((TH2F *)(fQAPrimaryProtonsAcceptedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
        if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(13)))->Fill(TMath::Abs(dca[1]));
+         ((TH2F *)(fQAPrimaryProtonsRejectedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));
        }
        else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(13)))->Fill(TMath::Abs(dca[1]));
-      }//DCA z global tracking
-      if(fProtonAnalysisBase->IsUsedMaxDCAZTPC()) {
-       if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZTPC()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(14)))->Fill(TMath::Abs(dca[1]));
-       }
-       else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZTPC())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(14)))->Fill(TMath::Abs(dca[1]));
-      }//DCA z TPC tracking
-      if(fProtonAnalysisBase->IsUsedMaxConstrainChi2()) {
-       if(track->GetConstrainedChi2() > 0) {
-         if(TMath::Log(track->GetConstrainedChi2()) > fProtonAnalysisBase->GetMaxConstrainChi2()) {
-           ((TH1F *)(fQAPrimaryProtonsRejectedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
+       ((TH2F *)(fQAPrimaryProtonsAcceptedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));*/
+      }//primary particle cut
+      
+      //Secondaries
+      if(label > nPrimaries) {
+       if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
+         if(nClustersITS < fProtonAnalysisBase->GetMinITSClusters()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
          }
-         else if(TMath::Log(track->GetConstrainedChi2()) <= fProtonAnalysisBase->GetMaxConstrainChi2())
-           ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
-       }
-      }//constrain chi2 - vertex
-      if(fProtonAnalysisBase->IsUsedITSRefit()) {
-       if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(16)))->Fill(0);
-       }
-       else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(16)))->Fill(0);
-      }//ITS refit
-      if(fProtonAnalysisBase->IsUsedTPCRefit()) {
-       if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(17)))->Fill(0);
-       }
-       else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(17)))->Fill(0);
-      }//TPC refit
-      if(fProtonAnalysisBase->IsUsedESDpid()) {
-       if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(18)))->Fill(0);
-       }
-       else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(18)))->Fill(0);
-      }//ESD pid
-      if(fProtonAnalysisBase->IsUsedTPCpid()) {
-       if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(19)))->Fill(0);
-       }
-       else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(19)))->Fill(0);
-      }//TPC pid
-      if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
-       if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(20)))->Fill(track->GetTPCsignalN());
-       }
-       if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(20)))->Fill(track->GetTPCsignalN());
-      }//number of TPC points for the dE/dx
-      if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
-       if(!track->HasPointOnITSLayer(0)) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(21)))->Fill(0);
-       }
-       else if(track->HasPointOnITSLayer(0))
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(21)))->Fill(0);
-      }//point on SPD1
-      if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
-       if(!track->HasPointOnITSLayer(1)) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(22)))->Fill(0);
-       }
-       else if(track->HasPointOnITSLayer(1))
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(22)))->Fill(0);
-      }//point on SPD2
-      if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
-       if(!track->HasPointOnITSLayer(2)) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(23)))->Fill(0);
-       }
-       else if(track->HasPointOnITSLayer(2))
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(23)))->Fill(0);
-      }//point on SDD1
-      if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
-       if(!track->HasPointOnITSLayer(3)) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(24)))->Fill(0);
-       }
-       else if(track->HasPointOnITSLayer(3))
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(24)))->Fill(0);
-      }//point on SDD2
-      if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
-       if(!track->HasPointOnITSLayer(4)) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(25)))->Fill(0);
-       }
-       else if(track->HasPointOnITSLayer(4))
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(25)))->Fill(0);
-      }//point on SSD1
-      if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
-       if(!track->HasPointOnITSLayer(5)) {
-         ((TH1F *)(fQAPrimaryProtonsRejectedList->At(26)))->Fill(0);
-       }
-       else if(track->HasPointOnITSLayer(5))
-         ((TH1F *)(fQAPrimaryProtonsAcceptedList->At(26)))->Fill(0);
-      }//point on SSD2
-    }//primary particle cut
+         else if(nClustersITS >= fProtonAnalysisBase->GetMinITSClusters()) 
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
+       }//ITS clusters
+       if(fProtonAnalysisBase->IsUsedMaxChi2PerITSCluster()) {
+         if(chi2PerClusterITS > fProtonAnalysisBase->GetMaxChi2PerITSCluster()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
+         }
+         else if(chi2PerClusterITS <= fProtonAnalysisBase->GetMaxChi2PerITSCluster())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
+       }//chi2 per ITS cluster
+       if(fProtonAnalysisBase->IsUsedMinTPCClusters()) {
+         if(nClustersTPC < fProtonAnalysisBase->GetMinTPCClusters()) {
+           //cout<<"Secondary proton rejected"<<endl;
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(2)))->Fill(nClustersTPC);
+         }
+         else if(nClustersTPC >= fProtonAnalysisBase->GetMinTPCClusters()) {
+           //cout<<"Secondary proton accepted"<<endl;
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
+         }
+       }//TPC clusters
+       if(fProtonAnalysisBase->IsUsedMaxChi2PerTPCCluster()) {
+         if(chi2PerClusterTPC > fProtonAnalysisBase->GetMaxChi2PerTPCCluster()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
+         }
+         else if(chi2PerClusterTPC <= fProtonAnalysisBase->GetMaxChi2PerTPCCluster())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
+       }//chi2 per TPC cluster
+       if(fProtonAnalysisBase->IsUsedMaxCov11()) {
+         if(extCov[0] > fProtonAnalysisBase->GetMaxCov11()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
+         }
+         else if(extCov[0] <= fProtonAnalysisBase->GetMaxCov11())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
+       }//cov11
+       if(fProtonAnalysisBase->IsUsedMaxCov22()) {
+         if(extCov[2] > fProtonAnalysisBase->GetMaxCov22()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
+         }
+         else if(extCov[2] <= fProtonAnalysisBase->GetMaxCov22())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
+       }//cov11
+       if(fProtonAnalysisBase->IsUsedMaxCov33()) {
+         if(extCov[5] > fProtonAnalysisBase->GetMaxCov33()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
+         }
+         else if(extCov[5] <= fProtonAnalysisBase->GetMaxCov33())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
+       }//cov11
+       if(fProtonAnalysisBase->IsUsedMaxCov44()) {
+         if(extCov[9] > fProtonAnalysisBase->GetMaxCov44()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
+         }
+         else if(extCov[9] <= fProtonAnalysisBase->GetMaxCov44())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
+       }//cov11
+       if(fProtonAnalysisBase->IsUsedMaxCov55()) {
+         if(extCov[14] > fProtonAnalysisBase->GetMaxCov55()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
+         }
+         else if(extCov[14] <= fProtonAnalysisBase->GetMaxCov55())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
+       }//cov55
+       if(fProtonAnalysisBase->IsUsedMaxSigmaToVertex()) {
+         if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertex()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
+         }
+         else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertex())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
+       }//sigma to vertex
+       if(fProtonAnalysisBase->IsUsedMaxSigmaToVertexTPC()) {
+         if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertexTPC()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
+         }
+         else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertexTPC())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
+       }//sigma to vertex TPC
+       if(fProtonAnalysisBase->IsUsedMaxDCAXY()) {
+         if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(11)))->Fill(TMath::Abs(dca[0]));
+         }
+         else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(11)))->Fill(TMath::Abs(dca[0]));
+       }//DCA xy global tracking
+       if(fProtonAnalysisBase->IsUsedMaxDCAXYTPC()) {
+         if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXYTPC()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(12)))->Fill(TMath::Abs(dca[0]));
+         }
+         else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXYTPC())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(12)))->Fill(TMath::Abs(dca[0]));
+       }//DCA xy TPC tracking
+       if(fProtonAnalysisBase->IsUsedMaxDCAZ()) {
+         if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(13)))->Fill(TMath::Abs(dca[1]));
+         }
+         else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(13)))->Fill(TMath::Abs(dca[1]));
+       }//DCA z global tracking
+       if(fProtonAnalysisBase->IsUsedMaxDCAZTPC()) {
+         if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZTPC()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(14)))->Fill(TMath::Abs(dca[1]));
+         }
+         else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZTPC())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(14)))->Fill(TMath::Abs(dca[1]));
+       }//DCA z TPC tracking
+       if(fProtonAnalysisBase->IsUsedMaxConstrainChi2()) {
+         if(track->GetConstrainedChi2() > 0) {
+           if(TMath::Log(track->GetConstrainedChi2()) > fProtonAnalysisBase->GetMaxConstrainChi2()) {
+             ((TH1F *)(fQASecondaryProtonsRejectedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
+           }
+           else if(TMath::Log(track->GetConstrainedChi2()) <= fProtonAnalysisBase->GetMaxConstrainChi2())
+             ((TH1F *)(fQASecondaryProtonsAcceptedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
+         }
+       }//constrain chi2 - vertex
+       if(fProtonAnalysisBase->IsUsedITSRefit()) {
+         if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(16)))->Fill(0);
+         }
+         else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(16)))->Fill(0);
+       }//ITS refit
+       if(fProtonAnalysisBase->IsUsedTPCRefit()) {
+         if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(17)))->Fill(0);
+         }
+         else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(17)))->Fill(0);
+       }//TPC refit
+       if(fProtonAnalysisBase->IsUsedESDpid()) {
+         if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(18)))->Fill(0);
+         }
+         else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(18)))->Fill(0);
+       }//ESD pid
+       if(fProtonAnalysisBase->IsUsedTPCpid()) {
+         if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(19)))->Fill(0);
+         }
+         else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(19)))->Fill(0);
+       }//TPC pid
+       if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
+         if(!track->HasPointOnITSLayer(0)) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(20)))->Fill(0);
+         }
+         else if(track->HasPointOnITSLayer(0))
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(20)))->Fill(0);
+       }//point on SPD1
+       if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
+         if(!track->HasPointOnITSLayer(1)) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(21)))->Fill(0);
+         }
+         else if(track->HasPointOnITSLayer(1))
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(21)))->Fill(0);
+       }//point on SPD2
+       if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
+         if(!track->HasPointOnITSLayer(2)) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(22)))->Fill(0);
+         }
+         else if(track->HasPointOnITSLayer(2))
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(22)))->Fill(0);
+       }//point on SDD1
+       if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
+         if(!track->HasPointOnITSLayer(3)) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(23)))->Fill(0);
+         }
+         else if(track->HasPointOnITSLayer(3))
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(23)))->Fill(0);
+       }//point on SDD2
+       if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
+         if(!track->HasPointOnITSLayer(4)) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(24)))->Fill(0);
+         }
+         else if(track->HasPointOnITSLayer(4))
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(24)))->Fill(0);
+       }//point on SSD1
+       if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
+         if(!track->HasPointOnITSLayer(5)) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(25)))->Fill(0);
+         }
+         else if(track->HasPointOnITSLayer(5))
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(25)))->Fill(0);
+       }//point on SSD2
+       if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
+         if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
+           ((TH1F *)(fQASecondaryProtonsRejectedList->At(26)))->Fill(track->GetTPCsignalN());
+         }
+         if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
+           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(26)))->Fill(track->GetTPCsignalN());
+       }//number of TPC points for the dE/dx
 
-    //Secondaries
-    if(label > nPrimaries) {
-      if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
-       if(nClustersITS < fProtonAnalysisBase->GetMinITSClusters()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(0)))->Fill(nClustersITS);
-       }
-       else if(nClustersITS >= fProtonAnalysisBase->GetMinITSClusters()) 
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(0)))->Fill(nClustersITS);
-      }//ITS clusters
-      if(fProtonAnalysisBase->IsUsedMaxChi2PerITSCluster()) {
-       if(chi2PerClusterITS > fProtonAnalysisBase->GetMaxChi2PerITSCluster()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(1)))->Fill(chi2PerClusterITS);
-       }
-       else if(chi2PerClusterITS <= fProtonAnalysisBase->GetMaxChi2PerITSCluster())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(1)))->Fill(chi2PerClusterITS);
-      }//chi2 per ITS cluster
-      if(fProtonAnalysisBase->IsUsedMinTPCClusters()) {
-       if(nClustersTPC < fProtonAnalysisBase->GetMinTPCClusters()) {
-         //cout<<"Secondary proton rejected"<<endl;
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(2)))->Fill(nClustersTPC);
-       }
-       else if(nClustersTPC >= fProtonAnalysisBase->GetMinTPCClusters()) {
-         //cout<<"Secondary proton accepted"<<endl;
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(2)))->Fill(nClustersTPC);
-       }
-      }//TPC clusters
-      if(fProtonAnalysisBase->IsUsedMaxChi2PerTPCCluster()) {
-       if(chi2PerClusterTPC > fProtonAnalysisBase->GetMaxChi2PerTPCCluster()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(3)))->Fill(chi2PerClusterTPC);
-       }
-       else if(chi2PerClusterTPC <= fProtonAnalysisBase->GetMaxChi2PerTPCCluster())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(3)))->Fill(chi2PerClusterTPC);
-      }//chi2 per TPC cluster
-      if(fProtonAnalysisBase->IsUsedMaxCov11()) {
-       if(extCov[0] > fProtonAnalysisBase->GetMaxCov11()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(4)))->Fill(extCov[0]);
-       }
-       else if(extCov[0] <= fProtonAnalysisBase->GetMaxCov11())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(4)))->Fill(extCov[0]);
-      }//cov11
-      if(fProtonAnalysisBase->IsUsedMaxCov22()) {
-       if(extCov[2] > fProtonAnalysisBase->GetMaxCov22()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(5)))->Fill(extCov[2]);
-       }
-       else if(extCov[2] <= fProtonAnalysisBase->GetMaxCov22())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(5)))->Fill(extCov[2]);
-      }//cov11
-      if(fProtonAnalysisBase->IsUsedMaxCov33()) {
-       if(extCov[5] > fProtonAnalysisBase->GetMaxCov33()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(6)))->Fill(extCov[5]);
-       }
-       else if(extCov[5] <= fProtonAnalysisBase->GetMaxCov33())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(6)))->Fill(extCov[5]);
-      }//cov11
-      if(fProtonAnalysisBase->IsUsedMaxCov44()) {
-       if(extCov[9] > fProtonAnalysisBase->GetMaxCov44()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(7)))->Fill(extCov[9]);
-       }
-       else if(extCov[9] <= fProtonAnalysisBase->GetMaxCov44())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(7)))->Fill(extCov[9]);
-      }//cov11
-      if(fProtonAnalysisBase->IsUsedMaxCov55()) {
-       if(extCov[14] > fProtonAnalysisBase->GetMaxCov55()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(8)))->Fill(extCov[14]);
-       }
-       else if(extCov[14] <= fProtonAnalysisBase->GetMaxCov55())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(8)))->Fill(extCov[14]);
-      }//cov55
-      if(fProtonAnalysisBase->IsUsedMaxSigmaToVertex()) {
-       if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertex()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
-       }
-       else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertex())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(9)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
-      }//sigma to vertex
-      if(fProtonAnalysisBase->IsUsedMaxSigmaToVertexTPC()) {
-       if(fProtonAnalysisBase->GetSigmaToVertex(track) > fProtonAnalysisBase->GetMaxSigmaToVertexTPC()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
-       }
-       else if(fProtonAnalysisBase->GetSigmaToVertex(track) <= fProtonAnalysisBase->GetMaxSigmaToVertexTPC())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(10)))->Fill(fProtonAnalysisBase->GetSigmaToVertex(track));
-      }//sigma to vertex TPC
-      if(fProtonAnalysisBase->IsUsedMaxDCAXY()) {
-       if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(11)))->Fill(TMath::Abs(dca[0]));
+       /*if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
+         if(gProcess == 4)
+           ((TH2F *)(fQASecondaryProtonsRejectedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
+         if(gProcess == 13)
+           ((TH2F *)(fQASecondaryProtonsRejectedList->At(29)))->Fill(gPt,TMath::Abs(dca[0]));
        }
-       else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(11)))->Fill(TMath::Abs(dca[0]));
-      }//DCA xy global tracking
-      if(fProtonAnalysisBase->IsUsedMaxDCAXYTPC()) {
-       if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXYTPC()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(12)))->Fill(TMath::Abs(dca[0]));
+       else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY()) {
+         if(gProcess == 4)
+           ((TH2F *)(fQASecondaryProtonsAcceptedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
+         if(gProcess == 13)
+           ((TH2F *)(fQASecondaryProtonsAcceptedList->At(29)))->Fill(gPt,TMath::Abs(dca[0]));
        }
-       else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXYTPC())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(12)))->Fill(TMath::Abs(dca[0]));
-      }//DCA xy TPC tracking
-      if(fProtonAnalysisBase->IsUsedMaxDCAZ()) {
        if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(13)))->Fill(TMath::Abs(dca[1]));
-       }
-       else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(13)))->Fill(TMath::Abs(dca[1]));
-      }//DCA z global tracking
-      if(fProtonAnalysisBase->IsUsedMaxDCAZTPC()) {
-       if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZTPC()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(14)))->Fill(TMath::Abs(dca[1]));
-       }
-       else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZTPC())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(14)))->Fill(TMath::Abs(dca[1]));
-      }//DCA z TPC tracking
-      if(fProtonAnalysisBase->IsUsedMaxConstrainChi2()) {
-       if(track->GetConstrainedChi2() > 0) {
-         if(TMath::Log(track->GetConstrainedChi2()) > fProtonAnalysisBase->GetMaxConstrainChi2()) {
-           ((TH1F *)(fQASecondaryProtonsRejectedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
-         }
-         else if(TMath::Log(track->GetConstrainedChi2()) <= fProtonAnalysisBase->GetMaxConstrainChi2())
-           ((TH1F *)(fQASecondaryProtonsAcceptedList->At(15)))->Fill(TMath::Log(track->GetConstrainedChi2()));
-       }
-      }//constrain chi2 - vertex
-      if(fProtonAnalysisBase->IsUsedITSRefit()) {
-       if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(16)))->Fill(0);
-       }
-       else if((track->GetStatus() & AliESDtrack::kITSrefit) != 0)
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(16)))->Fill(0);
-      }//ITS refit
-      if(fProtonAnalysisBase->IsUsedTPCRefit()) {
-       if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(17)))->Fill(0);
-       }
-       else if((track->GetStatus() & AliESDtrack::kTPCrefit) != 0)
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(17)))->Fill(0);
-      }//TPC refit
-      if(fProtonAnalysisBase->IsUsedESDpid()) {
-       if ((track->GetStatus() & AliESDtrack::kESDpid) == 0) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(18)))->Fill(0);
-       }
-       else if((track->GetStatus() & AliESDtrack::kESDpid) != 0)
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(18)))->Fill(0);
-      }//ESD pid
-      if(fProtonAnalysisBase->IsUsedTPCpid()) {
-       if ((track->GetStatus() & AliESDtrack::kTPCpid) == 0) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(19)))->Fill(0);
+         if(gProcess == 4)
+           ((TH2F *)(fQASecondaryProtonsRejectedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));
+         if(gProcess == 13)
+           ((TH2F *)(fQASecondaryProtonsRejectedList->At(30)))->Fill(gPt,TMath::Abs(dca[1]));
        }
-       else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(19)))->Fill(0);
-      }//TPC pid
-      if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
-       if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(20)))->Fill(track->GetTPCsignalN());
-       }
-       if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(20)))->Fill(track->GetTPCsignalN());
-      }//number of TPC points for the dE/dx
-      if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
-       if(!track->HasPointOnITSLayer(0)) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(21)))->Fill(0);
-       }
-       else if(track->HasPointOnITSLayer(0))
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(21)))->Fill(0);
-      }//point on SPD1
-      if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
-       if(!track->HasPointOnITSLayer(1)) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(22)))->Fill(0);
-       }
-       else if(track->HasPointOnITSLayer(1))
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(22)))->Fill(0);
-      }//point on SPD2
-      if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
-       if(!track->HasPointOnITSLayer(2)) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(23)))->Fill(0);
-       }
-       else if(track->HasPointOnITSLayer(2))
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(23)))->Fill(0);
-      }//point on SDD1
-      if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
-       if(!track->HasPointOnITSLayer(3)) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(24)))->Fill(0);
-       }
-       else if(track->HasPointOnITSLayer(3))
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(24)))->Fill(0);
-      }//point on SDD2
-      if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
-       if(!track->HasPointOnITSLayer(4)) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(25)))->Fill(0);
-       }
-       else if(track->HasPointOnITSLayer(4))
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(25)))->Fill(0);
-      }//point on SSD1
-      if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
-       if(!track->HasPointOnITSLayer(5)) {
-         ((TH1F *)(fQASecondaryProtonsRejectedList->At(26)))->Fill(0);
-       }
-       else if(track->HasPointOnITSLayer(5))
-         ((TH1F *)(fQASecondaryProtonsAcceptedList->At(26)))->Fill(0);
-      }//point on SSD2
-    }//secondary particle cut
-  }//protons
-
-  //antiprotons
-  if(track->Charge() < 0) {
-    //Primaries
-    if(label <= nPrimaries) {
-      if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
+       else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ()) {
+         if(gProcess == 4)
+           ((TH2F *)(fQASecondaryProtonsAcceptedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));
+         if(gProcess == 13)
+           ((TH2F *)(fQASecondaryProtonsAcceptedList->At(30)))->Fill(gPt,TMath::Abs(dca[1]));
+           }*/
+      }//secondary particle cut
+    }//protons
+    
+    //antiprotons
+    if(track->Charge() < 0) {
+      //Primaries
+      if(label <= nPrimaries) {
+       if(fProtonAnalysisBase->IsUsedMinITSClusters()) {
        if(nClustersITS < fProtonAnalysisBase->GetMinITSClusters()) {
          ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(0)))->Fill(nClustersITS);
        }
@@ -696,55 +737,66 @@ void AliProtonQAAnalysis::FillQA(AliStack *const stack,
        else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
          ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(19)))->Fill(0);
       }//TPC pid
-      if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
-       if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
-         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(20)))->Fill(track->GetTPCsignalN());
-       }
-       if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
-         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(20)))->Fill(track->GetTPCsignalN());
-      }//number of TPC points for the dE/dx
       if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
        if(!track->HasPointOnITSLayer(0)) {
-         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(21)))->Fill(0);
+         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(20)))->Fill(0);
        }
        else if(track->HasPointOnITSLayer(0))
-         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(21)))->Fill(0);
+         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(20)))->Fill(0);
       }//point on SPD1
       if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
        if(!track->HasPointOnITSLayer(1)) {
-         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(22)))->Fill(0);
+         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(21)))->Fill(0);
        }
        else if(track->HasPointOnITSLayer(1))
-         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(22)))->Fill(0);
+         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(21)))->Fill(0);
       }//point on SPD2
       if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
        if(!track->HasPointOnITSLayer(2)) {
-         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(23)))->Fill(0);
+         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(22)))->Fill(0);
        }
        else if(track->HasPointOnITSLayer(2))
-         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(23)))->Fill(0);
+         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(22)))->Fill(0);
       }//point on SDD1
       if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
        if(!track->HasPointOnITSLayer(3)) {
-         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(24)))->Fill(0);
+         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(23)))->Fill(0);
        }
        else if(track->HasPointOnITSLayer(3))
-         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(24)))->Fill(0);
+         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(23)))->Fill(0);
       }//point on SDD2
       if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
        if(!track->HasPointOnITSLayer(4)) {
-         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(25)))->Fill(0);
+         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(24)))->Fill(0);
        }
        else if(track->HasPointOnITSLayer(4))
-         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(25)))->Fill(0);
+         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(24)))->Fill(0);
       }//point on SSD1
       if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
        if(!track->HasPointOnITSLayer(5)) {
-         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(26)))->Fill(0);
+         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(25)))->Fill(0);
        }
        else if(track->HasPointOnITSLayer(5))
-         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(26)))->Fill(0);
+         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(25)))->Fill(0);
       }//point on SSD2
+      if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
+       if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
+         ((TH1F *)(fQAPrimaryAntiProtonsRejectedList->At(26)))->Fill(track->GetTPCsignalN());
+       }
+       if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
+         ((TH1F *)(fQAPrimaryAntiProtonsAcceptedList->At(26)))->Fill(track->GetTPCsignalN());
+      }//number of TPC points for the dE/dx
+
+      /*if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
+       ((TH2F *)(fQAPrimaryAntiProtonsRejectedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
+      }
+      else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY())
+       ((TH2F *)(fQAPrimaryAntiProtonsAcceptedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
+      if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
+       ((TH2F *)(fQAPrimaryAntiProtonsRejectedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));
+      }
+      else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ())
+      ((TH2F *)(fQAPrimaryAntiProtonsAcceptedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));*/
     }//primary particle cut
 
     //Secondaries
@@ -892,57 +944,83 @@ void AliProtonQAAnalysis::FillQA(AliStack *const stack,
        else if((track->GetStatus() & AliESDtrack::kTPCpid) != 0)
          ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(19)))->Fill(0);
       }//TPC pid
-      if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
-       if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
-         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(20)))->Fill(track->GetTPCsignalN());
-       }
-       if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
-         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(20)))->Fill(track->GetTPCsignalN());
-      }//number of TPC points for the dE/dx
       if(fProtonAnalysisBase->IsUsedPointOnITSLayer1()) {
        if(!track->HasPointOnITSLayer(0)) {
-         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(21)))->Fill(0);
+         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(20)))->Fill(0);
        }
        else if(track->HasPointOnITSLayer(0))
-         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(21)))->Fill(0);
+         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(20)))->Fill(0);
       }//point on SPD1
       if(fProtonAnalysisBase->IsUsedPointOnITSLayer2()) {
        if(!track->HasPointOnITSLayer(1)) {
-         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(22)))->Fill(0);
+         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(21)))->Fill(0);
        }
        else if(track->HasPointOnITSLayer(1))
-         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(22)))->Fill(0);
+         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(21)))->Fill(0);
       }//point on SPD2
       if(fProtonAnalysisBase->IsUsedPointOnITSLayer3()) {
        if(!track->HasPointOnITSLayer(2)) {
-         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(23)))->Fill(0);
+         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(22)))->Fill(0);
        }
        else if(track->HasPointOnITSLayer(2))
-         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(23)))->Fill(0);
+         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(22)))->Fill(0);
       }//point on SDD1
       if(fProtonAnalysisBase->IsUsedPointOnITSLayer4()) {
        if(!track->HasPointOnITSLayer(3)) {
-         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(24)))->Fill(0);
+         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(23)))->Fill(0);
        }
        else if(track->HasPointOnITSLayer(3))
-         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(24)))->Fill(0);
+         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(23)))->Fill(0);
       }//point on SDD2
       if(fProtonAnalysisBase->IsUsedPointOnITSLayer5()) {
        if(!track->HasPointOnITSLayer(4)) {
-         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(25)))->Fill(0);
+         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(24)))->Fill(0);
        }
        else if(track->HasPointOnITSLayer(4))
-         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(25)))->Fill(0);
+         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(24)))->Fill(0);
       }//point on SSD1
       if(fProtonAnalysisBase->IsUsedPointOnITSLayer6()) {
        if(!track->HasPointOnITSLayer(5)) {
-         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(26)))->Fill(0);
+         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(25)))->Fill(0);
        }
        else if(track->HasPointOnITSLayer(5))
-         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(26)))->Fill(0);
+         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(25)))->Fill(0);
       }//point on SSD2
+      if(fProtonAnalysisBase->IsUsedMinTPCdEdxPoints()) {
+       if(track->GetTPCsignalN() < fProtonAnalysisBase->GetMinTPCdEdxPoints()) {
+         ((TH1F *)(fQASecondaryAntiProtonsRejectedList->At(26)))->Fill(track->GetTPCsignalN());
+       }
+       if(track->GetTPCsignalN() >= fProtonAnalysisBase->GetMinTPCdEdxPoints())
+         ((TH1F *)(fQASecondaryAntiProtonsAcceptedList->At(26)))->Fill(track->GetTPCsignalN());
+      }//number of TPC points for the dE/dx
+
+      /*if(TMath::Abs(dca[0]) > fProtonAnalysisBase->GetMaxDCAXY()) {
+       if(gProcess == 4)
+         ((TH2F *)(fQASecondaryAntiProtonsRejectedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
+       if(gProcess == 13)
+         ((TH2F *)(fQASecondaryAntiProtonsRejectedList->At(29)))->Fill(gPt,TMath::Abs(dca[0]));
+      }
+      else if(TMath::Abs(dca[0]) <= fProtonAnalysisBase->GetMaxDCAXY()) {
+       if(gProcess == 4)
+         ((TH2F *)(fQASecondaryAntiProtonsAcceptedList->At(27)))->Fill(gPt,TMath::Abs(dca[0]));
+       if(gProcess == 13)
+         ((TH2F *)(fQASecondaryAntiProtonsAcceptedList->At(29)))->Fill(gPt,TMath::Abs(dca[0]));
+      }
+      if(TMath::Abs(dca[1]) > fProtonAnalysisBase->GetMaxDCAZ()) {
+       if(gProcess == 4)
+         ((TH2F *)(fQASecondaryAntiProtonsRejectedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));
+       if(gProcess == 13)
+         ((TH2F *)(fQASecondaryAntiProtonsRejectedList->At(30)))->Fill(gPt,TMath::Abs(dca[1]));
+      }
+      else if(TMath::Abs(dca[1]) <= fProtonAnalysisBase->GetMaxDCAZ()) {
+       if(gProcess == 4)
+         ((TH2F *)(fQASecondaryAntiProtonsAcceptedList->At(28)))->Fill(gPt,TMath::Abs(dca[1]));
+       if(gProcess == 13)
+         ((TH2F *)(fQASecondaryAntiProtonsAcceptedList->At(30)))->Fill(gPt,TMath::Abs(dca[1]));
+         }*/
     }//secondary particle cut
   }//antiprotons
+    //}//if TParticle
 }
 
 //____________________________________________________________________//
@@ -1005,17 +1083,42 @@ void AliProtonQAAnalysis::SetQAYPtBins(Int_t nbinsY,
   if(fRunEfficiencyAnalysis) InitEfficiencyAnalysis();
 }
 
+//____________________________________________________________________//
+void AliProtonQAAnalysis::SetQAYPtBins(Int_t nbinsY, Double_t *gY,
+                                      Int_t nbinsPt, Double_t *gPt) {
+  //Initializes the QA binning - asymmetric binning case
+  fUseAsymmetricBinning = kTRUE;
+  fNBinsY = nbinsY;
+  for(Int_t i = 0; i < nbinsY; i++) fY[i] = gY[i];
+  fMinY = gY[0]; fMaxY = gY[nbinsPt];
+  fNBinsPt = nbinsPt;
+  for(Int_t i = 0; i < nbinsPt; i++) fPt[i] = gPt[i];
+  fMinPt = gPt[0]; fMaxPt = gPt[nbinsPt];
+  InitQA();
+  InitCutLists();
+  InitVertexQA();
+  if(fRunMCAnalysis) InitMCAnalysis();
+  if(fRunEfficiencyAnalysis) InitEfficiencyAnalysis();
+}
+
 //____________________________________________________________________//
 void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
-  //Initialization of the efficiency list - reconstruction & PID efficiency
+  //Initialization of the efficiency list - reconstruction & PID & cut 
+  //efficiency
   //Adding each monitored object in the list
   fEfficiencyList = new TList();
 
   //MC primary protons and antiprotons for the reconstruction efficiency
-  TH2D *gHistMCYPtProtons = new TH2D("gHistMCYPtProtons",
-                                    ";;P_{T} [GeV/c]",
-                                    fNBinsY,fMinY,fMaxY,
-                                    fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistMCYPtProtons = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistMCYPtProtons = new TH2D("gHistMCYPtProtons",
+                                ";;P_{T} [GeV/c]",
+                                fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistMCYPtProtons = new TH2D("gHistMCYPtProtons",
+                                ";;P_{T} [GeV/c]",
+                                fNBinsY,fMinY,fMaxY,
+                                fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistMCYPtProtons->GetXaxis()->SetTitle("#eta");
   else 
@@ -1023,10 +1126,16 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   gHistMCYPtProtons->SetStats(kTRUE);
   gHistMCYPtProtons->GetXaxis()->SetTitleColor(1);
   fEfficiencyList->Add(gHistMCYPtProtons);
-  TH2D *gHistMCYPtAntiProtons = new TH2D("gHistMCYPtAntiProtons",
-                                        ";y;P_{T} [GeV/c]",
-                                        fNBinsY,fMinY,fMaxY,
-                                        fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistMCYPtAntiProtons = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistMCYPtAntiProtons = new TH2D("gHistMCYPtAntiProtons",
+                                    ";;P_{T} [GeV/c]",
+                                    fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistMCYPtAntiProtons = new TH2D("gHistMCYPtAntiProtons",
+                                    ";y;P_{T} [GeV/c]",
+                                    fNBinsY,fMinY,fMaxY,
+                                    fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistMCYPtAntiProtons->GetXaxis()->SetTitle("#eta");
   else 
@@ -1036,10 +1145,16 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   fEfficiencyList->Add(gHistMCYPtAntiProtons);
 
   //MC secondary protons and antiprotons that come from weak decay for the reconstruction efficiency
-  TH2D *gHistMCYPtProtonsFromWeak = new TH2D("gHistMCYPtProtonsFromWeak",
-                                            ";;P_{T} [GeV/c]",
-                                            fNBinsY,fMinY,fMaxY,
-                                            fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistMCYPtProtonsFromWeak = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistMCYPtProtonsFromWeak = new TH2D("gHistMCYPtProtonsFromWeak",
+                                        ";;P_{T} [GeV/c]",
+                                        fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistMCYPtProtonsFromWeak = new TH2D("gHistMCYPtProtonsFromWeak",
+                                        ";;P_{T} [GeV/c]",
+                                        fNBinsY,fMinY,fMaxY,
+                                        fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistMCYPtProtonsFromWeak->GetXaxis()->SetTitle("#eta");
   else 
@@ -1047,10 +1162,16 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   gHistMCYPtProtonsFromWeak->SetStats(kTRUE);
   gHistMCYPtProtonsFromWeak->GetXaxis()->SetTitleColor(1);
   fEfficiencyList->Add(gHistMCYPtProtonsFromWeak);
-  TH2D *gHistMCYPtAntiProtonsFromWeak = new TH2D("gHistMCYPtAntiProtonsFromWeak",
-                                                ";y;P_{T} [GeV/c]",
-                                                fNBinsY,fMinY,fMaxY,
-                                                fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistMCYPtAntiProtonsFromWeak = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistMCYPtAntiProtonsFromWeak = new TH2D("gHistMCYPtAntiProtonsFromWeak",
+                                            ";;P_{T} [GeV/c]",
+                                            fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistMCYPtAntiProtonsFromWeak = new TH2D("gHistMCYPtAntiProtonsFromWeak",
+                                            ";y;P_{T} [GeV/c]",
+                                            fNBinsY,fMinY,fMaxY,
+                                            fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistMCYPtAntiProtonsFromWeak->GetXaxis()->SetTitle("#eta");
   else 
@@ -1060,10 +1181,16 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   fEfficiencyList->Add(gHistMCYPtAntiProtonsFromWeak);
 
   //MC secondary protons and antiprotons that come from hadronic interactions for the reconstruction efficiency
-  TH2D *gHistMCYPtProtonsFromHadronic = new TH2D("gHistMCYPtProtonsFromHadronic",
-                                                ";;P_{T} [GeV/c]",
-                                                fNBinsY,fMinY,fMaxY,
-                                                fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistMCYPtProtonsFromHadronic = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistMCYPtProtonsFromHadronic = new TH2D("gHistMCYPtProtonsFromHadronic",
+                                            ";;P_{T} [GeV/c]",
+                                            fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistMCYPtProtonsFromHadronic = new TH2D("gHistMCYPtProtonsFromHadronic",
+                                            ";;P_{T} [GeV/c]",
+                                            fNBinsY,fMinY,fMaxY,
+                                            fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistMCYPtProtonsFromHadronic->GetXaxis()->SetTitle("#eta");
   else 
@@ -1071,10 +1198,16 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   gHistMCYPtProtonsFromHadronic->SetStats(kTRUE);
   gHistMCYPtProtonsFromHadronic->GetXaxis()->SetTitleColor(1);
   fEfficiencyList->Add(gHistMCYPtProtonsFromHadronic);
-  TH2D *gHistMCYPtAntiProtonsFromHadronic = new TH2D("gHistMCYPtAntiProtonsFromHadronic",
-                                                    ";y;P_{T} [GeV/c]",
-                                                    fNBinsY,fMinY,fMaxY,
-                                                    fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistMCYPtAntiProtonsFromHadronic = 0x0;
+  if(fUseAsymmetricBinning)
+  gHistMCYPtAntiProtonsFromHadronic = new TH2D("gHistMCYPtAntiProtonsFromHadronic",
+                                              ";;P_{T} [GeV/c]",
+                                              fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistMCYPtAntiProtonsFromHadronic = new TH2D("gHistMCYPtAntiProtonsFromHadronic",
+                                                ";y;P_{T} [GeV/c]",
+                                                fNBinsY,fMinY,fMaxY,
+                                                fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistMCYPtAntiProtonsFromHadronic->GetXaxis()->SetTitle("#eta");
   else 
@@ -1084,10 +1217,16 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   fEfficiencyList->Add(gHistMCYPtAntiProtonsFromHadronic);
   
   //ESD primary protons and antiprotons for the reconstruction efficiency
-  TH2D *gHistESDYPtProtons = new TH2D("gHistESDYPtProtons",
-                                     ";;P_{T} [GeV/c]",
-                                     fNBinsY,fMinY,fMaxY,
-                                     fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistESDYPtProtons = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistESDYPtProtons = new TH2D("gHistESDYPtProtons",
+                                 ";;P_{T} [GeV/c]",
+                                 fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistESDYPtProtons = new TH2D("gHistESDYPtProtons",
+                                 ";;P_{T} [GeV/c]",
+                                 fNBinsY,fMinY,fMaxY,
+                                 fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistESDYPtProtons->GetXaxis()->SetTitle("#eta");
   else 
@@ -1095,10 +1234,16 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   gHistESDYPtProtons->SetStats(kTRUE);
   gHistESDYPtProtons->GetXaxis()->SetTitleColor(1);
   fEfficiencyList->Add(gHistESDYPtProtons);
-  TH2D *gHistESDYPtAntiProtons = new TH2D("gHistESDYPtAntiProtons",
-                                         ";;P_{T} [GeV/c]",
-                                         fNBinsY,fMinY,fMaxY,
-                                         fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistESDYPtAntiProtons = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistESDYPtAntiProtons = new TH2D("gHistESDYPtAntiProtons",
+                                     ";;P_{T} [GeV/c]",
+                                     fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistESDYPtAntiProtons = new TH2D("gHistESDYPtAntiProtons",
+                                     ";;P_{T} [GeV/c]",
+                                     fNBinsY,fMinY,fMaxY,
+                                     fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistESDYPtAntiProtons->GetXaxis()->SetTitle("#eta");
   else 
@@ -1108,10 +1253,16 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   fEfficiencyList->Add(gHistESDYPtAntiProtons);
 
   //ESD (anti)protons from weak decays for the reconstruction efficiency
-  TH2D *gHistESDYPtProtonsFromWeak = new TH2D("gHistESDYPtProtonsFromWeak",
-                                             ";;P_{T} [GeV/c]",
-                                             fNBinsY,fMinY,fMaxY,
-                                             fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistESDYPtProtonsFromWeak = 0x0;
+  if(fUseAsymmetricBinning)
+  gHistESDYPtProtonsFromWeak = new TH2D("gHistESDYPtProtonsFromWeak",
+                                       ";;P_{T} [GeV/c]",
+                                       fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistESDYPtProtonsFromWeak = new TH2D("gHistESDYPtProtonsFromWeak",
+                                         ";;P_{T} [GeV/c]",
+                                         fNBinsY,fMinY,fMaxY,
+                                         fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistESDYPtProtonsFromWeak->GetXaxis()->SetTitle("#eta");
   else 
@@ -1119,10 +1270,16 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   gHistESDYPtProtonsFromWeak->SetStats(kTRUE);
   gHistESDYPtProtonsFromWeak->GetXaxis()->SetTitleColor(1);
   fEfficiencyList->Add(gHistESDYPtProtonsFromWeak);
-  TH2D *gHistESDYPtAntiProtonsFromWeak = new TH2D("gHistESDYPtAntiProtonsFromWeak",
-                                                 ";;P_{T} [GeV/c]",
-                                                 fNBinsY,fMinY,fMaxY,
-                                                 fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistESDYPtAntiProtonsFromWeak = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistESDYPtAntiProtonsFromWeak = new TH2D("gHistESDYPtAntiProtonsFromWeak",
+                                             ";;P_{T} [GeV/c]",
+                                             fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistESDYPtAntiProtonsFromWeak = new TH2D("gHistESDYPtAntiProtonsFromWeak",
+                                             ";;P_{T} [GeV/c]",
+                                             fNBinsY,fMinY,fMaxY,
+                                             fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistESDYPtAntiProtonsFromWeak->GetXaxis()->SetTitle("#eta");
   else 
@@ -1132,10 +1289,16 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   fEfficiencyList->Add(gHistESDYPtAntiProtonsFromWeak);
 
   //ESD (anti)protons from hadronic interactions for the reconstruction efficiency
-  TH2D *gHistESDYPtProtonsFromHadronic = new TH2D("gHistESDYPtProtonsFromHadronic",
-                                                 ";;P_{T} [GeV/c]",
-                                                 fNBinsY,fMinY,fMaxY,
-                                                 fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistESDYPtProtonsFromHadronic = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistESDYPtProtonsFromHadronic = new TH2D("gHistESDYPtProtonsFromHadronic",
+                                             ";;P_{T} [GeV/c]",
+                                             fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistESDYPtProtonsFromHadronic = new TH2D("gHistESDYPtProtonsFromHadronic",
+                                             ";;P_{T} [GeV/c]",
+                                             fNBinsY,fMinY,fMaxY,
+                                             fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistESDYPtProtonsFromHadronic->GetXaxis()->SetTitle("#eta");
   else 
@@ -1143,10 +1306,16 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   gHistESDYPtProtonsFromHadronic->SetStats(kTRUE);
   gHistESDYPtProtonsFromHadronic->GetXaxis()->SetTitleColor(1);
   fEfficiencyList->Add(gHistESDYPtProtonsFromHadronic);
-  TH2D *gHistESDYPtAntiProtonsFromHadronic = new TH2D("gHistESDYPtAntiProtonsFromHadronic",
-                                                     ";;P_{T} [GeV/c]",
-                                                     fNBinsY,fMinY,fMaxY,
-                                                     fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistESDYPtAntiProtonsFromHadronic = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistESDYPtAntiProtonsFromHadronic = new TH2D("gHistESDYPtAntiProtonsFromHadronic",
+                                                 ";;P_{T} [GeV/c]",
+                                                 fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistESDYPtAntiProtonsFromHadronic = new TH2D("gHistESDYPtAntiProtonsFromHadronic",
+                                                 ";;P_{T} [GeV/c]",
+                                                 fNBinsY,fMinY,fMaxY,
+                                                 fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistESDYPtAntiProtonsFromHadronic->GetXaxis()->SetTitle("#eta");
   else 
@@ -1155,13 +1324,22 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   gHistESDYPtAntiProtonsFromHadronic->GetXaxis()->SetTitleColor(1);
   fEfficiencyList->Add(gHistESDYPtAntiProtonsFromHadronic);
   
-  
   //ESD reconstructed tracks that were initially protons for the PID efficiency
-  TH3D *gHistESDInitYPtProtons = new TH3D("gHistESDInitYPtProtons",
-                                         ";;P_{T} [GeV/c];N_{points}",
-                                         fNBinsY,fMinY,fMaxY,
-                                         fNBinsPt,fMinPt,fMaxPt,
-                                         50,0,200);
+  TH3D *gHistESDInitYPtProtons = 0x0;
+  if(fUseAsymmetricBinning) {
+    Double_t gNPoints[51];
+    for(Int_t i = 0; i < 51; i++)
+      gNPoints[i] = i*4; 
+  gHistESDInitYPtProtons = new TH3D("gHistESDInitYPtProtons",
+                                   ";;P_{T} [GeV/c];N_{points}",
+                                   fNBinsY,fY,fNBinsPt,fPt,50,gNPoints);
+  }
+  else
+    gHistESDInitYPtProtons = new TH3D("gHistESDInitYPtProtons",
+                                     ";;P_{T} [GeV/c];N_{points}",
+                                     fNBinsY,fMinY,fMaxY,
+                                     fNBinsPt,fMinPt,fMaxPt,
+                                     50,0,200);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistESDInitYPtProtons->GetXaxis()->SetTitle("#eta");
   else 
@@ -1171,11 +1349,21 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   fEfficiencyList->Add(gHistESDInitYPtProtons);
   
   //ESD reconstructed tracks that were initially protons and were identified as protons for the PID efficiency
-  TH3D *gHistESDIdYPtProtons = new TH3D("gHistESDIdYPtProtons",
-                                       ";;P_{T} [GeV/c];N_{points}",
-                                       fNBinsY,fMinY,fMaxY,
-                                       fNBinsPt,fMinPt,fMaxPt,
-                                       50,0,200);
+  TH3D *gHistESDIdYPtProtons = 0x0;
+  if(fUseAsymmetricBinning) {
+    Double_t gNPoints[51];
+    for(Int_t i = 0; i < 51; i++)
+      gNPoints[i] = i*4; 
+    gHistESDIdYPtProtons = new TH3D("gHistESDIdYPtProtons",
+                                   ";;P_{T} [GeV/c];N_{points}",
+                                   fNBinsY,fY,fNBinsPt,fPt,50,gNPoints);
+  }
+  else
+    gHistESDIdYPtProtons = new TH3D("gHistESDIdYPtProtons",
+                                   ";;P_{T} [GeV/c];N_{points}",
+                                   fNBinsY,fMinY,fMaxY,
+                                   fNBinsPt,fMinPt,fMaxPt,
+                                   50,0,200);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistESDIdYPtProtons->GetXaxis()->SetTitle("#eta");
   else 
@@ -1185,11 +1373,21 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   fEfficiencyList->Add(gHistESDIdYPtProtons);
  
   //ESD reconstructed tracks that were identified as protons for the PID contamination
-  TH3D *gHistESDRecIdYPtProtons = new TH3D("gHistESDRecIdYPtProtons",
-                                          ";;P_{T} [GeV/c];N_{points}",
-                                          fNBinsY,fMinY,fMaxY,
-                                          fNBinsPt,fMinPt,fMaxPt,
-                                          50,0,200);
+  TH3D *gHistESDRecIdYPtProtons = 0x0;
+  if(fUseAsymmetricBinning) {
+    Double_t gNPoints[51];
+    for(Int_t i = 0; i < 51; i++)
+      gNPoints[i] = i*4; 
+    gHistESDRecIdYPtProtons = new TH3D("gHistESDRecIdYPtProtons",
+                                      ";;P_{T} [GeV/c];N_{points}",
+                                      fNBinsY,fY,fNBinsPt,fPt,50,gNPoints);
+  }
+  else
+    gHistESDRecIdYPtProtons = new TH3D("gHistESDRecIdYPtProtons",
+                                      ";;P_{T} [GeV/c];N_{points}",
+                                      fNBinsY,fMinY,fMaxY,
+                                      fNBinsPt,fMinPt,fMaxPt,
+                                      50,0,200);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistESDRecIdYPtProtons->GetXaxis()->SetTitle("#eta");
   else 
@@ -1199,11 +1397,21 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   fEfficiencyList->Add(gHistESDRecIdYPtProtons);
 
   //ESD reconstructed tracks that were identified as protons but were initially not protons for the PID contamination
-  TH3D *gHistESDContamYPtProtons = new TH3D("gHistESDContamYPtProtons",
-                                           ";;P_{T} [GeV/c];N_{points}",
-                                           fNBinsY,fMinY,fMaxY,
-                                           fNBinsPt,fMinPt,fMaxPt,
-                                           50,0,200);
+  TH3D *gHistESDContamYPtProtons = 0x0;
+  if(fUseAsymmetricBinning) {
+    Double_t gNPoints[51];
+    for(Int_t i = 0; i < 51; i++)
+      gNPoints[i] = i*4; 
+    gHistESDContamYPtProtons = new TH3D("gHistESDContamYPtProtons",
+                                       ";;P_{T} [GeV/c];N_{points}",
+                                       fNBinsY,fY,fNBinsPt,fPt,50,gNPoints);
+  }
+  else
+    gHistESDContamYPtProtons = new TH3D("gHistESDContamYPtProtons",
+                                       ";;P_{T} [GeV/c];N_{points}",
+                                       fNBinsY,fMinY,fMaxY,
+                                       fNBinsPt,fMinPt,fMaxPt,
+                                       50,0,200);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistESDContamYPtProtons->GetXaxis()->SetTitle("#eta");
   else 
@@ -1211,6 +1419,86 @@ void AliProtonQAAnalysis::InitEfficiencyAnalysis() {
   gHistESDContamYPtProtons->SetStats(kTRUE);
   gHistESDContamYPtProtons->GetXaxis()->SetTitleColor(1);
   fEfficiencyList->Add(gHistESDContamYPtProtons);
+
+  //==============//
+  //Cut efficiency//
+  //==============//
+  fCutEfficiencyList = new TList();
+  //Reconstructed primary tracks that were identified as protons
+  TH2D *gHistESDYPtProtonsTotal = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistESDYPtProtonsTotal = new TH2D("gHistESDYPtProtonsTotal",
+                                      ";;P_{T} [GeV/c]",
+                                      fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistESDYPtProtonsTotal = new TH2D("gHistESDYPtProtonsTotal",
+                                      ";;P_{T} [GeV/c]",
+                                      fNBinsY,fMinY,fMaxY,
+                                      fNBinsPt,fMinPt,fMaxPt);
+  if(fProtonAnalysisBase->GetEtaMode()) 
+    gHistESDYPtProtonsTotal->GetXaxis()->SetTitle("#eta");
+  else 
+    gHistESDYPtProtonsTotal->GetXaxis()->SetTitle("y");
+  gHistESDYPtProtonsTotal->SetStats(kTRUE);
+  gHistESDYPtProtonsTotal->GetXaxis()->SetTitleColor(1);
+  fCutEfficiencyList->Add(gHistESDYPtProtonsTotal);
+
+  //Reconstructed primary tracks that were identified as antiprotons
+  TH2D *gHistESDYPtAntiProtonsTotal = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistESDYPtAntiProtonsTotal = new TH2D("gHistESDYPtAntiProtonsTotal",
+                                          ";;P_{T} [GeV/c]",
+                                          fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistESDYPtAntiProtonsTotal = new TH2D("gHistESDYPtAntiProtonsTotal",
+                                          ";;P_{T} [GeV/c]",
+                                          fNBinsY,fMinY,fMaxY,
+                                          fNBinsPt,fMinPt,fMaxPt);
+  if(fProtonAnalysisBase->GetEtaMode()) 
+    gHistESDYPtAntiProtonsTotal->GetXaxis()->SetTitle("#eta");
+  else 
+    gHistESDYPtAntiProtonsTotal->GetXaxis()->SetTitle("y");
+  gHistESDYPtAntiProtonsTotal->SetStats(kTRUE);
+  gHistESDYPtAntiProtonsTotal->GetXaxis()->SetTitleColor(1);
+  fCutEfficiencyList->Add(gHistESDYPtAntiProtonsTotal);
+  
+  //Reconstructed, survived primary tracks that were identified as protons
+  TH2D *gHistESDYPtProtonsSurvived = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistESDYPtProtonsSurvived = new TH2D("gHistESDYPtProtonsSurvived",
+                                         ";;P_{T} [GeV/c]",
+                                         fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistESDYPtProtonsSurvived = new TH2D("gHistESDYPtProtonsSurvived",
+                                         ";;P_{T} [GeV/c]",
+                                         fNBinsY,fMinY,fMaxY,
+                                         fNBinsPt,fMinPt,fMaxPt);
+  if(fProtonAnalysisBase->GetEtaMode()) 
+    gHistESDYPtProtonsSurvived->GetXaxis()->SetTitle("#eta");
+  else 
+    gHistESDYPtProtonsSurvived->GetXaxis()->SetTitle("y");
+  gHistESDYPtProtonsSurvived->SetStats(kTRUE);
+  gHistESDYPtProtonsSurvived->GetXaxis()->SetTitleColor(1);
+  fCutEfficiencyList->Add(gHistESDYPtProtonsSurvived);
+  
+  //Reconstructed, survived primary tracks that were identified as antiprotons
+  TH2D *gHistESDYPtAntiProtonsSurvived = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistESDYPtAntiProtonsSurvived = new TH2D("gHistESDYPtAntiProtonsSurvived",
+                                             ";;P_{T} [GeV/c]",
+                                             fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistESDYPtAntiProtonsSurvived = new TH2D("gHistESDYPtAntiProtonsSurvived",
+                                             ";;P_{T} [GeV/c]",
+                                             fNBinsY,fMinY,fMaxY,
+                                             fNBinsPt,fMinPt,fMaxPt);
+  if(fProtonAnalysisBase->GetEtaMode()) 
+    gHistESDYPtAntiProtonsSurvived->GetXaxis()->SetTitle("#eta");
+  else 
+    gHistESDYPtAntiProtonsSurvived->GetXaxis()->SetTitle("y");
+  gHistESDYPtAntiProtonsSurvived->SetStats(kTRUE);
+  gHistESDYPtAntiProtonsSurvived->GetXaxis()->SetTitleColor(1);
+  fCutEfficiencyList->Add(gHistESDYPtAntiProtonsSurvived);
 }
 
 //____________________________________________________________________//
@@ -1462,7 +1750,7 @@ void AliProtonQAAnalysis::InitCutLists() {
   fAcceptedCutList->Add(gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsPass);//eta-phi of secondary accepted ESD antiprotons
   //eta-phi-number of TPC points for the dE/dx
   TH3D *gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass = new TH3D("gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass",
-                                                                 "Accepted primary protons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
+                                                                 "Accepted primary protons;#eta;#phi;N_{points}(TPC)",
                                                                  fNBinsY,fMinY,fMaxY,
                                                                  100,0,360,
                                                                  100,0,200);
@@ -1470,7 +1758,7 @@ void AliProtonQAAnalysis::InitCutLists() {
   gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass->GetXaxis()->SetTitleColor(1);
   fAcceptedCutList->Add(gHistEtaPhiTPCdEdxNPointsPrimaryProtonsPass);//eta-phi of primary accepted ESD protons
   TH3D *gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass = new TH3D("gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass",
-                                                                     "Accepted primary antiprotons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
+                                                                     "Accepted primary antiprotons;#eta;#phi;N_{points}(TPC)",
                                                                      fNBinsY,fMinY,fMaxY,
                                                                      100,0,360,
                                                                      100,0,200);
@@ -1478,7 +1766,7 @@ void AliProtonQAAnalysis::InitCutLists() {
   gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
   fAcceptedCutList->Add(gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsPass);//eta-phi of primary accepted ESD antiprotons
   TH3D *gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass = new TH3D("gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass",
-                                                                   "Accepted secondary protons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
+                                                                   "Accepted secondary protons;#eta;#phi;N_{points}(TPC)",
                                                                    fNBinsY,fMinY,fMaxY,
                                                                    100,0,360,
                                                                    100,0,200);
@@ -1486,7 +1774,7 @@ void AliProtonQAAnalysis::InitCutLists() {
   gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass->GetXaxis()->SetTitleColor(1);
   fAcceptedCutList->Add(gHistEtaPhiTPCdEdxNPointsSecondaryProtonsPass);//eta-phi of secondary accepted ESD protons
   TH3D *gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass = new TH3D("gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsPass",
-                                                                       "Accepted secondary antiprotons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
+                                                                       "Accepted secondary antiprotons;#eta;#phi;N_{points}(TPC)",
                                                                        fNBinsY,fMinY,fMaxY,
                                                                        100,0,360,
                                                                        100,0,200);
@@ -1581,7 +1869,7 @@ void AliProtonQAAnalysis::InitCutLists() {
   fRejectedCutList->Add(gHistEtaPhiChi2PerTPCClusterSecondaryAntiProtonsReject);//eta-phi of secondary rejected ESD antiprotons
   //eta-phi-number of TPC points for the dE/dx
   TH3D *gHistEtaPhiTPCdEdxNPointsPrimaryProtonsReject = new TH3D("gHistEtaPhiTPCdEdxNPointsPrimaryProtonsReject",
-                                                                 "Rejected primary protons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
+                                                                 "Rejected primary protons;#eta;#phi;N_{points}(TPC)",
                                                                  fNBinsY,fMinY,fMaxY,
                                                                  100,0,360,
                                                                  100,0,200);
@@ -1589,7 +1877,7 @@ void AliProtonQAAnalysis::InitCutLists() {
   gHistEtaPhiTPCdEdxNPointsPrimaryProtonsReject->GetXaxis()->SetTitleColor(1);
   fRejectedCutList->Add(gHistEtaPhiTPCdEdxNPointsPrimaryProtonsReject);//eta-phi of primary rejected ESD protons
   TH3D *gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsReject = new TH3D("gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsReject",
-                                                                     "Rejected primary antiprotons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
+                                                                     "Rejected primary antiprotons;#eta;#phi;N_{points}(TPC)",
                                                                      fNBinsY,fMinY,fMaxY,
                                                                      100,0,360,
                                                                      100,0,200);
@@ -1597,7 +1885,7 @@ void AliProtonQAAnalysis::InitCutLists() {
   gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsReject->GetXaxis()->SetTitleColor(1);
   fRejectedCutList->Add(gHistEtaPhiTPCdEdxNPointsPrimaryAntiProtonsReject);//eta-phi of primary rejected ESD antiprotons
   TH3D *gHistEtaPhiTPCdEdxNPointsSecondaryProtonsReject = new TH3D("gHistEtaPhiTPCdEdxNPointsSecondaryProtonsReject",
-                                                                   "Rejected secondary protons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
+                                                                   "Rejected secondary protons;#eta;#phi;N_{points}(TPC)",
                                                                    fNBinsY,fMinY,fMaxY,
                                                                    100,0,360,
                                                                    100,0,200);
@@ -1605,7 +1893,7 @@ void AliProtonQAAnalysis::InitCutLists() {
   gHistEtaPhiTPCdEdxNPointsSecondaryProtonsReject->GetXaxis()->SetTitleColor(1);
   fRejectedCutList->Add(gHistEtaPhiTPCdEdxNPointsSecondaryProtonsReject);//eta-phi of secondary rejected ESD protons
   TH3D *gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsReject = new TH3D("gHistEtaPhiTPCdEdxNPointsSecondaryAntiProtonsReject",
-                                                                       "Rejected secondary antiprotons;#eta;#phi;#chi^{2}/N_{clusters}(TPC)",
+                                                                       "Rejected secondary antiprotons;#eta;#phi;N_{points}(TPC)",
                                                                        fNBinsY,fMinY,fMaxY,
                                                                        100,0,360,
                                                                        100,0,200);
@@ -1666,6 +1954,92 @@ void AliProtonQAAnalysis::InitCutLists() {
                                                      100,0,10);
   fAcceptedDCAList->Add(gSecondaryAntiProtonsSigmaToVertex);
 
+  //3D DCA vs pT plots
+  TH3F *gHistPrimaryProtonsDCAxyEtaPt = new TH3F("gHistPrimaryProtonsDCAxyEtaPt",
+                                                ";#eta;P_{T} [GeV/c];dca_{xy} [cm]",
+                                                9,-0.9,0.9,
+                                                6,0.45,1.05,
+                                                100,0,10);
+  gHistPrimaryProtonsDCAxyEtaPt->SetStats(kFALSE);
+  fAcceptedDCAList->Add(gHistPrimaryProtonsDCAxyEtaPt);
+  TH3F *gHistPrimaryAntiProtonsDCAxyEtaPt = new TH3F("gHistPrimaryAntiProtonsDCAxyEtaPt",
+                                                    ";#eta;P_{T} [GeV/c];dca_{xy} [cm]",
+                                                    9,-0.9,0.9,
+                                                    6,0.45,1.05,
+                                                    100,0,10);
+  gHistPrimaryAntiProtonsDCAxyEtaPt->SetStats(kFALSE);
+  fAcceptedDCAList->Add(gHistPrimaryAntiProtonsDCAxyEtaPt);
+  TH3F *gHistSecondaryProtonsFromWeakDCAxyEtaPt = new TH3F("gHistSecondaryProtonsFromWeakDCAxyEtaPt",
+                                                          ";#eta;P_{T} [GeV/c];dca_{xy} [cm]",
+                                                          9,-0.9,0.9,
+                                                          6,0.45,1.05,
+                                                          100,0,10);
+  gHistSecondaryProtonsFromWeakDCAxyEtaPt->SetStats(kFALSE);
+  fAcceptedDCAList->Add(gHistSecondaryProtonsFromWeakDCAxyEtaPt);
+  TH3F *gHistSecondaryAntiProtonsFromWeakDCAxyEtaPt = new TH3F("gHistSecondaryAntiProtonsFromWeakDCAxyEtaPt",
+                                                              ";#eta;P_{T} [GeV/c];dca_{xy} [cm]",
+                                                              9,-0.9,0.9,
+                                                              6,0.45,1.05,
+                                                              100,0,10);
+  gHistSecondaryAntiProtonsFromWeakDCAxyEtaPt->SetStats(kFALSE);
+  fAcceptedDCAList->Add(gHistSecondaryAntiProtonsFromWeakDCAxyEtaPt);
+  TH3F *gHistSecondaryProtonsFromHadronicDCAxyEtaPt = new TH3F("gHistSecondaryProtonsFromHadronicDCAxyEtaPt",
+                                                              ";#eta;P_{T} [GeV/c];dca_{xy} [cm]",
+                                                              9,-0.9,0.9,
+                                                              6,0.45,1.05,
+                                                              100,0,10);
+  gHistSecondaryProtonsFromHadronicDCAxyEtaPt->SetStats(kFALSE);
+  fAcceptedDCAList->Add(gHistSecondaryProtonsFromHadronicDCAxyEtaPt);
+  TH3F *gHistSecondaryAntiProtonsFromHadronicDCAxyEtaPt = new TH3F("gHistSecondaryAntiProtonsFromHadronicDCAxyEtaPt",
+                                                                  ";#eta;P_{T} [GeV/c];dca_{xy} [cm]",
+                                                                  9,-0.9,0.9,
+                                                                  6,0.45,1.05,
+                                                                  100,0,10);
+  gHistSecondaryAntiProtonsFromHadronicDCAxyEtaPt->SetStats(kFALSE);
+  fAcceptedDCAList->Add(gHistSecondaryAntiProtonsFromHadronicDCAxyEtaPt);
+  
+  TH3F *gHistPrimaryProtonsDCAzEtaPt = new TH3F("gHistPrimaryProtonsDCAzEtaPt",
+                                               ";#eta;P_{T} [GeV/c];dca_{z} [cm]",
+                                               9,-0.9,0.9,
+                                               6,0.45,1.05,
+                                               100,0,10);
+  gHistPrimaryProtonsDCAzEtaPt->SetStats(kFALSE);
+  fAcceptedDCAList->Add(gHistPrimaryProtonsDCAzEtaPt);
+  TH3F *gHistPrimaryAntiProtonsDCAzEtaPt = new TH3F("gHistPrimaryAntiProtonsDCAzEtaPt",
+                                                   ";#eta;P_{T} [GeV/c];dca_{z} [cm]",
+                                                   9,-0.9,0.9,
+                                                   6,0.45,1.05,
+                                                   100,0,10);
+  gHistPrimaryAntiProtonsDCAzEtaPt->SetStats(kFALSE);
+  fAcceptedDCAList->Add(gHistPrimaryAntiProtonsDCAzEtaPt);
+  TH3F *gHistSecondaryProtonsFromWeakDCAzEtaPt = new TH3F("gHistSecondaryProtonsFromWeakDCAzEtaPt",
+                                                         ";#eta;P_{T} [GeV/c];dca_{z} [cm]",
+                                                         9,-0.9,0.9,
+                                                         6,0.45,1.05,
+                                                         100,0,10);
+  gHistSecondaryProtonsFromWeakDCAzEtaPt->SetStats(kFALSE);
+  fAcceptedDCAList->Add(gHistSecondaryProtonsFromWeakDCAzEtaPt);
+  TH3F *gHistSecondaryAntiProtonsFromWeakDCAzEtaPt = new TH3F("gHistSecondaryAntiProtonsFromWeakDCAzEtaPt",
+                                                             ";#eta;P_{T} [GeV/c];dca_{z} [cm]",
+                                                             9,-0.9,0.9,
+                                                             6,0.45,1.05,
+                                                             100,0,10);
+  gHistSecondaryAntiProtonsFromWeakDCAzEtaPt->SetStats(kFALSE);
+  fAcceptedDCAList->Add(gHistSecondaryAntiProtonsFromWeakDCAzEtaPt);
+  TH3F *gHistSecondaryProtonsFromHadronicDCAzEtaPt = new TH3F("gHistSecondaryProtonsFromHadronicDCAzEtaPt",
+                                                             ";#eta;P_{T} [GeV/c];dca_{z} [cm]",
+                                                             9,-0.9,0.9,
+                                                             6,0.45,1.05,
+                                                             100,0,10);
+  gHistSecondaryProtonsFromHadronicDCAzEtaPt->SetStats(kFALSE);
+  fAcceptedDCAList->Add(gHistSecondaryProtonsFromHadronicDCAzEtaPt);
+  TH3F *gHistSecondaryAntiProtonsFromHadronicDCAzEtaPt = new TH3F("gHistSecondaryAntiProtonsFromHadronicDCAzEtaPt",
+                                                                 ";#eta;P_{T} [GeV/c];dca_{z} [cm]",
+                                                                 9,-0.9,0.9,
+                                                                 6,0.45,1.05,
+                                                                 100,0,10);
+  gHistSecondaryAntiProtonsFromHadronicDCAzEtaPt->SetStats(kFALSE);
+  fAcceptedDCAList->Add(gHistSecondaryAntiProtonsFromHadronicDCAzEtaPt);
 }
 
 //____________________________________________________________________//
@@ -1835,10 +2209,16 @@ void AliProtonQAAnalysis::InitQA() {
   //2D histograms
   //TDirectory *dir2D = gDirectory->mkdir("2D");
   //fGlobalQAList->Add(dir2D); dir2D->cd();
-  TH2D *gHistYPtPrimaryProtonsPass = new TH2D("gHistYPtPrimaryProtonsPass",
-                                             ";;P_{T} [GeV/c]",
-                                             fNBinsY,fMinY,fMaxY,
-                                             fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistYPtPrimaryProtonsPass = 0x0;
+  if(fUseAsymmetricBinning)
+  gHistYPtPrimaryProtonsPass = new TH2D("gHistYPtPrimaryProtonsPass",
+                                       ";;P_{T} [GeV/c]",
+                                       fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistYPtPrimaryProtonsPass = new TH2D("gHistYPtPrimaryProtonsPass",
+                                         ";;P_{T} [GeV/c]",
+                                         fNBinsY,fMinY,fMaxY,
+                                         fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtPrimaryProtonsPass->GetXaxis()->SetTitle("#eta");
   else 
@@ -1846,10 +2226,16 @@ void AliProtonQAAnalysis::InitQA() {
   gHistYPtPrimaryProtonsPass->SetStats(kTRUE);
   gHistYPtPrimaryProtonsPass->GetXaxis()->SetTitleColor(1);
   fQA2DList->Add(gHistYPtPrimaryProtonsPass);//y-pT of primary accepted ESD protons
-  TH2D *gHistYPtPrimaryProtonsReject = new TH2D("gHistYPtPrimaryProtonsReject",
-                                               ";;P_{T} [GeV/c]",
-                                               fNBinsY,fMinY,fMaxY,
-                                               fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistYPtPrimaryProtonsReject = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistYPtPrimaryProtonsReject = new TH2D("gHistYPtPrimaryProtonsReject",
+                                           ";;P_{T} [GeV/c]",
+                                           fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistYPtPrimaryProtonsReject = new TH2D("gHistYPtPrimaryProtonsReject",
+                                           ";;P_{T} [GeV/c]",
+                                           fNBinsY,fMinY,fMaxY,
+                                           fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtPrimaryProtonsReject->GetXaxis()->SetTitle("#eta");
   else 
@@ -1858,10 +2244,16 @@ void AliProtonQAAnalysis::InitQA() {
   gHistYPtPrimaryProtonsReject->GetXaxis()->SetTitleColor(1);
   fQA2DList->Add(gHistYPtPrimaryProtonsReject);//y-pT of primary rejected ESD protons
 
-  TH2D *gHistYPtSecondaryProtonsPass = new TH2D("gHistYPtSecondaryProtonsPass",
-                                               ";;P_{T} [GeV/c]",
-                                               fNBinsY,fMinY,fMaxY,
-                                               fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistYPtSecondaryProtonsPass = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistYPtSecondaryProtonsPass = new TH2D("gHistYPtSecondaryProtonsPass",
+                                           ";;P_{T} [GeV/c]",
+                                           fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistYPtSecondaryProtonsPass = new TH2D("gHistYPtSecondaryProtonsPass",
+                                           ";;P_{T} [GeV/c]",
+                                           fNBinsY,fMinY,fMaxY,
+                                           fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtSecondaryProtonsPass->GetXaxis()->SetTitle("#eta");
   else 
@@ -1869,10 +2261,16 @@ void AliProtonQAAnalysis::InitQA() {
   gHistYPtSecondaryProtonsPass->SetStats(kTRUE);
   gHistYPtSecondaryProtonsPass->GetXaxis()->SetTitleColor(1);
   fQA2DList->Add(gHistYPtSecondaryProtonsPass);//y-pT of secondary accepted ESD protons
-  TH2D *gHistYPtSecondaryProtonsReject = new TH2D("gHistYPtSecondaryProtonsReject",
-                                                 ";;P_{T} [GeV/c]",
-                                                 fNBinsY,fMinY,fMaxY,
-                                                 fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistYPtSecondaryProtonsReject = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistYPtSecondaryProtonsReject = new TH2D("gHistYPtSecondaryProtonsReject",
+                                             ";;P_{T} [GeV/c]",
+                                             fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistYPtSecondaryProtonsReject = new TH2D("gHistYPtSecondaryProtonsReject",
+                                             ";;P_{T} [GeV/c]",
+                                             fNBinsY,fMinY,fMaxY,
+                                             fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtSecondaryProtonsReject->GetXaxis()->SetTitle("#eta");
   else 
@@ -1881,10 +2279,16 @@ void AliProtonQAAnalysis::InitQA() {
   gHistYPtSecondaryProtonsReject->GetXaxis()->SetTitleColor(1);
   fQA2DList->Add(gHistYPtSecondaryProtonsReject);//y-pT of secondary rejected ESD protons
 
-  TH2D *gHistYPtPrimaryAntiProtonsPass = new TH2D("gHistYPtPrimaryAntiProtonsPass",
-                                                 ";;P_{T} [GeV/c]",
-                                                 fNBinsY,fMinY,fMaxY,
-                                                 fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistYPtPrimaryAntiProtonsPass = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistYPtPrimaryAntiProtonsPass = new TH2D("gHistYPtPrimaryAntiProtonsPass",
+                                             ";;P_{T} [GeV/c]",
+                                             fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistYPtPrimaryAntiProtonsPass = new TH2D("gHistYPtPrimaryAntiProtonsPass",
+                                             ";;P_{T} [GeV/c]",
+                                             fNBinsY,fMinY,fMaxY,
+                                             fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtPrimaryAntiProtonsPass->GetXaxis()->SetTitle("#eta");
   else 
@@ -1892,10 +2296,16 @@ void AliProtonQAAnalysis::InitQA() {
   gHistYPtPrimaryAntiProtonsPass->SetStats(kTRUE);
   gHistYPtPrimaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
   fQA2DList->Add(gHistYPtPrimaryAntiProtonsPass);//y-pT of primary accepted ESD antiprotons
-  TH2D *gHistYPtPrimaryAntiProtonsReject = new TH2D("gHistYPtPrimaryAntiProtonsReject",
-                                                   ";;P_{T} [GeV/c]",
-                                                   fNBinsY,fMinY,fMaxY,
-                                                   fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistYPtPrimaryAntiProtonsReject = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistYPtPrimaryAntiProtonsReject = new TH2D("gHistYPtPrimaryAntiProtonsReject",
+                                               ";;P_{T} [GeV/c]",
+                                               fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistYPtPrimaryAntiProtonsReject = new TH2D("gHistYPtPrimaryAntiProtonsReject",
+                                               ";;P_{T} [GeV/c]",
+                                               fNBinsY,fMinY,fMaxY,
+                                               fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtPrimaryAntiProtonsReject->GetXaxis()->SetTitle("#eta");
   else 
@@ -1904,10 +2314,16 @@ void AliProtonQAAnalysis::InitQA() {
   gHistYPtPrimaryAntiProtonsReject->GetXaxis()->SetTitleColor(1);
   fQA2DList->Add(gHistYPtPrimaryAntiProtonsReject);//y-pT of primary rejected ESD antiprotons
 
-  TH2D *gHistYPtSecondaryAntiProtonsPass = new TH2D("gHistYPtSecondaryAntiProtonsPass",
-                                                   ";;P_{T} [GeV/c]",
-                                                   fNBinsY,fMinY,fMaxY,
-                                                   fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistYPtSecondaryAntiProtonsPass = 0x0;
+  if(fUseAsymmetricBinning)
+  gHistYPtSecondaryAntiProtonsPass = new TH2D("gHistYPtSecondaryAntiProtonsPass",
+                                             ";;P_{T} [GeV/c]",
+                                             fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistYPtSecondaryAntiProtonsPass = new TH2D("gHistYPtSecondaryAntiProtonsPass",
+                                               ";;P_{T} [GeV/c]",
+                                               fNBinsY,fMinY,fMaxY,
+                                               fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtSecondaryAntiProtonsPass->GetXaxis()->SetTitle("#eta");
   else 
@@ -1915,10 +2331,16 @@ void AliProtonQAAnalysis::InitQA() {
   gHistYPtSecondaryAntiProtonsPass->SetStats(kTRUE);
   gHistYPtSecondaryAntiProtonsPass->GetXaxis()->SetTitleColor(1);
   fQA2DList->Add(gHistYPtSecondaryAntiProtonsPass);//y-pT of secondary accepted ESD antiprotons
-  TH2D *gHistYPtSecondaryAntiProtonsReject = new TH2D("gHistYPtSecondaryAntiProtonsReject",
-                                                     ";;P_{T} [GeV/c]",
-                                                     fNBinsY,fMinY,fMaxY,
-                                                     fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistYPtSecondaryAntiProtonsReject = 0x0;
+  if(fUseAsymmetricBinning)
+  gHistYPtSecondaryAntiProtonsReject = new TH2D("gHistYPtSecondaryAntiProtonsReject",
+                                               ";;P_{T} [GeV/c]",
+                                               fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistYPtSecondaryAntiProtonsReject = new TH2D("gHistYPtSecondaryAntiProtonsReject",
+                                                 ";;P_{T} [GeV/c]",
+                                                 fNBinsY,fMinY,fMaxY,
+                                                 fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtSecondaryAntiProtonsReject->GetXaxis()->SetTitle("#eta");
   else 
@@ -1927,10 +2349,16 @@ void AliProtonQAAnalysis::InitQA() {
   gHistYPtSecondaryAntiProtonsReject->GetXaxis()->SetTitleColor(1);
   fQA2DList->Add(gHistYPtSecondaryAntiProtonsReject);//y-pT of secondary rejected ESD antiprotons
 
-  TH2D *gHistYPtPrimaryProtonsMC = new TH2D("gHistYPtPrimaryProtonsMC",
-                                           ";;P_{T} [GeV/c]",
-                                           fNBinsY,fMinY,fMaxY,
-                                           fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistYPtPrimaryProtonsMC = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistYPtPrimaryProtonsMC = new TH2D("gHistYPtPrimaryProtonsMC",
+                                       ";;P_{T} [GeV/c]",
+                                       fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistYPtPrimaryProtonsMC = new TH2D("gHistYPtPrimaryProtonsMC",
+                                       ";;P_{T} [GeV/c]",
+                                       fNBinsY,fMinY,fMaxY,
+                                       fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtPrimaryProtonsMC->GetXaxis()->SetTitle("#eta");
   else 
@@ -1938,10 +2366,16 @@ void AliProtonQAAnalysis::InitQA() {
   gHistYPtPrimaryProtonsMC->SetStats(kTRUE);
   gHistYPtPrimaryProtonsMC->GetXaxis()->SetTitleColor(1);
   fQA2DList->Add(gHistYPtPrimaryProtonsMC);//y-pT of primary MC protons
-  TH2D *gHistYPtPrimaryAntiProtonsMC = new TH2D("gHistYPtPrimaryAntiProtonsMC",
-                                               ";;P_{T} [GeV/c]",
-                                               fNBinsY,fMinY,fMaxY,
-                                               fNBinsPt,fMinPt,fMaxPt);
+  TH2D *gHistYPtPrimaryAntiProtonsMC = 0x0;
+  if(fUseAsymmetricBinning)
+    gHistYPtPrimaryAntiProtonsMC = new TH2D("gHistYPtPrimaryAntiProtonsMC",
+                                           ";;P_{T} [GeV/c]",
+                                           fNBinsY,fY,fNBinsPt,fPt);
+  else
+    gHistYPtPrimaryAntiProtonsMC = new TH2D("gHistYPtPrimaryAntiProtonsMC",
+                                           ";;P_{T} [GeV/c]",
+                                           fNBinsY,fMinY,fMaxY,
+                                           fNBinsPt,fMinPt,fMaxPt);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtPrimaryAntiProtonsMC->GetXaxis()->SetTitle("#eta");
   else 
@@ -1950,21 +2384,37 @@ void AliProtonQAAnalysis::InitQA() {
   gHistYPtPrimaryAntiProtonsMC->GetXaxis()->SetTitleColor(1);
   fQA2DList->Add(gHistYPtPrimaryAntiProtonsMC);//y-pT of primary MC antiprotons
 
-  TH3F *gHistYPtPDGProtonsPass = new TH3F("gHistYPtPDGProtonsPass",
-                                         ";;P_{T} [GeV/c];PDG",
-                                         fNBinsY,fMinY,fMaxY,
-                                         fNBinsPt,fMinPt,fMaxPt,
-                                         14,-0.5,13.5);
+  TH3F *gHistYPtPDGProtonsPass = 0x0;
+  if(fUseAsymmetricBinning) {
+    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};
+    gHistYPtPDGProtonsPass = new TH3F("gHistYPtPDGProtonsPass",
+                                     ";;P_{T} [GeV/c];PDG",
+                                     fNBinsY,fY,fNBinsPt,fPt,14,gPDG);
+  }
+  else
+    gHistYPtPDGProtonsPass = new TH3F("gHistYPtPDGProtonsPass",
+                                     ";;P_{T} [GeV/c];PDG",
+                                     fNBinsY,fMinY,fMaxY,
+                                     fNBinsPt,fMinPt,fMaxPt,
+                                     14,-0.5,13.5);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtPDGProtonsPass->GetXaxis()->SetTitle("#eta");
   else 
     gHistYPtPDGProtonsPass->GetXaxis()->SetTitle("y");
   fQA2DList->Add(gHistYPtPDGProtonsPass);//composition of secondary protons
-  TH3F *gHistYPtPDGAntiProtonsPass = new TH3F("gHistYPtPDGAntiProtonsPass",
-                                             ";;P_{T} [GeV/c];PDG",
-                                             fNBinsY,fMinY,fMaxY,
-                                             fNBinsPt,fMinPt,fMaxPt,
-                                             14,-0.5,13.5);
+  TH3F *gHistYPtPDGAntiProtonsPass = 0x0;
+  if(fUseAsymmetricBinning) {
+    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};
+    gHistYPtPDGAntiProtonsPass = new TH3F("gHistYPtPDGAntiProtonsPass",
+                                         ";;P_{T} [GeV/c];PDG",
+                                         fNBinsY,fY,fNBinsPt,fPt,14,gPDG);
+  }
+  else
+    gHistYPtPDGAntiProtonsPass = new TH3F("gHistYPtPDGAntiProtonsPass",
+                                         ";;P_{T} [GeV/c];PDG",
+                                         fNBinsY,fMinY,fMaxY,
+                                         fNBinsPt,fMinPt,fMaxPt,
+                                         14,-0.5,13.5);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtPDGAntiProtonsPass->GetXaxis()->SetTitle("#eta");
   else 
@@ -2181,7 +2631,6 @@ void AliProtonQAAnalysis::InitQA() {
   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsPointOnITSLayer6Reject);
   TH1F *gPrimaryProtonsNumberOfTPCdEdxPointsReject = new TH1F("gPrimaryProtonsNumberOfTPCdEdxPointsReject","",100,0,200);
   fQAPrimaryProtonsRejectedList->Add(gPrimaryProtonsNumberOfTPCdEdxPointsReject);
-
   //________________________________________________________________//
   /*gDirectory->cd("../../");
 
@@ -2499,7 +2948,19 @@ void AliProtonQAAnalysis::InitQA() {
   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsPointOnITSLayer6Pass);
   TH1F *gPrimaryAntiProtonsNumberOfTPCdEdxPointsPass = new TH1F("gPrimaryAntiProtonsNumberOfTPCdEdxPointsPass","",100,0,200);
   fQAPrimaryAntiProtonsAcceptedList->Add(gPrimaryAntiProtonsNumberOfTPCdEdxPointsPass);
-  
+  /*TH2F *gHistPrimaryAntiProtonsDCAxyPtPass = new TH2F("gHistPrimaryAntiProtonsDCAxyPtPass",
+                                                     ";P_{T} [GeV/c];dca_{xy} [cm]",
+                                                     16,0.3,1.1,
+                                                     1000,0,10);
+  gHistPrimaryAntiProtonsDCAxyPtPass->SetStats(kFALSE);
+  fQAPrimaryAntiProtonsAcceptedList->Add(gHistPrimaryAntiProtonsDCAxyPtPass);
+  TH2F *gHistPrimaryAntiProtonsDCAzPtPass = new TH2F("gHistPrimaryAntiProtonsDCAzPtPass",
+                                                    ";P_{T} [GeV/c];dca_{z} [cm]",
+                                                    16,0.3,1.1,
+                                                    1000,0,10);
+  gHistPrimaryAntiProtonsDCAzPtPass->SetStats(kFALSE);
+  fQAPrimaryAntiProtonsAcceptedList->Add(gHistPrimaryAntiProtonsDCAzPtPass);*/
+
   //Rejected primary antiprotons
   /*gDirectory->cd("../");
   TDirectory *dirAntiProtonsPrimaryRejected = gDirectory->mkdir("Rejected");
@@ -2601,6 +3062,18 @@ void AliProtonQAAnalysis::InitQA() {
   fQAPrimaryAntiProtonsRejectedList->Add(gPrimaryAntiProtonsPointOnITSLayer6Reject);
   TH1F *gPrimaryAntiProtonsNumberOfTPCdEdxPointsReject = new TH1F("gPrimaryAntiProtonsNumberOfTPCdEdxPointsReject","",100,0,200);
   fQAPrimaryAntiProtonsRejectedList->Add(gPrimaryAntiProtonsNumberOfTPCdEdxPointsReject);
+  /*TH2F *gHistPrimaryAntiProtonsDCAxyPtReject = new TH2F("gHistPrimaryAntiProtonsDCAxyPtReject",
+                                                       ";P_{T} [GeV/c];dca_{xy} [cm]",
+                                                       16,0.3,1.1,
+                                                       1000,0,10);
+  gHistPrimaryAntiProtonsDCAxyPtReject->SetStats(kFALSE);
+  fQAPrimaryAntiProtonsRejectedList->Add(gHistPrimaryAntiProtonsDCAxyPtReject);
+  TH2F *gHistPrimaryAntiProtonsDCAzPtReject = new TH2F("gHistPrimaryAntiProtonsDCAzPtReject",
+                                                      ";P_{T} [GeV/c];dca_{z} [cm]",
+                                                      16,0.3,1.1,
+                                                      1000,0,10);
+  gHistPrimaryAntiProtonsDCAzPtReject->SetStats(kFALSE);
+  fQAPrimaryAntiProtonsRejectedList->Add(gHistPrimaryAntiProtonsDCAzPtReject);*/
   
   //________________________________________________________________//
   /*gDirectory->cd("../../");
@@ -2707,7 +3180,31 @@ void AliProtonQAAnalysis::InitQA() {
   fQASecondaryAntiProtonsAcceptedList->Add(gSecondaryAntiProtonsPointOnITSLayer6Pass);
   TH1F *gSecondaryAntiProtonsNumberOfTPCdEdxPointsPass = new TH1F("gSecondaryAntiProtonsNumberOfTPCdEdxPointsPass","",100,0,200);
   fQASecondaryAntiProtonsAcceptedList->Add(gSecondaryAntiProtonsNumberOfTPCdEdxPointsPass);
-
+  /*TH2F *gHistSecondaryAntiProtonsFromWeakDCAxyPtPass = new TH2F("gHistSecondaryAntiProtonsFromWeakDCAxyPtPass",
+                                                               ";P_{T} [GeV/c];dca_{xy} [cm]",
+                                                               16,0.3,1.1,
+                                                               1000,0,10);
+  gHistSecondaryAntiProtonsFromWeakDCAxyPtPass->SetStats(kFALSE);
+  fQASecondaryAntiProtonsAcceptedList->Add(gHistSecondaryAntiProtonsFromWeakDCAxyPtPass);
+  TH2F *gHistSecondaryAntiProtonsFromWeakDCAzPtPass = new TH2F("gHistSecondaryAntiProtonsFromWeakDCAzPtPass",
+                                                              ";P_{T} [GeV/c];dca_{z} [cm]",
+                                                              16,0.3,1.1,
+                                                              1000,0,10);
+  gHistSecondaryAntiProtonsFromWeakDCAzPtPass->SetStats(kFALSE);
+  fQASecondaryAntiProtonsAcceptedList->Add(gHistSecondaryAntiProtonsFromWeakDCAzPtPass);
+  TH2F *gHistSecondaryAntiProtonsFromHadronicDCAxyPtPass = new TH2F("gHistSecondaryAntiProtonsFromHadronicDCAxyPtPass",
+                                                                   ";P_{T} [GeV/c];dca_{xy} [cm]",
+                                                                   16,0.3,1.1,
+                                                                   1000,0,10);
+  gHistSecondaryAntiProtonsFromHadronicDCAxyPtPass->SetStats(kFALSE);
+  fQASecondaryAntiProtonsAcceptedList->Add(gHistSecondaryAntiProtonsFromHadronicDCAxyPtPass);
+  TH2F *gHistSecondaryAntiProtonsFromHadronicDCAzPtPass = new TH2F("gHistSecondaryAntiProtonsFromHadronicDCAzPtPass",
+                                                                  ";P_{T} [GeV/c];dca_{z} [cm]",
+                                                                  16,0.3,1.1,
+                                                                  1000,0,10);
+  gHistSecondaryAntiProtonsFromHadronicDCAzPtPass->SetStats(kFALSE);
+  fQASecondaryAntiProtonsAcceptedList->Add(gHistSecondaryAntiProtonsFromHadronicDCAzPtPass);*/
+  
   //Rejected secondary antiprotons
   /*gDirectory->cd("../");
   TDirectory *dirAntiProtonsSecondaryRejected = gDirectory->mkdir("Rejected");
@@ -2809,6 +3306,30 @@ void AliProtonQAAnalysis::InitQA() {
   fQASecondaryAntiProtonsRejectedList->Add(gSecondaryAntiProtonsPointOnITSLayer6Reject);
   TH1F *gSecondaryAntiProtonsNumberOfTPCdEdxPointsReject = new TH1F("gSecondaryAntiProtonsNumberOfTPCdEdxPointsReject","",100,0,200);
   fQASecondaryAntiProtonsRejectedList->Add(gSecondaryAntiProtonsNumberOfTPCdEdxPointsReject);
+  /*TH2F *gHistSecondaryAntiProtonsFromWeakDCAxyPtReject = new TH2F("gHistSecondaryAntiProtonsFromWeakDCAxyPtReject",
+                                                                 ";P_{T} [GeV/c];dca_{xy} [cm]",
+                                                                 16,0.3,1.1,
+                                                                 1000,0,10);
+  gHistSecondaryAntiProtonsFromWeakDCAxyPtReject->SetStats(kFALSE);
+  fQASecondaryAntiProtonsRejectedList->Add(gHistSecondaryAntiProtonsFromWeakDCAxyPtReject);
+  TH2F *gHistSecondaryAntiProtonsFromWeakDCAzPtReject = new TH2F("gHistSecondaryAntiProtonsFromWeakDCAzPtReject",
+                                                                ";P_{T} [GeV/c];dca_{z} [cm]",
+                                                                16,0.3,1.1,
+                                                                1000,0,10);
+  gHistSecondaryAntiProtonsFromWeakDCAzPtReject->SetStats(kFALSE);
+  fQASecondaryAntiProtonsRejectedList->Add(gHistSecondaryAntiProtonsFromWeakDCAzPtReject);
+  TH2F *gHistSecondaryAntiProtonsFromHadronicDCAxyPtReject = new TH2F("gHistSecondaryAntiProtonsFromHadronicDCAxyPtReject",
+                                                                     ";P_{T} [GeV/c];dca_{xy} [cm]",
+                                                                     16,0.3,1.1,
+                                                                     1000,0,10);
+  gHistSecondaryAntiProtonsFromHadronicDCAxyPtReject->SetStats(kFALSE);
+  fQASecondaryAntiProtonsRejectedList->Add(gHistSecondaryAntiProtonsFromHadronicDCAxyPtReject);
+  TH2F *gHistSecondaryAntiProtonsFromHadronicDCAzPtReject = new TH2F("gHistSecondaryAntiProtonsFromHadronicDCAzPtReject",
+                                                                    ";P_{T} [GeV/c];dca_{z} [cm]",
+                                                                    16,0.3,1.1,
+                                                                    1000,0,10);
+  gHistSecondaryAntiProtonsFromHadronicDCAzPtReject->SetStats(kFALSE);
+  fQASecondaryAntiProtonsRejectedList->Add(gHistSecondaryAntiProtonsFromHadronicDCAzPtReject);*/
 }
 
 //____________________________________________________________________//
@@ -2823,11 +3344,15 @@ void AliProtonQAAnalysis::RunReconstructionEfficiencyAnalysis(AliMCEvent *const
   TArrayI labelMCArray(nMCParticles);
 
   for (Int_t iTracks = 0; iTracks < mcEvent->GetNumberOfTracks(); iTracks++) {
-    AliMCParticle *mcTrack = mcEvent->GetTrack(iTracks);
+    AliMCParticle *mcTrack = (AliMCParticle*) mcEvent->GetTrack(iTracks);
     if (!mcTrack) {
       Printf("ERROR: Could not receive track %d (mc loop)", iTracks);
       continue;
     }
+
+    Double_t vz = mcTrack->Zv();
+    if (TMath::Abs(vz) > 50.) continue;//exclude particles generated out of the acceptance
+
     if(TMath::Abs(mcTrack->Eta()) > 1.0) continue;//acceptance
     if((mcTrack->Pt() > fMaxPt)||(mcTrack->Pt() < fMinPt)) continue;
     if(fProtonAnalysisBase->GetEtaMode()) {
@@ -2851,7 +3376,7 @@ void AliProtonQAAnalysis::RunReconstructionEfficiencyAnalysis(AliMCEvent *const
     }
 
     //findable tracks
-    if (labelTPC) {
+    //if (labelTPC) {
       TParticle* particle = mcTrack->Particle();
       if(!particle) continue;
       Int_t pdgcode = particle->GetPdgCode();
@@ -2887,7 +3412,7 @@ void AliProtonQAAnalysis::RunReconstructionEfficiencyAnalysis(AliMCEvent *const
        Int_t lPartMother = -1;
        Int_t motherPDGCode = -1;
        lPartMother = particle->GetFirstMother();
-       AliMCParticle *mcMotherTrack = mcEvent->GetTrack(lPartMother);
+       AliMCParticle *mcMotherTrack = (AliMCParticle*) mcEvent->GetTrack(lPartMother);
        TParticle *motherParticle = mcMotherTrack->Particle();
        if(motherParticle) motherPDGCode = motherParticle->GetPdgCode();
        
@@ -2936,7 +3461,7 @@ void AliProtonQAAnalysis::RunReconstructionEfficiencyAnalysis(AliMCEvent *const
          }//hadronic interactions
        }//antiprotons
       }//secondaries
-    }//findable tracks
+      //}//findable tracks
   }//MC track loop
 
   //ESD track loop
@@ -2965,7 +3490,8 @@ void AliProtonQAAnalysis::RunReconstructionEfficiencyAnalysis(AliMCEvent *const
        
        if (mcLabel != TMath::Abs(label)) continue;
        if(mcLabel != label) continue;
-       
+       if(label > stack->GetNtrack()) continue;
+
        TParticle *particle = stack->Particle(label);
        if(!particle) continue;
        Int_t pdgcode = particle->GetPdgCode();
@@ -2977,9 +3503,10 @@ void AliProtonQAAnalysis::RunReconstructionEfficiencyAnalysis(AliMCEvent *const
        else 
          if((fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()) > fMaxY)||(fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()) < fMinY)) continue;
                
-       if(fUseCutsInEfficiency) 
-         if(!fProtonAnalysisBase->IsAccepted(esd,vertex,track)) continue;
-       
+       if(fUseCutsInEfficiency) {
+         if(!fProtonAnalysisBase->IsPrimary(esd,vertex,track)) continue;
+         if(!fProtonAnalysisBase->IsAccepted(track)) continue;
+       }       
        //reconstructed primary (anti)protons
        if(pdgcode == 2212) {
          if(label <= stack->GetNprimary()) {
@@ -3070,7 +3597,8 @@ void AliProtonQAAnalysis::RunReconstructionEfficiencyAnalysis(AliMCEvent *const
        
        if (mcLabel != TMath::Abs(label)) continue;
        if(mcLabel != label) continue;
-       
+       if(label > stack->GetNtrack()) continue;
+               
        TParticle *particle = stack->Particle(label);
        if(!particle) continue;
        Int_t pdgcode = particle->GetPdgCode();
@@ -3084,9 +3612,10 @@ void AliProtonQAAnalysis::RunReconstructionEfficiencyAnalysis(AliMCEvent *const
        
        //Double_t probability[5];
 
-       if(fUseCutsInEfficiency) 
-         if(!fProtonAnalysisBase->IsAccepted(esd,vertex,track)) continue;
-       
+       if(fUseCutsInEfficiency) {
+         if(!fProtonAnalysisBase->IsPrimary(esd,vertex,track)) continue;
+         if(!fProtonAnalysisBase->IsAccepted(track)) continue;
+       }       
        //reconstructed primary (anti)protons
        if(pdgcode == 2212) {
          if(label <= stack->GetNprimary()) {
@@ -3178,7 +3707,9 @@ void AliProtonQAAnalysis::RunReconstructionEfficiencyAnalysis(AliMCEvent *const
 
 //____________________________________________________________________//
 void AliProtonQAAnalysis::RunPIDEfficiencyAnalysis(AliStack *const stack, 
-                                                  AliESDEvent *esd) {
+                                                  AliESDEvent *esd,
+                                                  const AliESDVertex *vertex) {
+  //Runs the PID efficiency analysis
   Int_t nGoodTracks = esd->GetNumberOfTracks();
   TArrayI labelArray(nGoodTracks);
   Int_t labelCounter = 0;
@@ -3196,13 +3727,18 @@ void AliProtonQAAnalysis::RunPIDEfficiencyAnalysis(AliStack *const stack,
     if(IsLabelUsed(labelArray,label)) continue;
     labelArray.AddAt(label,labelCounter);
     labelCounter += 1;
-               
+    if(label > stack->GetNtrack()) continue;
+
     TParticle *particle = stack->Particle(label);
     if(!particle) continue;
     Int_t pdgcode = particle->GetPdgCode();
     
     Int_t nTPCpoints = track->GetTPCsignalN();
 
+    if(fUseCutsInEfficiency) {
+      if(!fProtonAnalysisBase->IsPrimary(esd,vertex,track)) continue;
+      if(!fProtonAnalysisBase->IsAccepted(track)) continue;
+    }  
     if(TMath::Abs(pdgcode) == 2212) {
       if(fProtonAnalysisBase->GetEtaMode())
        ((TH3D *)(fEfficiencyList->At(12)))->Fill(particle->Eta(),
@@ -3236,6 +3772,77 @@ void AliProtonQAAnalysis::RunPIDEfficiencyAnalysis(AliStack *const stack,
   labelArray.Reset();
 }
 
+//____________________________________________________________________//
+void AliProtonQAAnalysis::RunCutEfficiencyAnalysis(AliStack *const stack, 
+                                                  AliESDEvent *esd,
+                                                  const AliESDVertex *vertex) {
+  //Runs the cut efficiency analysis
+  Int_t nGoodTracks = esd->GetNumberOfTracks();
+  TArrayI labelArray(nGoodTracks);
+  Int_t labelCounter = 0;
+  Int_t nPrimaries = stack->GetNprimary();
+  for(Int_t iTracks = 0; iTracks < nGoodTracks; iTracks++) {
+    AliESDtrack* track = esd->GetTrack(iTracks);
+    if(!track) continue;
+    
+    //TPC only
+    if((fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kTPC)||(fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kHybrid)) {
+      AliExternalTrackParam *tpcTrack = (AliExternalTrackParam *)track->GetTPCInnerParam();
+      if(!tpcTrack) continue;
+    }
+       
+    Int_t label = TMath::Abs(track->GetLabel());
+    if(IsLabelUsed(labelArray,label)) continue;
+    labelArray.AddAt(label,labelCounter);
+    labelCounter += 1;
+    if(label > stack->GetNtrack()) continue;
+
+    TParticle *particle = stack->Particle(label);
+    if(!particle) continue;
+               
+    //select primaries
+    if(label > nPrimaries) continue;
+    //select identified protons
+    if(!fProtonAnalysisBase->IsProton(track)) continue;
+    if(track->Charge() > 0) {
+      if(fProtonAnalysisBase->GetEtaMode())
+       ((TH2F *)(fCutEfficiencyList->At(0)))->Fill(particle->Eta(),
+                                                   particle->Pt());
+      else
+       ((TH2F *)(fCutEfficiencyList->At(0)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()),particle->Pt());
+    }
+
+    if(track->Charge() < 0) {
+      if(fProtonAnalysisBase->GetEtaMode())
+       ((TH2F *)(fCutEfficiencyList->At(1)))->Fill(particle->Eta(),
+                                                   particle->Pt());
+      else
+       ((TH2F *)(fCutEfficiencyList->At(1)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()),particle->Pt());
+    }
+
+    //survived tracks
+    if(!fProtonAnalysisBase->IsPrimary(esd,vertex,track)) continue;
+    if(!fProtonAnalysisBase->IsAccepted(track)) continue;
+    if(track->Charge() > 0) {
+      if(fProtonAnalysisBase->GetEtaMode())
+       ((TH2F *)(fCutEfficiencyList->At(2)))->Fill(particle->Eta(),
+                                                   particle->Pt());
+      else
+       ((TH2F *)(fCutEfficiencyList->At(2)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()),particle->Pt());
+    }
+
+    if(track->Charge() < 0) {
+      if(fProtonAnalysisBase->GetEtaMode())
+       ((TH2F *)(fCutEfficiencyList->At(3)))->Fill(particle->Eta(),
+                                                   particle->Pt());
+      else
+       ((TH2F *)(fCutEfficiencyList->At(3)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()),particle->Pt());
+    }
+  }//ESD track loop
+  labelArray.Reset();
+}
+
 //____________________________________________________________________//
 void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack, 
                                                AliESDEvent *esd,
@@ -3276,8 +3883,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                   particle->Pt());
        else
          ((TH2D *)(fEfficiencyList->At(1)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                           particle->Py(),
-                                                           particle->Pz()),
+                                                                                particle->Py(),
+                                                                                particle->Pz()),
                                                   particle->Pt());
       }//antiprotons
     }//primaries
@@ -3296,8 +3903,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                     particle->Pt());
          else
            ((TH2D *)(fEfficiencyList->At(2)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                             particle->Py(),
-                                                             particle->Pz()),
+                                                                                  particle->Py(),
+                                                                                  particle->Pz()),
                                                     particle->Pt());
        }//weak decays
        if((particle->GetUniqueID() == 13)) {
@@ -3318,8 +3925,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                     particle->Pt());
          else
            ((TH2D *)(fEfficiencyList->At(3)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                             particle->Py(),
-                                                             particle->Pz()),
+                                                                                  particle->Py(),
+                                                                                  particle->Pz()),
                                                     particle->Pt());
        }//weak decays
        if((particle->GetUniqueID() == 13)) {
@@ -3349,7 +3956,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
     if(IsLabelUsed(labelArray,label)) continue;
     labelArray.AddAt(label,labelCounter);
     labelCounter += 1;
-    
+    if(label > stack->GetNtrack()) continue;
+
     TParticle *particle = stack->Particle(label);
     if(!particle) continue;
     Int_t pdgcode = particle->GetPdgCode();
@@ -3371,9 +3979,10 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
       else 
        if((fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()) > fMaxY)||(fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()) < fMinY)) continue;
       
-      if(fUseCutsInEfficiency) 
-       if(!fProtonAnalysisBase->IsAccepted(esd,vertex,track)) continue;
-      
+      if(fUseCutsInEfficiency) {
+       if(!fProtonAnalysisBase->IsPrimary(esd,vertex,track)) continue;
+       if(!fProtonAnalysisBase->IsAccepted(track)) continue;
+      }      
       //reconstructed primary (anti)protons
       if(pdgcode == 2212) {
        if(label <= stack->GetNprimary()) {
@@ -3383,8 +3992,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                     particle->Pt());
          else
            ((TH2D *)(fEfficiencyList->At(6)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                             particle->Py(),
-                                                             particle->Pz()),
+                                                                                  particle->Py(),
+                                                                                  particle->Pz()),
                                                     particle->Pt());
        }//primaries
        if(label > stack->GetNprimary()) {
@@ -3400,8 +4009,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                       particle->Pt());
            else
              ((TH2D *)(fEfficiencyList->At(8)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                               particle->Py(),
-                                                               particle->Pz()),
+                                                                                    particle->Py(),
+                                                                                    particle->Pz()),
                                                       particle->Pt());
          }//weak decays
          if((particle->GetUniqueID() == 13)) {
@@ -3410,8 +4019,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                        particle->Pt());
            else
              ((TH2D *)(fEfficiencyList->At(10)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                                particle->Py(),
-                                                                particle->Pz()),
+                                                                                     particle->Py(),
+                                                                                     particle->Pz()),
                                                        particle->Pt());
          }//hadronic interactions
        }//secondaries
@@ -3423,8 +4032,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                     particle->Pt());
          else
            ((TH2D *)(fEfficiencyList->At(7)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                             particle->Py(),
-                                                             particle->Pz()),
+                                                                                  particle->Py(),
+                                                                                  particle->Pz()),
                                                     particle->Pt());
        }//primaries
        if(label > stack->GetNprimary()) {
@@ -3440,8 +4049,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                       particle->Pt());
            else
              ((TH2D *)(fEfficiencyList->At(9)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                               particle->Py(),
-                                                               particle->Pz()),
+                                                                                    particle->Py(),
+                                                                                    particle->Pz()),
                                                       particle->Pt());
          }//weak decays
          if((particle->GetUniqueID() == 13)) {
@@ -3450,8 +4059,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                        particle->Pt());
            else
              ((TH2D *)(fEfficiencyList->At(11)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                                particle->Py(),
-                                                                particle->Pz()),
+                                                                                     particle->Py(),
+                                                                                     particle->Pz()),
                                                        particle->Pt());
          }//hadronic interactions
        }//secondaries
@@ -3466,9 +4075,10 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
        if((fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()) > fMaxY)||(fProtonAnalysisBase->Rapidity(particle->Px(),particle->Py(),particle->Pz()) < fMinY)) continue;
       }
       
-      if(fUseCutsInEfficiency) 
-       if(!fProtonAnalysisBase->IsAccepted(esd,vertex,track)) continue;
-      
+      if(fUseCutsInEfficiency) {
+       if(!fProtonAnalysisBase->IsPrimary(esd,vertex,track)) continue;
+       if(!fProtonAnalysisBase->IsAccepted(track)) continue;
+      }      
       //reconstructed primary (anti)protons
       if(pdgcode == 2212) {
        if(label <= stack->GetNprimary()) {
@@ -3478,8 +4088,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                     particle->Pt());
          else
            ((TH2D *)(fEfficiencyList->At(6)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                             particle->Py(),
-                                                             particle->Pz()),
+                                                                                  particle->Py(),
+                                                                                  particle->Pz()),
                                                     particle->Pt());
        }//primaries
        if(label > stack->GetNprimary()) {
@@ -3495,8 +4105,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                       particle->Pt());
            else
              ((TH2D *)(fEfficiencyList->At(8)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                               particle->Py(),
-                                                               particle->Pz()),
+                                                                                    particle->Py(),
+                                                                                    particle->Pz()),
                                                       particle->Pt());
          }//weak decays
          if((particle->GetUniqueID() == 13)) {
@@ -3505,8 +4115,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                        particle->Pt());
            else
              ((TH2D *)(fEfficiencyList->At(10)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                                particle->Py(),
-                                                                particle->Pz()),
+                                                                                     particle->Py(),
+                                                                                     particle->Pz()),
                                                        particle->Pt());
          }//hadronic interactions
        }//secondaries
@@ -3517,8 +4127,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                    particle->Pt());
        else
          ((TH2D *)(fEfficiencyList->At(12)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                            particle->Py(),
-                                                            particle->Pz()),
+                                                                                 particle->Py(),
+                                                                                 particle->Pz()),
                                                    particle->Pt());
        if(label <= stack->GetNprimary()) {
          if(fProtonAnalysisBase->GetEtaMode())
@@ -3526,8 +4136,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                     particle->Pt());
          else
            ((TH2D *)(fEfficiencyList->At(7)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                             particle->Py(),
-                                                             particle->Pz()),
+                                                                                  particle->Py(),
+                                                                                  particle->Pz()),
                                                     particle->Pt());
        }//primaries
        if(label > stack->GetNprimary()) {
@@ -3543,8 +4153,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                       particle->Pt());
            else
              ((TH2D *)(fEfficiencyList->At(9)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                               particle->Py(),
-                                                               particle->Pz()),
+                                                                                    particle->Py(),
+                                                                                    particle->Pz()),
                                                       particle->Pt());
          }//weak decays
          if((particle->GetUniqueID() == 13)) {
@@ -3553,8 +4163,8 @@ void AliProtonQAAnalysis::RunEfficiencyAnalysis(AliStack *const stack,
                                                        particle->Pt());
            else
              ((TH2D *)(fEfficiencyList->At(11)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                                particle->Py(),
-                                                                particle->Pz()),
+                                                                                     particle->Py(),
+                                                                                     particle->Pz()),
                                                        particle->Pt());
          }//hadronic interactions
        }//secondaries
@@ -3580,7 +4190,6 @@ Bool_t AliProtonQAAnalysis::IsLabelUsed(TArrayI labelArray,
 
 //____________________________________________________________________//
 void AliProtonQAAnalysis::RunVertexQA(AliGenEventHeader *header,
-                                     AliStack *const stack, 
                                      AliESDEvent *const esd) {
   //Runs the vertex QA
   //MC vertex
@@ -3683,8 +4292,8 @@ void AliProtonQAAnalysis::RunQAAnalysis(AliStack *stack,
                                           particle->Pt());
       else
        ((TH2D *)(fQA2DList->At(8)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                   particle->Py(),
-                                                   particle->Pz()),
+                                                                        particle->Py(),
+                                                                        particle->Pz()),
                                           particle->Pt());
     }
     if(pdgcode == -2212) {
@@ -3693,12 +4302,13 @@ void AliProtonQAAnalysis::RunQAAnalysis(AliStack *stack,
                                           particle->Pt());
       else
        ((TH2D *)(fQA2DList->At(9)))->Fill(fProtonAnalysisBase->Rapidity(particle->Px(),
-                                                   particle->Py(),
-                                                   particle->Pz()),
+                                                                        particle->Py(),
+                                                                        particle->Pz()),
                                           particle->Pt());
     }
   }//MC loop
-  
+
+  Double_t dca[2] = {0.0,0.0}, cov[3] = {0.0,0.0,0.0};
   //ESD track loop
   Int_t nGoodTracks = esd->GetNumberOfTracks();
   TArrayI labelArray(nGoodTracks);
@@ -3711,7 +4321,8 @@ void AliProtonQAAnalysis::RunQAAnalysis(AliStack *stack,
     if(IsLabelUsed(labelArray,label)) continue;
     labelArray.AddAt(label,labelCounter);
     labelCounter += 1;
-    
+    if(label > stack->GetNtrack()) continue;
+
     TParticle *particle = stack->Particle(label);
     if(!particle) continue;
     if(TMath::Abs(particle->Eta()) > 1.0) continue;//acceptance
@@ -3719,21 +4330,20 @@ void AliProtonQAAnalysis::RunQAAnalysis(AliStack *stack,
     AliESDtrack trackTPC;
     
     //in case it's a TPC only track relate it to the proper vertex
-    if((fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kTPC)&&(!fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kHybrid)) {
+    //if((fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kTPC)&&(!fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kHybrid)) {
       //if((fUseTPCOnly)&&(!fUseHybridTPC)) {
-      Float_t p[2],cov[3];
-      track->GetImpactParametersTPC(p,cov);
-      if (p[0]==0 && p[1]==0)  
+      /*track->GetImpactParametersTPC(dca,cov);
+      if (dca[0]==0 && dca[1]==0)  
        track->RelateToVertexTPC(((AliESDEvent*)esd)->GetPrimaryVertexTPC(),esd->GetMagneticField(),kVeryBig);
       if (!track->FillTPCOnlyTrack(trackTPC)) {
        continue;
       }
-      track = &trackTPC ;
-    }
+      track = &trackTPC ;*/
+    //}
     
     Double_t gPt = 0.0, gP = 0.0;
     //Double_t probability[5];
-    Float_t dcaXY = 0.0, dcaZ = 0.0;
+    //Float_t dcaXY = 0.0, dcaZ = 0.0;
     Double_t nSigmaToVertex = fProtonAnalysisBase->GetSigmaToVertex(track);
     Int_t  fIdxInt[200];
     Int_t nClustersITS = track->GetITSclusters(fIdxInt);
@@ -3756,200 +4366,225 @@ void AliProtonQAAnalysis::RunQAAnalysis(AliStack *stack,
       if(!tpcTrack) continue;
       gPt = tpcTrack->Pt();
       gP = tpcTrack->P();
-      if(fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kHybrid)
+      /*if(fProtonAnalysisBase->GetAnalysisMode()==AliProtonAnalysisBase::kHybrid)
        track->GetImpactParameters(dcaXY,dcaZ);
-      else track->GetImpactParametersTPC(dcaXY,dcaZ);
-      
+       else track->GetImpactParametersTPC(dcaXY,dcaZ);*/
+      tpcTrack->PropagateToDCA(vertex,
+                               esd->GetMagneticField(),
+                               100.,dca,cov);
+
       //pid
       if(fProtonAnalysisBase->IsProton(track)) {
        if(!fProtonAnalysisBase->IsInPhaseSpace(track)) continue; //track outside the analyzed y-Pt
 
        FillQA(stack,esd,vertex,track);
-       if(fProtonAnalysisBase->IsAccepted(esd,vertex,track)) {
-         if(label <= stack->GetNprimary()) {
-           if(track->Charge() > 0) {
-             for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
-               if(track->HasPointOnITSLayer(iLayer))
-                 ((TH1F *)(fAcceptedCutList->At(0)))->Fill(iLayer+1);
+       if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
+         if(fProtonAnalysisBase->IsAccepted(track)) {
+           if(label <= stack->GetNprimary()) {
+             if(track->Charge() > 0) {
+               for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
+                 if(track->HasPointOnITSLayer(iLayer))
+                   ((TH1F *)(fAcceptedCutList->At(0)))->Fill(iLayer+1);
+               }
+               ((TH1F *)(fAcceptedCutList->At(4)))->Fill(nClustersITS);
+               ((TH1F *)(fAcceptedCutList->At(8)))->Fill(chi2PerClusterITS);
+               ((TH1F *)(fAcceptedCutList->At(12)))->Fill(chi2ConstrainVertex);
+               ((TH1F *)(fAcceptedCutList->At(16)))->Fill(nClustersTPC);
+               ((TH1F *)(fAcceptedCutList->At(20)))->Fill(chi2PerClusterTPC);
+               ((TH1F *)(fAcceptedCutList->At(24)))->Fill(extCov[0]);
+               ((TH1F *)(fAcceptedCutList->At(28)))->Fill(extCov[2]);
+               ((TH1F *)(fAcceptedCutList->At(32)))->Fill(extCov[5]);
+               ((TH1F *)(fAcceptedCutList->At(36)))->Fill(extCov[9]);
+               ((TH1F *)(fAcceptedCutList->At(40)))->Fill(extCov[14]);
+               ((TH3D *)(fAcceptedCutList->At(44)))->Fill(tpcTrack->Eta(),
+                                                          tpcTrack->Phi()*180./TMath::Pi(),
+                                                          nClustersTPC);
+               ((TH3D *)(fAcceptedCutList->At(48)))->Fill(tpcTrack->Eta(),
+                                                          tpcTrack->Phi()*180./TMath::Pi(),
+                                                          chi2PerClusterTPC);
+               ((TH3D *)(fAcceptedCutList->At(52)))->Fill(tpcTrack->Eta(),
+                                                          tpcTrack->Phi()*180./TMath::Pi(),
+                                                          npointsTPCdEdx);
+               ((TH1D *)(fAcceptedCutList->At(56)))->Fill(npointsTPCdEdx);
+               
+               ((TH1F *)(fAcceptedDCAList->At(0)))->Fill(TMath::Abs(dca[0]));
+               ((TH1F *)(fAcceptedDCAList->At(4)))->Fill(TMath::Abs(dca[1]));
+               ((TH1F *)(fAcceptedDCAList->At(8)))->Fill(nSigmaToVertex);
+               ((TH3F *)(fAcceptedDCAList->At(12)))->Fill(tpcTrack->Eta(),gPt,TMath::Abs(dca[0]));
+               ((TH3F *)(fAcceptedDCAList->At(18)))->Fill(tpcTrack->Eta(),gPt,TMath::Abs(dca[1]));
+               if(fProtonAnalysisBase->GetEtaMode())
+                 ((TH2D *)(fQA2DList->At(0)))->Fill(tpcTrack->Eta(),gPt);
+               else
+                 ((TH2D *)(fQA2DList->At(0)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
+                                                                                  tpcTrack->Py(),
+                                                                                  tpcTrack->Pz()),
+                                                    gPt);
+             }//accepted primary protons
+             else if(track->Charge() < 0) {
+               for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
+                 if(track->HasPointOnITSLayer(iLayer))
+                   ((TH1F *)(fAcceptedCutList->At(1)))->Fill(iLayer+1);
+               }
+               ((TH1F *)(fAcceptedCutList->At(5)))->Fill(nClustersITS);
+               ((TH1F *)(fAcceptedCutList->At(9)))->Fill(chi2PerClusterITS);
+               ((TH1F *)(fAcceptedCutList->At(13)))->Fill(chi2ConstrainVertex);
+               ((TH1F *)(fAcceptedCutList->At(17)))->Fill(nClustersTPC);
+               ((TH1F *)(fAcceptedCutList->At(21)))->Fill(chi2PerClusterTPC);
+               ((TH1F *)(fAcceptedCutList->At(25)))->Fill(extCov[0]);
+               ((TH1F *)(fAcceptedCutList->At(29)))->Fill(extCov[2]);
+               ((TH1F *)(fAcceptedCutList->At(33)))->Fill(extCov[5]);
+               ((TH1F *)(fAcceptedCutList->At(37)))->Fill(extCov[9]);
+               ((TH1F *)(fAcceptedCutList->At(41)))->Fill(extCov[14]);
+               ((TH3D *)(fAcceptedCutList->At(45)))->Fill(tpcTrack->Eta(),
+                                                          tpcTrack->Phi()*180./TMath::Pi(),
+                                                          nClustersTPC);
+               ((TH3D *)(fAcceptedCutList->At(49)))->Fill(tpcTrack->Eta(),
+                                                          tpcTrack->Phi()*180./TMath::Pi(),
+                                                          chi2PerClusterTPC);
+               ((TH3D *)(fAcceptedCutList->At(53)))->Fill(tpcTrack->Eta(),
+                                                          tpcTrack->Phi()*180./TMath::Pi(),
+                                                          npointsTPCdEdx);
+               ((TH1D *)(fAcceptedCutList->At(57)))->Fill(npointsTPCdEdx);
+               
+               ((TH1F *)(fAcceptedDCAList->At(1)))->Fill(TMath::Abs(dca[0]));
+               ((TH1F *)(fAcceptedDCAList->At(5)))->Fill(TMath::Abs(dca[1]));
+               ((TH1F *)(fAcceptedDCAList->At(9)))->Fill(nSigmaToVertex);
+               ((TH3F *)(fAcceptedDCAList->At(13)))->Fill(tpcTrack->Eta(),gPt,TMath::Abs(dca[0]));
+               ((TH3F *)(fAcceptedDCAList->At(19)))->Fill(tpcTrack->Eta(),gPt,TMath::Abs(dca[1]));
+               if(fProtonAnalysisBase->GetEtaMode())
+                 ((TH2D *)(fQA2DList->At(4)))->Fill(tpcTrack->Eta(),gPt);
+               else
+                 ((TH2D *)(fQA2DList->At(4)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
+                                                                                  tpcTrack->Py(),
+                                                                                  tpcTrack->Pz()),
+                                                    gPt);
+             }//accepted primary antiprotons
+           }//accepted primary particles
+           else if(label > stack->GetNprimary()) {
+             Int_t lPartMother = -1;
+             Int_t motherPDGCode = -1;
+             if(particle) {
+               lPartMother = particle->GetFirstMother();
+               TParticle *motherParticle = stack->Particle(lPartMother);
+               if(motherParticle) motherPDGCode = motherParticle->GetPdgCode();
              }
-             ((TH1F *)(fAcceptedCutList->At(4)))->Fill(nClustersITS);
-             ((TH1F *)(fAcceptedCutList->At(8)))->Fill(chi2PerClusterITS);
-             ((TH1F *)(fAcceptedCutList->At(12)))->Fill(chi2ConstrainVertex);
-             ((TH1F *)(fAcceptedCutList->At(16)))->Fill(nClustersTPC);
-             ((TH1F *)(fAcceptedCutList->At(20)))->Fill(chi2PerClusterTPC);
-             ((TH1F *)(fAcceptedCutList->At(24)))->Fill(extCov[0]);
-             ((TH1F *)(fAcceptedCutList->At(28)))->Fill(extCov[2]);
-             ((TH1F *)(fAcceptedCutList->At(32)))->Fill(extCov[5]);
-             ((TH1F *)(fAcceptedCutList->At(36)))->Fill(extCov[9]);
-             ((TH1F *)(fAcceptedCutList->At(40)))->Fill(extCov[14]);
-             ((TH3D *)(fAcceptedCutList->At(44)))->Fill(tpcTrack->Eta(),
-                                                        tpcTrack->Phi()*180./TMath::Pi(),
-                                                        nClustersTPC);
-             ((TH3D *)(fAcceptedCutList->At(48)))->Fill(tpcTrack->Eta(),
-                                                        tpcTrack->Phi()*180./TMath::Pi(),
-                                                        chi2PerClusterTPC);
-             ((TH3D *)(fAcceptedCutList->At(52)))->Fill(tpcTrack->Eta(),
-                                                        tpcTrack->Phi()*180./TMath::Pi(),
-                                                        npointsTPCdEdx);
-             ((TH1D *)(fAcceptedCutList->At(56)))->Fill(npointsTPCdEdx);
              
-             ((TH1F *)(fAcceptedDCAList->At(0)))->Fill(TMath::Abs(dcaXY));
-             ((TH1F *)(fAcceptedDCAList->At(4)))->Fill(TMath::Abs(dcaZ));
-             ((TH1F *)(fAcceptedDCAList->At(8)))->Fill(nSigmaToVertex);
-             if(fProtonAnalysisBase->GetEtaMode())
-               ((TH2D *)(fQA2DList->At(0)))->Fill(tpcTrack->Eta(),gPt);
-             else
-               ((TH2D *)(fQA2DList->At(0)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
-                                                           tpcTrack->Py(),
-                                                           tpcTrack->Pz()),
-                                                  gPt);
-           }//accepted primary protons
-           else if(track->Charge() < 0) {
-             for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
-               if(track->HasPointOnITSLayer(iLayer))
-                 ((TH1F *)(fAcceptedCutList->At(1)))->Fill(iLayer+1);
-             }
-             ((TH1F *)(fAcceptedCutList->At(5)))->Fill(nClustersITS);
-             ((TH1F *)(fAcceptedCutList->At(9)))->Fill(chi2PerClusterITS);
-             ((TH1F *)(fAcceptedCutList->At(13)))->Fill(chi2ConstrainVertex);
-             ((TH1F *)(fAcceptedCutList->At(17)))->Fill(nClustersTPC);
-             ((TH1F *)(fAcceptedCutList->At(21)))->Fill(chi2PerClusterTPC);
-             ((TH1F *)(fAcceptedCutList->At(25)))->Fill(extCov[0]);
-             ((TH1F *)(fAcceptedCutList->At(29)))->Fill(extCov[2]);
-             ((TH1F *)(fAcceptedCutList->At(33)))->Fill(extCov[5]);
-             ((TH1F *)(fAcceptedCutList->At(37)))->Fill(extCov[9]);
-             ((TH1F *)(fAcceptedCutList->At(41)))->Fill(extCov[14]);
-             ((TH3D *)(fAcceptedCutList->At(45)))->Fill(tpcTrack->Eta(),
-                                                        tpcTrack->Phi()*180./TMath::Pi(),
-                                                        nClustersTPC);
-             ((TH3D *)(fAcceptedCutList->At(49)))->Fill(tpcTrack->Eta(),
-                                                        tpcTrack->Phi()*180./TMath::Pi(),
-                                                        chi2PerClusterTPC);
-             ((TH3D *)(fAcceptedCutList->At(53)))->Fill(tpcTrack->Eta(),
-                                                        tpcTrack->Phi()*180./TMath::Pi(),
-                                                        npointsTPCdEdx);
-             ((TH1D *)(fAcceptedCutList->At(57)))->Fill(npointsTPCdEdx);
+             if(fMCProcessIdFlag)
+               if(particle->GetUniqueID() != fMCProcessId) continue;
+             if(fMotherParticlePDGCodeFlag)
+               if(TMath::Abs(motherPDGCode) != fMotherParticlePDGCode) continue;
              
-             ((TH1F *)(fAcceptedDCAList->At(1)))->Fill(TMath::Abs(dcaXY));
-             ((TH1F *)(fAcceptedDCAList->At(5)))->Fill(TMath::Abs(dcaZ));
-             ((TH1F *)(fAcceptedDCAList->At(9)))->Fill(nSigmaToVertex);
-             if(fProtonAnalysisBase->GetEtaMode())
-               ((TH2D *)(fQA2DList->At(4)))->Fill(tpcTrack->Eta(),gPt);
-             else
-               ((TH2D *)(fQA2DList->At(4)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
-                                                           tpcTrack->Py(),
-                                                           tpcTrack->Pz()),
-                                                  gPt);
-           }//accepted primary antiprotons
-         }//accepted primary particles
-         else if(label > stack->GetNprimary()) {
-           Int_t lPartMother = -1;
-           Int_t motherPDGCode = -1;
-           if(particle) {
-             lPartMother = particle->GetFirstMother();
-             TParticle *motherParticle = stack->Particle(lPartMother);
-             if(motherParticle) motherPDGCode = motherParticle->GetPdgCode();
-           }
-           
-           if(fMCProcessIdFlag)
-             if(particle->GetUniqueID() != fMCProcessId) continue;
-           if(fMotherParticlePDGCodeFlag)
-             if(TMath::Abs(motherPDGCode) != fMotherParticlePDGCode) continue;
-           
-           if(track->Charge() > 0) {
-             for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
-               if(track->HasPointOnITSLayer(iLayer))
-                 ((TH1F *)(fAcceptedCutList->At(2)))->Fill(iLayer+1);
-             }
-             ((TH1F *)(fAcceptedCutList->At(6)))->Fill(nClustersITS);
-             ((TH1F *)(fAcceptedCutList->At(10)))->Fill(chi2PerClusterITS);
-             ((TH1F *)(fAcceptedCutList->At(14)))->Fill(chi2ConstrainVertex);
-             ((TH1F *)(fAcceptedCutList->At(18)))->Fill(nClustersTPC);
-             ((TH1F *)(fAcceptedCutList->At(22)))->Fill(chi2PerClusterTPC);
-             ((TH1F *)(fAcceptedCutList->At(26)))->Fill(extCov[0]);
-             ((TH1F *)(fAcceptedCutList->At(30)))->Fill(extCov[2]);
-             ((TH1F *)(fAcceptedCutList->At(34)))->Fill(extCov[5]);
-             ((TH1F *)(fAcceptedCutList->At(38)))->Fill(extCov[9]);
-             ((TH1F *)(fAcceptedCutList->At(42)))->Fill(extCov[14]);
-             ((TH3D *)(fAcceptedCutList->At(46)))->Fill(tpcTrack->Eta(),
-                                                        tpcTrack->Phi()*180./TMath::Pi(),
-                                                        nClustersTPC);
-             ((TH3D *)(fAcceptedCutList->At(50)))->Fill(tpcTrack->Eta(),
-                                                        tpcTrack->Phi()*180./TMath::Pi(),
-                                                        chi2PerClusterTPC);
-             ((TH3D *)(fAcceptedCutList->At(54)))->Fill(tpcTrack->Eta(),
-                                                        tpcTrack->Phi()*180./TMath::Pi(),
-                                                        npointsTPCdEdx);
-             ((TH1D *)(fAcceptedCutList->At(58)))->Fill(npointsTPCdEdx);
-
-             ((TH1F *)(fAcceptedDCAList->At(2)))->Fill(TMath::Abs(dcaXY));
-             ((TH1F *)(fAcceptedDCAList->At(6)))->Fill(TMath::Abs(dcaZ));
-             ((TH1F *)(fAcceptedDCAList->At(10)))->Fill(nSigmaToVertex);
-             if(fProtonAnalysisBase->GetEtaMode())
-               ((TH2D *)(fQA2DList->At(2)))->Fill(tpcTrack->Eta(),gPt);
-             else
-               ((TH2D *)(fQA2DList->At(2)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
-                                                           tpcTrack->Py(),
-                                                           tpcTrack->Pz()),
-                                                  gPt);
-             if(fProtonAnalysisBase->GetEtaMode())
-             ((TH3F *)(fQA2DList->At(10)))->Fill(tpcTrack->Eta(),gPt,
-                                                 ConvertPDGToInt(motherPDGCode));
-             else
-               ((TH3F *)(fQA2DList->At(10)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
-                                                            tpcTrack->Py(),
-                                                            tpcTrack->Pz()),
-                                                   gPt,
-                                                   ConvertPDGToInt(motherPDGCode));
-           }//accepted secondary protons
-           else if(track->Charge() < 0) {
-             for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
-               if(track->HasPointOnITSLayer(iLayer))
-                 ((TH1F *)(fAcceptedCutList->At(3)))->Fill(iLayer+1);
-             }
-             ((TH1F *)(fAcceptedCutList->At(7)))->Fill(nClustersITS);
-             ((TH1F *)(fAcceptedCutList->At(11)))->Fill(chi2PerClusterITS);
-             ((TH1F *)(fAcceptedCutList->At(15)))->Fill(chi2ConstrainVertex);
-             ((TH1F *)(fAcceptedCutList->At(19)))->Fill(nClustersTPC);
-             ((TH1F *)(fAcceptedCutList->At(23)))->Fill(chi2PerClusterTPC);
-             ((TH1F *)(fAcceptedCutList->At(27)))->Fill(extCov[0]);
-             ((TH1F *)(fAcceptedCutList->At(31)))->Fill(extCov[2]);
-             ((TH1F *)(fAcceptedCutList->At(35)))->Fill(extCov[5]);
-             ((TH1F *)(fAcceptedCutList->At(39)))->Fill(extCov[9]);
-             ((TH1F *)(fAcceptedCutList->At(43)))->Fill(extCov[14]);
-             ((TH3D *)(fAcceptedCutList->At(47)))->Fill(tpcTrack->Eta(),
-                                                        tpcTrack->Phi()*180./TMath::Pi(),
-                                                        nClustersTPC);
-             ((TH3D *)(fAcceptedCutList->At(51)))->Fill(tpcTrack->Eta(),
-                                                        tpcTrack->Phi()*180./TMath::Pi(),
-                                                        chi2PerClusterTPC);
-             ((TH3D *)(fAcceptedCutList->At(55)))->Fill(tpcTrack->Eta(),
-                                                        tpcTrack->Phi()*180./TMath::Pi(),
-                                                        npointsTPCdEdx);
-             ((TH1F *)(fAcceptedCutList->At(59)))->Fill(npointsTPCdEdx);
-
-             ((TH1F *)(fAcceptedDCAList->At(3)))->Fill(TMath::Abs(dcaXY));
-             ((TH1F *)(fAcceptedDCAList->At(7)))->Fill(TMath::Abs(dcaZ));
-             ((TH1F *)(fAcceptedDCAList->At(11)))->Fill(nSigmaToVertex);
-             if(fProtonAnalysisBase->GetEtaMode())
-               ((TH2D *)(fQA2DList->At(6)))->Fill(tpcTrack->Eta(),gPt);
-             else
-               ((TH2D *)(fQA2DList->At(6)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
-                                                           tpcTrack->Py(),
-                                                           tpcTrack->Pz()),
-                                                  gPt);
-             if(fProtonAnalysisBase->GetEtaMode())
-               ((TH3F *)(fQA2DList->At(11)))->Fill(tpcTrack->Eta(),gPt,
-                                                   ConvertPDGToInt(motherPDGCode));
-             else
-               ((TH3F *)(fQA2DList->At(11)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
-                                                            tpcTrack->Py(),
-                                                            tpcTrack->Pz()),
-                                                   gPt,
-                                                   ConvertPDGToInt(motherPDGCode));
-           }//accepted secondary antiprotons
-         }//accepted secondary particles
-       }//accepted - track cuts
+             if(track->Charge() > 0) {
+               for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
+                 if(track->HasPointOnITSLayer(iLayer))
+                   ((TH1F *)(fAcceptedCutList->At(2)))->Fill(iLayer+1);
+               }
+               ((TH1F *)(fAcceptedCutList->At(6)))->Fill(nClustersITS);
+               ((TH1F *)(fAcceptedCutList->At(10)))->Fill(chi2PerClusterITS);
+               ((TH1F *)(fAcceptedCutList->At(14)))->Fill(chi2ConstrainVertex);
+               ((TH1F *)(fAcceptedCutList->At(18)))->Fill(nClustersTPC);
+               ((TH1F *)(fAcceptedCutList->At(22)))->Fill(chi2PerClusterTPC);
+               ((TH1F *)(fAcceptedCutList->At(26)))->Fill(extCov[0]);
+               ((TH1F *)(fAcceptedCutList->At(30)))->Fill(extCov[2]);
+               ((TH1F *)(fAcceptedCutList->At(34)))->Fill(extCov[5]);
+               ((TH1F *)(fAcceptedCutList->At(38)))->Fill(extCov[9]);
+               ((TH1F *)(fAcceptedCutList->At(42)))->Fill(extCov[14]);
+               ((TH3D *)(fAcceptedCutList->At(46)))->Fill(tpcTrack->Eta(),
+                                                          tpcTrack->Phi()*180./TMath::Pi(),
+                                                          nClustersTPC);
+               ((TH3D *)(fAcceptedCutList->At(50)))->Fill(tpcTrack->Eta(),
+                                                          tpcTrack->Phi()*180./TMath::Pi(),
+                                                          chi2PerClusterTPC);
+               ((TH3D *)(fAcceptedCutList->At(54)))->Fill(tpcTrack->Eta(),
+                                                          tpcTrack->Phi()*180./TMath::Pi(),
+                                                          npointsTPCdEdx);
+               ((TH1D *)(fAcceptedCutList->At(58)))->Fill(npointsTPCdEdx);
+               
+               ((TH1F *)(fAcceptedDCAList->At(2)))->Fill(TMath::Abs(dca[0]));
+               ((TH1F *)(fAcceptedDCAList->At(6)))->Fill(TMath::Abs(dca[1]));
+               ((TH1F *)(fAcceptedDCAList->At(10)))->Fill(nSigmaToVertex);
+               if(particle->GetUniqueID() == 4) {
+                 ((TH3F *)(fAcceptedDCAList->At(14)))->Fill(tpcTrack->Eta(),gPt,TMath::Abs(dca[0]));
+                 ((TH3F *)(fAcceptedDCAList->At(20)))->Fill(tpcTrack->Eta(),gPt,TMath::Abs(dca[1]));
+               }
+               if(particle->GetUniqueID() == 13) {
+                 ((TH3F *)(fAcceptedDCAList->At(16)))->Fill(tpcTrack->Eta(),gPt,TMath::Abs(dca[0]));
+                 ((TH3F *)(fAcceptedDCAList->At(22)))->Fill(tpcTrack->Eta(),gPt,TMath::Abs(dca[1]));
+               }
+               if(fProtonAnalysisBase->GetEtaMode())
+                 ((TH2D *)(fQA2DList->At(2)))->Fill(tpcTrack->Eta(),gPt);
+               else
+                 ((TH2D *)(fQA2DList->At(2)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
+                                                                                  tpcTrack->Py(),
+                                                                                  tpcTrack->Pz()),
+                                                    gPt);
+               if(fProtonAnalysisBase->GetEtaMode())
+                 ((TH3F *)(fQA2DList->At(10)))->Fill(tpcTrack->Eta(),gPt,
+                                                     ConvertPDGToInt(motherPDGCode));
+               else
+                 ((TH3F *)(fQA2DList->At(10)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
+                                                                                   tpcTrack->Py(),
+                                                                                   tpcTrack->Pz()),
+                                                     gPt,
+                                                     ConvertPDGToInt(motherPDGCode));
+             }//accepted secondary protons
+             else if(track->Charge() < 0) {
+               for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
+                 if(track->HasPointOnITSLayer(iLayer))
+                   ((TH1F *)(fAcceptedCutList->At(3)))->Fill(iLayer+1);
+               }
+               ((TH1F *)(fAcceptedCutList->At(7)))->Fill(nClustersITS);
+               ((TH1F *)(fAcceptedCutList->At(11)))->Fill(chi2PerClusterITS);
+               ((TH1F *)(fAcceptedCutList->At(15)))->Fill(chi2ConstrainVertex);
+               ((TH1F *)(fAcceptedCutList->At(19)))->Fill(nClustersTPC);
+               ((TH1F *)(fAcceptedCutList->At(23)))->Fill(chi2PerClusterTPC);
+               ((TH1F *)(fAcceptedCutList->At(27)))->Fill(extCov[0]);
+               ((TH1F *)(fAcceptedCutList->At(31)))->Fill(extCov[2]);
+               ((TH1F *)(fAcceptedCutList->At(35)))->Fill(extCov[5]);
+               ((TH1F *)(fAcceptedCutList->At(39)))->Fill(extCov[9]);
+               ((TH1F *)(fAcceptedCutList->At(43)))->Fill(extCov[14]);
+               ((TH3D *)(fAcceptedCutList->At(47)))->Fill(tpcTrack->Eta(),
+                                                          tpcTrack->Phi()*180./TMath::Pi(),
+                                                          nClustersTPC);
+               ((TH3D *)(fAcceptedCutList->At(51)))->Fill(tpcTrack->Eta(),
+                                                          tpcTrack->Phi()*180./TMath::Pi(),
+                                                          chi2PerClusterTPC);
+               ((TH3D *)(fAcceptedCutList->At(55)))->Fill(tpcTrack->Eta(),
+                                                          tpcTrack->Phi()*180./TMath::Pi(),
+                                                          npointsTPCdEdx);
+               ((TH1F *)(fAcceptedCutList->At(59)))->Fill(npointsTPCdEdx);
+               
+               ((TH1F *)(fAcceptedDCAList->At(3)))->Fill(TMath::Abs(dca[0]));
+               ((TH1F *)(fAcceptedDCAList->At(7)))->Fill(TMath::Abs(dca[1]));
+               ((TH1F *)(fAcceptedDCAList->At(11)))->Fill(nSigmaToVertex);
+               if(particle->GetUniqueID() == 4) {
+                 ((TH3F *)(fAcceptedDCAList->At(15)))->Fill(tpcTrack->Eta(),gPt,TMath::Abs(dca[0]));
+                 ((TH3F *)(fAcceptedDCAList->At(21)))->Fill(tpcTrack->Eta(),gPt,TMath::Abs(dca[1]));
+               }
+               if(particle->GetUniqueID() == 13) {
+                 ((TH3F *)(fAcceptedDCAList->At(17)))->Fill(tpcTrack->Eta(),gPt,TMath::Abs(dca[0]));
+                 ((TH3F *)(fAcceptedDCAList->At(23)))->Fill(tpcTrack->Eta(),gPt,TMath::Abs(dca[1]));
+               }
+               if(fProtonAnalysisBase->GetEtaMode())
+                 ((TH2D *)(fQA2DList->At(6)))->Fill(tpcTrack->Eta(),gPt);
+               else
+                 ((TH2D *)(fQA2DList->At(6)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
+                                                                                  tpcTrack->Py(),
+                                                                                  tpcTrack->Pz()),
+                                                    gPt);
+               if(fProtonAnalysisBase->GetEtaMode())
+                 ((TH3F *)(fQA2DList->At(11)))->Fill(tpcTrack->Eta(),gPt,
+                                                     ConvertPDGToInt(motherPDGCode));
+               else
+                 ((TH3F *)(fQA2DList->At(11)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
+                                                                                   tpcTrack->Py(),
+                                                                                   tpcTrack->Pz()),
+                                                     gPt,
+                                                     ConvertPDGToInt(motherPDGCode));
+             }//accepted secondary antiprotons
+           }//accepted secondary particles
+         }//accepted - track cuts
+       }//primary-like cut
        else {
          if(label <= stack->GetNprimary()) {
            if(track->Charge() > 0) {
@@ -3962,13 +4597,13 @@ void AliProtonQAAnalysis::RunQAAnalysis(AliStack *stack,
              ((TH3D *)(fRejectedCutList->At(8)))->Fill(tpcTrack->Eta(),
                                                        tpcTrack->Phi()*180./TMath::Pi(),
                                                        npointsTPCdEdx);
-
+             
              if(fProtonAnalysisBase->GetEtaMode())
                ((TH2D *)(fQA2DList->At(1)))->Fill(tpcTrack->Eta(),gPt);
              else
                ((TH2D *)(fQA2DList->At(1)))->Fill(fProtonAnalysisBase->Rapidity(tpcTrack->Px(),
-                                                           tpcTrack->Py(),
-                                                           tpcTrack->Pz()),
+                                                                                tpcTrack->Py(),
+                                                                                tpcTrack->Pz()),
                                                   gPt);
            }
            else if(track->Charge() < 0) {
@@ -4036,199 +4671,224 @@ void AliProtonQAAnalysis::RunQAAnalysis(AliStack *stack,
     else {
       gPt = track->Pt();
       gP = track->P();
-      track->GetImpactParameters(dcaXY,dcaZ);
+      track->PropagateToDCA(vertex,
+                               esd->GetMagneticField(),
+                               100.,dca,cov);
       
       //pid
       if(fProtonAnalysisBase->IsProton(track)) {
        if(!fProtonAnalysisBase->IsInPhaseSpace(track)) continue; //track outside the analyzed y-Pt
 
        FillQA(stack,esd,vertex,track);
-       if(fProtonAnalysisBase->IsAccepted(esd,vertex,track)) {
-         if(label <= stack->GetNprimary()) {
-           if(track->Charge() > 0) {
-             for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
-               if(track->HasPointOnITSLayer(iLayer))
-                 ((TH1F *)(fAcceptedCutList->At(0)))->Fill(iLayer+1);
+       if(fProtonAnalysisBase->IsPrimary(esd,vertex,track)) {
+         if(fProtonAnalysisBase->IsAccepted(track)) {
+           if(label <= stack->GetNprimary()) {
+             if(track->Charge() > 0) {
+               for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
+                 if(track->HasPointOnITSLayer(iLayer))
+                   ((TH1F *)(fAcceptedCutList->At(0)))->Fill(iLayer+1);
+               }
+               ((TH1F *)(fAcceptedCutList->At(4)))->Fill(nClustersITS);
+               ((TH1F *)(fAcceptedCutList->At(8)))->Fill(chi2PerClusterITS);
+               ((TH1F *)(fAcceptedCutList->At(12)))->Fill(chi2ConstrainVertex);
+               ((TH1F *)(fAcceptedCutList->At(16)))->Fill(nClustersTPC);
+               ((TH1F *)(fAcceptedCutList->At(20)))->Fill(chi2PerClusterTPC);
+               ((TH1F *)(fAcceptedCutList->At(24)))->Fill(extCov[0]);
+               ((TH1F *)(fAcceptedCutList->At(28)))->Fill(extCov[2]);
+               ((TH1F *)(fAcceptedCutList->At(32)))->Fill(extCov[5]);
+               ((TH1F *)(fAcceptedCutList->At(36)))->Fill(extCov[9]);
+               ((TH1F *)(fAcceptedCutList->At(40)))->Fill(extCov[14]);
+               ((TH3D *)(fAcceptedCutList->At(44)))->Fill(track->Eta(),
+                                                          track->Phi()*180./TMath::Pi(),
+                                                          nClustersTPC);
+               ((TH3D *)(fAcceptedCutList->At(48)))->Fill(track->Eta(),
+                                                          track->Phi()*180./TMath::Pi(),
+                                                          chi2PerClusterTPC);
+               ((TH3D *)(fAcceptedCutList->At(52)))->Fill(track->Eta(),
+                                                          track->Phi()*180./TMath::Pi(),
+                                                          npointsTPCdEdx);
+               ((TH1F *)(fAcceptedCutList->At(56)))->Fill(npointsTPCdEdx);
+               
+               ((TH1F *)(fAcceptedDCAList->At(0)))->Fill(TMath::Abs(dca[0]));
+               ((TH1F *)(fAcceptedDCAList->At(4)))->Fill(TMath::Abs(dca[1]));
+               ((TH1F *)(fAcceptedDCAList->At(8)))->Fill(nSigmaToVertex);
+               ((TH3F *)(fAcceptedDCAList->At(12)))->Fill(track->Eta(),gPt,TMath::Abs(dca[0]));
+               ((TH3F *)(fAcceptedDCAList->At(18)))->Fill(track->Eta(),gPt,TMath::Abs(dca[0]));
+               if(fProtonAnalysisBase->GetEtaMode())
+                 ((TH2D *)(fQA2DList->At(0)))->Fill(track->Eta(),gPt);
+               else
+                 ((TH2D *)(fQA2DList->At(0)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),
+                                                                                  track->Py(),
+                                                                                  track->Pz()),
+                                                    gPt);
              }
-             ((TH1F *)(fAcceptedCutList->At(4)))->Fill(nClustersITS);
-             ((TH1F *)(fAcceptedCutList->At(8)))->Fill(chi2PerClusterITS);
-             ((TH1F *)(fAcceptedCutList->At(12)))->Fill(chi2ConstrainVertex);
-             ((TH1F *)(fAcceptedCutList->At(16)))->Fill(nClustersTPC);
-             ((TH1F *)(fAcceptedCutList->At(20)))->Fill(chi2PerClusterTPC);
-             ((TH1F *)(fAcceptedCutList->At(24)))->Fill(extCov[0]);
-             ((TH1F *)(fAcceptedCutList->At(28)))->Fill(extCov[2]);
-             ((TH1F *)(fAcceptedCutList->At(32)))->Fill(extCov[5]);
-             ((TH1F *)(fAcceptedCutList->At(36)))->Fill(extCov[9]);
-             ((TH1F *)(fAcceptedCutList->At(40)))->Fill(extCov[14]);
-             ((TH3D *)(fAcceptedCutList->At(44)))->Fill(track->Eta(),
-                                                        track->Phi()*180./TMath::Pi(),
-                                                        nClustersTPC);
-             ((TH3D *)(fAcceptedCutList->At(48)))->Fill(track->Eta(),
-                                                        track->Phi()*180./TMath::Pi(),
-                                                        chi2PerClusterTPC);
-             ((TH3D *)(fAcceptedCutList->At(52)))->Fill(track->Eta(),
-                                                        track->Phi()*180./TMath::Pi(),
-                                                        npointsTPCdEdx);
-             ((TH1F *)(fAcceptedCutList->At(56)))->Fill(npointsTPCdEdx);
-             
-             ((TH1F *)(fAcceptedDCAList->At(0)))->Fill(TMath::Abs(dcaXY));
-             ((TH1F *)(fAcceptedDCAList->At(4)))->Fill(TMath::Abs(dcaZ));
-             ((TH1F *)(fAcceptedDCAList->At(8)))->Fill(nSigmaToVertex);
-             if(fProtonAnalysisBase->GetEtaMode())
-               ((TH2D *)(fQA2DList->At(0)))->Fill(track->Eta(),gPt);
-             else
-               ((TH2D *)(fQA2DList->At(0)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),
-                                                           track->Py(),
-                                                           track->Pz()),
-                                                  gPt);
-           }
-           else if(track->Charge() < 0) {
-             for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
-               if(track->HasPointOnITSLayer(iLayer))
-                 ((TH1F *)(fAcceptedCutList->At(1)))->Fill(iLayer+1);
+             else if(track->Charge() < 0) {
+               for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
+                 if(track->HasPointOnITSLayer(iLayer))
+                   ((TH1F *)(fAcceptedCutList->At(1)))->Fill(iLayer+1);
+               }
+               ((TH1F *)(fAcceptedCutList->At(5)))->Fill(nClustersITS);
+               ((TH1F *)(fAcceptedCutList->At(9)))->Fill(chi2PerClusterITS);
+               ((TH1F *)(fAcceptedCutList->At(13)))->Fill(chi2ConstrainVertex);
+               ((TH1F *)(fAcceptedCutList->At(17)))->Fill(nClustersTPC);
+               ((TH1F *)(fAcceptedCutList->At(21)))->Fill(chi2PerClusterTPC);
+               ((TH1F *)(fAcceptedCutList->At(25)))->Fill(extCov[0]);
+               ((TH1F *)(fAcceptedCutList->At(29)))->Fill(extCov[2]);
+               ((TH1F *)(fAcceptedCutList->At(33)))->Fill(extCov[5]);
+               ((TH1F *)(fAcceptedCutList->At(37)))->Fill(extCov[9]);
+               ((TH1F *)(fAcceptedCutList->At(41)))->Fill(extCov[14]);
+               ((TH3D *)(fAcceptedCutList->At(45)))->Fill(track->Eta(),
+                                                          track->Phi()*180./TMath::Pi(),
+                                                          nClustersTPC);
+               ((TH3D *)(fAcceptedCutList->At(49)))->Fill(track->Eta(),
+                                                          track->Phi()*180./TMath::Pi(),
+                                                          chi2PerClusterTPC);
+               ((TH3D *)(fAcceptedCutList->At(53)))->Fill(track->Eta(),
+                                                          track->Phi()*180./TMath::Pi(),
+                                                          npointsTPCdEdx);
+               ((TH1F *)(fAcceptedCutList->At(57)))->Fill(npointsTPCdEdx);
+               
+               ((TH1F *)(fAcceptedDCAList->At(1)))->Fill(TMath::Abs(dca[0]));
+               ((TH1F *)(fAcceptedDCAList->At(5)))->Fill(TMath::Abs(dca[1]));
+               ((TH1F *)(fAcceptedDCAList->At(9)))->Fill(nSigmaToVertex);
+               ((TH3F *)(fAcceptedDCAList->At(13)))->Fill(track->Eta(),gPt,TMath::Abs(dca[0]));
+               ((TH3F *)(fAcceptedDCAList->At(19)))->Fill(track->Eta(),gPt,TMath::Abs(dca[0]));
+               if(fProtonAnalysisBase->GetEtaMode())
+                 ((TH2D *)(fQA2DList->At(4)))->Fill(track->Eta(),gPt);
+               else
+                 ((TH2D *)(fQA2DList->At(4)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),
+                                                                                  track->Py(),
+                                                                                  track->Pz()),
+                                                    gPt);
              }
-             ((TH1F *)(fAcceptedCutList->At(5)))->Fill(nClustersITS);
-             ((TH1F *)(fAcceptedCutList->At(9)))->Fill(chi2PerClusterITS);
-             ((TH1F *)(fAcceptedCutList->At(13)))->Fill(chi2ConstrainVertex);
-             ((TH1F *)(fAcceptedCutList->At(17)))->Fill(nClustersTPC);
-             ((TH1F *)(fAcceptedCutList->At(21)))->Fill(chi2PerClusterTPC);
-             ((TH1F *)(fAcceptedCutList->At(25)))->Fill(extCov[0]);
-             ((TH1F *)(fAcceptedCutList->At(29)))->Fill(extCov[2]);
-             ((TH1F *)(fAcceptedCutList->At(33)))->Fill(extCov[5]);
-             ((TH1F *)(fAcceptedCutList->At(37)))->Fill(extCov[9]);
-             ((TH1F *)(fAcceptedCutList->At(41)))->Fill(extCov[14]);
-             ((TH3D *)(fAcceptedCutList->At(45)))->Fill(track->Eta(),
-                                                        track->Phi()*180./TMath::Pi(),
-                                                        nClustersTPC);
-             ((TH3D *)(fAcceptedCutList->At(49)))->Fill(track->Eta(),
-                                                        track->Phi()*180./TMath::Pi(),
-                                                        chi2PerClusterTPC);
-             ((TH3D *)(fAcceptedCutList->At(53)))->Fill(track->Eta(),
-                                                        track->Phi()*180./TMath::Pi(),
-                                                        npointsTPCdEdx);
-             ((TH1F *)(fAcceptedCutList->At(57)))->Fill(npointsTPCdEdx);
-             
-             ((TH1F *)(fAcceptedDCAList->At(1)))->Fill(TMath::Abs(dcaXY));
-             ((TH1F *)(fAcceptedDCAList->At(5)))->Fill(TMath::Abs(dcaZ));
-             ((TH1F *)(fAcceptedDCAList->At(9)))->Fill(nSigmaToVertex);
-             if(fProtonAnalysisBase->GetEtaMode())
-               ((TH2D *)(fQA2DList->At(4)))->Fill(track->Eta(),gPt);
-             else
-               ((TH2D *)(fQA2DList->At(4)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),
-                                                           track->Py(),
-                                                           track->Pz()),
-                                                  gPt);
-           }
-         }//primary particles
-         else if(label > stack->GetNprimary()) {
-           Int_t lPartMother = -1;
-           Int_t motherPDGCode = -1;
-           if(particle) {
-             lPartMother = particle->GetFirstMother();
-             TParticle *motherParticle = stack->Particle(lPartMother);
-             if(motherParticle) motherPDGCode = motherParticle->GetPdgCode();
-           }
-           
-           if(fMCProcessIdFlag)
-             if(particle->GetUniqueID() != fMCProcessId) continue;
-           if(fMotherParticlePDGCodeFlag)
-             if(TMath::Abs(motherPDGCode) != fMotherParticlePDGCode) continue;
-           
-           if(track->Charge() > 0) {
-             for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
-               if(track->HasPointOnITSLayer(iLayer))
-                 ((TH1F *)(fAcceptedCutList->At(2)))->Fill(iLayer+1);
+           }//primary particles
+           else if(label > stack->GetNprimary()) {
+             Int_t lPartMother = -1;
+             Int_t motherPDGCode = -1;
+             if(particle) {
+               lPartMother = particle->GetFirstMother();
+               TParticle *motherParticle = stack->Particle(lPartMother);
+               if(motherParticle) motherPDGCode = motherParticle->GetPdgCode();
              }
-             ((TH1F *)(fAcceptedCutList->At(6)))->Fill(nClustersITS);
-             ((TH1F *)(fAcceptedCutList->At(10)))->Fill(chi2PerClusterITS);
-             ((TH1F *)(fAcceptedCutList->At(14)))->Fill(chi2ConstrainVertex);
-             ((TH1F *)(fAcceptedCutList->At(18)))->Fill(nClustersTPC);
-             ((TH1F *)(fAcceptedCutList->At(22)))->Fill(chi2PerClusterTPC);
-             ((TH1F *)(fAcceptedCutList->At(26)))->Fill(extCov[0]);
-             ((TH1F *)(fAcceptedCutList->At(30)))->Fill(extCov[2]);
-             ((TH1F *)(fAcceptedCutList->At(34)))->Fill(extCov[5]);
-             ((TH1F *)(fAcceptedCutList->At(38)))->Fill(extCov[9]);
-             ((TH1F *)(fAcceptedCutList->At(42)))->Fill(extCov[14]);
-             ((TH3D *)(fAcceptedCutList->At(46)))->Fill(track->Eta(),
-                                                        track->Phi()*180./TMath::Pi(),
-                                                        nClustersTPC);
-             ((TH3D *)(fAcceptedCutList->At(50)))->Fill(track->Eta(),
-                                                        track->Phi()*180./TMath::Pi(),
-                                                        chi2PerClusterTPC);
-             ((TH3D *)(fAcceptedCutList->At(54)))->Fill(track->Eta(),
-                                                        track->Phi()*180./TMath::Pi(),
-                                                        npointsTPCdEdx);
-             ((TH1F *)(fAcceptedCutList->At(58)))->Fill(npointsTPCdEdx);
              
-             ((TH1F *)(fAcceptedDCAList->At(2)))->Fill(TMath::Abs(dcaXY));
-             ((TH1F *)(fAcceptedDCAList->At(6)))->Fill(TMath::Abs(dcaZ));
-             ((TH1F *)(fAcceptedDCAList->At(10)))->Fill(nSigmaToVertex);
-             if(fProtonAnalysisBase->GetEtaMode())
-               ((TH2D *)(fQA2DList->At(2)))->Fill(track->Eta(),gPt);
-             else
-               ((TH2D *)(fQA2DList->At(2)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),
-                                                           track->Py(),
-                                                           track->Pz()),
-                                                  gPt);
-             if(fProtonAnalysisBase->GetEtaMode())
-               ((TH3F *)(fQA2DList->At(10)))->Fill(track->Eta(),gPt,
-                                                   ConvertPDGToInt(motherPDGCode));
-             else
-               ((TH3F *)(fQA2DList->At(10)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),
-                                                            track->Py(),
-                                                            track->Pz()),
-                                                   gPt,
-                                                   ConvertPDGToInt(motherPDGCode));
-           }
-           else if(track->Charge() < 0) {
-             for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
-               if(track->HasPointOnITSLayer(iLayer))
-                 ((TH1F *)(fAcceptedCutList->At(3)))->Fill(iLayer+1);
-             }
-             ((TH1F *)(fAcceptedCutList->At(7)))->Fill(nClustersITS);
-             ((TH1F *)(fAcceptedCutList->At(11)))->Fill(chi2PerClusterITS);
-             ((TH1F *)(fAcceptedCutList->At(15)))->Fill(chi2ConstrainVertex);
-             ((TH1F *)(fAcceptedCutList->At(19)))->Fill(nClustersTPC);
-             ((TH1F *)(fAcceptedCutList->At(23)))->Fill(chi2PerClusterTPC);
-             ((TH1F *)(fAcceptedCutList->At(27)))->Fill(extCov[0]);
-             ((TH1F *)(fAcceptedCutList->At(31)))->Fill(extCov[2]);
-             ((TH1F *)(fAcceptedCutList->At(35)))->Fill(extCov[5]);
-             ((TH1F *)(fAcceptedCutList->At(39)))->Fill(extCov[9]);
-             ((TH1F *)(fAcceptedCutList->At(43)))->Fill(extCov[14]);
-             ((TH3D *)(fAcceptedCutList->At(47)))->Fill(track->Eta(),
-                                                        track->Phi()*180./TMath::Pi(),
-                                                        nClustersTPC);
-             ((TH3D *)(fAcceptedCutList->At(51)))->Fill(track->Eta(),
-                                                        track->Phi()*180./TMath::Pi(),
-                                                        chi2PerClusterTPC);
-             ((TH3D *)(fAcceptedCutList->At(55)))->Fill(track->Eta(),
-                                                        track->Phi()*180./TMath::Pi(),
-                                                        npointsTPCdEdx);
-             ((TH1F *)(fAcceptedCutList->At(59)))->Fill(npointsTPCdEdx);
+             if(fMCProcessIdFlag)
+               if(particle->GetUniqueID() != fMCProcessId) continue;
+             if(fMotherParticlePDGCodeFlag)
+               if(TMath::Abs(motherPDGCode) != fMotherParticlePDGCode) continue;
              
-             ((TH1F *)(fAcceptedDCAList->At(3)))->Fill(TMath::Abs(dcaXY));
-             ((TH1F *)(fAcceptedDCAList->At(7)))->Fill(TMath::Abs(dcaZ));
-             ((TH1F *)(fAcceptedDCAList->At(11)))->Fill(nSigmaToVertex);
-             if(fProtonAnalysisBase->GetEtaMode())
-               ((TH2D *)(fQA2DList->At(6)))->Fill(track->Eta(),gPt);
-             else
-               ((TH2D *)(fQA2DList->At(6)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),
-                                                           track->Py(),
-                                                           track->Pz()),
-                                                  gPt);
-             if(fProtonAnalysisBase->GetEtaMode())
-               ((TH3F *)(fQA2DList->At(11)))->Fill(track->Eta(),gPt,
-                                                   ConvertPDGToInt(motherPDGCode));
-             else
-               ((TH3F *)(fQA2DList->At(11)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),
-                                                            track->Py(),
-                                                            track->Pz()),
-                                                   gPt,
-                                                   ConvertPDGToInt(motherPDGCode));
-           }
-         }//secondary particles
-       }//accepted - track cuts
-       else if(!fProtonAnalysisBase->IsAccepted(esd,vertex,track)) {
+             if(track->Charge() > 0) {
+               for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
+                 if(track->HasPointOnITSLayer(iLayer))
+                   ((TH1F *)(fAcceptedCutList->At(2)))->Fill(iLayer+1);
+               }
+               ((TH1F *)(fAcceptedCutList->At(6)))->Fill(nClustersITS);
+               ((TH1F *)(fAcceptedCutList->At(10)))->Fill(chi2PerClusterITS);
+               ((TH1F *)(fAcceptedCutList->At(14)))->Fill(chi2ConstrainVertex);
+               ((TH1F *)(fAcceptedCutList->At(18)))->Fill(nClustersTPC);
+               ((TH1F *)(fAcceptedCutList->At(22)))->Fill(chi2PerClusterTPC);
+               ((TH1F *)(fAcceptedCutList->At(26)))->Fill(extCov[0]);
+               ((TH1F *)(fAcceptedCutList->At(30)))->Fill(extCov[2]);
+               ((TH1F *)(fAcceptedCutList->At(34)))->Fill(extCov[5]);
+               ((TH1F *)(fAcceptedCutList->At(38)))->Fill(extCov[9]);
+               ((TH1F *)(fAcceptedCutList->At(42)))->Fill(extCov[14]);
+               ((TH3D *)(fAcceptedCutList->At(46)))->Fill(track->Eta(),
+                                                          track->Phi()*180./TMath::Pi(),
+                                                          nClustersTPC);
+               ((TH3D *)(fAcceptedCutList->At(50)))->Fill(track->Eta(),
+                                                          track->Phi()*180./TMath::Pi(),
+                                                          chi2PerClusterTPC);
+               ((TH3D *)(fAcceptedCutList->At(54)))->Fill(track->Eta(),
+                                                          track->Phi()*180./TMath::Pi(),
+                                                          npointsTPCdEdx);
+               ((TH1F *)(fAcceptedCutList->At(58)))->Fill(npointsTPCdEdx);
+               
+               ((TH1F *)(fAcceptedDCAList->At(2)))->Fill(TMath::Abs(dca[0]));
+               ((TH1F *)(fAcceptedDCAList->At(6)))->Fill(TMath::Abs(dca[1]));
+               ((TH1F *)(fAcceptedDCAList->At(10)))->Fill(nSigmaToVertex);
+               if(particle->GetUniqueID() == 4) {
+                 ((TH3F *)(fAcceptedDCAList->At(14)))->Fill(track->Eta(),gPt,TMath::Abs(dca[0]));
+                 ((TH3F *)(fAcceptedDCAList->At(20)))->Fill(track->Eta(),gPt,TMath::Abs(dca[1]));
+               }
+               if(particle->GetUniqueID() == 13) {
+                 ((TH3F *)(fAcceptedDCAList->At(16)))->Fill(track->Eta(),gPt,TMath::Abs(dca[0]));
+                 ((TH3F *)(fAcceptedDCAList->At(22)))->Fill(track->Eta(),gPt,TMath::Abs(dca[1]));
+               }
+               if(fProtonAnalysisBase->GetEtaMode())
+                 ((TH2D *)(fQA2DList->At(2)))->Fill(track->Eta(),gPt);
+               else
+                 ((TH2D *)(fQA2DList->At(2)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),
+                                                                                  track->Py(),
+                                                                                  track->Pz()),
+                                                    gPt);
+               if(fProtonAnalysisBase->GetEtaMode())
+                 ((TH3F *)(fQA2DList->At(10)))->Fill(track->Eta(),gPt,
+                                                     ConvertPDGToInt(motherPDGCode));
+               else
+                 ((TH3F *)(fQA2DList->At(10)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),
+                                                                                   track->Py(),
+                                                                                   track->Pz()),
+                                                     gPt,
+                                                     ConvertPDGToInt(motherPDGCode));
+             }
+             else if(track->Charge() < 0) {
+               for(Int_t iLayer = 0; iLayer < 6; iLayer++) {
+                 if(track->HasPointOnITSLayer(iLayer))
+                   ((TH1F *)(fAcceptedCutList->At(3)))->Fill(iLayer+1);
+               }
+               ((TH1F *)(fAcceptedCutList->At(7)))->Fill(nClustersITS);
+               ((TH1F *)(fAcceptedCutList->At(11)))->Fill(chi2PerClusterITS);
+               ((TH1F *)(fAcceptedCutList->At(15)))->Fill(chi2ConstrainVertex);
+               ((TH1F *)(fAcceptedCutList->At(19)))->Fill(nClustersTPC);
+               ((TH1F *)(fAcceptedCutList->At(23)))->Fill(chi2PerClusterTPC);
+               ((TH1F *)(fAcceptedCutList->At(27)))->Fill(extCov[0]);
+               ((TH1F *)(fAcceptedCutList->At(31)))->Fill(extCov[2]);
+               ((TH1F *)(fAcceptedCutList->At(35)))->Fill(extCov[5]);
+               ((TH1F *)(fAcceptedCutList->At(39)))->Fill(extCov[9]);
+               ((TH1F *)(fAcceptedCutList->At(43)))->Fill(extCov[14]);
+               ((TH3D *)(fAcceptedCutList->At(47)))->Fill(track->Eta(),
+                                                          track->Phi()*180./TMath::Pi(),
+                                                          nClustersTPC);
+               ((TH3D *)(fAcceptedCutList->At(51)))->Fill(track->Eta(),
+                                                          track->Phi()*180./TMath::Pi(),
+                                                          chi2PerClusterTPC);
+               ((TH3D *)(fAcceptedCutList->At(55)))->Fill(track->Eta(),
+                                                          track->Phi()*180./TMath::Pi(),
+                                                          npointsTPCdEdx);
+               ((TH1F *)(fAcceptedCutList->At(59)))->Fill(npointsTPCdEdx);
+               
+               ((TH1F *)(fAcceptedDCAList->At(3)))->Fill(TMath::Abs(dca[0]));
+               ((TH1F *)(fAcceptedDCAList->At(7)))->Fill(TMath::Abs(dca[1]));
+               ((TH1F *)(fAcceptedDCAList->At(11)))->Fill(nSigmaToVertex);
+               if(particle->GetUniqueID() == 4) {
+                 ((TH3F *)(fAcceptedDCAList->At(15)))->Fill(track->Eta(),gPt,TMath::Abs(dca[0]));
+                 ((TH3F *)(fAcceptedDCAList->At(21)))->Fill(track->Eta(),gPt,TMath::Abs(dca[1]));
+               }
+               if(particle->GetUniqueID() == 13) {
+                 ((TH3F *)(fAcceptedDCAList->At(17)))->Fill(track->Eta(),gPt,TMath::Abs(dca[0]));
+                 ((TH3F *)(fAcceptedDCAList->At(23)))->Fill(track->Eta(),gPt,TMath::Abs(dca[1]));
+               }
+               if(fProtonAnalysisBase->GetEtaMode())
+                 ((TH2D *)(fQA2DList->At(6)))->Fill(track->Eta(),gPt);
+               else
+                 ((TH2D *)(fQA2DList->At(6)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),
+                                                                                  track->Py(),
+                                                                                  track->Pz()),
+                                                    gPt);
+               if(fProtonAnalysisBase->GetEtaMode())
+                 ((TH3F *)(fQA2DList->At(11)))->Fill(track->Eta(),gPt,
+                                                     ConvertPDGToInt(motherPDGCode));
+               else
+                 ((TH3F *)(fQA2DList->At(11)))->Fill(fProtonAnalysisBase->Rapidity(track->Px(),
+                                                                                   track->Py(),
+                                                                                   track->Pz()),
+                                                     gPt,
+                                                     ConvertPDGToInt(motherPDGCode));
+             }
+           }//secondary particles
+         }//accepted - track cuts
+       }//primary-like cut
+       else if((!fProtonAnalysisBase->IsAccepted(track)) || 
+               (!fProtonAnalysisBase->IsPrimary(esd,vertex,track))) {
          if(label <= stack->GetNprimary()) {
            if(track->Charge() > 0) {
              ((TH3D *)(fRejectedCutList->At(0)))->Fill(track->Eta(),
@@ -4317,21 +4977,37 @@ void AliProtonQAAnalysis::RunQAAnalysis(AliStack *stack,
 void AliProtonQAAnalysis::InitMCAnalysis() {
   //MC analysis - 3D histograms: y-pT-pdg
   fPDGList = new TList();
-  TH3F *gHistYPtPDGProtons = new TH3F("gHistYPtPDGProtons",
-                                     ";;P_{T} [GeV/c];PDG",
-                                     fNBinsY,fMinY,fMaxY,
-                                     fNBinsPt,fMinPt,fMaxPt,
-                                     14,-0.5,13.5);
+  TH3F *gHistYPtPDGProtons = 0x0;
+  if(fUseAsymmetricBinning) {
+    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};
+  gHistYPtPDGProtons = new TH3F("gHistYPtPDGProtons",
+                               ";;P_{T} [GeV/c];PDG",
+                               fNBinsY,fY,fNBinsPt,fPt,14,gPDG);
+  }
+  else
+    gHistYPtPDGProtons = new TH3F("gHistYPtPDGProtons",
+                                 ";;P_{T} [GeV/c];PDG",
+                                 fNBinsY,fMinY,fMaxY,
+                                 fNBinsPt,fMinPt,fMaxPt,
+                                 14,-0.5,13.5);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtPDGProtons->GetXaxis()->SetTitle("#eta");
   else 
     gHistYPtPDGProtons->GetXaxis()->SetTitle("y");
   fPDGList->Add(gHistYPtPDGProtons);
-  TH3F *gHistYPtPDGAntiProtons = new TH3F("gHistYPtPDGAntiProtons",
-                                         ";;P_{T} [GeV/c];PDG",
-                                         fNBinsY,fMinY,fMaxY,
-                                         fNBinsPt,fMinPt,fMaxPt,
-                                         14,-0.5,13.5);
+  TH3F *gHistYPtPDGAntiProtons = 0x0;
+  if(fUseAsymmetricBinning) {
+    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};
+    gHistYPtPDGAntiProtons = new TH3F("gHistYPtPDGAntiProtons",
+                                     ";;P_{T} [GeV/c];PDG",
+                                     fNBinsY,fY,fNBinsPt,fPt,14,gPDG);
+  }
+  else
+    gHistYPtPDGAntiProtons = new TH3F("gHistYPtPDGAntiProtons",
+                                     ";;P_{T} [GeV/c];PDG",
+                                     fNBinsY,fMinY,fMaxY,
+                                     fNBinsPt,fMinPt,fMaxPt,
+                                     14,-0.5,13.5);
   if(fProtonAnalysisBase->GetEtaMode()) 
     gHistYPtPDGAntiProtons->GetXaxis()->SetTitle("#eta");
   else