]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGHF/vertexingHF/AliAnalysisTaskSEHFQA.cxx
Updates
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliAnalysisTaskSEHFQA.cxx
index 5924880de3999d88d6340223d35e89a14d9b61bf..fff02bc0dee2489f2fa33c9822362256b5bb07af 100644 (file)
@@ -60,6 +60,7 @@
 #include "AliRDHFCutsD0toKpi.h"
 #include "AliRDHFCutsLctopKpi.h"
 #include "AliRDHFCutsLctoV0.h"
+#include "AliVertexingHFUtils.h"
 #include "AliInputEventHandler.h"
 
 #include "AliFlowEvent.h"
@@ -67,6 +68,8 @@
 #include "AliFlowTrackSimple.h"
 #include "AliFlowVector.h"
 
+#include "AliTRDTriggerAnalysis.h"
+
 #include "AliAnalysisTaskSEHFQA.h"
 
 using std::cout;
@@ -77,7 +80,7 @@ ClassImp(AliAnalysisTaskSEHFQA)
 //____________________________________________________________________________
 
 AliAnalysisTaskSEHFQA::AliAnalysisTaskSEHFQA():AliAnalysisTaskSE(),
-  fNEntries(0x0),
+  fOutputEntries(0x0),
   fOutputPID(0x0),
   fOutputTrack(0x0),
   fOutputCounters(0x0),
@@ -106,7 +109,7 @@ AliAnalysisTaskSEHFQA::AliAnalysisTaskSEHFQA():AliAnalysisTaskSE(),
 //____________________________________________________________________________
 AliAnalysisTaskSEHFQA::AliAnalysisTaskSEHFQA(const char *name, AliAnalysisTaskSEHFQA::DecChannel ch,AliRDHFCuts* cuts):
   AliAnalysisTaskSE(name),
-  fNEntries(0x0),
+  fOutputEntries(0x0),
   fOutputPID(0x0),
   fOutputTrack(0x0),
   fOutputCounters(0x0),
@@ -135,8 +138,8 @@ AliAnalysisTaskSEHFQA::AliAnalysisTaskSEHFQA(const char *name, AliAnalysisTaskSE
   fOnOff[3]=kTRUE;
   fOnOff[4]=kTRUE;
 
-  // Output slot #1 writes into a TH1F container (number of events)
-  DefineOutput(1,TH1F::Class());  //My private output
+  // Output slot #1 writes into a TList container (number of events)
+  DefineOutput(1,TList::Class());
   // Output slot #2 writes into a TList container (PID)
   if (fOnOff[1]) DefineOutput(2,TList::Class());  //My private output
   // Output slot #3 writes into a TList container (Tracks)
@@ -181,7 +184,8 @@ AliAnalysisTaskSEHFQA::AliAnalysisTaskSEHFQA(const char *name, AliAnalysisTaskSE
 AliAnalysisTaskSEHFQA::~AliAnalysisTaskSEHFQA()
 {
   //destructor
-  delete fNEntries;
+
+  delete fOutputEntries;
 
   delete fOutputPID;
 
@@ -269,23 +273,39 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
   if(fDebug > 1) printf("AnalysisTaskSEHFQA::UserCreateOutputObjects() \n");
 
   //count events
-
-  fNEntries=new TH1F(GetOutputSlot(1)->GetContainer()->GetName(), "Counts the number of events", 10,-0.5,9.5);
-  fNEntries->GetXaxis()->SetBinLabel(1,"nEventsAnal");
-  fNEntries->GetXaxis()->SetBinLabel(2,"Pile-up Rej");
-  fNEntries->GetXaxis()->SetBinLabel(3,"No VertexingHF");
-  fNEntries->GetXaxis()->SetBinLabel(4,"nCandidates(AnCuts)");
-  fNEntries->GetXaxis()->SetBinLabel(5,"EventsWithGoodVtx");
-  //fNEntries->GetXaxis()->SetBinLabel(6,"N. of 0SMH");
-  fNEntries->GetXaxis()->SetBinLabel(6,"N candidates");
+  fOutputEntries=new TList();
+  fOutputEntries->SetOwner();
+  fOutputEntries->SetName(GetOutputSlot(1)->GetContainer()->GetName());
+
+
+  TString hnameEntries="hNentries";
+  TH1F* hNentries=new TH1F(hnameEntries.Data(), "Counts the number of events", 10,-0.5,9.5);
+  hNentries->GetXaxis()->SetBinLabel(1,"nEventsAnal");
+  hNentries->GetXaxis()->SetBinLabel(2,"Pile-up Rej");
+  hNentries->GetXaxis()->SetBinLabel(3,"No VertexingHF");
+  hNentries->GetXaxis()->SetBinLabel(4,"nCandidates(AnCuts)");
+  hNentries->GetXaxis()->SetBinLabel(5,"EventsWithGoodVtx");
+  hNentries->GetXaxis()->SetBinLabel(6,"N candidates");
   if(fReadMC){
-    fNEntries->GetXaxis()->SetBinLabel(7,"MC Cand from c");
-    fNEntries->GetXaxis()->SetBinLabel(8,"MC Cand from b");
-    fNEntries->GetXaxis()->SetBinLabel(9,"N fake Trks");
-    fNEntries->GetXaxis()->SetBinLabel(10,"N true Trks");
+    hNentries->GetXaxis()->SetBinLabel(7,"MC Cand from c");
+    hNentries->GetXaxis()->SetBinLabel(8,"MC Cand from b");
+    hNentries->GetXaxis()->SetBinLabel(9,"N fake Trks");
+    hNentries->GetXaxis()->SetBinLabel(10,"N true Trks");
   }
 
-  fNEntries->GetXaxis()->SetNdivisions(1,kFALSE);
+  hNentries->GetXaxis()->SetNdivisions(1,kFALSE);
+
+  hnameEntries="HasSelBit";
+  TH2F* hNentriesSelBit=new TH2F(hnameEntries.Data(), "Counts the number of events with SelectionBit", 5,0.,5.,100,0.,30.);
+  hNentriesSelBit->GetXaxis()->SetBinLabel(1,"Dplus");
+  hNentriesSelBit->GetXaxis()->SetBinLabel(2,"Ds");
+  hNentriesSelBit->GetXaxis()->SetBinLabel(3,"LcKpi");
+  hNentriesSelBit->GetXaxis()->SetBinLabel(4,"D0toKpi");
+  hNentriesSelBit->GetXaxis()->SetBinLabel(5,"Dstar");
+
+  fOutputEntries->Add(hNentries);
+  fOutputEntries->Add(hNentriesSelBit);
+
 
   //PID
   if(fOnOff[1]){
@@ -371,6 +391,7 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
     hname="hTPCsigmaProton";
     TH2F* hTPCsigmaProton=new TH2F(hname.Data(),"TPC Sigma for proton as a function of momentum;p[GeV/c];Sigma Proton",500,0.,10.,400,-20,20);
 
+
     fOutputPID->Add(hTOFflags);
     fOutputPID->Add(hTOFsig);
     fOutputPID->Add(hTPCsig);
@@ -392,6 +413,35 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
     fOutputPID->Add(hTPCsigmaPion);
     fOutputPID->Add(hTPCsigmaProton);
 
+    if(fFillDistrTrackEffChecks){
+
+      hname="hTPCsigNvsPtAllTracks";
+      TH2F* hTPCsigNvsPtAllTracks=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. p_{T};p_{T} [GeV/c]; n. points", 200, 0.,20.,161,-0.5,160.5);
+      
+      hname="hTPCsigNvsPhiAllTracks";
+      TH2F* hTPCsigNvsPhiAllTracks=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. #phi;#phi [rad]; n. points", 100, 0.,2*TMath::Pi(),161,-0.5,160.5);
+      
+      hname="hTPCsigNvsEtaAllTracks";
+      TH2F* hTPCsigNvsEtaAllTracks=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. #eta;eta; n. points", 80,-2.,2.,161,-0.5,160.5);
+      
+      hname="hTPCsigNvsPtDaughters";
+      TH2F* hTPCsigNvsPtDaughters=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. p_{T};p_{T} [GeV/c]; n. points", 200, 0.,20.,161,-0.5,160.5);
+      
+      hname="hTPCsigNvsPhiDaughters";
+      TH2F* hTPCsigNvsPhiDaughters=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. #phi;#phi [rad]; n. points", 100, 0.,2*TMath::Pi(),161,-0.5,160.5);
+      
+      hname="hTPCsigNvsEtaDaughters";
+      TH2F* hTPCsigNvsEtaDaughters=new TH2F(hname.Data(),"Distribution of n. points used for TPC dE/dx vs. #eta;eta; n. points", 80,-2.,2.,161,-0.5,160.5);
+      
+      fOutputPID->Add(hTPCsigNvsPtAllTracks);
+      fOutputPID->Add(hTPCsigNvsPhiAllTracks);
+      fOutputPID->Add(hTPCsigNvsEtaAllTracks);
+      fOutputPID->Add(hTPCsigNvsPtDaughters);
+      fOutputPID->Add(hTPCsigNvsPhiDaughters);
+      fOutputPID->Add(hTPCsigNvsEtaDaughters);
+    }
+    
+    
     if(fReadMC){
       //TOF
       hname="hTOFsigmaMCKSigPid";
@@ -471,6 +521,10 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
       TH1F* hptGoodTrFromDaugh=new TH1F(hname.Data(),"Pt distribution of 'good' candidate's daughters;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
       hptGoodTrFromDaugh->SetTitleOffset(1.3,"Y");
       fOutputTrack->Add(hptGoodTrFromDaugh);
+      hname="hptGoodTrFromDaugh_filt";
+      TH1F* hptGoodTrFromDaugh_filt=new TH1F(hname.Data(),"Pt distribution of 'good' candidate's daughters, cuts level;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
+      hptGoodTrFromDaugh_filt->SetTitleOffset(1.3,"Y");
+      fOutputTrack->Add(hptGoodTrFromDaugh_filt);
     }
 
     hname="hdistrGoodTr";
@@ -484,9 +538,28 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
     hname="hd0dau";
     TH1F* hd0dau=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of D daughter tracks;d_{0rphi}[cm];Entries/10^{3} cm",200,-0.1,0.1);
 
+    hname="hd0dau_filt";
+    TH1F* hd0dau_filt=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of D daughter tracks, cut level;d_{0rphi}[cm];Entries/10^{3} cm",200,-0.1,0.1);
+
+    hname="hd0dauphi";
+    TH2F* hd0dauphi=new TH2F(hname.Data(), "Impact parameter (rphi) distribution of D daughter tracks versus #phi; #phi [rad]; d_{0rphi} [cm]",400,0,6.3,200,-0.1,0.1);
+
+    hname="hd0dauphi_filt";
+    TH2F* hd0dauphi_filt=new TH2F(hname.Data(), "Impact parameter (rphi) distribution of D daughter tracks versus #phi, cut level; #phi [rad]; d_{0rphi} [cm]",400,0,6.3,200,-0.1,0.1);
+    
     hname="hd0zdau";
     TH1F* hd0zdau=new TH1F(hname.Data(),"Impact parameter (z) distribution of D daughter tracks;d_{0z}[cm];Entries/10^{3} cm",200,-0.1,0.1);
 
+    hname="hd0zdau_filt";
+    TH1F* hd0zdau_filt=new TH1F(hname.Data(),"Impact parameter (z) distribution of D daughter tracks, cut level;d_{0z}[cm];Entries/10^{3} cm",200,-0.1,0.1);
+
+
+    hname="hd0zdauphi";
+    TH2F* hd0zdauphi=new TH2F(hname.Data(), "Impact parameter (z) distribution of D daughter tracks versus #phi; #phi [rad]; d_{0z} [cm]",400,0,6.3,200,-0.1,0.1);
+
+    hname="hd0zdauphi_filt";
+    TH2F* hd0zdauphi_filt=new TH2F(hname.Data(), "Impact parameter (z) distribution of D daughter tracks versus #phi, filtering level; #phi [rad]; d_{0z} [cm]",400,0,6.3,200,-0.1,0.1);
+
     hname="hd0TracksSPDin";
     TH1F* hd0TracksSPDin=new TH1F(hname.Data(),"Impact parameter (rphi) distribution of AOD tracks kITSrefit, SPDinner; d_{0rphi}[cm];Entries",200,-0.5,0.5);
 
@@ -503,54 +576,54 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
     if(fFillDistrTrackEffChecks){
       hname="hPtDaughters";
       TH1F *hPtDaughters=new TH1F(hname.Data(),"p_{T} distributions of the daughter tracks;p_{T} [GeV/c];Entries",200,0.,20.);
-    
+
       hname="hPhiDaughters";
       TH1F *hPhiDaughters=new TH1F(hname.Data(),"#phi distribution of the daughter tracks;#phi [rad];Entries",100,0.,2*(TMath::Pi()));
-    
+
       hname="hEtaDaughters";
       TH1F *hEtaDaughters=new TH1F(hname.Data(),"#eta distribution of the daughter tracks;#eta;Entries",80,-2.,2.);
-    
+
       hname="hEtavsPhiDaughters";
       TH2F *hEtavsPhiDaughters=new TH2F(hname.Data(),"#eta vs #phi distribution of the daughter tracks;#phi;#eta",100,0.,2*(TMath::Pi()),80,-2.,2.);
-    
+
       hname="hNTPCclsvsPtDaughters";
       TH2F *hNTPCclsvsPtDaughters=new TH2F(hname.Data(),"N TPC clusters vs p_{T} distribution of the daughter tracks;p_{T} [GeV/c];N TPC cls",200,0.,20.,85,-0.5,169.5);
-    
+
       hname="hNTPCclsvsPhiDaughters";
       TH2F *hNTPCclsvsPhiDaughters=new TH2F(hname.Data(),"N TPC clusters vs #phi distribution of the daughter tracks;#phi [rad];N TPC cls",100,0.,2*(TMath::Pi()),85,-0.5,169.5);
-      
+
       hname="hNTPCclsvsEtaDaughters";
       TH2F *hNTPCclsvsEtaDaughters=new TH2F(hname.Data(),"N TPC clusters vs #eta distribution of the daughter tracks;#eta;N TPC cls",80,-2.,2.,85,-0.5,169.5);
 
       hname="hNTPCCrossedRowsvsPtDaughters";
       TH2F *hNTPCCrossedRowsvsPtDaughters=new TH2F(hname.Data(),"N TPC crossed rows vs p_{T} distribution of the daughter tracks;p_{T} [GeV/c];N TPC cros. rows",200,0.,20.,100,-0.5,199.5);
-    
+
       hname="hNTPCCrossedRowsvsPhiDaughters";
       TH2F *hNTPCCrossedRowsvsPhiDaughters=new TH2F(hname.Data(),"N TPC crossed rows vs #phi distribution of the daughter tracks;#phi [rad];N TPC cros. rows",100,0.,2*(TMath::Pi()),100,-0.5,199.5);
-      
+
       hname="hNTPCCrossedRowsvsEtaDaughters";
       TH2F *hNTPCCrossedRowsvsEtaDaughters=new TH2F(hname.Data(),"N TPC crossed rows vs #eta distribution of the daughter tracks;#eta;N TPC cros. rows",80,-2.,2.,100,-0.5,199.5);
+
       hname="hRatioCRowsOverFclsvsPtDaughters";
       TH2F *hRatioCRowsOverFclsvsPtDaughters=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs p_{T} distribution of the daughter tracks;p_{T} [GeV/c];CRows/FCls",200,0.,20,100,0.,1.);
-   
+
       hname="hRatioCRowsOverFclsvsPhiDaughters";
       TH2F *hRatioCRowsOverFclsvsPhiDaughters=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #phi distribution of the daughter tracks;#phi [rad];CRows/FCls",100,0.,2*(TMath::Pi()),100,0.,1.);
-    
+
       hname="hRatioCRowsOverFclsvsEtaDaughters";
       TH2F *hRatioCRowsOverFclsvsEtaDaughters=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #eta distribution of the daughter tracks;#eta;CRows/FCls",80,-2.,2.,100,0.,1.);
-    
+
       hname="hNITSclsvsPtDaughters";
       TH2F *hNITSclsvsPtDaughters=new TH2F(hname.Data(),"N ITS clusters vs p_{T} distribution of the daughter tracks;p_{T} [GeV/c];N ITS cls",200,0.,20,7,-0.5,6.5);
-    
+
       hname="hNITSclsvsPhiDaughters";
       TH2F *hNITSclsvsPhiDaughters=new TH2F(hname.Data(),"N ITS clusters vs #phi distribution of the daughter tracks;#phi [rad];N ITS cls",100,0.,2*(TMath::Pi()),7,-0.5,6.5);
-    
+
       hname="hNITSclsvsEtaDaughters";
       TH2F *hNITSclsvsEtaDaughters=new TH2F(hname.Data(),"N ITS clusters vs #eta distribution of the daughter tracks;#eta;N ITS cls",80,-2.,2.,7,-0.5,6.5);
-    
+
       hname="hSPDclsDaughters";
-      TH1I *hSPDclsDaughters = new TH1I(hname.Data(),"N SPD points distrubution; ;Entries",4,0,4);
+      TH1I *hSPDclsDaughters = new TH1I(hname.Data(),"N SPD points distribution;;Entries",4,-0.5,3.5);
       hSPDclsDaughters->GetXaxis()->SetBinLabel(1, "no SPD");
       hSPDclsDaughters->GetXaxis()->SetBinLabel(2, "kOnlyFirst");
       hSPDclsDaughters->GetXaxis()->SetBinLabel(3, "kOnlySecond");
@@ -558,59 +631,60 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
 
       hname="hPtAllTracks";
       TH1F *hPtAllTracks=new TH1F(hname.Data(),"p_{T} distributions of the AOD tracks (ID>0);p_{T} [GeV/c];Entries",200,0.,20.);
-    
+
       hname="hPhiAllTracks";
       TH1F *hPhiAllTracks=new TH1F(hname.Data(),"#phi distribution of the AOD tracks (ID>0);#phi [rad];Entries",100,0.,2*(TMath::Pi()));
-    
+
       hname="hEtaAllTracks";
       TH1F *hEtaAllTracks=new TH1F(hname.Data(),"#eta distribution of the AOD tracks (ID>0);#eta;Entries",80,-2.,2.);
-    
+
       hname="hEtavsPhiAllTracks";
       TH2F *hEtavsPhiAllTracks=new TH2F(hname.Data(),"#eta vs #phi distribution of the AOD tracks (ID>0);#phi;#eta",100,0.,2*(TMath::Pi()),80,-2.,2.);
-    
+
       hname="hNTPCclsvsPtAllTracks";
       TH2F *hNTPCclsvsPtAllTracks=new TH2F(hname.Data(),"N TPC clusters vs p_{T} distribution of the AOD tracks (ID>0);p_{T} [GeV/c];N TPC cls",200,0.,20,85,-0.5,169.5);
-    
+
       hname="hNTPCclsvsPhiAllTracks";
       TH2F *hNTPCclsvsPhiAllTracks=new TH2F(hname.Data(),"N TPC clusters vs #phi distribution of the AOD tracks (ID>0);#phi [rad];N TPC cls",100,0.,2*(TMath::Pi()),85,-0.5,169.5);
-      
+
       hname="hNTPCclsvsEtaAllTracks";
       TH2F *hNTPCclsvsEtaAllTracks=new TH2F(hname.Data(),"N TPC clusters vs #eta distribution of the AOD tracks (ID>0);#eta;N TPC cls",80,-2.,2.,85,-0.5,169.5);
 
       hname="hNTPCCrossedRowsvsPtAllTracks";
       TH2F *hNTPCCrossedRowsvsPtAllTracks=new TH2F(hname.Data(),"N TPC crossed rows vs p_{T} distribution of the AOD tracks;p_{T} [GeV/c];N TPC cros. rows",200,0.,20.,100,-0.5,199.5);
-    
+
       hname="hNTPCCrossedRowsvsPhiAllTracks";
       TH2F *hNTPCCrossedRowsvsPhiAllTracks=new TH2F(hname.Data(),"N TPC crossed rows vs #phi distribution of the AOD tracks;#phi [rad];N TPC cros. rows",100,0.,2*(TMath::Pi()),100,-0.5,199.5);
-      
+
       hname="hNTPCCrossedRowsvsEtaAllTracks";
       TH2F *hNTPCCrossedRowsvsEtaAllTracks=new TH2F(hname.Data(),"N TPC crossed rows vs #eta distribution of the AOD tracks;#eta;N TPC cros. rows",80,-2.,2.,100,-0.5,199.5);
+
       hname="hRatioCRowsOverFclsvsPtAllTracks";
       TH2F *hRatioCRowsOverFclsvsPtAllTracks=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs p_{T} distribution of the AOD tracks (ID>0);p_{T} [GeV/c];CRows/FCls",200,0.,20,100,0.,1.);
-   
+
       hname="hRatioCRowsOverFclsvsPhiAllTracks";
       TH2F *hRatioCRowsOverFclsvsPhiAllTracks=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #phi distribution of the AOD tracks (ID>0);#phi [rad];CRows/FCls",100,0.,2*(TMath::Pi()),100,0.,1.);
-    
+
       hname="hRatioCRowsOverFclsvsEtaAllTracks";
       TH2F *hRatioCRowsOverFclsvsEtaAllTracks=new TH2F(hname.Data(),"CrossedRows/FindableClusters vs #eta distribution of the AOD tracks (ID>0);#eta;CRows/FCls",80,-2.,2.,100,0.,1.);
-    
+
       hname="hNITSclsvsPtAllTracks";
       TH2F *hNITSclsvsPtAllTracks=new TH2F(hname.Data(),"N ITS clusters vs p_{T} distribution of the AOD tracks (ID>0);p_{T} [GeV/c];N ITS cls",200,0.,20,7,-0.5,6.5);
-    
+
       hname="hNITSclsvsPhiAllTracks";
       TH2F *hNITSclsvsPhiAllTracks=new TH2F(hname.Data(),"N ITS clusters vs #phi distribution of the AOD tracks (ID>0);#phi [rad];N ITS cls",100,0.,2*(TMath::Pi()),7,-0.5,6.5);
-    
+
       hname="hNITSclsvsEtaAllTracks";
       TH2F *hNITSclsvsEtaAllTracks=new TH2F(hname.Data(),"N ITS clusters vs #eta distribution of the AOD tracks (ID>0);#eta;N ITS cls",80,-2.,2.,7,-0.5,6.5);
-    
+
       hname="hSPDclsAllTracks";
-      TH1I *hSPDclsAllTracks = new TH1I(hname.Data(),"N SPD points distrubution AOD tracks (ID>0); ;Entries",4,0,4);
+      TH1I *hSPDclsAllTracks = new TH1I(hname.Data(),"N SPD points distribution AOD tracks (ID>0);;Entries",4,-0.5,3.5);
       hSPDclsAllTracks->GetXaxis()->SetBinLabel(1, "no SPD");
       hSPDclsAllTracks->GetXaxis()->SetBinLabel(2, "kOnlyFirst");
       hSPDclsAllTracks->GetXaxis()->SetBinLabel(3, "kOnlySecond");
       hSPDclsAllTracks->GetXaxis()->SetBinLabel(4, "kBoth");
 
+
       fOutputTrack->Add(hPtDaughters);
       fOutputTrack->Add(hPhiDaughters);
       fOutputTrack->Add(hEtaDaughters);
@@ -662,7 +736,13 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
     fOutputTrack->Add(hd0TracksFilterBit4);
     fOutputTrack->Add(hd0TracksTPCITSSPDany);
     fOutputTrack->Add(hd0dau);
+    fOutputTrack->Add(hd0dauphi);
     fOutputTrack->Add(hd0zdau);
+    fOutputTrack->Add(hd0zdauphi);
+    fOutputTrack->Add(hd0dau_filt);
+    fOutputTrack->Add(hd0dauphi_filt);
+    fOutputTrack->Add(hd0zdau_filt);
+    fOutputTrack->Add(hd0zdauphi_filt);
     
 
     if(fReadMC){
@@ -673,6 +753,10 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
       hname="hd0f";
       TH1F* hd0f=new TH1F(hname.Data(),"Impact parameter distribution of fake tracks;d_{0}[cm];Entries/10^{3} cm",200,-0.1,0.1);
 
+      hname="hd0f_filt";
+      TH1F* hd0f_filt=new TH1F(hname.Data(),"Impact parameter distribution of fake tracks, cut level;d_{0}[cm];Entries/10^{3} cm",200,-0.1,0.1);
+
+
       hname="hptFakeTr";
       TH1F* hptFakeTr=new TH1F(hname.Data(),"Pt distribution of fake tracks;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
       hptFakeTr->SetTitleOffset(1.3,"Y");
@@ -681,12 +765,17 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
        TH1F* hptFakeTrFromDaugh=new TH1F(hname.Data(),"Pt distribution of fake tracks from daughters;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
        hptFakeTrFromDaugh->SetTitleOffset(1.3,"Y");
        fOutputTrack->Add(hptFakeTrFromDaugh);
+
+       hname="hptFakeTrFromDaugh_filt";
+       TH1F* hptFakeTrFromDaughFilt=new TH1F(hname.Data(),"Pt distribution of fake tracks from daughters, cut level;p_{t}[GeV];Entries/0.05 GeV/c",400,0.,20.);
+       hptFakeTrFromDaughFilt->SetTitleOffset(1.3,"Y");
+       fOutputTrack->Add(hptFakeTrFromDaughFilt);
       }
 
       fOutputTrack->Add(hptFakeTr);
       fOutputTrack->Add(hdistrFakeTr);
       fOutputTrack->Add(hd0f);
-   
+      fOutputTrack->Add(hd0f_filt);
     }
   }
 
@@ -733,6 +822,12 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
     hname="hntrklvsPercentile";
     TH2F* hntrklvsPercentile=new TH2F(hname.Data(),"N tracklets vs Percentile;ntracklets;percentile",5000,-0.5,4999.5,240,-10.,110);
 
+    hname="hntrklvsPercentile01";
+    TH2F* hntrklvsPercentile01=new TH2F(hname.Data(),"N tracklets vs Percentile |#eta|<1;ntracklets;percentile",5000,-0.5,4999.5,240,-10.,110);
+      
+    hname="hntrklvsPercentile01AllEv";
+    TH2F* hntrklvsPercentile01AllEv=new TH2F(hname.Data(),"N tracklets vs Percentile |#eta|<1 - All Events;ntracklets;percentile",5000,-0.5,4999.5,240,-10.,110);
+
     hname="hnTPCTracksvsPercentile";
     TH2F* hnTPCTracksvsPercentile=new TH2F(hname.Data(),"N TPC tracks vs Percentile;nTPCTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
 
@@ -742,14 +837,20 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
     hname="hnTPCITS1SPDTracksvsPercentile";
     TH2F* hnTPCITS1SPDTracksvsPercentile=new TH2F(hname.Data(),"N TPC+ITS+1SPD tracks vs Percentile;nTPCITS1SPDTracks;percentile",5000,-0.5,9999.5,240,-10.,110);
 
-    hname="hV0MultiplicityPercentile";
-    TH2F*hV0MultiplicityPercentile = new TH2F(hname.Data(),"V0 Multiplicity vs Percentile;V0 multiplicity;percentile",1000,-0.5,9999.5,120,-10.,110);
+    hname="hStdEstimSignalPercentile";
+    TH2F*hStdEstimSignalPercentile = new TH2F(hname.Data(),"Std estimator signal vs Percentile;Std estimator signal;percentile",1000,-0.5,9999.5,120,-10.,110);
+
+    hname="hStdEstimSignalNtrackletsIn";
+    TH2F*hStdEstimSignalNtrackletsIn = new TH2F(hname.Data(),"Std estimator signal vs Number of tracklets in the CC;Std estimator signal;number of tracklets",1000,-0.5,9999.5,5000,-0.5,4999.5);
 
-    hname="hV0MultiplicityNtrackletsIn";
-    TH2F*hV0MultiplicityNtrackletsIn = new TH2F(hname.Data(),"V0 Multiplicity vs Number of tracklets in the CC;V0 multiplicity;percentile",1000,-0.5,9999.5,5000,-0.5,4999.5);
+    hname="hStdEstimSignal";
+    TH1F*hStdEstimSignal = new TH1F(hname.Data(),"Std estimator signal",700,0,1400);
 
-    hname="hStdPercentileSPDPercentile";
-    TH2F* hStdPercentileSPDPercentile = new TH2F(hname.Data(),"Std estimator Percentile Vs SPD Percentile;Std estimator percentile;SPD percentile",120,-10.,110,120,-10.,110);
+    hname="hStdPercentileSecondPercentile";
+    TH2F* hStdPercentileSecondPercentile = new TH2F(hname.Data(),"Std estimator Percentile Vs Second Estimator Percentile;Std estimator percentile;Second estimator percentile",120,-10.,110,120,-10.,110);
+
+    hname="hStdSignalSecondSignal";
+    TH2F* hStdSignalSecondSignal = new TH2F(hname.Data(),"Std estimator signal Vs Second Estimator signal;Std estimator;Second estimator",1000,-0.5,9999.5,1000,-0.5,9999.5);
 
     fOutputCheckCentrality->Add(hNtrackletsIn);
     fOutputCheckCentrality->Add(hNtrackletsOut);
@@ -757,12 +858,16 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
     fOutputCheckCentrality->Add(hMultOut);
     fOutputCheckCentrality->Add(hMultvsPercentile);
     fOutputCheckCentrality->Add(hntrklvsPercentile);
+    fOutputCheckCentrality->Add(hntrklvsPercentile01);
+    fOutputCheckCentrality->Add(hntrklvsPercentile01AllEv);
     fOutputCheckCentrality->Add(hnTPCTracksvsPercentile);
     fOutputCheckCentrality->Add(hnTPCITSTracksvsPercentile);
     fOutputCheckCentrality->Add(hnTPCITS1SPDTracksvsPercentile);
-    fOutputCheckCentrality->Add(hV0MultiplicityPercentile);
-    fOutputCheckCentrality->Add(hV0MultiplicityNtrackletsIn);
-    fOutputCheckCentrality->Add(hStdPercentileSPDPercentile);
+    fOutputCheckCentrality->Add(hStdEstimSignalPercentile);
+    fOutputCheckCentrality->Add(hStdEstimSignal);
+    fOutputCheckCentrality->Add(hStdEstimSignalNtrackletsIn);
+    fOutputCheckCentrality->Add(hStdPercentileSecondPercentile);
+    fOutputCheckCentrality->Add(hStdSignalSecondSignal);
 
     PostData(6,fOutputCheckCentrality);
   
@@ -770,11 +875,26 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
     if(fOnOff[0]){
       TString hname="hNtracklets";
       TH1F* hNtracklets=new TH1F(hname.Data(),"Number of tracklets;ntracklets;Entries",5000,-0.5,4999.5);
-
+      hname="hNtracklets01";
+      TH1F* hNtracklets01=new TH1F(hname.Data(),"Number of tracklets |#eta|<1;ntracklets;Entries",5000,-0.5,4999.5);
+      hname="hNtracklets01AllEv";
+      TH1F* hNtracklets01AllEv=new TH1F(hname.Data(),"Number of tracklets |#eta|<1 - All events;ntracklets;Entries",5000,-0.5,4999.5);
       hname="hMult";
       TH1F* hMult=new TH1F(hname.Data(),"Multiplicity;multiplicity;Entries",10000,-0.5,9999.5);
+      hname="hMultFBit4";
+      TH1F* hMultFBit4=new TH1F(hname.Data(),"Multiplicity (global+tracklet) with filter bit 4;multiplicity;Entries",10000,-0.5,9999.5);
+      hname="hMultComb05";
+      TH1F* hMultC05=new TH1F(hname.Data(),"Multiplicity (global+tracklet) in |#eta|<0.5;multiplicity;Entries",10000,-0.5,9999.5);
+      hname="hMultComb08";
+      TH1F* hMultC08=new TH1F(hname.Data(),"Multiplicity (global+tracklet) in |#eta|<0.8;multiplicity;Entries",10000,-0.5,9999.5);
+
       fOutputTrack->Add(hNtracklets);
+      fOutputTrack->Add(hNtracklets01);
+      fOutputTrack->Add(hNtracklets01AllEv);
       fOutputTrack->Add(hMult);
+      fOutputTrack->Add(hMultFBit4);
+      fOutputTrack->Add(hMultC05);
+      fOutputTrack->Add(hMultC08);
     }
   }
 
@@ -805,59 +925,120 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
     hWhichVertSelEv->GetXaxis()->SetBinLabel(3,"SPD-3D");
     hWhichVertSelEv->GetXaxis()->SetBinLabel(4,"SPD-z");
 
-    TH2F* hTrigCent=new TH2F("hTrigCent","Centrality vs. Trigger types",14,-1.5,12.5,12,-10,110);
+    TH2F* hTrigCent=new TH2F("hTrigCent","Centrality vs. Trigger types",24,-1.5,22.5,12,-10,110);
     hTrigCent->GetXaxis()->SetBinLabel(1,"All");
     hTrigCent->GetXaxis()->SetBinLabel(2,"kAny");
     hTrigCent->GetXaxis()->SetBinLabel(3,"kMB");
     hTrigCent->GetXaxis()->SetBinLabel(4,"kINT7");
-    hTrigCent->GetXaxis()->SetBinLabel(5,"kCINT5");
-    hTrigCent->GetXaxis()->SetBinLabel(6,"kCent");
-    hTrigCent->GetXaxis()->SetBinLabel(7,"kSemiCent");
-    hTrigCent->GetXaxis()->SetBinLabel(8,"kEMC1+7");
-    hTrigCent->GetXaxis()->SetBinLabel(9,"kEMCJET+GAMMA");
-    hTrigCent->GetXaxis()->SetBinLabel(10,"Muons");
-    hTrigCent->GetXaxis()->SetBinLabel(11,"PHOS");
-    hTrigCent->GetXaxis()->SetBinLabel(12,"TRD");
-    hTrigCent->GetXaxis()->SetBinLabel(13,"HighMult");
-    hTrigCent->GetXaxis()->SetBinLabel(14,"Others");
-
-    TH2F* hTrigMul=new TH2F("hTrigMul","Multiplicity vs. Trigger types",14,-1.5,12.5,100,0.,10000.);
+    hTrigCent->GetXaxis()->SetBinLabel(5,"kINT8");
+    hTrigCent->GetXaxis()->SetBinLabel(6,"kCINT5");
+    hTrigCent->GetXaxis()->SetBinLabel(7,"kCent");
+    hTrigCent->GetXaxis()->SetBinLabel(8,"kSemiCent");
+    hTrigCent->GetXaxis()->SetBinLabel(9,"kEMC1");
+    hTrigCent->GetXaxis()->SetBinLabel(10,"kEMC7");
+    hTrigCent->GetXaxis()->SetBinLabel(11,"kEMC8");
+    hTrigCent->GetXaxis()->SetBinLabel(12,"kEMCJET7");
+    hTrigCent->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
+    hTrigCent->GetXaxis()->SetBinLabel(14,"kEMCJET8");
+    hTrigCent->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
+    hTrigCent->GetXaxis()->SetBinLabel(16,"Muons");
+    hTrigCent->GetXaxis()->SetBinLabel(17,"PHOS");
+    hTrigCent->GetXaxis()->SetBinLabel(18,"TRD");
+    hTrigCent->GetXaxis()->SetBinLabel(19,"TRDHJT");
+    hTrigCent->GetXaxis()->SetBinLabel(20,"TRDHSE");
+    hTrigCent->GetXaxis()->SetBinLabel(21,"HighMult");
+    hTrigCent->GetXaxis()->SetBinLabel(22,"SPI7");
+    hTrigCent->GetXaxis()->SetBinLabel(23,"SPI8");
+    hTrigCent->GetXaxis()->SetBinLabel(24,"Others");
+
+    TH2F* hTrigMul=new TH2F("hTrigMul","Multiplicity vs. Trigger types",24,-1.5,22.5,1000,0.,10000.);
     hTrigMul->GetXaxis()->SetBinLabel(1,"All");
     hTrigMul->GetXaxis()->SetBinLabel(2,"kAny");
     hTrigMul->GetXaxis()->SetBinLabel(3,"kMB");
     hTrigMul->GetXaxis()->SetBinLabel(4,"kINT7");
-    hTrigMul->GetXaxis()->SetBinLabel(5,"kCINT5");
-    hTrigMul->GetXaxis()->SetBinLabel(6,"kCent");
-    hTrigMul->GetXaxis()->SetBinLabel(7,"kSemiCent");
-    hTrigMul->GetXaxis()->SetBinLabel(8,"kEMC1+7");
-    hTrigMul->GetXaxis()->SetBinLabel(9,"kEMCJET+GAMMA");
-    hTrigMul->GetXaxis()->SetBinLabel(10,"Muons");
-    hTrigMul->GetXaxis()->SetBinLabel(11,"PHOS");
-    hTrigMul->GetXaxis()->SetBinLabel(12,"TRD");
-    hTrigMul->GetXaxis()->SetBinLabel(13,"HighMult");
-    hTrigMul->GetXaxis()->SetBinLabel(14,"Others");
-
-    TH2F* hTrigCentSel=new TH2F("hTrigCentSel","Trigger types",14,-1.5,12.5,12,-10,110);
+    hTrigMul->GetXaxis()->SetBinLabel(5,"kINT8");
+    hTrigMul->GetXaxis()->SetBinLabel(6,"kCINT5");
+    hTrigMul->GetXaxis()->SetBinLabel(7,"kCent");
+    hTrigMul->GetXaxis()->SetBinLabel(8,"kSemiCent");
+    hTrigMul->GetXaxis()->SetBinLabel(9,"kEMC1");
+    hTrigMul->GetXaxis()->SetBinLabel(10,"kEMC7");
+    hTrigMul->GetXaxis()->SetBinLabel(11,"kEMC8");
+    hTrigMul->GetXaxis()->SetBinLabel(12,"kEMCJET7");
+    hTrigMul->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
+    hTrigMul->GetXaxis()->SetBinLabel(14,"kEMCJET8");
+    hTrigMul->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
+    hTrigMul->GetXaxis()->SetBinLabel(16,"Muons");
+    hTrigMul->GetXaxis()->SetBinLabel(17,"PHOS");
+    hTrigMul->GetXaxis()->SetBinLabel(18,"TRD");
+    hTrigMul->GetXaxis()->SetBinLabel(19,"TRDHJT");
+    hTrigMul->GetXaxis()->SetBinLabel(20,"TRDHSE");
+    hTrigMul->GetXaxis()->SetBinLabel(21,"HighMult");
+    hTrigMul->GetXaxis()->SetBinLabel(22,"SPI7");
+    hTrigMul->GetXaxis()->SetBinLabel(23,"SPI8");
+    hTrigMul->GetXaxis()->SetBinLabel(24,"Others");
+
+    TH2F* hTrigCentSel=new TH2F("hTrigCentSel","Trigger types",24,-1.5,22.5,12,-10,110);
     hTrigCentSel->GetXaxis()->SetBinLabel(1,"All");
     hTrigCentSel->GetXaxis()->SetBinLabel(2,"kAny");
     hTrigCentSel->GetXaxis()->SetBinLabel(3,"kMB");
     hTrigCentSel->GetXaxis()->SetBinLabel(4,"kINT7");
-    hTrigCentSel->GetXaxis()->SetBinLabel(5,"kCINT5");
-    hTrigCentSel->GetXaxis()->SetBinLabel(6,"kCent");
-    hTrigCentSel->GetXaxis()->SetBinLabel(7,"kSemiCent");
-    hTrigCentSel->GetXaxis()->SetBinLabel(8,"kEMC1+7");
-    hTrigCentSel->GetXaxis()->SetBinLabel(9,"kEMCJET+GAMMA");
-    hTrigCentSel->GetXaxis()->SetBinLabel(10,"Muons");
-    hTrigCentSel->GetXaxis()->SetBinLabel(11,"PHOS");
-    hTrigCentSel->GetXaxis()->SetBinLabel(12,"TRD");
-    hTrigCentSel->GetXaxis()->SetBinLabel(13,"HighMult");
-    hTrigCentSel->GetXaxis()->SetBinLabel(14,"Others");
+    hTrigCentSel->GetXaxis()->SetBinLabel(5,"kINT8");
+    hTrigCentSel->GetXaxis()->SetBinLabel(6,"kCINT5");
+    hTrigCentSel->GetXaxis()->SetBinLabel(7,"kCent");
+    hTrigCentSel->GetXaxis()->SetBinLabel(8,"kSemiCent");
+    hTrigCentSel->GetXaxis()->SetBinLabel(9,"kEMC1");
+    hTrigCentSel->GetXaxis()->SetBinLabel(10,"kEMC7");
+    hTrigCentSel->GetXaxis()->SetBinLabel(11,"kEMC8");
+    hTrigCentSel->GetXaxis()->SetBinLabel(12,"kEMCJET7");
+    hTrigCentSel->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
+    hTrigCentSel->GetXaxis()->SetBinLabel(14,"kEMCJET8");
+    hTrigCentSel->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
+    hTrigCentSel->GetXaxis()->SetBinLabel(16,"Muons");
+    hTrigCentSel->GetXaxis()->SetBinLabel(17,"PHOS");
+    hTrigCentSel->GetXaxis()->SetBinLabel(18,"TRD");
+    hTrigCentSel->GetXaxis()->SetBinLabel(19,"TRDHJT");
+    hTrigCentSel->GetXaxis()->SetBinLabel(20,"TRDHSE");
+    hTrigCentSel->GetXaxis()->SetBinLabel(21,"HighMult");
+    hTrigCentSel->GetXaxis()->SetBinLabel(22,"SPI7");
+    hTrigCentSel->GetXaxis()->SetBinLabel(23,"SPI8");
+    hTrigCentSel->GetXaxis()->SetBinLabel(24,"Others");
+
+    TH2F* hTrigMulSel=new TH2F("hTrigMulSel","Multiplicity after selection vs. Trigger types",24,-1.5,22.5,1000,0.,10000.);
+    hTrigMulSel->GetXaxis()->SetBinLabel(1,"All");
+    hTrigMulSel->GetXaxis()->SetBinLabel(2,"kAny");
+    hTrigMulSel->GetXaxis()->SetBinLabel(3,"kMB");
+    hTrigMulSel->GetXaxis()->SetBinLabel(4,"kINT7");
+    hTrigMulSel->GetXaxis()->SetBinLabel(5,"kINT8");
+    hTrigMulSel->GetXaxis()->SetBinLabel(6,"kCINT5");
+    hTrigMulSel->GetXaxis()->SetBinLabel(7,"kCent");
+    hTrigMulSel->GetXaxis()->SetBinLabel(8,"kSemiCent");
+    hTrigMulSel->GetXaxis()->SetBinLabel(9,"kEMC1");
+    hTrigMulSel->GetXaxis()->SetBinLabel(10,"kEMC7");
+    hTrigMulSel->GetXaxis()->SetBinLabel(11,"kEMC8");
+    hTrigMulSel->GetXaxis()->SetBinLabel(12,"kEMCJET7");
+    hTrigMulSel->GetXaxis()->SetBinLabel(13,"kEMCGAMMA7");
+    hTrigMulSel->GetXaxis()->SetBinLabel(14,"kEMCJET8");
+    hTrigMulSel->GetXaxis()->SetBinLabel(15,"kEMCGAMMA8");
+    hTrigMulSel->GetXaxis()->SetBinLabel(16,"Muons");
+    hTrigMulSel->GetXaxis()->SetBinLabel(17,"PHOS");
+    hTrigMulSel->GetXaxis()->SetBinLabel(18,"TRD");
+    hTrigMulSel->GetXaxis()->SetBinLabel(19,"TRDHJT");
+    hTrigMulSel->GetXaxis()->SetBinLabel(20,"TRDHSE");
+    hTrigMulSel->GetXaxis()->SetBinLabel(21,"HighMult");
+    hTrigMulSel->GetXaxis()->SetBinLabel(22,"SPI7");
+    hTrigMulSel->GetXaxis()->SetBinLabel(23,"SPI8");
+    hTrigMulSel->GetXaxis()->SetBinLabel(24,"Others");
 
     AliCounterCollection *trigCounter=new AliCounterCollection("trigCounter");
     trigCounter->AddRubric("run",500000);
-    trigCounter->AddRubric("triggerType","All/Any/MB/Cent/SemiCent/EMCAL/MUON/NoPhysSelMUON/NoPhysSelEvNot7/NoPhysSelCMUP1/NoPhysSelMB/NoPhysSelCent/NoPhysSelSemiCent/CINT7");
+    trigCounter->AddRubric("triggerType","All/Any/MB/Cent/SemiCent/EMCAL/MUON/NoPhysSelMUON/NoPhysSelEvNot7/NoPhysSelCMUP1/NoPhysSelMB/NoPhysSelCent/NoPhysSelSemiCent/CINT7/INT8");
     trigCounter->Init();
 
+    AliCounterCollection *trigCounter2=new AliCounterCollection("trigCounter2");
+    trigCounter2->AddRubric("run",500000);
+    trigCounter2->AddRubric("triggerType","All/Any/MB/CINT7/INT8/NoPhysSelEvNot7/NoPhysSelMB/HighMult/SPI7/SPI8/EMC1/EMC7/EMC8/EMCJET7/EMCJET8/EMCGAMMA/TRD/TRDHJT/TRDHSE");
+    trigCounter2->Init();
+
     TH1F* hWhyEvRejected=new TH1F("hWhyEvRejected", "Why Event rejected",7,-1.5,5.5);
 
     hWhyEvRejected->GetXaxis()->SetBinLabel(1,"N events");
@@ -880,8 +1061,10 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
     fOutputEvSelection->Add(hWhichVertSelEv);
     fOutputEvSelection->Add(hTrigCent);
     fOutputEvSelection->Add(hTrigMul);
+    fOutputEvSelection->Add(hTrigMulSel);
     fOutputEvSelection->Add(hTrigCentSel);
     fOutputEvSelection->Add(trigCounter);
+    fOutputEvSelection->Add(trigCounter2);
     fOutputEvSelection->Add(hWhyEvRejected);
 
   }
@@ -948,25 +1131,8 @@ void AliAnalysisTaskSEHFQA::UserCreateOutputObjects()
     fOutputFlowObs->Add(hCentVsMultRPS);
   }
 
-  /*
-  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
-  AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
-  AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
-  if (fCuts->GetIsUsePID() && fDecayChannel==kLambdactoV0) {
-    fCuts->GetPidHF()->SetPidResponse(pidResp);
-    AliRDHFCutsLctoV0* lccuts=dynamic_cast<AliRDHFCutsLctoV0*>(fCuts);
-    if(lccuts){
-      lccuts->GetPidV0pos()->SetPidResponse(pidResp);
-      lccuts->GetPidV0neg()->SetPidResponse(pidResp);
-      fCuts->GetPidHF()->SetOldPid(kFALSE);
-      lccuts->GetPidV0pos()->SetOldPid(kFALSE);
-      lccuts->GetPidV0neg()->SetOldPid(kFALSE);
-    }
-  }
-  */
-
   // Post the data
-  PostData(1,fNEntries);
+  PostData(1,fOutputEntries);
 
   if(fOnOff[1]) PostData(2,fOutputPID);
   if(fOnOff[0]) PostData(3,fOutputTrack);
@@ -986,7 +1152,7 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
   AliAODEvent *aod = dynamic_cast<AliAODEvent*> (InputEvent());
   if(fDebug>2) printf("Analysing decay %d\n",fDecayChannel);
   // Post the data already here
-  PostData(1,fNEntries);
+  PostData(1,fOutputEntries);
   if(fOnOff[1]) PostData(2,fOutputPID);
   if(fOnOff[0]) PostData(3,fOutputTrack);
   PostData(4,fCuts);
@@ -996,6 +1162,12 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
   }
 
   TClonesArray *arrayProng =0;
+
+  // Load all the branches of the DeltaAOD - needed for SelectionBit counting
+  TClonesArray *arrayProng1 =0;
+  TClonesArray *arrayProng2 =0;
+  TClonesArray *arrayProng3 =0;
+
   Int_t pdg=0;
   Int_t *pdgdaughters=0x0;
 
@@ -1165,7 +1337,7 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
   if(!arrayProng) {
     AliInfo("Branch not found! The output will contain only track related histograms\n");
     isSimpleMode=kTRUE;
-    fNEntries->Fill(2);
+    ((TH1F*)fOutputEntries->FindObject("hNentries"))->Fill(2);
   }
   
   TClonesArray *mcArray = 0;
@@ -1198,16 +1370,33 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
   
   UInt_t evSelMask=((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
   Double_t centrality=fCuts->GetCentrality(aod);
-  Double_t multiplicity=aod->GetHeader()->GetRefMultiplicity();
+  AliAODHeader * header = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+  if(!header) AliFatal("Not a standard AOD");
+
+  Double_t multiplicity=header->GetRefMultiplicity();
   Int_t runNumber = aod->GetRunNumber();
   TString trigClass=aod->GetFiredTriggerClasses();
-  Int_t nAODtracks=aod->GetNTracks();
+  Int_t nAODtracks=aod->GetNumberOfTracks();
   Int_t nSelTracksTPCOnly=0;
   Int_t nSelTracksTPCITS=0;
   Int_t nSelTracksTPCITS1SPD=0;
+  Int_t ntracksFBit4=0;
+
+  AliTRDTriggerAnalysis trdSelection;
+  trdSelection.CalcTriggers(aod);
+
+  if(fReadMC) {
+    if(aod->GetTriggerMask()==0 && 
+       (runNumber>=195344 && runNumber<=195677)){
+      AliDebug(3,"Event rejected because of null trigger mask");
+      delete [] pdgdaughters;
+      return;
+    }
+  }
 
   for (Int_t k=0;k<nAODtracks;k++){
-    AliAODTrack* track=aod->GetTrack(k);
+    AliAODTrack* track=dynamic_cast<AliAODTrack*>(aod->GetTrack(k));
+    if(!track) AliFatal("Not a standard AOD");
     if(track->GetID()<0) continue;
     Int_t nclsTot=0,nclsSPD=0;
     for(Int_t l=0;l<6;l++) {
@@ -1223,6 +1412,9 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
        if(nclsSPD>0) nSelTracksTPCITS1SPD++;      
       }
     }
+    if(track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){
+      ntracksFBit4++;
+    }
   }
 
   if(fOnOff[4]) {
@@ -1233,19 +1425,23 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
     TH2F* hTrigC=(TH2F*)fOutputEvSelection->FindObject("hTrigCent");
     TH2F* hTrigM=(TH2F*)fOutputEvSelection->FindObject("hTrigMul");
     AliCounterCollection* trigCount=(AliCounterCollection*)fOutputEvSelection->FindObject("trigCounter");
+    AliCounterCollection* trigCount2=(AliCounterCollection*)fOutputEvSelection->FindObject("trigCounter2");
 
     hTrigC->Fill(-1.,centrality);
     hTrigM->Fill(-1.,multiplicity);
     trigCount->Count(Form("triggerType:All/Run:%d",runNumber));
+    trigCount2->Count(Form("triggerType:All/Run:%d",runNumber));
     if(evSelMask==0){
-      if(aod->GetEventType()!=7){
+      if(aod->GetEventType()!=7 || trigClass.Contains("BEAMB")){
        trigCount->Count(Form("triggerType:NoPhysSelEvNot7/Run:%d",runNumber));
+       trigCount2->Count(Form("triggerType:NoPhysSelEvNot7/Run:%d",runNumber));
       }else if(trigClass.Contains("CMUP1")){
        trigCount->Count(Form("triggerType:NoPhysSelCMUP1/Run:%d",runNumber));
       }else if(trigClass.Contains("MUON")){
        trigCount->Count(Form("triggerType:NoPhysSelMUON/Run:%d",runNumber));
       }else if(trigClass.Contains("CPBI2_B1-B") || trigClass.Contains(" CPBI2WU_B1-B")){
        trigCount->Count(Form("triggerType:NoPhysSelMB/Run:%d",runNumber));
+       trigCount2->Count(Form("triggerType:NoPhysSelMB/Run:%d",runNumber));
       }else if(trigClass.Contains("CCENT") || trigClass.Contains("CVHN")){
        trigCount->Count(Form("triggerType:NoPhysSelCent/Run:%d",runNumber));
       }else if(trigClass.Contains("CSEMI") || trigClass.Contains("CVLN")){
@@ -1256,60 +1452,131 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
       hTrigC->Fill(0.,centrality);
       hTrigM->Fill(0.,multiplicity);
       trigCount->Count(Form("triggerType:Any/Run:%d",runNumber));
+      trigCount2->Count(Form("triggerType:Any/Run:%d",runNumber));
     }  
     if(evSelMask & AliVEvent::kMB){
       hTrigC->Fill(1.,centrality);
       hTrigM->Fill(1.,multiplicity);
       trigCount->Count(Form("triggerType:MB/Run:%d",runNumber));
+      trigCount2->Count(Form("triggerType:MB/Run:%d",runNumber));
     }
     if(evSelMask & AliVEvent::kINT7){ 
       hTrigC->Fill(2.,centrality);
       hTrigM->Fill(2.,multiplicity);
       trigCount->Count(Form("triggerType:CINT7/Run:%d",runNumber));
+      trigCount2->Count(Form("triggerType:CINT7/Run:%d",runNumber));
     }
-    if(evSelMask & AliVEvent::kCINT5){ 
+    if(evSelMask & AliVEvent::kINT8){ 
       hTrigC->Fill(3.,centrality);
       hTrigM->Fill(3.,multiplicity);
+      trigCount->Count(Form("triggerType:INT8/Run:%d",runNumber));   
+      trigCount2->Count(Form("triggerType:INT8/Run:%d",runNumber));      
     }
-    if(evSelMask & AliVEvent::kCentral){
+    if(evSelMask & AliVEvent::kCINT5){ 
       hTrigC->Fill(4.,centrality);
       hTrigM->Fill(4.,multiplicity);
-      trigCount->Count(Form("triggerType:Cent/Run:%d",runNumber));
     }
-    if(evSelMask & AliVEvent::kSemiCentral){ 
+    if(evSelMask & AliVEvent::kCentral){
       hTrigC->Fill(5.,centrality);
       hTrigM->Fill(5.,multiplicity);
-      trigCount->Count(Form("triggerType:SemiCent/Run:%d",runNumber));
+      trigCount->Count(Form("triggerType:Cent/Run:%d",runNumber));
     }
-    if(evSelMask & (AliVEvent::kEMC1 | AliVEvent::kEMC7)){
+    if(evSelMask & AliVEvent::kSemiCentral){ 
       hTrigC->Fill(6.,centrality);
       hTrigM->Fill(6.,multiplicity);
+      trigCount->Count(Form("triggerType:SemiCent/Run:%d",runNumber));
     }
-    if(evSelMask & (AliVEvent::kEMCEJE | AliVEvent::kEMCEGA)){
+
+    if(evSelMask & AliVEvent::kEMC1){
       hTrigC->Fill(7.,centrality);
       hTrigM->Fill(7.,multiplicity);
       trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
+      trigCount2->Count(Form("triggerType:EMC1/Run:%d",runNumber));
     }
-    if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) |  (AliVEvent::kMUS7 | AliVEvent::kMUON))){
+    if((evSelMask & AliVEvent::kEMC7) && trigClass.Contains("CEMC7")){
       hTrigC->Fill(8.,centrality);
       hTrigM->Fill(8.,multiplicity);
-      trigCount->Count(Form("triggerType:MUON/Run:%d",runNumber));
+      trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
+      trigCount2->Count(Form("triggerType:EMC7/Run:%d",runNumber));
     }
-    if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)){ 
+    if((evSelMask & AliVEvent::kEMC8) && trigClass.Contains("CEMC8")){
       hTrigC->Fill(9.,centrality);
       hTrigM->Fill(9.,multiplicity);
+      trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
+      trigCount2->Count(Form("triggerType:EMC8/Run:%d",runNumber));
+    }
+    if(evSelMask & AliVEvent::kEMCEJE){
+       trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
+       if(trigClass.Contains("CEMC7EJE")) {
+        trigCount2->Count(Form("triggerType:EMCJET7/Run:%d",runNumber));
+        hTrigC->Fill(10.,centrality);
+        hTrigM->Fill(10.,multiplicity);
+
+       }
+       else if(trigClass.Contains("CEMC8EJE")) {
+        trigCount2->Count(Form("triggerType:EMCJET8/Run:%d",runNumber));
+        hTrigC->Fill(12.,centrality);
+        hTrigM->Fill(12.,multiplicity);
+       }
+    }
+    if(evSelMask & AliVEvent::kEMCEGA){
+      if(trigClass.Contains("CEMC7EGA")) {
+       hTrigC->Fill(11.,centrality);
+       hTrigM->Fill(11.,multiplicity);
+      } else if (trigClass.Contains("CEMC8EGA")){
+       hTrigC->Fill(13.,centrality);
+       hTrigM->Fill(13.,multiplicity);
+
+      }
+      trigCount->Count(Form("triggerType:EMCAL/Run:%d",runNumber));
+      trigCount2->Count(Form("triggerType:EMCGAMMA/Run:%d",runNumber));
+    }
+    if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) |  (AliVEvent::kMUS7 | AliVEvent::kMUON))){
+      hTrigC->Fill(14.,centrality);
+      hTrigM->Fill(14.,multiplicity);
+      trigCount->Count(Form("triggerType:MUON/Run:%d",runNumber));
+    }
+    if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)){ 
+      hTrigC->Fill(15.,centrality);
+      hTrigM->Fill(15.,multiplicity);
     }
     if(evSelMask & (AliVEvent::kTRD)){
-      hTrigC->Fill(10.,centrality);
-      hTrigM->Fill(10.,multiplicity);
+      hTrigC->Fill(16.,centrality);
+      hTrigM->Fill(16.,multiplicity);
+      trigCount2->Count(Form("triggerType:TRD/Run:%d",runNumber));
+    }
+    if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHJT)){
+      hTrigC->Fill(17.,centrality);
+      hTrigM->Fill(17.,multiplicity);
+      trigCount2->Count(Form("triggerType:TRDHJT/Run:%d",runNumber));
+    }
+    if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHSE)){
+      hTrigC->Fill(18.,centrality);
+      hTrigM->Fill(18.,multiplicity);
+      trigCount2->Count(Form("triggerType:TRDHSE/Run:%d",runNumber));
     }
     if(evSelMask & (AliVEvent::kHighMult)){
-      hTrigC->Fill(11.,centrality);
-      hTrigM->Fill(11.,multiplicity);
+      hTrigC->Fill(19.,centrality);
+      hTrigM->Fill(19.,multiplicity);
+      trigCount2->Count(Form("triggerType:HighMult/Run:%d",runNumber));
+    }
+    if(evSelMask & AliVEvent::kSPI7){
+      if(trigClass.Contains("CSPI7")) {
+       hTrigC->Fill(20.,centrality);
+       hTrigM->Fill(20.,multiplicity);
+       trigCount2->Count(Form("triggerType:SPI7/Run:%d",runNumber));
+      }
+    }
+    if(evSelMask & AliVEvent::kSPI){
+      if(trigClass.Contains("CSPI8")) {
+       hTrigC->Fill(21.,centrality);
+       hTrigM->Fill(21.,multiplicity);
+        trigCount2->Count(Form("triggerType:SPI8/Run:%d",runNumber));
+      }
     }
     if(evSelMask & (AliVEvent::kDG5 | AliVEvent::kZED)){
-      hTrigC->Fill(12.,centrality);
-      hTrigM->Fill(12.,multiplicity);
+      hTrigC->Fill(22.,centrality);
+      hTrigM->Fill(22.,multiplicity);
     }
   }
   
@@ -1322,8 +1589,7 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
   }
 
   // count event
-  fNEntries->Fill(0); 
-
+  ((TH1F*)fOutputEntries->FindObject("hNentries"))->Fill(0);
   //count events with good vertex
   // AOD primary vertex
   AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
@@ -1334,11 +1600,11 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
   const AliESDVertex vESD(pos,cov,100.,100);
 
   TString primTitle = vtx1->GetTitle();
-  if(primTitle.Contains("VertexerTracks") && vtx1->GetNContributors()>0) fNEntries->Fill(4);
+  if(primTitle.Contains("VertexerTracks") && vtx1->GetNContributors()>0) ((TH1F*)fOutputEntries->FindObject("hNentries"))->Fill(4);
 
   // trigger class for PbPb C0SMH-B-NOPF-ALLNOTRD, C0SMH-B-NOPF-ALL
   //TString trigclass=aod->GetFiredTriggerClasses();
-  //if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains("C0SMH-B-NOPF-ALL")) fNEntries->Fill(5); //tmp
+  //if(trigclass.Contains("C0SMH-B-NOPF-ALLNOTRD") || trigclass.Contains("C0SMH-B-NOPF-ALL")) hNentries->Fill(5); //tmp
 
 
 
@@ -1354,7 +1620,7 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
   //select event
   if(!fCuts->IsEventSelected(aod)) {
     evSelected=kFALSE;
-    if(fCuts->IsEventRejectedDueToPileupSPD()) {
+    if(fCuts->IsEventRejectedDueToPileup()) {
       if(hWhyEvRejected) hWhyEvRejected->Fill(0); 
       evselByPileup=kFALSE;
     }// rejected for pileup
@@ -1382,21 +1648,94 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
   }
   if(evSelected && fOnOff[3]){
     TH2F* hTrigS=(TH2F*)fOutputEvSelection->FindObject("hTrigCentSel");
+    TH2F* hTrigSM=(TH2F*)fOutputEvSelection->FindObject("hTrigMulSel");
     hTrigS->Fill(-1.,centrality);
-
-    if(evSelMask & AliVEvent::kAny) hTrigS->Fill(0.,centrality);
-    if(evSelMask & AliVEvent::kMB) hTrigS->Fill(1.,centrality);
-    if(evSelMask & AliVEvent::kINT7) hTrigS->Fill(2.,centrality);
-    if(evSelMask & AliVEvent::kCINT5) hTrigS->Fill(3.,centrality);
-    if(evSelMask & AliVEvent::kCentral) hTrigS->Fill(4.,centrality);
-    if(evSelMask & AliVEvent::kSemiCentral) hTrigS->Fill(5.,centrality);
-    if(evSelMask & (AliVEvent::kEMC1 | AliVEvent::kEMC7)) hTrigS->Fill(6.,centrality);
-    if(evSelMask & (AliVEvent::kEMCEJE | AliVEvent::kEMCEGA)) hTrigS->Fill(7.,centrality);
-    if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) |  (AliVEvent::kMUS7 | AliVEvent::kMUON))) hTrigS->Fill(8.,centrality);
-    if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)) hTrigS->Fill(9.,centrality);
-    if(evSelMask & (AliVEvent::kTRD)) hTrigS->Fill(10.,centrality);
-    if(evSelMask & (AliVEvent::kHighMult)) hTrigS->Fill(11.,centrality);
-    if(evSelMask & (AliVEvent::kDG5 | AliVEvent::kZED)) hTrigS->Fill(12.,centrality);
+    hTrigSM->Fill(-1.,multiplicity);
+    if(evSelMask & AliVEvent::kAny) {
+      hTrigS->Fill(0.,centrality);
+      hTrigSM->Fill(0.,multiplicity);}
+    if(evSelMask & AliVEvent::kMB) {
+      hTrigS->Fill(1.,centrality);
+      hTrigSM->Fill(1.,multiplicity);}
+    if(evSelMask & AliVEvent::kINT7){
+      hTrigS->Fill(2.,centrality);
+      hTrigSM->Fill(2.,multiplicity);}
+    if(evSelMask & AliVEvent::kINT8){
+      hTrigS->Fill(3.,centrality);
+      hTrigSM->Fill(3.,multiplicity);}
+    if(evSelMask & AliVEvent::kCINT5){ 
+      hTrigS->Fill(4.,centrality);
+      hTrigSM->Fill(4.,multiplicity);}
+    if(evSelMask & AliVEvent::kCentral){
+      hTrigS->Fill(5.,centrality);
+      hTrigSM->Fill(5.,multiplicity);}
+    if(evSelMask & AliVEvent::kSemiCentral){
+      hTrigS->Fill(6.,centrality);
+      hTrigSM->Fill(6.,multiplicity);}
+    if(evSelMask & AliVEvent::kEMC1){
+      hTrigS->Fill(7.,centrality);
+      hTrigSM->Fill(7.,multiplicity);
+    }
+    if((evSelMask & AliVEvent::kEMC7) && trigClass.Contains("CEMC7")){
+      hTrigS->Fill(8.,centrality);
+      hTrigSM->Fill(8.,multiplicity);
+    }
+    if((evSelMask & AliVEvent::kEMC8) && trigClass.Contains("CEMC8")){
+      hTrigS->Fill(9.,centrality);
+      hTrigSM->Fill(9.,multiplicity);
+    }
+      if((evSelMask & AliVEvent::kEMCEJE) && trigClass.Contains("CEMC7EJE")){
+      hTrigS->Fill(10.,centrality);
+      hTrigSM->Fill(10.,multiplicity);
+    }
+    if((evSelMask & AliVEvent::kEMCEGA) && trigClass.Contains("CEMC7EGA")){
+      hTrigS->Fill(11.,centrality);
+      hTrigSM->Fill(11.,multiplicity);
+    }
+    if((evSelMask & AliVEvent::kEMCEJE) && trigClass.Contains("CEMC8EJE")){
+      hTrigS->Fill(12.,centrality);
+      hTrigSM->Fill(12.,multiplicity);
+    }
+    if((evSelMask & AliVEvent::kEMCEGA) && trigClass.Contains("CEMC8EGA")){
+      hTrigS->Fill(13.,centrality);
+      hTrigSM->Fill(13.,multiplicity);
+    }
+    if(evSelMask & (((AliVEvent::kCMUS5 | AliVEvent::kMUSH7) | (AliVEvent::kMUL7 | AliVEvent::kMUU7)) |  (AliVEvent::kMUS7 | AliVEvent::kMUON))){
+      hTrigS->Fill(14.,centrality);
+      hTrigSM->Fill(14.,multiplicity);}
+    if(evSelMask & (AliVEvent::kPHI1 | AliVEvent::kPHI7)){
+      hTrigS->Fill(15.,centrality);
+      hTrigSM->Fill(15.,multiplicity);}
+    if(evSelMask & (AliVEvent::kTRD)){
+      hTrigS->Fill(16.,centrality);
+      hTrigSM->Fill(16.,multiplicity);
+    }
+    if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHJT)){
+      hTrigS->Fill(17.,centrality);
+      hTrigSM->Fill(17.,multiplicity);
+    }
+    if((evSelMask & AliVEvent::kTRD) && trdSelection.IsFired(AliTRDTriggerAnalysis::kHSE)){
+      hTrigS->Fill(18.,centrality);
+      hTrigSM->Fill(18.,multiplicity);
+    }
+    if(evSelMask & (AliVEvent::kHighMult)){
+      hTrigS->Fill(19.,centrality);
+      hTrigSM->Fill(19.,multiplicity);}
+    if(evSelMask & AliVEvent::kSPI7){
+      if(trigClass.Contains("CSPI7")) {
+       hTrigS->Fill(20.,centrality);
+       hTrigSM->Fill(20.,multiplicity);
+      }
+    }
+    if(evSelMask & AliVEvent::kSPI){
+      if(trigClass.Contains("CSPI8")) {
+       hTrigS->Fill(21.,centrality);
+       hTrigSM->Fill(21.,multiplicity);
+      }
+    }
+    if(evSelMask & (AliVEvent::kDG5 | AliVEvent::kZED)){
+      hTrigS->Fill(22.,centrality);
+      hTrigSM->Fill(22.,multiplicity);}
   }
   
   if(evSelected || (!evSelbyCentrality && evSelByVertex && evselByPileup && evSelByPS)){ //events selected or not selected because of centrality
@@ -1407,13 +1746,46 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
       Float_t secondCentf =fCuts->GetCentrality(aod,fEstimator);
       Int_t secondCent = (Int_t)(secondCentf+0.5);
       Int_t mincent=stdCent-stdCent%10;
+      Float_t stdSignal = 0.;
+      Float_t secondSignal = 0.;
       AliAODVZERO *vzeroAOD = (AliAODVZERO*)aod->GetVZEROData();
-      Float_t vzeroMult = vzeroAOD->GetMTotV0A() +  vzeroAOD->GetMTotV0C();
-      AliCentrality *aodcent = aod->GetCentrality();
-      Float_t spdCentf = aodcent->GetCentralityPercentile("CL1");
+      AliAODZDC *zdcAOD = (AliAODZDC*)aod->GetZDCData();
+      const Double_t *towerZNASignal = zdcAOD->GetZNATowerEnergy();
+      switch(fCuts->GetUseCentrality())
+      {
+         case AliRDHFCuts::kCentV0M:
+            stdSignal = vzeroAOD->GetMTotV0A() +  vzeroAOD->GetMTotV0C();
+            break;
+         case AliRDHFCuts::kCentV0A:
+            stdSignal = vzeroAOD->GetMTotV0A();
+            break;
+         case AliRDHFCuts::kCentZNA:
+            stdSignal = towerZNASignal[0];
+            break;
+         default:
+            stdSignal = 0.;
+            break;
+      }
+      switch(fEstimator)
+      {
+         case AliRDHFCuts::kCentV0M:
+            secondSignal = vzeroAOD->GetMTotV0A() +  vzeroAOD->GetMTotV0C();
+            break;
+         case AliRDHFCuts::kCentV0A:
+            secondSignal = vzeroAOD->GetMTotV0A();
+            break;
+         case AliRDHFCuts::kCentZNA:
+            secondSignal = towerZNASignal[0];
+            break;
+         default:
+            secondSignal = 0.;
+            break;
+      }
+      //AliCentrality *aodcent = aod->GetCentrality();
+      // Float_t spdCentf = aodcent->GetCentralityPercentile("CL1");
       if(stdCentf==-1) {
-       mincent=-10; 
-       stdCent=-1;
+         mincent=-10; 
+         stdCent=-1;
       }
       if(mincent==100)mincent--;
       ((AliCounterCollection*)fOutputCounters->FindObject("stdEstimator"))->Count(Form("centralityclass:%d_%d/Run:%d",mincent,mincent+10,runNumber));
@@ -1428,26 +1800,43 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
 
       if(stdCent<fCuts->GetMinCentrality() || stdCent>fCuts->GetMaxCentrality()){
        ((TH1F*)fOutputCheckCentrality->FindObject("hNtrackletsOut"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
-       ((TH1F*)fOutputCheckCentrality->FindObject("hMultOut"))->Fill(aod->GetHeader()->GetRefMultiplicity());
+       ((TH1F*)fOutputCheckCentrality->FindObject("hMultOut"))->Fill(header->GetRefMultiplicity());
       }else{
        ((TH1F*)fOutputCheckCentrality->FindObject("hNtrackletsIn"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
-       ((TH1F*)fOutputCheckCentrality->FindObject("hMultIn"))->Fill(aod->GetHeader()->GetRefMultiplicity());
+       ((TH1F*)fOutputCheckCentrality->FindObject("hMultIn"))->Fill(header->GetRefMultiplicity());
       }
-      ((TH2F*)fOutputCheckCentrality->FindObject("hMultvsPercentile"))->Fill(aod->GetHeader()->GetRefMultiplicity(),stdCentf);
+      ((TH2F*)fOutputCheckCentrality->FindObject("hMultvsPercentile"))->Fill(header->GetRefMultiplicity(),stdCentf);
       ((TH2F*)fOutputCheckCentrality->FindObject("hntrklvsPercentile"))->Fill(aod->GetTracklets()->GetNumberOfTracklets(),stdCentf);
+      ((TH2F*)fOutputCheckCentrality->FindObject("hntrklvsPercentile01"))->Fill(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.),stdCentf);
       ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCTracksvsPercentile"))->Fill(nSelTracksTPCOnly,stdCentf);
       ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCITSTracksvsPercentile"))->Fill(nSelTracksTPCITS,stdCentf);
       ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCITS1SPDTracksvsPercentile"))->Fill(nSelTracksTPCITS1SPD,stdCentf);
-      ((TH2F*)fOutputCheckCentrality->FindObject("hV0MultiplicityPercentile"))->Fill(vzeroMult,stdCentf);
-      ((TH2F*)fOutputCheckCentrality->FindObject("hV0MultiplicityNtrackletsIn"))->Fill(vzeroMult,aod->GetTracklets()->GetNumberOfTracklets());
-      ((TH2F*)fOutputCheckCentrality->FindObject("hStdPercentileSPDPercentile"))->Fill(stdCentf,spdCentf);
+      ((TH2F*)fOutputCheckCentrality->FindObject("hStdEstimSignalPercentile"))->Fill(stdSignal,stdCentf);
+      ((TH1F*)fOutputCheckCentrality->FindObject("hStdEstimSignal"))->Fill(stdSignal);
+      ((TH2F*)fOutputCheckCentrality->FindObject("hStdEstimSignalNtrackletsIn"))->Fill(stdSignal,aod->GetTracklets()->GetNumberOfTracklets());
+      ((TH2F*)fOutputCheckCentrality->FindObject("hStdPercentileSecondPercentile"))->Fill(stdCentf,secondCentf);
+      ((TH2F*)fOutputCheckCentrality->FindObject("hStdSignalSecondSignal"))->Fill(stdSignal,secondSignal);
 
       PostData(6,fOutputCheckCentrality);
 
     } else{
       if(fOnOff[0]){
        ((TH1F*)fOutputTrack->FindObject("hNtracklets"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
-       ((TH1F*)fOutputTrack->FindObject("hMult"))->Fill(aod->GetHeader()->GetRefMultiplicity());
+       ((TH1F*)fOutputTrack->FindObject("hNtracklets01"))->Fill(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.));
+       ((TH1F*)fOutputTrack->FindObject("hMult"))->Fill(header->GetRefMultiplicity());
+       ((TH1F*)fOutputTrack->FindObject("hMultFBit4"))->Fill(ntracksFBit4);
+       ((TH1F*)fOutputTrack->FindObject("hMultComb05"))->Fill(header->GetRefMultiplicityComb05());
+       ((TH1F*)fOutputTrack->FindObject("hMultComb08"))->Fill(header->GetRefMultiplicityComb08());
+      }
+    }
+  }
+
+  if(evSelected || (!evSelbyCentrality && evSelByVertex && evselByPileup && evSelByPS) || (!evSelByVertex && evselByPileup && evSelByPS)){ //events selected or not selected because of centrality
+    if(fOnOff[2] && fCuts->GetUseCentrality()){
+      ((TH2F*)fOutputCheckCentrality->FindObject("hntrklvsPercentile01AllEv"))->Fill(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.),fCuts->GetCentrality(aod));
+    }else{
+      if(fOnOff[0]){
+       ((TH1F*)fOutputTrack->FindObject("hNtracklets01AllEv"))->Fill(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.));
       }
     }
   }
@@ -1460,8 +1849,8 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
     Int_t vtxTyp=0;
     if(vertex->GetNContributors()<=0) vtxTyp=-1;
     TString title=vertex->GetTitle();
-    if(title.Contains("Z")) vtxTyp=3;
-    if(title.Contains("3D")) vtxTyp=2;    
+    if(title.Contains("Z")) vtxTyp=2;
+    if(title.Contains("3D")) vtxTyp=1;    
     ((TH1F*)fOutputEvSelection->FindObject("hxvtx"))->Fill(xvtx);
     ((TH1F*)fOutputEvSelection->FindObject("hyvtx"))->Fill(yvtx);
     ((TH1F*)fOutputEvSelection->FindObject("hzvtx"))->Fill(zvtx);
@@ -1485,6 +1874,46 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
     delete [] pdgdaughters;
     return;
   }
+
+  // load all the branches and fill the SelectionBit histo
+  if(fUseSelectionBit){
+    
+    //load branches
+    arrayProng1=(TClonesArray*)aod->GetList()->FindObject("Charm3Prong");
+    Int_t nCand = arrayProng1->GetEntriesFast();
+    arrayProng2=(TClonesArray*)aod->GetList()->FindObject("D0toKpi");
+    Int_t nCand2 = arrayProng2->GetEntriesFast();
+    arrayProng3=(TClonesArray*)aod->GetList()->FindObject("Dstar");
+    Int_t nCand3 = arrayProng3->GetEntriesFast();
+    
+    // D+, Ds and Lc
+    for (Int_t iCand = 0; iCand < nCand; iCand++) {
+      AliAODRecoDecayHF *d = (AliAODRecoDecayHF*)arrayProng1->UncheckedAt(iCand);
+      Double_t ptCand_selBit = d->Pt();
+      if(fUseSelectionBit && d->GetSelectionMap()) {
+       if(d->HasSelectionBit(AliRDHFCuts::kDplusCuts)) ((TH2F*)fOutputEntries->FindObject("HasSelBit"))->Fill(0.0,ptCand_selBit);
+               if(d->HasSelectionBit(AliRDHFCuts::kDsCuts)) ((TH2F*)fOutputEntries->FindObject("HasSelBit"))->Fill(1.0,ptCand_selBit);
+       if(d->HasSelectionBit(AliRDHFCuts::kLcCuts)) ((TH2F*)fOutputEntries->FindObject("HasSelBit"))->Fill(2.0,ptCand_selBit);
+      }
+    }
+    // D0kpi
+    for (Int_t iCand = 0; iCand < nCand2; iCand++) {
+      AliAODRecoDecayHF *d = (AliAODRecoDecayHF*)arrayProng2->UncheckedAt(iCand);
+      Double_t ptCand_selBit = d->Pt();
+      if(fUseSelectionBit && d->GetSelectionMap()) {
+       if(d->HasSelectionBit(AliRDHFCuts::kD0toKpiCuts)) ((TH2F*)fOutputEntries->FindObject("HasSelBit"))->Fill(4.0,ptCand_selBit);
+      }     
+    }
+    // Dstar
+    for (Int_t iCand = 0; iCand < nCand3; iCand++) {
+      AliAODRecoDecayHF *d = (AliAODRecoDecayHF*)arrayProng3->UncheckedAt(iCand);
+      Double_t ptCand_selBit = d->Pt();
+      if(fUseSelectionBit && d->GetSelectionMap()) {
+               if(d->HasSelectionBit(AliRDHFCuts::kDstarCuts)) ((TH2F*)fOutputEntries->FindObject("HasSelBit"))->Fill(3.0,ptCand_selBit);
+      }
+    }
+  }
+
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   AliInputEventHandler *inputHandler=(AliInputEventHandler*)mgr->GetInputEventHandler();
   AliPIDResponse *pidResp=inputHandler->GetPIDResponse();
@@ -1502,17 +1931,18 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
   Int_t ntracks=0;
   Int_t isGoodTrack=0, isFakeTrack=0, isSelTrack=0;
 
-  if(aod) ntracks=aod->GetNTracks();
+  if(aod) ntracks=aod->GetNumberOfTracks();
 
   if(fOnOff[0] || fOnOff[1]){
     //loop on tracks in the event
     for (Int_t k=0;k<ntracks;k++){
-      AliAODTrack* track=aod->GetTrack(k);
+      AliAODTrack* track=dynamic_cast<AliAODTrack*>(aod->GetTrack(k));
+      if(!track) AliFatal("Not a standard AOD");
 
       // Track selection cuts
       if(track->GetID()<0) continue;
       Double_t d0z0[2],covd0z0[3];
-      track->PropagateToDCA(vtx1,aod->GetMagneticField(),99999.,d0z0,covd0z0);
+      if(!track->PropagateToDCA(vtx1,aod->GetMagneticField(),99999.,d0z0,covd0z0)) continue;
       if(track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){
        ((TH1F*)fOutputTrack->FindObject("hd0TracksFilterBit4"))->Fill(d0z0[0]);
       }
@@ -1531,15 +1961,18 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
          !((trStatus & AliVTrack::kITSrefit) == AliVTrack::kITSrefit)){
        selTrack=kFALSE;
       }
-
+      if(!track->TestFilterMask(AliAODTrack::kTrkGlobalNoDCA)){ // BIT(4) standard cuts with very loose DCA
+        selTrack=kFALSE;
+      }
+      if(TMath::Abs(track->Eta())>0.9){
+        selTrack=kFALSE;
+      }
       Float_t nCrossedRowsTPC = track->GetTPCClusterInfo(2,1);
       Float_t  ratioCrossedRowsOverFindableClustersTPC = 1.0;
       if (track->GetTPCNclsF()>0) {
        ratioCrossedRowsOverFindableClustersTPC = nCrossedRowsTPC/track->GetTPCNclsF();
       }
-      if ( nCrossedRowsTPC<70 || ratioCrossedRowsOverFindableClustersTPC<.8 ){
-       selTrack=kFALSE;        
-      }
+      
       if(selTrack){
        if(track->HasPointOnITSLayer(0) || track->HasPointOnITSLayer(1)){
          ((TH1F*)fOutputTrack->FindObject("hd0TracksTPCITSSPDany"))->Fill(d0z0[0]);
@@ -1635,10 +2068,11 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
        }//if TOF status
        //}
       
-       if(pidHF && pidHF->CheckStatus(track,"TPC")){ 
+       if(pidHF && pidHF->CheckStatus(track,"TPC") && selTrack){ 
 
          Double_t TPCp=pid->GetTPCmomentum();
          Double_t TPCsignal=pid->GetTPCsignal();
+         UShort_t TPCsignalN=pid->GetTPCsignalN();
          ((TH1F*)fOutputPID->FindObject("hTPCsig"))->Fill(TPCsignal);
          ((TH1F*)fOutputPID->FindObject("hTPCsigvsp"))->Fill(TPCp,TPCsignal);
          //if (pidHF->IsKaonRaw(track, "TOF"))
@@ -1665,11 +2099,15 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
            }
 
          }
-
-
+         if(fFillDistrTrackEffChecks && track->GetStatus()&AliESDtrack::kITSrefit && track->GetStatus()&AliESDtrack::kTPCrefit){
+           ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPtAllTracks"))->Fill(track->Pt(),(Float_t)TPCsignalN);
+           ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPhiAllTracks"))->Fill(track->Phi(),(Float_t)TPCsignalN);
+           ((TH2F*)fOutputPID->FindObject("hTPCsigNvsEtaAllTracks"))->Fill(track->Eta(),(Float_t)TPCsignalN);
+         }
+         
        }//if TPC status
       } //end PID histograms
-
+      
       Int_t nclsTot=0,nclsSPD=0;
 
       //check clusters of the tracks
@@ -1684,9 +2122,8 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
        }
        ((TH1F*)fOutputTrack->FindObject("hnClsITS"))->Fill(nclsTot);
        ((TH1F*)fOutputTrack->FindObject("hnClsSPD"))->Fill(nclsSPD);
-
-       if(fFillDistrTrackEffChecks && track->GetStatus()&AliESDtrack::kITSrefit &&
-          track->GetStatus()&AliESDtrack::kTPCrefit){
+       
+       if(fFillDistrTrackEffChecks && track->GetStatus()&AliESDtrack::kITSrefit && track->GetStatus()&AliESDtrack::kTPCrefit){
 
          ((TH1F*)fOutputTrack->FindObject("hPtAllTracks"))->Fill(track->Pt());
          ((TH1F*)fOutputTrack->FindObject("hPhiAllTracks"))->Fill(track->Phi());
@@ -1703,7 +2140,7 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
          ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPtAllTracks"))->Fill(track->Pt(),ratioCrossedRowsOverFindableClustersTPC);
          ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPhiAllTracks"))->Fill(track->Phi(),ratioCrossedRowsOverFindableClustersTPC);
          ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsEtaAllTracks"))->Fill(track->Eta(),ratioCrossedRowsOverFindableClustersTPC);
-         
+
          if(!(track->HasPointOnITSLayer(0)) && !(track->HasPointOnITSLayer(1))){ //no SPD points
            ((TH1I*)fOutputTrack->FindObject("hSPDclsAllTracks"))->Fill(0);
          } 
@@ -1720,8 +2157,8 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
          ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPhiAllTracks"))->Fill(track->Phi(), nclsTot);
          ((TH2F*)fOutputTrack->FindObject("hNITSclsvsEtaAllTracks"))->Fill(track->Eta(), nclsTot);
 
-         }
-
+       }
+       
        if(track->Pt()>0.3 &&
           TMath::Abs(track->Eta())<0.8 &&
           track->GetStatus()&AliESDtrack::kITSrefit &&
@@ -1741,8 +2178,8 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
        Int_t label=0;
        if(fReadMC){
          label=track->GetLabel();
-         if (label<0)fNEntries->Fill(8);
-         else fNEntries->Fill(9); 
+         if (label<0)((TH1F*)fOutputEntries->FindObject("hNentries"))->Fill(8);
+         else ((TH1F*)fOutputEntries->FindObject("hNentries"))->Fill(9);
        }
 
 
@@ -1760,10 +2197,12 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
            ((TH1F*)fOutputTrack->FindObject("hptGoodTr"))->Fill(track->Pt());
            isGoodTrack++;
          }
+
+         if(fCuts->IsDaughterSelected(track,&vESD,fCuts->GetTrackCuts())){
+           isSelTrack++;
+         }//select tracks for our analyses
+
        }
-       if(fCuts->IsDaughterSelected(track,&vESD,fCuts->GetTrackCuts())){
-         isSelTrack++;
-       }//select tracks for our analyses
       } //fill track histos
     } //end loop on tracks
 
@@ -1822,12 +2261,12 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
            if(mot){
              Int_t pdgMotCode = mot->GetPdgCode();
        
-             if(TMath::Abs(pdgMotCode)==4) fNEntries->Fill(6); //from primary charm
-             if(TMath::Abs(pdgMotCode)==5) fNEntries->Fill(7); //from beauty
+             if(TMath::Abs(pdgMotCode)==4) ((TH1F*)fOutputEntries->FindObject("hNentries"))->Fill(6); //from primary charm
+             if(TMath::Abs(pdgMotCode)==5) ((TH1F*)fOutputEntries->FindObject("hNentries"))->Fill(7); //from beauty
            }
          }
        }//end MC
-       fNEntries->Fill(5); //count the candidates (data and MC)
+       ((TH1F*)fOutputEntries->FindObject("hNentries"))->Fill(5);//count the candidates (data and MC)
 
        for(Int_t id=0;id<ndaugh;id++){
          //other histograms to be filled when the cut object is given
@@ -1844,6 +2283,38 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
          else 
            track=(AliAODTrack*)d->GetDaughter(id);
 
+
+         // filtering cut level
+         
+         if (fCuts->IsInFiducialAcceptance(d->Pt(),d->Y(pdg)) && fCuts->IsSelected(d,AliRDHFCuts::kAll,aod)) {
+           
+           Int_t label=0;
+           if(fReadMC)label=track->GetLabel();
+           if(fOnOff[0]){
+             
+             if(fReadMC && label<0) {
+               isFakeTrack++;
+               ((TH1F*)fOutputTrack->FindObject("hptFakeTrFromDaugh_filt"))->Fill(track->Pt());
+          
+               ((TH1F*)fOutputTrack->FindObject("hd0f_filt"))->Fill(d->Getd0Prong(id));
+             } else {
+               ((TH1F*)fOutputTrack->FindObject("hptGoodTrFromDaugh_filt"))->Fill(track->Pt());
+               ((TH1F*)fOutputTrack->FindObject("hd0dau_filt"))->Fill(d->Getd0Prong(id));
+                Double_t phidaughter = d->PhiProng(id);
+               if(phidaughter<0) phidaughter=2.0*TMath::Pi()+phidaughter;
+               ((TH2F*)fOutputTrack->FindObject("hd0dauphi_filt"))->Fill(phidaughter, d->Getd0Prong(id));
+               Double_t d0rphiz[2],covd0[3];
+               Bool_t isDCA=track->PropagateToDCA(aod->GetPrimaryVertex(),aod->GetMagneticField(),9999.,d0rphiz,covd0);
+               if(isDCA){
+                 ((TH1F*)fOutputTrack->FindObject("hd0zdau_filt"))->Fill(d0rphiz[1]);
+                 ((TH2F*)fOutputTrack->FindObject("hd0zdauphi_filt"))->Fill(phidaughter,d0rphiz[1]);
+               }
+             }
+           }
+         }
+
+
+
          //track quality
 
          if (fCuts->IsInFiducialAcceptance(d->Pt(),d->Y(pdg)) && fCuts->IsSelected(d,AliRDHFCuts::kTracks,aod)) {
@@ -1860,63 +2331,82 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
              } else {
                ((TH1F*)fOutputTrack->FindObject("hptGoodTrFromDaugh"))->Fill(track->Pt());
                ((TH1F*)fOutputTrack->FindObject("hd0dau"))->Fill(d->Getd0Prong(id));
+                Double_t phidaughter = d->PhiProng(id);
+               if(phidaughter<0) phidaughter=2.0*TMath::Pi()+phidaughter;
+               ((TH2F*)fOutputTrack->FindObject("hd0dauphi"))->Fill(phidaughter, d->Getd0Prong(id));
                Double_t d0rphiz[2],covd0[3];
                Bool_t isDCA=track->PropagateToDCA(aod->GetPrimaryVertex(),aod->GetMagneticField(),9999.,d0rphiz,covd0);
-               if(isDCA) ((TH1F*)fOutputTrack->FindObject("hd0zdau"))->Fill(d0rphiz[1]);
+               if(isDCA){
+                 ((TH1F*)fOutputTrack->FindObject("hd0zdau"))->Fill(d0rphiz[1]);
+                 ((TH2F*)fOutputTrack->FindObject("hd0zdauphi"))->Fill(phidaughter,d0rphiz[1]);
+               }
              }
            }
-           if (fCuts->IsSelected(d,AliRDHFCuts::kAll,aod) && fOnOff[1]){
-             fNEntries->Fill(3); //candidates passing analysis cuts
-
-             if(fFillDistrTrackEffChecks){
-               Int_t nITScls = 0;
-               Int_t nSPDcls = 0;
-               Double_t nTPCCrossedRows = track->GetTPCClusterInfo(2,1);
-               Double_t ratioCrossedRowsOverFcls = 1.0;
-               if(track->GetTPCNclsF()>0){
-                 ratioCrossedRowsOverFcls = (nTPCCrossedRows)/(track->GetTPCNclsF());
-               }
-               for(Int_t l=0;l<6;l++) {
-                 if(TESTBIT(track->GetITSClusterMap(),l)) {
-                   nITScls++; if(l<2) nSPDcls++;
-                 }
+
+
+           if(fFillDistrTrackEffChecks){
+             Int_t nITScls = 0;
+             Double_t nTPCCrossedRows = track->GetTPCClusterInfo(2,1);
+             Double_t ratioCrossedRowsOverFcls = 1.0;
+             if(track->GetTPCNclsF()>0){
+               ratioCrossedRowsOverFcls = (nTPCCrossedRows)/(track->GetTPCNclsF());
+             }
+             for(Int_t l=0;l<6;l++) {
+               if(TESTBIT(track->GetITSClusterMap(),l)) {
+                 nITScls++;
                }
+             }
+
+             ((TH1F*)fOutputTrack->FindObject("hPtDaughters"))->Fill(track->Pt());
+             ((TH1F*)fOutputTrack->FindObject("hPhiDaughters"))->Fill(track->Phi());
+             ((TH1F*)fOutputTrack->FindObject("hEtaDaughters"))->Fill(track->Eta());
+             ((TH2F*)fOutputTrack->FindObject("hEtavsPhiDaughters"))->Fill(track->Phi(),track->Eta());
+
+             ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPtDaughters"))->Fill(track->Pt(),track->GetTPCNcls());
+             ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPhiDaughters"))->Fill(track->Phi(),track->GetTPCNcls());
+             ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsEtaDaughters"))->Fill(track->Eta(),track->GetTPCNcls());
+
+             ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPtDaughters"))->Fill(track->Pt(),nTPCCrossedRows);
+             ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPhiDaughters"))->Fill(track->Phi(),nTPCCrossedRows);
+             ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsEtaDaughters"))->Fill(track->Eta(),nTPCCrossedRows);
+
+             ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPtDaughters"))->Fill(track->Pt(),ratioCrossedRowsOverFcls);
+             ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPhiDaughters"))->Fill(track->Phi(),ratioCrossedRowsOverFcls);
+             ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsEtaDaughters"))->Fill(track->Eta(),ratioCrossedRowsOverFcls);
+
+             ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPtDaughters"))->Fill(track->Pt(), nITScls);
+             ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPhiDaughters"))->Fill(track->Phi(), nITScls);
+             ((TH2F*)fOutputTrack->FindObject("hNITSclsvsEtaDaughters"))->Fill(track->Eta(), nITScls);
+             if(!(track->HasPointOnITSLayer(0)) && !(track->HasPointOnITSLayer(1))){ //no SPD points
+               ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(0);
+             } 
+             if(track->HasPointOnITSLayer(0) && !(track->HasPointOnITSLayer(1))){ //kOnlyFirst
+               ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(1);
+             } 
+             if(!(track->HasPointOnITSLayer(0)) && track->HasPointOnITSLayer(1)){ //kOnlySecond
+               ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(2);
+             }
+             if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)){ //kBoth
+               ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(3);
+             }
+
 
-               ((TH1F*)fOutputTrack->FindObject("hPtDaughters"))->Fill(track->Pt());
-               ((TH1F*)fOutputTrack->FindObject("hPhiDaughters"))->Fill(track->Phi());
-               ((TH1F*)fOutputTrack->FindObject("hEtaDaughters"))->Fill(track->Eta());
-               ((TH2F*)fOutputTrack->FindObject("hEtavsPhiDaughters"))->Fill(track->Phi(),track->Eta());
-               
-               ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPtDaughters"))->Fill(track->Pt(),track->GetTPCNcls());
-               ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsPhiDaughters"))->Fill(track->Phi(),track->GetTPCNcls());
-               ((TH2F*)fOutputTrack->FindObject("hNTPCclsvsEtaDaughters"))->Fill(track->Eta(),track->GetTPCNcls());
-
-               ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPtDaughters"))->Fill(track->Pt(),nTPCCrossedRows);
-               ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsPhiDaughters"))->Fill(track->Phi(),nTPCCrossedRows);
-               ((TH2F*)fOutputTrack->FindObject("hNTPCCrossedRowsvsEtaDaughters"))->Fill(track->Eta(),nTPCCrossedRows);
-               
-               ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPtDaughters"))->Fill(track->Pt(),ratioCrossedRowsOverFcls);
-               ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsPhiDaughters"))->Fill(track->Phi(),ratioCrossedRowsOverFcls);
-               ((TH2F*)fOutputTrack->FindObject("hRatioCRowsOverFclsvsEtaDaughters"))->Fill(track->Eta(),ratioCrossedRowsOverFcls);
-              
-               ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPtDaughters"))->Fill(track->Pt(), nITScls);
-               ((TH2F*)fOutputTrack->FindObject("hNITSclsvsPhiDaughters"))->Fill(track->Phi(), nITScls);
-               ((TH2F*)fOutputTrack->FindObject("hNITSclsvsEtaDaughters"))->Fill(track->Eta(), nITScls);
-               if(!(track->HasPointOnITSLayer(0)) && !(track->HasPointOnITSLayer(1))){ //no SPD points
-                 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(0);
-               } 
-               if(track->HasPointOnITSLayer(0) && !(track->HasPointOnITSLayer(1))){ //kOnlyFirst
-                 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(1);
-               } 
-               if(!(track->HasPointOnITSLayer(0)) && track->HasPointOnITSLayer(1)){ //kOnlySecond
-                 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(2);
+             if(fOnOff[1]){
+               AliAODPid *pid = track->GetDetPid();
+               if(pid){
+                 if(pidHF && pidHF->CheckStatus(track,"TPC")){
+                   ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPtDaughters"))->Fill(track->Pt(),pid->GetTPCsignalN());
+                   ((TH2F*)fOutputPID->FindObject("hTPCsigNvsPhiDaughters"))->Fill(track->Phi(),pid->GetTPCsignalN());
+                   ((TH2F*)fOutputPID->FindObject("hTPCsigNvsEtaDaughters"))->Fill(track->Eta(),pid->GetTPCsignalN());
+                 }
                }
-               if(track->HasPointOnITSLayer(0) && track->HasPointOnITSLayer(1)){ //kBoth
-                 ((TH1I*)fOutputTrack->FindObject("hSPDclsDaughters"))->Fill(3);
-               } 
              }
-            
-           
+           }
+
+
+           if (fCuts->IsSelected(d,AliRDHFCuts::kAll,aod) && fOnOff[1]){
+              ((TH1F*)fOutputEntries->FindObject("hNentries"))->Fill(3); //candidates passing analysis cuts
+
            AliAODPid *pid = track->GetDetPid();
              if(pid){
                Double_t times[5];
@@ -1946,13 +2436,12 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
 
   delete tpcres;
   delete [] pdgdaughters;
-  PostData(1,fNEntries);
+  PostData(1,fOutputEntries);
   if(fOnOff[1]) PostData(2,fOutputPID);
   if(fOnOff[0]) PostData(3,fOutputTrack);
   PostData(4,fCuts);
   if(fOnOff[2]) PostData(5,fOutputCounters);
   //Post data 6 done in case of centrality on   
-
 }
 
 //____________________________________________________________________________
@@ -2001,7 +2490,7 @@ void AliAnalysisTaskSEHFQA::FillFlowObs(AliAODEvent *aod){
       fRFPcuts->SetAODfilterBit(128);
     }
     if(i>1) {
-      fRFPcuts->SetParamType(AliFlowTrackCuts::kV0);
+      fRFPcuts->SetParamType(AliFlowTrackCuts::kVZERO);
       fRFPcuts->SetEtaRange(-5,+5);
       fRFPcuts->SetPhiMin(0);
       fRFPcuts->SetPhiMax(TMath::TwoPi());
@@ -2046,8 +2535,8 @@ void AliAnalysisTaskSEHFQA::FillFlowObs(AliAODEvent *aod){
 void AliAnalysisTaskSEHFQA::Terminate(Option_t */*option*/){
   //terminate analysis
 
 fNEntries = dynamic_cast<TH1F*>(GetOutputData(1));
-  if(!fNEntries){
fOutputEntries = dynamic_cast<TList*> (GetOutputData(1));
+  if (!fOutputEntries && fOnOff[1]) {
     printf("ERROR: %s not available\n",GetOutputSlot(1)->GetContainer()->GetName());
     return;
   }
@@ -2066,3 +2555,4 @@ void AliAnalysisTaskSEHFQA::Terminate(Option_t */*option*/){
 
 }
 
+