]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGJE/AliPWG4HighPtTrackQA.cxx
Remove temporary task
[u/mrichter/AliRoot.git] / PWGJE / AliPWG4HighPtTrackQA.cxx
index 227ba57c63cd000b0f623ad4d72a0be724c6029f..4edae36b50956d544c4687db24e782325769cbd1 100644 (file)
@@ -18,7 +18,7 @@
 // of tracks and track selection criteria
 // Output: Histograms for different set of cuts
 //-----------------------------------------------------------------------
-// Author : Marta Verweij - UU
+// Author : M. Verweij - UU
 //-----------------------------------------------------------------------
 
 #ifndef ALIPWG4HIGHPTTRACKQA_CXX
@@ -52,7 +52,6 @@
 #include "AliCentrality.h"
 #include "AliAODVertex.h"
 #include "AliAODEvent.h"
-//#include "AliAnalysisHelperJetTasks.h"
 
 using namespace std; //required for resolving the 'cout' symbol
 
@@ -64,16 +63,18 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA()
   fEvent(0x0),
   fESD(0x0),
   fVtx(0x0),
+  fVtxAOD(0x0),
   fTrackCuts(0x0), 
   fTrackCutsITSLoose(0x0), 
   fTrackCutsTPConly(0x0), 
   fTrackType(0),
   fFilterMask(0),
+  fIncludeNoITS(kFALSE),
   fSigmaConstrainedMax(-1.),
   fPtMax(100.),
   fIsPbPb(0),
   fCentClass(10),
-  fNVariables(25),
+  fNVariables(26),
   fVariables(0x0),
   fITSClusterMap(0),
   fAvgTrials(1),
@@ -92,6 +93,7 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA()
   fPtSel(0),    
   fPtPhi(0x0),
   fPtEta(0x0),
+  fPtEtaPhi(0x0),
   fPtDCA2D(0x0),
   fPtDCAZ(0x0),
   fPtNClustersTPC(0x0),
@@ -100,6 +102,7 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA()
   fPtNClustersTPCShared(0x0),
   fPtNClustersTPCSharedFrac(0x0),
   fPtNPointITS(0x0),
+  fPtNPointITSPhi(0x0),
   fPtChi2C(0x0),
   fPtNSigmaToVertex(0x0),
   fPtRelUncertainty1Pt(0x0),
@@ -110,7 +113,6 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA()
   fPtRelUncertainty1PtChi2(0x0),
   fPtRelUncertainty1PtChi2Iter1(0x0),
   fPtRelUncertainty1PtPhi(0x0),
-  fPtUncertainty1Pt(0x0),
   fPtChi2PerClusterTPC(0x0),
   fPtChi2PerClusterTPCIter1(0x0),
   fPtNCrossedRows(0x0),
@@ -123,6 +125,7 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA()
   fNCrossedRowsNCrossedRowsFit(0x0),
   fNClustersNCrossedRows(0x0),
   fNClustersNCrossedRowsFit(0x0),
+  fPtNClustersNClustersFitMap(0x0),
   fPtRelUncertainty1PtNCrossedRows(0x0),
   fPtRelUncertainty1PtNCrossedRowsFit(0x0),
   fPtChi2Gold(0x0),
@@ -130,6 +133,7 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA()
   fPtChi2GoldPhi(0x0),
   fPtChi2GGCPhi(0x0),
   fChi2GoldChi2GGC(0x0),
+  fPtChi2ITSPhi(0x0),
   fPtSigmaY2(0x0),
   fPtSigmaZ2(0x0),
   fPtSigmaSnp2(0x0),
@@ -144,7 +148,10 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA()
   fProfPtPtSigma1Pt(0x0),
   fHistList(0)
 {
-  SetNVariables(25);
+  //
+  // Constructor
+  //
+  SetNVariables(26);
 
   fPtBinEdges[0][0] = 10.;
   fPtBinEdges[0][1] = 1.;
@@ -161,16 +168,18 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA(const char *name):
   fEvent(0x0),
   fESD(0x0),
   fVtx(0x0),
+  fVtxAOD(0x0),
   fTrackCuts(0x0),
   fTrackCutsITSLoose(0x0), 
   fTrackCutsTPConly(0x0), 
   fTrackType(0),
   fFilterMask(0),
+  fIncludeNoITS(kFALSE),
   fSigmaConstrainedMax(-1.),
   fPtMax(100.),
   fIsPbPb(0),
   fCentClass(10),
-  fNVariables(25),
+  fNVariables(26),
   fVariables(0x0),
   fITSClusterMap(0),
   fAvgTrials(1),
@@ -189,6 +198,7 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA(const char *name):
   fPtSel(0),
   fPtPhi(0x0),
   fPtEta(0x0),
+  fPtEtaPhi(0x0),
   fPtDCA2D(0x0),
   fPtDCAZ(0x0),
   fPtNClustersTPC(0x0),
@@ -197,6 +207,7 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA(const char *name):
   fPtNClustersTPCShared(0x0),
   fPtNClustersTPCSharedFrac(0x0),
   fPtNPointITS(0x0),
+  fPtNPointITSPhi(0x0),
   fPtChi2C(0x0),
   fPtNSigmaToVertex(0x0),
   fPtRelUncertainty1Pt(0x0),
@@ -207,7 +218,6 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA(const char *name):
   fPtRelUncertainty1PtChi2(0x0),
   fPtRelUncertainty1PtChi2Iter1(0x0),
   fPtRelUncertainty1PtPhi(0x0),
-  fPtUncertainty1Pt(0x0),
   fPtChi2PerClusterTPC(0x0),
   fPtChi2PerClusterTPCIter1(0x0),
   fPtNCrossedRows(0x0),
@@ -220,6 +230,7 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA(const char *name):
   fNCrossedRowsNCrossedRowsFit(0x0),
   fNClustersNCrossedRows(0x0),
   fNClustersNCrossedRowsFit(0x0),
+  fPtNClustersNClustersFitMap(0x0),
   fPtRelUncertainty1PtNCrossedRows(0x0),
   fPtRelUncertainty1PtNCrossedRowsFit(0x0),
   fPtChi2Gold(0x0),
@@ -227,6 +238,7 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA(const char *name):
   fPtChi2GoldPhi(0x0),
   fPtChi2GGCPhi(0x0),
   fChi2GoldChi2GGC(0x0),
+  fPtChi2ITSPhi(0x0),
   fPtSigmaY2(0x0),
   fPtSigmaZ2(0x0),
   fPtSigmaSnp2(0x0),
@@ -246,7 +258,7 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA(const char *name):
   //
   AliDebug(2,Form("AliPWG4HighPtTrackQA Calling Constructor"));
 
-  SetNVariables(25);
+  SetNVariables(26);
 
   fPtBinEdges[0][0] = 10.;
   fPtBinEdges[0][1] = 1.;
@@ -263,6 +275,9 @@ AliPWG4HighPtTrackQA::AliPWG4HighPtTrackQA(const char *name):
 
 //________________________________________________________________________
 void AliPWG4HighPtTrackQA::SetPtBinEdges(Int_t region, Double_t ptmax, Double_t ptBinWidth) {
+  //
+  // Set variable bin sizes for pT axis in histos
+  //
 
   if(region<3) {
     fPtBinEdges[region][0] = ptmax;
@@ -500,6 +515,8 @@ void AliPWG4HighPtTrackQA::UserCreateOutputObjects() {
   fHistList->Add(fh1NTracksAll);
 
   fh1NTracksReject = new TH1F("fh1NTracksReject","fh1NTracksReject",1,-0.5,0.5);
+  fh1NTracksReject->Fill("noHybridTrack",0);
+  fh1NTracksReject->Fill("noITSrefit",0);
   fh1NTracksReject->Fill("noESDtrack",0);
   fh1NTracksReject->Fill("noTPCInner",0);
   fh1NTracksReject->Fill("FillTPC",0);
@@ -523,6 +540,9 @@ void AliPWG4HighPtTrackQA::UserCreateOutputObjects() {
  
   fPtEta = new TH2F("fPtEta","fPtEta",fgkNPtBins,binsPt,fgkNEtaBins,binsEta);
   fHistList->Add(fPtEta);
+
+  fPtEtaPhi = new TH3F("fPtEtaPhi","fPtEtaPhi",fgkNPtBins,binsPt,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
+  fHistList->Add(fPtEtaPhi);
  
   fPtDCA2D = new TH2F("fPtDCA2D","fPtDCA2D",fgkNPtBins,binsPt,fgkNDCA2DBins,binsDCA2D);
   fHistList->Add(fPtDCA2D);
@@ -547,6 +567,9 @@ void AliPWG4HighPtTrackQA::UserCreateOutputObjects() {
  
   fPtNPointITS = new TH2F("fPtNPointITS","fPtNPointITS",fgkNPtBins,binsPt,fgkNNPointITSBins,binsNPointITS);
   fHistList->Add(fPtNPointITS);
+
+  fPtNPointITSPhi = new TH3F("fPtNPointITSPhi","fPtNPointITSPhi",fgkNPtBins,binsPt,fgkNNPointITSBins,binsNPointITS,fgkNPhiBins,binsPhi);
+  fHistList->Add(fPtNPointITSPhi);
  
   fPtChi2C = new TH2F("fPtChi2C","fPtChi2C",fgkNPtBins,binsPt,fgkNChi2CBins,binsChi2C);
   fHistList->Add(fPtChi2C);
@@ -578,9 +601,6 @@ void AliPWG4HighPtTrackQA::UserCreateOutputObjects() {
   fPtRelUncertainty1PtPhi = new TH3F("fPtRelUncertainty1PtPhi","fPtRelUncertainty1PtPhi",fgkNPtBins,binsPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNPhiBins,binsPhi);
   fHistList->Add(fPtRelUncertainty1PtPhi);
 
-  fPtUncertainty1Pt = new TH2F("fPtUncertainty1Pt","fPtUncertainty1Pt",fgkNPtBins,binsPt,fgkNUncertainty1PtBins,binsUncertainty1Pt);
-  fHistList->Add(fPtUncertainty1Pt);
   fPtChi2PerClusterTPC = new TH2F("fPtChi2PerClusterTPC","fPtChi2PerClusterTPC",fgkNPtBins,binsPt,fgkNChi2PerClusBins,binsChi2PerClus);
   fHistList->Add(fPtChi2PerClusterTPC);
  
@@ -617,6 +637,9 @@ void AliPWG4HighPtTrackQA::UserCreateOutputObjects() {
   fNClustersNCrossedRowsFit = new TH2F("fNClustersNCrossedRowsFit","fNClustersNCrossedRowsFit",fgkNNClustersTPCBins,binsNClustersTPC,fgkNNClustersTPCBins,binsNClustersTPC);
   fHistList->Add(fNClustersNCrossedRowsFit);
 
+  fPtNClustersNClustersFitMap = new TH3F("fPtNClustersNClustersFitMap","fPtNClustersNClustersFitMap;p_{T};N_{cls};N_{cls}^{fit map}",fgkNPtBins,binsPt,fgkNNClustersTPCBins,binsNClustersTPC,fgkNNClustersTPCBins,binsNClustersTPC);
+  fHistList->Add(fPtNClustersNClustersFitMap);
+
   fPtRelUncertainty1PtNCrossedRows = new TH3F("fPtRelUncertainty1PtNCrossedRows","fPtRelUncertainty1PtNCrossedRows",fgkNPtBins,binsPt,fgkNRel1PtUncertaintyBins,binsRel1PtUncertainty,fgkNNClustersTPCBins,binsNClustersTPC);
   fHistList->Add(fPtRelUncertainty1PtNCrossedRows);
 
@@ -638,6 +661,8 @@ void AliPWG4HighPtTrackQA::UserCreateOutputObjects() {
   fChi2GoldChi2GGC = new TH2F("fChi2GoldChi2GGC","fChi2GoldChi2GGC;#chi^{2}_{gold};#chi^{2}_{ggc}",fgkNChi2CBins,binsChi2C,fgkNChi2CBins,binsChi2C);
   fHistList->Add(fChi2GoldChi2GGC);
 
+  fPtChi2ITSPhi = new TH3F("fPtChi2ITSPhi","fPtChi2ITSPhi;p_{T};#chi^{2}_{ITS};#varphi",fgkNPtBins,binsPt,fgkNChi2CBins,binsChi2C,fgkNPhiBins,binsPhi);
+  fHistList->Add(fPtChi2ITSPhi);
 
   fPtSigmaY2 = new TH2F("fPtSigmaY2","fPtSigmaY2",fgkN1PtBins,bins1Pt,fgkNSigmaY2Bins,binsSigmaY2);
   fHistList->Add(fPtSigmaY2);
@@ -685,6 +710,7 @@ void AliPWG4HighPtTrackQA::UserCreateOutputObjects() {
   if(binsDCA2D)             delete [] binsDCA2D;
   if(binsDCAZ)              delete [] binsDCAZ;
   if(binsNPointITS)         delete [] binsNPointITS;
+  if(binsITSClusterMap)     delete [] binsITSClusterMap;
   if(binsNSigmaToVertex)    delete [] binsNSigmaToVertex;
   if(binsChi2C)             delete [] binsChi2C;
   if(binsEta)               delete [] binsEta;
@@ -768,15 +794,15 @@ Bool_t AliPWG4HighPtTrackQA::SelectEvent() {
     }
   }
   else if(fDataType==kAOD&&dynamic_cast<AliAODEvent*>(fEvent)) {
-    const AliAODVertex *vtx = ((AliAODEvent*)fEvent)->GetPrimaryVertexSPD();
-    if(!vtx) {
+    fVtxAOD = ((AliAODEvent*)fEvent)->GetPrimaryVertex();
+    if(!fVtxAOD) {
       fNEventReject->Fill("noVTX",1);
       selectEvent = kFALSE;
       return selectEvent;
     }
     
     // Need vertex cut
-    if(vtx->GetNContributors()<2) {
+    if(fVtxAOD->GetNContributors()<2) {
       fNEventReject->Fill("NCont<2",1);
       selectEvent = kFALSE;
       return selectEvent;
@@ -784,7 +810,7 @@ Bool_t AliPWG4HighPtTrackQA::SelectEvent() {
     
     //Check if z-vertex < 10 cm
     double primVtx[3];
-    vtx->GetXYZ(primVtx);
+    fVtxAOD->GetXYZ(primVtx);
     if(TMath::Sqrt(primVtx[0]*primVtx[0] + primVtx[1]*primVtx[1])>1. || TMath::Abs(primVtx[2]>10.)){
       fNEventReject->Fill("ZVTX>10",1);
       selectEvent = kFALSE;
@@ -858,7 +884,7 @@ Int_t AliPWG4HighPtTrackQA::CalculateCentrality(AliESDEvent *esd){
 }
 
 //________________________________________________________________________
-Int_t AliPWG4HighPtTrackQA::CalculateCentrality(AliAODEvent *aod){
+Int_t AliPWG4HighPtTrackQA::CalculateCentrality(const AliAODEvent *aod){
   //
   // Get centrality from AOD
   //
@@ -872,7 +898,7 @@ Int_t AliPWG4HighPtTrackQA::CalculateCentrality(AliAODEvent *aod){
 }
 
 //________________________________________________________________________
-Int_t AliPWG4HighPtTrackQA::GetCentralityClass(Float_t cent) {
+Int_t AliPWG4HighPtTrackQA::GetCentralityClass(Float_t cent) const {
   //
   // Get centrality class
   //
@@ -981,6 +1007,9 @@ void AliPWG4HighPtTrackQA::DoAnalysisESD() {
     20: nClustersTPCShared
     21: Golden Chi2 - global vs TPC constrained
     22: Chi2 between global and global constrained
+    23: #crossed rows from fit map
+    24: (#crossed rows)/(#findable clusters) from fit map
+    25: chi2ITS
   */
 
   for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
@@ -1008,7 +1037,7 @@ void AliPWG4HighPtTrackQA::DoAnalysisESD() {
     if(fTrackType==1)
       track = AliESDtrackCuts::GetTPCOnlyTrack(fESD,esdtrack->GetID());
     else if(fTrackType==2 || fTrackType==4) {
-      track = AliESDtrackCuts::GetTPCOnlyTrack(fESD,esdtrack->GetID());
+      track = AliESDtrackCuts::GetTPCOnlyTrack(const_cast<AliESDEvent*>(fESD),esdtrack->GetID());
       if(!track) {
        fh1NTracksReject->Fill("noTPConly",1);
        if(origtrack) delete origtrack;
@@ -1086,7 +1115,7 @@ void AliPWG4HighPtTrackQA::DoAnalysisESD() {
     if (!(fTrackCuts->AcceptTrack(track)) && fTrackType!=4 && fTrackType!=5 && fTrackType!=6) {
       fh1NTracksReject->Fill("trackCuts",1);
       if(fTrackType==1 || fTrackType==2 || fTrackType==7) {
-       if(track) delete track;
+       if(track) delete track;
       }
       if(origtrack) delete origtrack;
       continue;
@@ -1180,6 +1209,11 @@ void AliPWG4HighPtTrackQA::DoAnalysisESD() {
     Float_t crossedRowsTPCNClsFFit = 1.;
     if(track->GetTPCNclsF()>0.) crossedRowsTPCNClsFFit = fVariables->At(23)/track->GetTPCNclsF();
     fVariables->SetAt(crossedRowsTPCNClsFFit,24);
+
+    fVariables->SetAt(track->GetITSchi2(),25);
+
+    TBits fitmap = track->GetTPCFitMap();
+    fPtNClustersNClustersFitMap->Fill(track->Pt(),track->GetTPCNcls(),(float)fitmap.CountBits());
     
     FillHistograms();
   
@@ -1196,14 +1230,26 @@ void AliPWG4HighPtTrackQA::DoAnalysisESD() {
 
 //________________________________________________________________________
 void AliPWG4HighPtTrackQA::DoAnalysisAOD() {
-
+  //
+  // Do QA on AOD input
+  //
   AliAODEvent *aod = dynamic_cast<AliAODEvent*>(fEvent);
-  if(!aod)return;
-  AliExternalTrackParam *exParam = new  AliExternalTrackParam();
+  if(!aod) return;
+  AliExternalTrackParam exParam;
   for (Int_t iTrack = 0; iTrack < fEvent->GetNumberOfTracks(); iTrack++) {
 
     AliAODTrack *aodtrack = aod->GetTrack(iTrack);
-    if( !aodtrack->TestFilterMask(fFilterMask) ) continue;
+    if( !aodtrack->TestFilterMask(fFilterMask) ) {
+      fh1NTracksReject->Fill("noHybridTrack",1);
+      continue;
+    }
+
+    if(!fIncludeNoITS) {
+      if ((aodtrack->GetStatus()&AliESDtrack::kITSrefit)==0) {
+       fh1NTracksReject->Fill("noITSrefit",1);
+       continue;
+      }
+    }
 
     fVariables->Reset(0.);
 
@@ -1211,20 +1257,27 @@ void AliPWG4HighPtTrackQA::DoAnalysisAOD() {
     fVariables->SetAt(aodtrack->Phi(),1);
     fVariables->SetAt(aodtrack->Eta(),2);
 
-    Double_t dca[2] = {1e6,1e6};
-    Double_t covar[3] = {1e6,1e6,1e6};
-    if(aodtrack->PropagateToDCA(fEvent->GetPrimaryVertex(),fEvent->GetMagneticField(),100.,dca,covar)) {
-      fVariables->SetAt(dca[0],3);
-      fVariables->SetAt(dca[1],4);
+    Double_t dca[2] = {0.,0.};
+    if(aodtrack->IsGlobalConstrained()) {
+      dca[0] = aodtrack->DCA();
+      dca[1] = aodtrack->ZAtDCA();
+    } else {
+      Double_t v[3]   = {0};
+      Double_t pos[3] = {0};
+      fVtxAOD->GetXYZ(v);
+      aodtrack->GetXYZ(pos);
+      dca[0] = pos[0] - v[0];
+      dca[1] = pos[1] - v[1];
     }
-
+    fVariables->SetAt(dca[0],3);
+    fVariables->SetAt(dca[1],4);
     fVariables->SetAt((float)aodtrack->GetTPCNcls(),5);
     fVariables->SetAt((float)aodtrack->GetITSNcls(),6);
     fVariables->SetAt(aodtrack->Chi2perNDF(),7);
     fVariables->SetAt(0.,8);
     fVariables->SetAt(GetTrackLengthTPC(aodtrack),9);
     fVariables->SetAt(aodtrack->Chi2perNDF(),10);
-    fVariables->SetAt(GetTPCClusterInfo(aodtrack,2,1),11);
+    fVariables->SetAt(GetTPCClusterInfo(aodtrack,2,1,0,159,kFALSE),11);
     Float_t crossedRowsTPCNClsF = 0.;
     if(aodtrack->GetTPCNclsF()>0.) crossedRowsTPCNClsF = fVariables->At(11)/aodtrack->GetTPCNclsF();
     fVariables->SetAt(crossedRowsTPCNClsF,12);
@@ -1237,45 +1290,51 @@ void AliPWG4HighPtTrackQA::DoAnalysisAOD() {
     Double_t xyz[3] = {0,};
     aodtrack->GetXYZ(xyz);
     Short_t sign = aodtrack->Charge();
-    exParam->Set(xyz,pxpypz,cov,sign);
+    exParam.Set(xyz,pxpypz,cov,sign);
 
-    fVariables->SetAt(exParam->GetSigmaY2(),13);
-    fVariables->SetAt(exParam->GetSigmaZ2(),14);
-    fVariables->SetAt(exParam->GetSigmaSnp2(),15);
-    fVariables->SetAt(exParam->GetSigmaTgl2(),16);
-    fVariables->SetAt(exParam->GetSigma1Pt2(),17);
+    fVariables->SetAt(exParam.GetSigmaY2(),13);
+    fVariables->SetAt(exParam.GetSigmaZ2(),14);
+    fVariables->SetAt(exParam.GetSigmaSnp2(),15);
+    fVariables->SetAt(exParam.GetSigmaTgl2(),16);
+    fVariables->SetAt(exParam.GetSigma1Pt2(),17);
 
-    fVariables->SetAt(0.,18);
-    fVariables->SetAt(0.,19);
+    fVariables->SetAt(0.,18); //NClustersTPCIter1
+    fVariables->SetAt(0.,19); //Chi2TPCIter1
 
     TBits sharedClusterMap = aodtrack->GetTPCSharedMap();
     fVariables->SetAt(sharedClusterMap.CountBits(),20);
     
-    fVariables->SetAt(0.,21); //not available in AOD
-    fVariables->SetAt(0.,22); //not available in AOD
+    fVariables->SetAt(0.,21); //not available in AOD golden chi2
+    fVariables->SetAt(0.,22); //not available in AOD  Chi2 between global and global constrained
+
+    fVariables->SetAt(GetTPCClusterInfo(aodtrack,2,1,0,159,kTRUE),23); //not available in AOD #crossed rows from fit map
+    Float_t crossedRowsTPCNClsFFit = 0.;
+    if(aodtrack->GetTPCNclsF()>0.) crossedRowsTPCNClsFFit = fVariables->At(23)/aodtrack->GetTPCNclsF();
+    fVariables->SetAt(crossedRowsTPCNClsFFit,24); //(#crossed rows)/(#findable clusters) from fit map
 
-    fVariables->SetAt(0.,23); //not available in AOD
-    fVariables->SetAt(0.,24); //not available in AOD
+    fVariables->SetAt(0.,25);
 
     fPtAll->Fill(fVariables->At(0));
 
     FillHistograms();
-
   }
-
 }
 
 //________________________________________________________________________
 void AliPWG4HighPtTrackQA::FillHistograms() {
+  //
+  // Fill all QA histograms
+  //
 
   fPtSel->Fill(fVariables->At(0));
   fPtPhi->Fill(fVariables->At(0),fVariables->At(1));
   fPtEta->Fill(fVariables->At(0),fVariables->At(2));
+  fPtEtaPhi->Fill(fVariables->At(0),fVariables->At(2),fVariables->At(1));
   fPtDCA2D->Fill(fVariables->At(0),fVariables->At(3));
   fPtDCAZ->Fill(fVariables->At(0),fVariables->At(4));
   fPtNClustersTPC->Fill(fVariables->At(0),fVariables->At(5));
   fPtNPointITS->Fill(fVariables->At(0),fVariables->At(6));
-
+  fPtNPointITSPhi->Fill(fVariables->At(0),fVariables->At(6),fVariables->At(1));
   
   fPtNClustersTPCIter1->Fill(fVariables->At(0),fVariables->At(18));
   fPtNClustersTPCIter1Phi->Fill(fVariables->At(0),fVariables->At(18),fVariables->At(1));
@@ -1300,7 +1359,6 @@ void AliPWG4HighPtTrackQA::FillHistograms() {
     fPtRelUncertainty1PtChi2Iter1->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)),fVariables->At(19)/fVariables->At(18));
   fPtRelUncertainty1PtPhi->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)),fVariables->At(1));
   
-  fPtUncertainty1Pt->Fill(fVariables->At(0),TMath::Sqrt(fVariables->At(17)));
   fPtSigmaY2->Fill(1./fVariables->At(0),TMath::Sqrt(fVariables->At(13)));
   fPtSigmaZ2->Fill(1./fVariables->At(0),TMath::Sqrt(fVariables->At(14)));
   fPtSigmaSnp2->Fill(1./fVariables->At(0),TMath::Sqrt(fVariables->At(15)));
@@ -1340,6 +1398,9 @@ void AliPWG4HighPtTrackQA::FillHistograms() {
   fPtRelUncertainty1PtNCrossedRows->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)),fVariables->At(11));
   fPtRelUncertainty1PtNCrossedRowsFit->Fill(fVariables->At(0),fVariables->At(0)*TMath::Sqrt(fVariables->At(17)),fVariables->At(23));
 
+  if(fVariables->At(6)>0.)
+    fPtChi2ITSPhi->Fill(fVariables->At(0),fVariables->At(25)/fVariables->At(6),fVariables->At(1));
+
 }
 
 //________________________________________________________________________
@@ -1363,8 +1424,6 @@ Bool_t AliPWG4HighPtTrackQA::PythiaInfoFromFile(const char* currFile,Float_t &fX
     // not an archive take the basename....
     file.ReplaceAll(gSystem->BaseName(file.Data()),"");
   }
-  //  Printf("%s",file.Data());
-   
 
   TFile *fxsec = TFile::Open(Form("%s%s",file.Data(),"pyxsec.root")); // problem that we cannot really test the existance of a file in a archive so we have to lvie with open error message from root
   if(!fxsec){
@@ -1442,7 +1501,7 @@ Bool_t AliPWG4HighPtTrackQA::Notify()
 }
 
 //________________________________________________________________________
-AliGenPythiaEventHeader*  AliPWG4HighPtTrackQA::GetPythiaEventHeader(AliMCEvent *mcEvent){
+AliGenPythiaEventHeader*  AliPWG4HighPtTrackQA::GetPythiaEventHeader(const AliMCEvent *mcEvent){
   
   if(!mcEvent)return 0;
   AliGenEventHeader* genHeader = mcEvent->GenEventHeader();
@@ -1472,7 +1531,7 @@ AliGenPythiaEventHeader*  AliPWG4HighPtTrackQA::GetPythiaEventHeader(AliMCEvent
 }
 
 //_______________________________________________________________________
-Float_t AliPWG4HighPtTrackQA::GetTPCClusterInfo(AliAODTrack *tr,Int_t nNeighbours/*=3*/, Int_t type/*=0*/, Int_t row0, Int_t row1) const
+Float_t AliPWG4HighPtTrackQA::GetTPCClusterInfo(const AliAODTrack *tr,Int_t nNeighbours/*=3*/, Int_t type/*=0*/, Int_t row0, Int_t row1, Bool_t useFitMap) const
 {
   //MV: copied from AliESDtrack since method is not available in AliAODTrack
 
@@ -1488,7 +1547,12 @@ Float_t AliPWG4HighPtTrackQA::GetTPCClusterInfo(AliAODTrack *tr,Int_t nNeighbour
   //           effects with a very simple algorithm.
   //
 
-  TBits fTPCClusterMap = tr->GetTPCClusterMap(); 
+  TBits fTPCClusterMap = 0;
+  if(useFitMap)
+    fTPCClusterMap = tr->GetTPCFitMap(); 
+  else
+    fTPCClusterMap = tr->GetTPCClusterMap(); 
+
   if (type==2) return fTPCClusterMap.CountBits();
 
   Int_t found=0;
@@ -1530,7 +1594,7 @@ Float_t AliPWG4HighPtTrackQA::GetTPCClusterInfo(AliAODTrack *tr,Int_t nNeighbour
 }
 
 //_______________________________________________________________________
-Float_t AliPWG4HighPtTrackQA::GetTPCClusterInfoFitMap(AliESDtrack *tr,Int_t nNeighbours/*=3*/, Int_t type/*=0*/, Int_t row0, Int_t row1) const
+Float_t AliPWG4HighPtTrackQA::GetTPCClusterInfoFitMap(const AliESDtrack *tr,Int_t nNeighbours/*=3*/, Int_t type/*=0*/, Int_t row0, Int_t row1) const
 {
   //
   // TPC cluster information from fit map
@@ -1586,7 +1650,7 @@ Float_t AliPWG4HighPtTrackQA::GetTPCClusterInfoFitMap(AliESDtrack *tr,Int_t nNei
 }
 
 //_______________________________________________________________________
-Int_t AliPWG4HighPtTrackQA::GetTrackLengthTPC(AliESDtrack *track) {
+Int_t AliPWG4HighPtTrackQA::GetTrackLengthTPC(const AliESDtrack *track) const {
   //
   // returns distance between 1st and last hit in TPC
   // distance given in number of padrows
@@ -1609,7 +1673,7 @@ Int_t AliPWG4HighPtTrackQA::GetTrackLengthTPC(AliESDtrack *track) {
 }
 
 //_______________________________________________________________________
-Int_t AliPWG4HighPtTrackQA::GetTrackLengthTPC(AliAODTrack *track) {
+Int_t AliPWG4HighPtTrackQA::GetTrackLengthTPC(const AliAODTrack *track) const {
   //
   // returns distance between 1st and last hit in TPC
   // distance given in number of padrows