new functionality and data memebers added
authorjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 2 Mar 2010 07:45:02 +0000 (07:45 +0000)
committerjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 2 Mar 2010 07:45:02 +0000 (07:45 +0000)
PWG0/dNdPt/AlidNdPtCorrection.cxx
PWG0/dNdPt/AlidNdPtCorrection.h

index 56ddbc2..b7ef512 100644 (file)
@@ -39,6 +39,8 @@
 #include "AliMCEvent.h"  \r
 #include "AliESDtrackCuts.h"  \r
 #include "AliLog.h" \r
+#include "AliMultiplicity.h"\r
+#include "AliTracker.h"\r
 \r
 #include "AlidNdPtEventCuts.h"\r
 #include "AlidNdPtAcceptanceCuts.h"\r
@@ -68,6 +70,21 @@ ClassImp(AlidNdPtCorrection)
   fMCNSDEventAllPrimTrackMultHist1(0),\r
   fMCTriggerPrimTrackMultHist1(0),\r
   fMCEventPrimTrackMultHist1(0),\r
+  fMCAllPrimTrackTrueMultHist1(0),\r
+  fMCNDEventAllPrimTrackTrueMultHist1(0),\r
+  fMCNSDEventAllPrimTrackTrueMultHist1(0),\r
+  fMCTriggerPrimTrackTrueMultHist1(0),\r
+  fMCEventPrimTrackTrueMultHist1(0),\r
+  fMCAllPrimTrackMeanPtMult1(0),\r
+  fMCNDEventAllPrimTrackMeanPtMult1(0),\r
+  fMCNSDEventAllPrimTrackMeanPtMult1(0),\r
+  fMCTriggerPrimTrackMeanPtMult1(0),\r
+  fMCEventPrimTrackMeanPtMult1(0),\r
+  fMCAllPrimTrackMeanPtTrueMult1(0),\r
+  fMCNDEventAllPrimTrackMeanPtTrueMult1(0),\r
+  fMCNSDEventAllPrimTrackMeanPtTrueMult1(0),\r
+  fMCTriggerPrimTrackMeanPtTrueMult1(0),\r
+  fMCEventPrimTrackMeanPtTrueMult1(0),\r
   fEventMultCorrelationMatrix(0),\r
   fZvNorm(0),\r
   fZvEmptyEventsNorm(0),\r
@@ -80,6 +97,7 @@ ClassImp(AlidNdPtCorrection)
   fCorrTriggerMBtoNSDTrackEventMatrix(0),\r
   fCorrTrackEventMatrix(0),\r
   fCorrTrackMatrix(0),\r
+  fCorrHighPtTrackMatrix(0),\r
   fContTrackMatrix(0),\r
   fContMultTrackMatrix(0),\r
   fCorrMatrixFileName(""),\r
@@ -92,6 +110,10 @@ ClassImp(AlidNdPtCorrection)
 \r
   for(Int_t i=0; i<8; i++) { \r
     fCorrRecTrackMultHist1[i] = 0;\r
+    fCorrRecTrackTrueMultHist1[i] = 0;\r
+    fCorrRecTrackMeanPtMultHist1[i] = 0;\r
+    fCorrRecTrackMeanPtTrueMultHist1[i] = 0;\r
+    fCorrRecTrackPt1[i] = 0;\r
   }\r
 \r
   for(Int_t i=0; i<5; i++) { \r
@@ -117,6 +139,21 @@ AlidNdPtCorrection::AlidNdPtCorrection(Char_t* name, Char_t* title, TString corr
   fMCNSDEventAllPrimTrackMultHist1(0),\r
   fMCTriggerPrimTrackMultHist1(0),\r
   fMCEventPrimTrackMultHist1(0),\r
+  fMCAllPrimTrackTrueMultHist1(0),\r
+  fMCNDEventAllPrimTrackTrueMultHist1(0),\r
+  fMCNSDEventAllPrimTrackTrueMultHist1(0),\r
+  fMCTriggerPrimTrackTrueMultHist1(0),\r
+  fMCEventPrimTrackTrueMultHist1(0),\r
+  fMCAllPrimTrackMeanPtMult1(0),\r
+  fMCNDEventAllPrimTrackMeanPtMult1(0),\r
+  fMCNSDEventAllPrimTrackMeanPtMult1(0),\r
+  fMCTriggerPrimTrackMeanPtMult1(0),\r
+  fMCEventPrimTrackMeanPtMult1(0),\r
+  fMCAllPrimTrackMeanPtTrueMult1(0),\r
+  fMCNDEventAllPrimTrackMeanPtTrueMult1(0),\r
+  fMCNSDEventAllPrimTrackMeanPtTrueMult1(0),\r
+  fMCTriggerPrimTrackMeanPtTrueMult1(0),\r
+  fMCEventPrimTrackMeanPtTrueMult1(0),\r
   fEventMultCorrelationMatrix(0),\r
   fZvNorm(0),\r
   fZvEmptyEventsNorm(0),\r
@@ -129,6 +166,7 @@ AlidNdPtCorrection::AlidNdPtCorrection(Char_t* name, Char_t* title, TString corr
   fCorrTriggerMBtoNSDTrackEventMatrix(0),\r
   fCorrTrackEventMatrix(0),\r
   fCorrTrackMatrix(0),\r
+  fCorrHighPtTrackMatrix(0),\r
   fContTrackMatrix(0),\r
   fContMultTrackMatrix(0),\r
   fCorrMatrixFileName(corrMatrixFileName),\r
@@ -141,7 +179,10 @@ AlidNdPtCorrection::AlidNdPtCorrection(Char_t* name, Char_t* title, TString corr
 \r
   for(Int_t i=0; i<8; i++) { \r
     fCorrRecTrackMultHist1[i] = 0;\r
-    fPtvsPt[i] = 0;\r
+    fCorrRecTrackTrueMultHist1[i] = 0;\r
+    fCorrRecTrackMeanPtMultHist1[i] = 0;\r
+    fCorrRecTrackMeanPtTrueMultHist1[i] = 0;\r
+    fCorrRecTrackPt1[i] = 0;\r
   }\r
 \r
   for(Int_t i=0; i<5; i++) { \r
@@ -171,6 +212,25 @@ AlidNdPtCorrection::~AlidNdPtCorrection() {
   if(fMCNSDEventAllPrimTrackMultHist1) delete fMCNSDEventAllPrimTrackMultHist1; fMCNSDEventAllPrimTrackMultHist1=0;\r
   if(fMCTriggerPrimTrackMultHist1) delete fMCTriggerPrimTrackMultHist1; fMCTriggerPrimTrackMultHist1=0;\r
   if(fMCEventPrimTrackMultHist1) delete fMCEventPrimTrackMultHist1; fMCEventPrimTrackMultHist1=0;\r
+\r
+  if(fMCAllPrimTrackTrueMultHist1) delete fMCAllPrimTrackTrueMultHist1; fMCAllPrimTrackTrueMultHist1=0;\r
+  if(fMCNDEventAllPrimTrackTrueMultHist1) delete fMCNDEventAllPrimTrackTrueMultHist1; fMCNDEventAllPrimTrackTrueMultHist1=0;\r
+  if(fMCNSDEventAllPrimTrackTrueMultHist1) delete fMCNSDEventAllPrimTrackTrueMultHist1; fMCNSDEventAllPrimTrackTrueMultHist1=0;\r
+  if(fMCTriggerPrimTrackTrueMultHist1) delete fMCTriggerPrimTrackTrueMultHist1; fMCTriggerPrimTrackTrueMultHist1=0;\r
+  if(fMCEventPrimTrackTrueMultHist1) delete fMCEventPrimTrackTrueMultHist1; fMCEventPrimTrackTrueMultHist1=0;\r
+\r
+  if(fMCAllPrimTrackMeanPtMult1) delete fMCAllPrimTrackMeanPtMult1; fMCAllPrimTrackMeanPtMult1=0;\r
+  if(fMCNDEventAllPrimTrackMeanPtMult1) delete fMCNDEventAllPrimTrackMeanPtMult1; fMCNDEventAllPrimTrackMeanPtMult1=0;\r
+  if(fMCNSDEventAllPrimTrackMeanPtMult1) delete fMCNSDEventAllPrimTrackMeanPtMult1; fMCNSDEventAllPrimTrackMeanPtMult1=0;\r
+  if(fMCTriggerPrimTrackMeanPtMult1) delete fMCTriggerPrimTrackMeanPtMult1; fMCTriggerPrimTrackMeanPtMult1=0;\r
+  if(fMCEventPrimTrackMeanPtMult1) delete fMCEventPrimTrackMeanPtMult1; fMCEventPrimTrackMeanPtMult1=0;\r
+\r
+  if(fMCAllPrimTrackMeanPtTrueMult1) delete fMCAllPrimTrackMeanPtTrueMult1; fMCAllPrimTrackMeanPtTrueMult1=0;\r
+  if(fMCNDEventAllPrimTrackMeanPtTrueMult1) delete fMCNDEventAllPrimTrackMeanPtTrueMult1; fMCNDEventAllPrimTrackMeanPtTrueMult1=0;\r
+  if(fMCNSDEventAllPrimTrackMeanPtTrueMult1) delete fMCNSDEventAllPrimTrackMeanPtTrueMult1; fMCNSDEventAllPrimTrackMeanPtTrueMult1=0;\r
+  if(fMCTriggerPrimTrackMeanPtTrueMult1) delete fMCTriggerPrimTrackMeanPtTrueMult1; fMCTriggerPrimTrackMeanPtTrueMult1=0;\r
+  if(fMCEventPrimTrackMeanPtTrueMult1) delete fMCEventPrimTrackMeanPtTrueMult1; fMCEventPrimTrackMeanPtTrueMult1=0;\r
+\r
   if(fCosmicsHisto) delete fCosmicsHisto; fCosmicsHisto=0;\r
 \r
   for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
@@ -179,7 +239,10 @@ AlidNdPtCorrection::~AlidNdPtCorrection() {
 \r
   for(Int_t i=0; i<8; i++) { \r
     if(fCorrRecTrackMultHist1[i]) delete fCorrRecTrackMultHist1[i]; fCorrRecTrackMultHist1[i]=0;\r
-    if(fPtvsPt[i]) delete fPtvsPt[i]; fPtvsPt[i]=0;\r
+    if(fCorrRecTrackTrueMultHist1[i]) delete fCorrRecTrackTrueMultHist1[i]; fCorrRecTrackTrueMultHist1[i]=0;\r
+    if(fCorrRecTrackMeanPtMultHist1[i]) delete fCorrRecTrackMeanPtMultHist1[i]; fCorrRecTrackMeanPtMultHist1[i]=0;\r
+    if(fCorrRecTrackMeanPtTrueMultHist1[i]) delete fCorrRecTrackMeanPtTrueMultHist1[i]; fCorrRecTrackMeanPtTrueMultHist1[i]=0;\r
+    if(fCorrRecTrackPt1[i]) delete fCorrRecTrackPt1[i]; fCorrRecTrackPt1[i]=0;\r
   }\r
 \r
   for(Int_t i=0; i<5; i++) { \r
@@ -262,7 +325,7 @@ void AlidNdPtCorrection::Init(){
 \r
   Int_t binsMCNSDEventAllPrimTrackMultHist1[3]={ptNbins,etaNbins,150};\r
   Double_t minMCNSDEventAllPrimTrackMultHist1[3]={0.,-1.,-0.5}; \r
-  Double_t maxMCNSDEventAllPrimTrackMultHist1[3]={20.,1.,140.9}; \r
+  Double_t maxMCNSDEventAllPrimTrackMultHist1[3]={20.,1.,149.5}; \r
   sprintf(name,"fMCNSDEventAllPrimTrackMultHist1");\r
   sprintf(title,"mcPt:mcEta:multiplicity");\r
   \r
@@ -302,6 +365,203 @@ void AlidNdPtCorrection::Init(){
   fMCEventPrimTrackMultHist1->GetAxis(2)->SetTitle("multiplicity");\r
   fMCEventPrimTrackMultHist1->Sumw2();\r
 \r
+  //\r
+  // true multiplicity\r
+  //\r
+\r
+  Int_t binsMCAllPrimTrackTrueMultHist1[3]={ptNbins,etaNbins,150};\r
+  Double_t minMCAllPrimTrackTrueMultHist1[3]={0.,-1.,-0.5}; \r
+  Double_t maxMCAllPrimTrackTrueMultHist1[3]={20.,1.,149.5}; \r
+  sprintf(name,"fMCAllPrimTrackTrueMultHist1");\r
+  sprintf(title,"mcPt:mcEta:true_mult");\r
+  \r
+  fMCAllPrimTrackTrueMultHist1 = new THnSparseF(name,title,3,binsMCAllPrimTrackTrueMultHist1,minMCAllPrimTrackTrueMultHist1,maxMCAllPrimTrackTrueMultHist1);\r
+  fMCAllPrimTrackTrueMultHist1->SetBinEdges(0,binsPt);\r
+  fMCAllPrimTrackTrueMultHist1->SetBinEdges(1,binsEta);\r
+  fMCAllPrimTrackTrueMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
+  fMCAllPrimTrackTrueMultHist1->GetAxis(1)->SetTitle("mcEta");\r
+  fMCAllPrimTrackTrueMultHist1->GetAxis(2)->SetTitle("true_mult");\r
+  fMCAllPrimTrackTrueMultHist1->Sumw2();\r
+\r
+  Int_t binsMCNDEventAllPrimTrackTrueMultHist1[3]={ptNbins,etaNbins,150};\r
+  Double_t minMCNDEventAllPrimTrackTrueMultHist1[3]={0.,-1.,-0.5}; \r
+  Double_t maxMCNDEventAllPrimTrackTrueMultHist1[3]={20.,1.,149.5}; \r
+  sprintf(name,"fMCNDEventAllPrimTrackTrueMultHist1");\r
+  sprintf(title,"mcPt:mcEta:true_mult");\r
+  \r
+  fMCNDEventAllPrimTrackTrueMultHist1 = new THnSparseF(name,title,3,binsMCNDEventAllPrimTrackTrueMultHist1,minMCNDEventAllPrimTrackTrueMultHist1,maxMCNDEventAllPrimTrackTrueMultHist1);\r
+  fMCNDEventAllPrimTrackTrueMultHist1->SetBinEdges(0,binsPt);\r
+  fMCNDEventAllPrimTrackTrueMultHist1->SetBinEdges(1,binsEta);\r
+  fMCNDEventAllPrimTrackTrueMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
+  fMCNDEventAllPrimTrackTrueMultHist1->GetAxis(1)->SetTitle("mcEta");\r
+  fMCNDEventAllPrimTrackTrueMultHist1->GetAxis(2)->SetTitle("true_mult");\r
+  fMCNDEventAllPrimTrackTrueMultHist1->Sumw2();\r
+\r
+  Int_t binsMCNSDEventAllPrimTrackTrueMultHist1[3]={ptNbins,etaNbins,150};\r
+  Double_t minMCNSDEventAllPrimTrackTrueMultHist1[3]={0.,-1.,-0.5}; \r
+  Double_t maxMCNSDEventAllPrimTrackTrueMultHist1[3]={20.,1.,149.5}; \r
+  sprintf(name,"fMCNSDEventAllPrimTrackTrueMultHist1");\r
+  sprintf(title,"mcPt:mcEta:true_mult");\r
+  \r
+  fMCNSDEventAllPrimTrackTrueMultHist1 = new THnSparseF(name,title,3,binsMCNSDEventAllPrimTrackTrueMultHist1,minMCNSDEventAllPrimTrackTrueMultHist1,maxMCNSDEventAllPrimTrackTrueMultHist1);\r
+  fMCNSDEventAllPrimTrackTrueMultHist1->SetBinEdges(0,binsPt);\r
+  fMCNSDEventAllPrimTrackTrueMultHist1->SetBinEdges(1,binsEta);\r
+  fMCNSDEventAllPrimTrackTrueMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
+  fMCNSDEventAllPrimTrackTrueMultHist1->GetAxis(1)->SetTitle("mcEta");\r
+  fMCNSDEventAllPrimTrackTrueMultHist1->GetAxis(2)->SetTitle("true_mult");\r
+  fMCNSDEventAllPrimTrackTrueMultHist1->Sumw2();\r
+\r
+  Int_t binsMCEventTriggerPrimTrackTrueMultHist1[3]={ptNbins,etaNbins,150};\r
+  Double_t minMCEventTriggerPrimTrackTrueMultHist1[3]={0.,-1.,-0.5}; \r
+  Double_t maxMCEventTriggerPrimTrackTrueMultHist1[3]={20.,1.,149.5}; \r
+  sprintf(name,"fMCTriggerPrimTrackTrueMultHist1");\r
+  sprintf(title,"mcPt:mcEta:true_mult");\r
+  \r
+  fMCTriggerPrimTrackTrueMultHist1 = new THnSparseF(name,title,3,binsMCEventTriggerPrimTrackTrueMultHist1,minMCEventTriggerPrimTrackTrueMultHist1,maxMCEventTriggerPrimTrackTrueMultHist1);\r
+  fMCTriggerPrimTrackTrueMultHist1->SetBinEdges(0,binsPt);\r
+  fMCTriggerPrimTrackTrueMultHist1->SetBinEdges(1,binsEta);\r
+  fMCTriggerPrimTrackTrueMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
+  fMCTriggerPrimTrackTrueMultHist1->GetAxis(1)->SetTitle("mcEta");\r
+  fMCTriggerPrimTrackTrueMultHist1->GetAxis(2)->SetTitle("true_mult");\r
+  fMCTriggerPrimTrackTrueMultHist1->Sumw2();\r
+\r
+  Int_t binsMCEventPrimTrackTrueMultHist1[3]={ptNbins,etaNbins,150};\r
+  Double_t minMCEventPrimTrackTrueMultHist1[3]={0.,-1.,-0.5}; \r
+  Double_t maxMCEventPrimTrackTrueMultHist1[3]={20.,1.,149.5}; \r
+  sprintf(name,"fMCEventPrimTrackTrueMultHist1");\r
+  sprintf(title,"mcPt:mcEta:true_mult");\r
+  \r
+  fMCEventPrimTrackTrueMultHist1 = new THnSparseF(name,title,3,binsMCEventPrimTrackTrueMultHist1,minMCEventPrimTrackTrueMultHist1,maxMCEventPrimTrackTrueMultHist1);\r
+  fMCEventPrimTrackTrueMultHist1->SetBinEdges(0,binsPt);\r
+  fMCEventPrimTrackTrueMultHist1->SetBinEdges(1,binsEta);\r
+  fMCEventPrimTrackTrueMultHist1->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
+  fMCEventPrimTrackTrueMultHist1->GetAxis(1)->SetTitle("mcEta");\r
+  fMCEventPrimTrackTrueMultHist1->GetAxis(2)->SetTitle("true_mult");\r
+  fMCEventPrimTrackTrueMultHist1->Sumw2();\r
+\r
+  //\r
+  // mean pt\r
+  //\r
+  Int_t binsMCAllPrimTrackMeanPtTrueMult1[2]={100,150};\r
+  Double_t minMCAllPrimTrackMeanPtTrueMult1[2]={0.,-0.5}; \r
+  Double_t maxMCAllPrimTrackMeanPtTrueMult1[2]={10.,149.5}; \r
+  sprintf(name,"fMCAllPrimTrackMeanPtTrueMult1");\r
+  sprintf(title,"event <mcPt>:true_mult");\r
+  \r
+  fMCAllPrimTrackMeanPtTrueMult1 = new THnSparseF(name,title,2,binsMCAllPrimTrackMeanPtTrueMult1,minMCAllPrimTrackMeanPtTrueMult1,maxMCAllPrimTrackMeanPtTrueMult1);\r
+  fMCAllPrimTrackMeanPtTrueMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
+  fMCAllPrimTrackMeanPtTrueMult1->GetAxis(1)->SetTitle("true_mult");\r
+  fMCAllPrimTrackMeanPtTrueMult1->Sumw2();\r
+\r
+  Int_t binsMCAllPrimTrackMeanPtMult1[2]={100,150};\r
+  Double_t minMCAllPrimTrackMeanPtMult1[2]={0.,-0.5}; \r
+  Double_t maxMCAllPrimTrackMeanPtMult1[2]={10.,149.5}; \r
+  sprintf(name,"fMCAllPrimTrackMeanPtMult1");\r
+  sprintf(title,"event <mcPt>:mult");\r
+  \r
+  fMCAllPrimTrackMeanPtMult1 = new THnSparseF(name,title,2,binsMCAllPrimTrackMeanPtMult1,minMCAllPrimTrackMeanPtMult1,maxMCAllPrimTrackMeanPtMult1);\r
+  fMCAllPrimTrackMeanPtMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
+  fMCAllPrimTrackMeanPtMult1->GetAxis(1)->SetTitle("multiplicity");\r
+  fMCAllPrimTrackMeanPtMult1->Sumw2();\r
+\r
+  //\r
+  Int_t binsMCNDEventAllPrimTrackMeanPtTrueMult1[2]={100,150};\r
+  Double_t minMCNDEventAllPrimTrackMeanPtTrueMult1[2]={0.,-0.5}; \r
+  Double_t maxMCNDEventAllPrimTrackMeanPtTrueMult1[2]={10.,149.5}; \r
+  sprintf(name,"fMCNDEventAllPrimTrackMeanPtTrueMult1");\r
+  sprintf(title,"event <mcPt>:true_mult");\r
+  \r
+  fMCNDEventAllPrimTrackMeanPtTrueMult1 = new THnSparseF(name,title,2,binsMCNDEventAllPrimTrackMeanPtTrueMult1,minMCNDEventAllPrimTrackMeanPtTrueMult1,maxMCNDEventAllPrimTrackMeanPtTrueMult1);\r
+  fMCNDEventAllPrimTrackMeanPtTrueMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
+  fMCNDEventAllPrimTrackMeanPtTrueMult1->GetAxis(1)->SetTitle("true_mult");\r
+  fMCNDEventAllPrimTrackMeanPtTrueMult1->Sumw2();\r
+\r
+  Int_t binsMCNDEventAllPrimTrackMeanPtMult1[2]={100,150};\r
+  Double_t minMCNDEventAllPrimTrackMeanPtMult1[2]={0.,-0.5}; \r
+  Double_t maxMCNDEventAllPrimTrackMeanPtMult1[2]={10.,149.5}; \r
+  sprintf(name,"fMCNDEventAllPrimTrackMeanPtMult1");\r
+  sprintf(title,"event <mcPt>:mult");\r
+  \r
+  fMCNDEventAllPrimTrackMeanPtMult1 = new THnSparseF(name,title,2,binsMCNDEventAllPrimTrackMeanPtMult1,minMCNDEventAllPrimTrackMeanPtMult1,maxMCNDEventAllPrimTrackMeanPtMult1);\r
+  fMCNDEventAllPrimTrackMeanPtMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
+  fMCNDEventAllPrimTrackMeanPtMult1->GetAxis(1)->SetTitle("multiplicity");\r
+  fMCNDEventAllPrimTrackMeanPtMult1->Sumw2();\r
+\r
+  //\r
+  Int_t binsMCNSDEventAllPrimTrackMeanPtTrueMult1[2]={100,150};\r
+  Double_t minMCNSDEventAllPrimTrackMeanPtTrueMult1[2]={0.,-0.5}; \r
+  Double_t maxMCNSDEventAllPrimTrackMeanPtTrueMult1[2]={10.,149.5}; \r
+  sprintf(name,"fMCNSDEventAllPrimTrackMeanPtTrueMult1");\r
+  sprintf(title,"event <mcPt>:true_mult");\r
+  \r
+  fMCNSDEventAllPrimTrackMeanPtTrueMult1 = new THnSparseF(name,title,2,binsMCNSDEventAllPrimTrackMeanPtTrueMult1,minMCNSDEventAllPrimTrackMeanPtTrueMult1,maxMCNSDEventAllPrimTrackMeanPtTrueMult1);\r
+  fMCNSDEventAllPrimTrackMeanPtTrueMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
+  fMCNSDEventAllPrimTrackMeanPtTrueMult1->GetAxis(1)->SetTitle("true_mult");\r
+  fMCNSDEventAllPrimTrackMeanPtTrueMult1->Sumw2();\r
+\r
+  Int_t binsMCNSDEventAllPrimTrackMeanPtMult1[2]={100,150};\r
+  Double_t minMCNSDEventAllPrimTrackMeanPtMult1[2]={0.,-0.5}; \r
+  Double_t maxMCNSDEventAllPrimTrackMeanPtMult1[2]={10.,149.5}; \r
+  sprintf(name,"fMCNSDEventAllPrimTrackMeanPtMult1");\r
+  sprintf(title,"event <mcPt>:mult");\r
+  \r
+  fMCNSDEventAllPrimTrackMeanPtMult1 = new THnSparseF(name,title,2,binsMCNSDEventAllPrimTrackMeanPtMult1,minMCNSDEventAllPrimTrackMeanPtMult1,maxMCNSDEventAllPrimTrackMeanPtMult1);\r
+  fMCNSDEventAllPrimTrackMeanPtMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
+  fMCNSDEventAllPrimTrackMeanPtMult1->GetAxis(1)->SetTitle("multiplicity");\r
+  fMCNSDEventAllPrimTrackMeanPtMult1->Sumw2();\r
+\r
+  //\r
+  Int_t binsMCTriggerPrimTrackMeanPtTrueMult1[2]={100,150};\r
+  Double_t minMCTriggerPrimTrackMeanPtTrueMult1[2]={0.,-0.5}; \r
+  Double_t maxMCTriggerPrimTrackMeanPtTrueMult1[2]={10.,149.5}; \r
+  sprintf(name,"fMCTriggerPrimTrackMeanPtTrueMult1");\r
+  sprintf(title,"event <mcPt>:true_mult");\r
+  \r
+  fMCTriggerPrimTrackMeanPtTrueMult1 = new THnSparseF(name,title,2,binsMCTriggerPrimTrackMeanPtTrueMult1,minMCTriggerPrimTrackMeanPtTrueMult1,maxMCTriggerPrimTrackMeanPtTrueMult1);\r
+  fMCTriggerPrimTrackMeanPtTrueMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
+  fMCTriggerPrimTrackMeanPtTrueMult1->GetAxis(1)->SetTitle("true_mult");\r
+  fMCTriggerPrimTrackMeanPtTrueMult1->Sumw2();\r
+\r
+  Int_t binsMCTriggerPrimTrackMeanPtMult1[2]={100,150};\r
+  Double_t minMCTriggerPrimTrackMeanPtMult1[2]={0.,-0.5}; \r
+  Double_t maxMCTriggerPrimTrackMeanPtMult1[2]={10.,149.5}; \r
+  sprintf(name,"fMCTriggerPrimTrackMeanPtMult1");\r
+  sprintf(title,"event <mcPt>:mult");\r
+  \r
+  fMCTriggerPrimTrackMeanPtMult1 = new THnSparseF(name,title,2,binsMCTriggerPrimTrackMeanPtMult1,minMCTriggerPrimTrackMeanPtMult1,maxMCTriggerPrimTrackMeanPtMult1);\r
+  fMCTriggerPrimTrackMeanPtMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
+  fMCTriggerPrimTrackMeanPtMult1->GetAxis(1)->SetTitle("multiplicity");\r
+  fMCTriggerPrimTrackMeanPtMult1->Sumw2();\r
+\r
+  //\r
+  Int_t binsMCEventPrimTrackMeanPtTrueMult1[2]={100,150};\r
+  Double_t minMCEventPrimTrackMeanPtTrueMult1[2]={0.,-0.5}; \r
+  Double_t maxMCEventPrimTrackMeanPtTrueMult1[2]={10.,149.5}; \r
+  sprintf(name,"fMCEventPrimTrackMeanPtTrueMult1");\r
+  sprintf(title,"event <mcPt>:true_mult");\r
+  \r
+  fMCEventPrimTrackMeanPtTrueMult1 = new THnSparseF(name,title,2,binsMCEventPrimTrackMeanPtTrueMult1,minMCEventPrimTrackMeanPtTrueMult1,maxMCEventPrimTrackMeanPtTrueMult1);\r
+  fMCEventPrimTrackMeanPtTrueMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
+  fMCEventPrimTrackMeanPtTrueMult1->GetAxis(1)->SetTitle("true_mult");\r
+  fMCEventPrimTrackMeanPtTrueMult1->Sumw2();\r
+\r
+  Int_t binsMCEventPrimTrackMeanPtMult1[2]={100,150};\r
+  Double_t minMCEventPrimTrackMeanPtMult1[2]={0.,-0.5}; \r
+  Double_t maxMCEventPrimTrackMeanPtMult1[2]={10.,149.5}; \r
+  sprintf(name,"fMCEventPrimTrackMeanPtMult1");\r
+  sprintf(title,"event <mcPt>:mult");\r
+  \r
+  fMCEventPrimTrackMeanPtMult1 = new THnSparseF(name,title,2,binsMCEventPrimTrackMeanPtMult1,minMCEventPrimTrackMeanPtMult1,maxMCEventPrimTrackMeanPtMult1);\r
+  fMCEventPrimTrackMeanPtMult1->GetAxis(0)->SetTitle("<mcPt> (GeV/c)");\r
+  fMCEventPrimTrackMeanPtMult1->GetAxis(1)->SetTitle("multiplicity");\r
+  fMCEventPrimTrackMeanPtMult1->Sumw2();\r
+\r
+\r
+\r
+\r
+\r
+\r
+  //\r
   for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) \r
   {\r
     // THnSparse track histograms\r
@@ -321,13 +581,27 @@ void AlidNdPtCorrection::Init(){
     fRecTrackHist1[i]->Sumw2();\r
   }\r
 \r
+  //\r
   Int_t binsCorrRecTrackMultHist1[3]={ptNbins,etaNbins,150};\r
   Double_t minCorrRecTrackMultHist1[3]={0.,-1.,-0.5}; \r
   Double_t maxCorrRecTrackMultHist1[3]={20.,1.,149.5};\r
 \r
-  Int_t binsPtvsPt[3]={ptNbins,320};\r
-  Double_t minPtvsPt[3]={0.,0.}; \r
-  Double_t maxPtvsPt[3]={20.,16.};\r
+  Int_t binsCorrRecTrackTrueMultHist1[3]={ptNbins,etaNbins,150};\r
+  Double_t minCorrRecTrackTrueMultHist1[3]={0.,-1.,-0.5}; \r
+  Double_t maxCorrRecTrackTrueMultHist1[3]={20.,1.,149.5};\r
+\r
+  //\r
+  Int_t binsCorrRecTrackMeanPtMultHist1[2]={100,150};\r
+  Double_t minCorrRecTrackMeanPtMultHist1[2]={0.,-0.5}; \r
+  Double_t maxCorrRecTrackMeanPtMultHist1[2]={10.,149.5};\r
+\r
+  Int_t binsCorrRecTrackMeanPtTrueMultHist1[2]={100,150};\r
+  Double_t minCorrRecTrackMeanPtTrueMultHist1[2]={0.,-0.5}; \r
+  Double_t maxCorrRecTrackMeanPtTrueMultHist1[2]={10.,149.5};\r
+\r
+  Int_t binsCorrRecTrackPt1[1]={200};\r
+  Double_t minCorrRecTrackPt1[1]={0.}; \r
+  Double_t maxCorrRecTrackPt1[1]={10.};\r
 \r
   for(Int_t i=0; i<8; i++) \r
   {\r
@@ -342,13 +616,40 @@ void AlidNdPtCorrection::Init(){
     fCorrRecTrackMultHist1[i]->GetAxis(2)->SetTitle("multiplicity");\r
     fCorrRecTrackMultHist1[i]->Sumw2();\r
 \r
-    sprintf(name,"fPtvsPt_%d",i);\r
-    sprintf(title,"Pt:Pt");\r
-    fPtvsPt[i] = new THnSparseF(name,title,2,binsPtvsPt,minPtvsPt,maxPtvsPt);\r
-    fPtvsPt[i]->SetBinEdges(0,binsPt);\r
-    fPtvsPt[i]->GetAxis(0)->SetTitle("Pt (GeV/c)"); \r
-    fPtvsPt[i]->GetAxis(1)->SetTitle("Pt (GeV/c)"); \r
-    fPtvsPt[i]->Sumw2();\r
+    // THnSparse track histograms\r
+    sprintf(name,"fCorrRecTrackTrueMultHist1_%d",i);\r
+    sprintf(title,"Pt:Eta:true_mult");\r
+    fCorrRecTrackTrueMultHist1[i] = new THnSparseF(name,title,3,binsCorrRecTrackTrueMultHist1,minCorrRecTrackTrueMultHist1,maxCorrRecTrackTrueMultHist1);\r
+    fCorrRecTrackTrueMultHist1[i]->SetBinEdges(0,binsPt);\r
+    fCorrRecTrackTrueMultHist1[i]->SetBinEdges(1,binsEta);\r
+    fCorrRecTrackTrueMultHist1[i]->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
+    fCorrRecTrackTrueMultHist1[i]->GetAxis(1)->SetTitle("Eta");\r
+    fCorrRecTrackTrueMultHist1[i]->GetAxis(2)->SetTitle("true multiplicity");\r
+    fCorrRecTrackTrueMultHist1[i]->Sumw2();\r
+\r
+\r
+    // THnSparse track histograms\r
+    sprintf(name,"fCorrRecTrackMeanPtMultHist1_%d",i);\r
+    sprintf(title,"<Pt>:mult");\r
+    fCorrRecTrackMeanPtMultHist1[i] = new THnSparseF(name,title,2,binsCorrRecTrackMeanPtMultHist1,minCorrRecTrackMeanPtMultHist1,maxCorrRecTrackMeanPtMultHist1);\r
+    fCorrRecTrackMeanPtMultHist1[i]->GetAxis(0)->SetTitle("<Pt> (GeV/c)");\r
+    fCorrRecTrackMeanPtMultHist1[i]->GetAxis(1)->SetTitle("multiplicity");\r
+    fCorrRecTrackMeanPtMultHist1[i]->Sumw2();\r
+\r
+    // THnSparse track histograms\r
+    sprintf(name,"fCorrRecTrackMeanPtTrueMultHist1_%d",i);\r
+    sprintf(title,"<Pt>:true_mult");\r
+    fCorrRecTrackMeanPtTrueMultHist1[i] = new THnSparseF(name,title,2,binsCorrRecTrackMeanPtTrueMultHist1,minCorrRecTrackMeanPtTrueMultHist1,maxCorrRecTrackMeanPtTrueMultHist1);\r
+    fCorrRecTrackMeanPtTrueMultHist1[i]->GetAxis(0)->SetTitle("<Pt> (GeV/c)");\r
+    fCorrRecTrackMeanPtTrueMultHist1[i]->GetAxis(1)->SetTitle("true multiplicity");\r
+    fCorrRecTrackMeanPtTrueMultHist1[i]->Sumw2();\r
+\r
+    sprintf(name,"fCorrRecTrackPt1_%d",i);\r
+    sprintf(title,"pt small bining");\r
+    fCorrRecTrackPt1[i] = new THnSparseF(name,title,1,binsCorrRecTrackPt1,minCorrRecTrackPt1,maxCorrRecTrackPt1);\r
+    fCorrRecTrackPt1[i]->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
+    fCorrRecTrackPt1[i]->Sumw2();\r
+\r
   }\r
 \r
   Int_t binsEventMatrix[2]={zvNbins,150};\r
@@ -517,6 +818,12 @@ void AlidNdPtCorrection::Init(){
          Printf("No %s matrix \n", "zv_pt_eta_track_corr_matrix");\r
       }\r
 \r
+      // high pt track reconstruction efficiency correction (zv,pt,eta)\r
+      fCorrHighPtTrackMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_highPt_track_corr_matrix");\r
+      if(!fCorrHighPtTrackMatrix) {\r
+         Printf("No %s matrix \n", "zv_pt_eta_highPt_track_corr_matrix");\r
+      }\r
+\r
       // secondary tracks contamination correction (zv,pt,eta)\r
       fContTrackMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_cont_matrix");\r
       if(!fContTrackMatrix) {\r
@@ -554,16 +861,16 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
     return;\r
   }\r
 \r
-  // get physics trigger selection \r
-  AliPhysicsSelection *trigSel = GetPhysicsTriggerSelection();\r
-  if(!trigSel) {\r
-    AliDebug(AliLog::kError, "cannot get trigSel");\r
-    return;\r
-  }\r
-\r
   // trigger selection\r
   Bool_t isEventTriggered = kTRUE;\r
-  if(evtCuts->IsTriggerRequired())  {\r
+  if(evtCuts->IsTriggerRequired())  \r
+  {\r
+    AliPhysicsSelection *trigSel = GetPhysicsTriggerSelection();\r
+    if(!trigSel) {\r
+      AliDebug(AliLog::kError, "cannot get trigSel");\r
+      return;\r
+    }\r
+\r
     if(IsUseMCInfo()) { \r
       //static AliTriggerAnalysis* triggerAnalysis = new AliTriggerAnalysis;\r
       //isEventTriggered = triggerAnalysis->IsTriggerFired(esdEvent, GetTrigger());\r
@@ -571,11 +878,10 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
       isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
     }\r
     else {\r
-      //isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());\r
       isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
     }\r
   }\r
-\r
+  \r
   // use MC information\r
   AliHeader* header = 0;\r
   AliGenEventHeader* genHeader = 0;\r
@@ -642,7 +948,7 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
     isRecVertex = kTRUE;\r
   }\r
   Bool_t isEventOK = evtCuts->AcceptEvent(esdEvent,mcEvent,vtxESD) && isRecVertex; \r
-  //printf("isEventOK %d \n",isEventOK);\r
+  //printf("isEventOK %d, isRecVertex %d, nContributors %d, Zv %f\n",isEventOK, isRecVertex, vtxESD->GetNContributors(), vtxESD->GetZv());\r
 \r
   //\r
   // get multiplicity vertex contributors\r
@@ -651,9 +957,38 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
   if(GetAnalysisMode() == AlidNdPtHelper::kTPC || GetAnalysisMode() == AlidNdPtHelper::kMCRec) {  \r
     multMBTracks = AlidNdPtHelper::GetTPCMBTrackMult(esdEvent,evtCuts,accCuts,esdTrackCuts);\r
   } \r
-  else if(GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtxUpdate || GetAnalysisMode() == AlidNdPtHelper::kMCRec) {\r
-    //multMBTracks = AlidNdPtHelper::GetSPDMBTrackMult(esdEvent,0.0);\r
-    multMBTracks = vtxESD->GetNContributors();\r
+  else if(GetAnalysisMode() == AlidNdPtHelper::kTPCITS || GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtx || \r
+          GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtxUpdate || GetAnalysisMode() == AlidNdPtHelper::kMCRec || \r
+         GetAnalysisMode()==AlidNdPtHelper::kTPCITSHybrid) {\r
+    //if(vtxESD->GetStatus())\r
+    //   multMBTracks = vtxESD->GetNContributors();\r
+\r
+    // origin Jan Fiete GO\r
+    const AliMultiplicity* mult = esdEvent->GetMultiplicity();\r
+    if (mult) {\r
+      Int_t trackletCount = 0;\r
+\r
+      for(Int_t i=0; i<mult->GetNumberOfTracklets(); ++i) {\r
+        Float_t deltaPhi = mult->GetDeltaPhi(i);\r
+        // prevent values to be shifted by 2 Pi()\r
+        if (deltaPhi < -TMath::Pi())\r
+          deltaPhi += TMath::Pi() * 2;\r
+        if (deltaPhi > TMath::Pi())\r
+          deltaPhi -= TMath::Pi() * 2;\r
+\r
+         //if (fDeltaPhiCut > 0 && TMath::Abs(deltaPhi) > fDeltaPhiCut)\r
+         // continue;\r
+\r
+       trackletCount++;\r
+       }\r
+       //multMBTracks = mult->GetNumberOfTracklets();\r
+       multMBTracks = trackletCount;\r
+       //printf("trackletCount %d \n", trackletCount);\r
+     }\r
+     else {\r
+       AliDebug(AliLog::kError, Form("Multiplicty %p", mult));\r
+       return; \r
+     }\r
   } \r
   else {\r
     AliDebug(AliLog::kError, Form("Found analysis type %s", GetAnalysisMode()));\r
@@ -678,12 +1013,14 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
     labelsRec = new Int_t[entries];\r
 \r
     // calculate mult of reconstructed tracks\r
+\r
     for(Int_t i=0; i<entries;++i) \r
     {\r
       AliESDtrack *track = (AliESDtrack*)allChargedTracks->At(i);\r
       if(!track) continue;\r
       if(track->Charge()==0) continue;\r
 \r
+\r
       // only postive charged \r
       if(GetParticleMode() == AlidNdPtHelper::kPlus && track->Charge() < 0) \r
         continue;\r
@@ -694,7 +1031,7 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
 \r
       // cosmics analysis\r
       isCosmic = kFALSE;\r
-      if( GetParticleMode()==AlidNdPtHelper::kCosmics )\r
+      if( GetParticleMode()==AlidNdPtHelper::kCosmic )\r
       {\r
           for(Int_t j=0; j<entries;++j) \r
           {\r
@@ -728,6 +1065,7 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
       if(!track) continue;\r
       if(track->Charge()==0) continue;\r
 \r
+\r
       // only postive charged \r
       if(GetParticleMode() == AlidNdPtHelper::kPlus && track->Charge() < 0) \r
       continue;\r
@@ -741,7 +1079,7 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
       {\r
         // cosmics analysis\r
         isCosmic = kFALSE;\r
-        if( GetParticleMode()==AlidNdPtHelper::kCosmics )\r
+        if( GetParticleMode()==AlidNdPtHelper::kCosmic )\r
         {\r
           for(Int_t j=0; j<entries;++j) \r
           {\r
@@ -758,17 +1096,41 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
           if(!isCosmic) continue;\r
         }\r
 \r
-         if (GetAnalysisMode()==AlidNdPtHelper::kTPCSPDvtxUpdate) \r
-        {\r
+        Bool_t isOK = kFALSE;\r
+        Double_t x[3]; track->GetXYZ(x);\r
+        Double_t b[3]; AliTracker::GetBxByBz(x,b);\r
+\r
+        //\r
+        // if TPC-ITS hybrid tracking (kTPCITSHybrid)\r
+        // replace track parameters with TPC-ony track parameters\r
+        //\r
+        if( GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybrid ) \r
+        {\r
+          // Relate TPC-only tracks to SPD vertex\r
+          isOK = track->RelateToVertexTPCBxByBz(esdEvent->GetPrimaryVertexSPD(), b, kVeryBig);\r
+          if(!isOK) continue;\r
+\r
+         // replace esd track parameters with TPCinner\r
+          AliExternalTrackParam  *tpcTrack  = new AliExternalTrackParam(*(track->GetTPCInnerParam()));\r
+         if (!tpcTrack) return;\r
+          track->Set(tpcTrack->GetX(),tpcTrack->GetAlpha(),tpcTrack->GetParameter(),tpcTrack->GetCovariance());\r
+\r
+          if(tpcTrack) delete tpcTrack; \r
+        } \r
+\r
+        //\r
+        if (GetAnalysisMode()==AlidNdPtHelper::kTPCSPDvtxUpdate) \r
+        {\r
           //\r
           // update track parameters\r
           //\r
            AliExternalTrackParam cParam;\r
-          track->RelateToVertexTPC(esdEvent->GetPrimaryVertexSPD(),esdEvent->GetMagneticField(),kVeryBig,&cParam);\r
+          isOK = track->RelateToVertexTPC(esdEvent->GetPrimaryVertexSPD(),esdEvent->GetMagneticField(),kVeryBig,&cParam);\r
+          if(!isOK) continue;\r
           track->Set(cParam.GetX(),cParam.GetAlpha(),cParam.GetParameter(),cParam.GetCovariance());\r
 \r
            if(accCuts->AcceptTrack(track)) { \r
-             FillHistograms(track,stack,AlidNdPtHelper::kRecTracks,vtxESD->GetZv(),multRecTemp); \r
+             FillHistograms(track,stack,AlidNdPtHelper::kRecTracks,vtxESD->GetZv(),multRecTemp,multMCTrueTracks); \r
             labelsRec[multRec] = TMath::Abs(track->GetLabel());\r
             multRec++;\r
           }\r
@@ -779,7 +1141,7 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
           // Replace rec with MC\r
           //\r
            if(accCuts->AcceptTrack(track)) { \r
-            FillHistograms(track,stack,AlidNdPtHelper::kRecTracks,vtxMC[2],multRecTemp); \r
+            FillHistograms(track,stack,AlidNdPtHelper::kRecTracks,vtxMC[2],multRecTemp, multMCTrueTracks); \r
             labelsRec[multRec] = TMath::Abs(track->GetLabel());\r
             multRec++;\r
            }\r
@@ -789,7 +1151,7 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
           // all the rest tracking scenarios\r
           //\r
            if(accCuts->AcceptTrack(track)) { \r
-             FillHistograms(track,stack,AlidNdPtHelper::kRecTracks,vtxESD->GetZv(),multRecTemp); \r
+             FillHistograms(track,stack,AlidNdPtHelper::kRecTracks,vtxESD->GetZv(),multRecTemp, multMCTrueTracks); \r
             labelsRec[multRec] = TMath::Abs(track->GetLabel());\r
             multRec++;\r
           }\r
@@ -804,6 +1166,26 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
       FillHistograms(AlidNdPtHelper::kRecEvents,vtxESD->GetZv(),multMBTracks);\r
     }\r
 \r
+    // calculate meanPt from the event\r
+    Double_t meanPtMult[8] = {0};  \r
+    Double_t meanPtTrueMult[8] = {0};  \r
+    for (Int_t i = 0; i<8; i++) {\r
+      if(!fCorrRecTrackMultHist1[i]) continue;\r
+      meanPtMult[i] = fCorrRecTrackPt1[i]->Projection(0)->GetMean();    \r
+      Double_t vCorrRecTrackMeanPtMultHist1[2] = {meanPtMult[i],multRecTemp};\r
+      fCorrRecTrackMeanPtMultHist1[i]->Fill(vCorrRecTrackMeanPtMultHist1); \r
+      \r
+      if( IsUseMCInfo() ) {\r
+        if(!fCorrRecTrackTrueMultHist1[i]) continue;\r
+        meanPtTrueMult[i] = fCorrRecTrackPt1[i]->Projection(0)->GetMean();    \r
+        Double_t vCorrRecTrackMeanPtTrueMultHist1[2] = {meanPtMult[i],multMCTrueTracks};\r
+        fCorrRecTrackMeanPtTrueMultHist1[i]->Fill(vCorrRecTrackMeanPtTrueMultHist1); \r
+      }\r
+\r
+      // reset pt histo for the next event\r
+      if(fCorrRecTrackPt1[i])  fCorrRecTrackPt1[i]->Reset();\r
+    }\r
+\r
     // control event histograms\r
     Double_t vRecEventHist1[3] = {vtxESD->GetXv(),vtxESD->GetYv(),vtxESD->GetZv()};\r
     fRecEventHist1->Fill(vRecEventHist1);\r
@@ -843,6 +1225,7 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
       //\r
       // MC histograms for efficiency studies\r
       //\r
+      Double_t sumPtMC = 0;\r
       Int_t nPart  = stack->GetNtrack();\r
       for (Int_t iMc = 0; iMc < nPart; ++iMc) \r
       {\r
@@ -868,25 +1251,72 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
       \r
         // physical primary\r
         Bool_t prim = stack->IsPhysicalPrimary(iMc);\r
+        if(!prim) continue;\r
 \r
         // all primaries in acceptance\r
         if(!accCuts->AcceptTrack(particle)) continue;\r
-        if(!prim) continue;\r
 \r
         Double_t gpt = particle->Pt();\r
         Double_t geta = particle->Eta();\r
 \r
+        // sum up pt in the event\r
+       sumPtMC +=gpt; \r
+\r
         Double_t valMCAllTrackMultHist1[3] = {gpt,geta,multRec};         \r
+        Double_t valMCAllTrackTrueMultHist1[3] = {gpt,geta,multMCTrueTracks};    \r
+\r
         fMCAllPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
+        fMCAllPrimTrackTrueMultHist1->Fill(valMCAllTrackTrueMultHist1);\r
+\r
         if(evtType == AliPWG0Helper::kND) {\r
           fMCNDEventAllPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
+          fMCNDEventAllPrimTrackTrueMultHist1->Fill(valMCAllTrackTrueMultHist1);\r
         }\r
         if(evtType != AliPWG0Helper::kSD) {\r
           fMCNSDEventAllPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
+          fMCNSDEventAllPrimTrackTrueMultHist1->Fill(valMCAllTrackTrueMultHist1);\r
         }\r
-        if(isEventTriggered) fMCTriggerPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
-        if(isEventTriggered && isEventOK) fMCEventPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
+        if(isEventTriggered) { \r
+         fMCTriggerPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
+          fMCTriggerPrimTrackTrueMultHist1->Fill(valMCAllTrackTrueMultHist1);\r
+       }\r
+        if(isEventTriggered && isEventOK) { \r
+         fMCEventPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
+          fMCEventPrimTrackTrueMultHist1->Fill(valMCAllTrackTrueMultHist1);\r
+       }\r
       }\r
+\r
+      //\r
+      // calculate <pt> in the event\r
+      //\r
+      Double_t meanPtMCMult = 0;\r
+      Double_t meanPtMCTrueMult = 0;\r
+      if(multRec) meanPtMCMult = sumPtMC/multRec; \r
+      if(multMCTrueTracks) meanPtMCTrueMult = sumPtMC/multMCTrueTracks; \r
+\r
+      Double_t valMCMeanPtMult[2] = {meanPtMCMult,multRec};      \r
+      Double_t valMCMeanPtTrueMult[2] = {meanPtMCTrueMult,multMCTrueTracks};     \r
+\r
+      fMCAllPrimTrackMeanPtMult1->Fill(valMCMeanPtMult);\r
+      fMCAllPrimTrackMeanPtTrueMult1->Fill(valMCMeanPtTrueMult);\r
+\r
+      if(evtType == AliPWG0Helper::kND) {\r
+          fMCNDEventAllPrimTrackMeanPtMult1->Fill(valMCMeanPtMult);\r
+          fMCNDEventAllPrimTrackMeanPtTrueMult1->Fill(valMCMeanPtTrueMult);\r
+      }\r
+      if(evtType != AliPWG0Helper::kSD) {\r
+          fMCNSDEventAllPrimTrackMeanPtMult1->Fill(valMCMeanPtMult);\r
+          fMCNSDEventAllPrimTrackMeanPtTrueMult1->Fill(valMCMeanPtTrueMult);\r
+      }\r
+      if(isEventTriggered) { \r
+         fMCTriggerPrimTrackMeanPtMult1->Fill(valMCMeanPtMult);\r
+          fMCTriggerPrimTrackMeanPtTrueMult1->Fill(valMCMeanPtTrueMult);\r
+      }\r
+      if(isEventTriggered && isEventOK) { \r
+          fMCEventPrimTrackMeanPtMult1->Fill(valMCMeanPtMult);\r
+          fMCEventPrimTrackMeanPtTrueMult1->Fill(valMCMeanPtTrueMult);\r
+      }\r
+\r
     }\r
   } // end bUseMC\r
 \r
@@ -940,7 +1370,7 @@ void AlidNdPtCorrection::FillHistograms(AlidNdPtHelper::EventObject eventObj, Do
 }\r
 \r
 //_____________________________________________________________________________\r
-void AlidNdPtCorrection::FillHistograms(AliESDtrack * const esdTrack, AliStack * const stack, AlidNdPtHelper::TrackObject trackObj, Double_t zv, Int_t mult) const\r
+void AlidNdPtCorrection::FillHistograms(AliESDtrack * const esdTrack, AliStack * const stack, AlidNdPtHelper::TrackObject trackObj, Double_t zv, Int_t mult, Int_t trueMult) const\r
 {\r
   //\r
   // Fill ESD track and MC histograms \r
@@ -983,7 +1413,10 @@ void AlidNdPtCorrection::FillHistograms(AliESDtrack * const esdTrack, AliStack *
   if(trackObj == AlidNdPtHelper::kRecTracks || GetAnalysisMode() == AlidNdPtHelper::kMCRec)  \r
   {\r
     // track level corrections\r
-    Double_t trackEffF = GetCorrFactZvPtEta(fCorrTrackMatrix,zv,pt,eta);\r
+    Double_t trackEffF = 1.0;  \r
+    if(pt < 2.5) trackEffF = GetCorrFactZvPtEta(fCorrTrackMatrix,zv,pt,eta);\r
+    else trackEffF = GetCorrFactZvPtEta(fCorrHighPtTrackMatrix,zv,pt,eta);\r
+\r
     Double_t trackContF = GetContFactZvPtEta(fContTrackMatrix,zv,pt,eta);\r
     Double_t multTrackContF = GetContFactZvPtEta(fContMultTrackMatrix,zv,pt,eta);\r
     //printf("zv %f, pt %f, eta %f \n",zv,pt,eta);\r
@@ -1008,15 +1441,19 @@ void AlidNdPtCorrection::FillHistograms(AliESDtrack * const esdTrack, AliStack *
  \r
     // Fill histograms\r
     Double_t valCorrRecTrackMultHist1[3] = {pt,eta,mult};        \r
-    Double_t valPtvsPt[2] = {pt,pt};     \r
+    Double_t valCorrRecTrackPt1[1] = {pt};       \r
     for(Int_t i=0; i<8; i++) {\r
       fCorrRecTrackMultHist1[i]->Fill(valCorrRecTrackMultHist1,corrF[i]);\r
-      fPtvsPt[i]->Fill(valPtvsPt,corrF[i]);\r
+      fCorrRecTrackPt1[i]->Fill(valCorrRecTrackPt1,corrF[i]);\r
+\r
+      if( IsUseMCInfo() ) {\r
+        Double_t valCorrRecTrackTrueMultHist1[3] = {pt,eta,trueMult};    \r
+        fCorrRecTrackTrueMultHist1[i]->Fill(valCorrRecTrackTrueMultHist1,corrF[i]);\r
+      } \r
     }\r
   }\r
 }\r
 \r
-//_____________________________________________________________________________\r
 void AlidNdPtCorrection::FillHistograms(AliStack * const stack, Int_t /*label*/, AlidNdPtHelper::TrackObject /*trackObj*/, Int_t /*mult*/) const\r
 {\r
   // Fill MC histograms\r
@@ -1170,6 +1607,25 @@ Long64_t AlidNdPtCorrection::Merge(TCollection* const list)
     fMCNSDEventAllPrimTrackMultHist1->Add(entry->fMCNSDEventAllPrimTrackMultHist1);\r
     fMCTriggerPrimTrackMultHist1->Add(entry->fMCTriggerPrimTrackMultHist1);\r
     fMCEventPrimTrackMultHist1->Add(entry->fMCEventPrimTrackMultHist1);\r
+\r
+    fMCAllPrimTrackTrueMultHist1->Add(entry->fMCAllPrimTrackTrueMultHist1);\r
+    fMCNDEventAllPrimTrackTrueMultHist1->Add(entry->fMCNDEventAllPrimTrackTrueMultHist1);\r
+    fMCNSDEventAllPrimTrackTrueMultHist1->Add(entry->fMCNSDEventAllPrimTrackTrueMultHist1);\r
+    fMCTriggerPrimTrackTrueMultHist1->Add(entry->fMCTriggerPrimTrackTrueMultHist1);\r
+    fMCEventPrimTrackTrueMultHist1->Add(entry->fMCEventPrimTrackTrueMultHist1);\r
+\r
+    fMCAllPrimTrackMeanPtMult1->Add(entry->fMCAllPrimTrackMeanPtMult1);\r
+    fMCNDEventAllPrimTrackMeanPtMult1->Add(entry->fMCNDEventAllPrimTrackMeanPtMult1);\r
+    fMCNSDEventAllPrimTrackMeanPtMult1->Add(entry->fMCNSDEventAllPrimTrackMeanPtMult1);\r
+    fMCTriggerPrimTrackMeanPtMult1->Add(entry->fMCTriggerPrimTrackMeanPtMult1);\r
+    fMCEventPrimTrackMeanPtMult1->Add(entry->fMCEventPrimTrackMeanPtMult1);\r
+\r
+    fMCAllPrimTrackMeanPtTrueMult1->Add(entry->fMCAllPrimTrackMeanPtTrueMult1);\r
+    fMCNDEventAllPrimTrackMeanPtTrueMult1->Add(entry->fMCNDEventAllPrimTrackMeanPtTrueMult1);\r
+    fMCNSDEventAllPrimTrackMeanPtTrueMult1->Add(entry->fMCNSDEventAllPrimTrackMeanPtTrueMult1);\r
+    fMCTriggerPrimTrackMeanPtTrueMult1->Add(entry->fMCTriggerPrimTrackMeanPtTrueMult1);\r
+    fMCEventPrimTrackMeanPtTrueMult1->Add(entry->fMCEventPrimTrackMeanPtTrueMult1);\r
+\r
     fCosmicsHisto->Add(entry->fCosmicsHisto);\r
 \r
     for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) {\r
@@ -1178,7 +1634,12 @@ Long64_t AlidNdPtCorrection::Merge(TCollection* const list)
 \r
     for(Int_t i=0; i<8; i++) {\r
       fCorrRecTrackMultHist1[i]->Add(entry->fCorrRecTrackMultHist1[i]);\r
-      fPtvsPt[i]->Add(entry->fPtvsPt[i]);\r
+      fCorrRecTrackTrueMultHist1[i]->Add(entry->fCorrRecTrackTrueMultHist1[i]);\r
+\r
+      fCorrRecTrackMeanPtMultHist1[i]->Add(entry->fCorrRecTrackMeanPtMultHist1[i]);\r
+      fCorrRecTrackMeanPtTrueMultHist1[i]->Add(entry->fCorrRecTrackMeanPtTrueMultHist1[i]);\r
+\r
+      fCorrRecTrackPt1[i]->Add(entry->fCorrRecTrackPt1[i]);\r
     }\r
 \r
     for(Int_t i=0; i<5; i++) {\r
@@ -1258,17 +1719,6 @@ void AlidNdPtCorrection::Analyse()
   aFolderObj->Add(h2D);\r
 \r
   //\r
-  // pt profile\r
-  //\r
-  char name[256];\r
-  for(Int_t i=0; i<8; i++) {\r
-    h2D = fPtvsPt[i]->Projection(1,0);\r
-    sprintf(name,"PtvsMeanPt_%d",i);\r
-    h2D->SetName(name);\r
-    aFolderObj->Add(h2D);\r
-  }\r
-\r
-  //\r
   // event level \r
   //\r
   h = fCorrRecEventHist1[0]->Projection(1);\r
@@ -1534,7 +1984,7 @@ void AlidNdPtCorrection::Analyse()
 \r
   hsc = (TH1D*)hs->Clone();\r
   hsc->SetName("pt_rec_NSD_trig_event_track_mult_eff_cont_corrected_s_norm");\r
-  hsc->Scale(1./(fCorrRecEventHist1[4]->Projection(1)->Integral()+fCorrRecEventHist2[4]->Projection(1)->Integral()));\r
+  hsc->Scale(1./(fCorrRecEventHist1[4]->Projection(1)->Integral() + fCorrRecEventHist2[4]->Projection(1)->Integral()));\r
   aFolderObj->Add(hsc);\r
 \r
   //\r
index 0d6f529..7166b95 100644 (file)
@@ -58,7 +58,7 @@ public :
   TFolder *CreateFolder(TString folder = "folderdNdPtCorrection",TString title = "Analysed dNdPt histograms");
 
   // Fill histograms
-  void FillHistograms(AliESDtrack *const esdTrack, AliStack *const stack, AlidNdPtHelper::TrackObject trackObj, Double_t zv, Int_t multRec) const;
+  void FillHistograms(AliESDtrack *const esdTrack, AliStack *const stack, AlidNdPtHelper::TrackObject trackObj, Double_t zv, Int_t multRec, Int_t trueMult) const;
   void FillHistograms(AliStack *const stack, Int_t label, AlidNdPtHelper::TrackObject trackObj, Int_t multRec) const;
   void FillHistograms(AlidNdPtHelper::EventObject eventObj, Double_t zv, Int_t multMBRec) const;
 
@@ -81,11 +81,34 @@ public :
   THnSparseF *GetMCTriggerPrimTrackMultHist1() const {return fMCTriggerPrimTrackMultHist1;}; 
   THnSparseF *GetMCEventPrimTrackMultHist1() const {return fMCEventPrimTrackMultHist1;}; 
 
+  THnSparseF *GetMCAllPrimTrackTrueMultHist1() const {return fMCAllPrimTrackTrueMultHist1;}; 
+  THnSparseF *GetMCNDEventAllPrimTrackTrueMultHist1() const {return fMCNDEventAllPrimTrackTrueMultHist1;}; 
+  THnSparseF *GetMCNSDEventAllPrimTrackTrueMultHist1() const {return fMCNSDEventAllPrimTrackTrueMultHist1;}; 
+  THnSparseF *GetMCTriggerPrimTrackTrueMultHist1() const {return fMCTriggerPrimTrackTrueMultHist1;}; 
+  THnSparseF *GetMCEventPrimTrackTrueMultHist1() const {return fMCEventPrimTrackTrueMultHist1;}; 
+
+
+  THnSparseF *GetMCAllPrimTrackMeanPtMult1() const {return fMCAllPrimTrackMeanPtMult1;}; 
+  THnSparseF *GetMCNDEventAllPrimTrackMeanPtMult1() const {return fMCNDEventAllPrimTrackMeanPtMult1;}; 
+  THnSparseF *GetMCNSDEventAllPrimTrackMeanPtMult1() const {return fMCNSDEventAllPrimTrackMeanPtMult1;}; 
+  THnSparseF *GetMCTriggerPrimTrackMeanPtMult1() const {return fMCTriggerPrimTrackMeanPtMult1;}; 
+  THnSparseF *GetMCEventPrimTrackMeanPtMult1() const {return fMCEventPrimTrackMeanPtMult1;}; 
+
+  THnSparseF *GetMCAllPrimTrackMeanPtTrueMult1() const {return fMCAllPrimTrackMeanPtTrueMult1;}; 
+  THnSparseF *GetMCNDEventAllPrimTrackMeanPtTrueMult1() const {return fMCNDEventAllPrimTrackMeanPtTrueMult1;}; 
+  THnSparseF *GetMCNSDEventAllPrimTrackMeanPtTrueMult1() const {return fMCNSDEventAllPrimTrackMeanPtTrueMult1;}; 
+  THnSparseF *GetMCTriggerPrimTrackMeanPtTrueMult1() const {return fMCTriggerPrimTrackMeanPtTrueMult1;}; 
+  THnSparseF *GetMCEventPrimTrackMeanPtTrueMult1() const {return fMCEventPrimTrackMeanPtTrueMult1;};
+
   THnSparseF *GetCorrRecTrackMultHist1(Int_t i) const {return fCorrRecTrackMultHist1[i];}
+  THnSparseF *GetCorrRecTrackTrueMultHist1(Int_t i) const {return fCorrRecTrackTrueMultHist1[i];}
+  THnSparseF *GetCorrRecTrackMeanPtMultHist1(Int_t i) const {return fCorrRecTrackMeanPtMultHist1[i];}
+  THnSparseF *GetCorrRecTrackMeanPtTrueMultHist1(Int_t i) const {return fCorrRecTrackMeanPtTrueMultHist1[i];}
+  THnSparseF *GetCorrRecTrackPt1(Int_t i) const {return fCorrRecTrackPt1[i];}
+
   THnSparseF *GetCorrRecEventHist1(Int_t i) const {return fCorrRecEventHist1[i];}
   THnSparseF *GetCorrRecEventHist2(Int_t i) const {return fCorrRecEventHist2[i];}
 
-  THnSparseF *GetPtvsPt(Int_t i) const {return fPtvsPt[i];}
 
   // correlation matrix
   void SetEventMultCorrelationMatrix(THnSparseF *const matrix=0) {fEventMultCorrelationMatrix = matrix;}
@@ -127,6 +150,9 @@ public :
   void SetCorrTrackMatrix(THnSparseF *const matrix=0) {fCorrTrackMatrix = matrix;}
   THnSparseF *GetCorrTrackMatrix() const {return fCorrTrackMatrix;}
 
+  void SetCorrHighPtTrackMatrix(THnSparseF *const matrix=0) {fCorrHighPtTrackMatrix = matrix;}
+  THnSparseF *GetCorrHighPtTrackMatrix() const {return fCorrHighPtTrackMatrix;}
+
   void SetContTrackMatrix(THnSparseF *const matrix=0) {fContTrackMatrix = matrix;}
   THnSparseF *GetContTrackMatrix() const {return fContTrackMatrix;}
 
@@ -176,12 +202,47 @@ private:
   // all mc primary tracks in acceptance (NSD events)
   THnSparseF *fMCNSDEventAllPrimTrackMultHist1; //-> mcPt:mcEta:multiplicity
 
-  //all mc primary tracks in acceptance (triggered events)
+  // all mc primary tracks in acceptance (triggered events)
   THnSparseF *fMCTriggerPrimTrackMultHist1; //-> mcPt:mcEta:multiplicity
 
-  //mc primary tracks in acceptance (triggered and event vertex reconstructed)
+  // mc primary tracks in acceptance (triggered and event vertex reconstructed)
   THnSparseF *fMCEventPrimTrackMultHist1; //-> mcPt:mcEta:multiplicity
 
+  // true multiplicity 
+
+  // all mc primary tracks in acceptance (INEL)
+  THnSparseF *fMCAllPrimTrackTrueMultHist1; //-> mcPt:mcEta:true multiplicity
+
+  // all mc primary tracks in acceptance (ND events)
+  THnSparseF *fMCNDEventAllPrimTrackTrueMultHist1; //-> mcPt:mcEta:true multiplicity
+
+  // all mc primary tracks in acceptance (NSD events)
+  THnSparseF *fMCNSDEventAllPrimTrackTrueMultHist1; //-> mcPt:mcEta:true multiplicity
+
+  // all mc primary tracks in acceptance (triggered events)
+  THnSparseF *fMCTriggerPrimTrackTrueMultHist1; //-> mcPt:mcEta:true multiplicity
+
+  // mc primary tracks in acceptance (triggered and event vertex reconstructed)
+  THnSparseF *fMCEventPrimTrackTrueMultHist1; //-> mcPt:mcEta:true multiplicity
+
+  //
+  // mc <pt> from the event
+  //
+
+  THnSparseF *fMCAllPrimTrackMeanPtMult1; //-> <mcPt>:multiplicity
+  THnSparseF *fMCNDEventAllPrimTrackMeanPtMult1; //-> <mcPt>:multiplicity
+  THnSparseF *fMCNSDEventAllPrimTrackMeanPtMult1; //-> <mcPt>:multiplicity
+  THnSparseF *fMCTriggerPrimTrackMeanPtMult1; //-> <mcPt>:multiplicity
+  THnSparseF *fMCEventPrimTrackMeanPtMult1; //-> <mcPt>:multiplicity
+
+  // true multiplicity 
+
+  THnSparseF *fMCAllPrimTrackMeanPtTrueMult1; //-> <mcPt>:true multiplicity
+  THnSparseF *fMCNDEventAllPrimTrackMeanPtTrueMult1; //-> <mcPt>:true multiplicity
+  THnSparseF *fMCNSDEventAllPrimTrackMeanPtTrueMult1; //-> <mcPt>:true multiplicity
+  THnSparseF *fMCTriggerPrimTrackMeanPtTrueMult1; //-> <mcPt>:true multiplicity
+  THnSparseF *fMCEventPrimTrackMeanPtTrueMult1; //-> <mcPt>:true multiplicity
+
 
   // track histograms 
   // [0]=all charged tracks, 
@@ -199,9 +260,13 @@ private:
   // [6]=[4]+trigger MBtoND, 
   // [7]=[4]+trigger MBToNSD)
   THnSparseF *fCorrRecTrackMultHist1[8]; //-> Pt:Eta:mult corrected histograms 
+  THnSparseF *fCorrRecTrackTrueMultHist1[8]; //-> Pt:Eta:trueMult corrected histograms
+
+  // <pt> vs multiplicity from the event
+  THnSparseF *fCorrRecTrackMeanPtMultHist1[8]; //-> <Pt>:mult corrected histograms
+  THnSparseF *fCorrRecTrackMeanPtTrueMultHist1[8]; //-> <Pt>:trueMult corrected histograms
 
-  // pt vs pt to get proper pt bin (center of gravity)
-  THnSparseF *fPtvsPt[8]; //-> pt:pt 
+  THnSparseF *fCorrRecTrackPt1[8]; //-> Pt corrected histograms in the event (helper histograms)
 
   // corrected event histograms
   // [0]-not corrected, 
@@ -251,6 +316,7 @@ private:
 
   // track-level corrections
   THnSparseF *fCorrTrackMatrix;  //-> mcVz:mcPt:mcEta (fRecPrimTrackMatrix / fGenPrimTrackMatrix)
+  THnSparseF *fCorrHighPtTrackMatrix;  //-> mcVz:mcPt:mcEta (fRecPrimTrackMatrix / fGenPrimTrackMatrix high pt tracks)
   THnSparseF *fContTrackMatrix;  //-> mcVz:mcPt:mcEta (fRecSecTrackMatrix / fRecTrackMatrix)
   THnSparseF *fContMultTrackMatrix; //-> mcVz:mcPt:mcEta (fRecMultTrackMatrix / fRecTrackMatrix)