Added d0 vs phi and cluster type
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 23 Apr 2010 21:05:15 +0000 (21:05 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 23 Apr 2010 21:05:15 +0000 (21:05 +0000)
PWG1/ITS/AliAnalysisTaskSEImpParRes.cxx
PWG1/ITS/AliAnalysisTaskSEImpParRes.h
PWG1/macros/AddTaskImpParRes.C

index 59ad65e..6341a41 100644 (file)
 #include <TH1F.h>
 
 #include "AliAnalysisManager.h"
+#include "AliGeomManager.h"
+#include "AliTrackPointArray.h"
 #include "AliMCEventHandler.h"
+#include "AliGenEventHeader.h"
 #include "AliMCEvent.h"
 #include "AliStack.h"
 #include "AliESDEvent.h"
@@ -41,7 +44,7 @@ AliAnalysisTaskSEImpParRes::AliAnalysisTaskSEImpParRes():
 AliAnalysisTaskSE(),
 fReadMC(kFALSE),
 fSelectedPdg(-1),
-fUseDiamond(kTRUE),
+fUseDiamond(kFALSE),
 fOutputitspureSARec(0),
 fOutputitspureSASkip(0), 
 fOutputallPointRec(0),
@@ -60,6 +63,19 @@ fOutputOnlyRefitRec(0),
 fOutputOnlyRefitSkip(0),
 fOutputSinThetaRec(0),
 fOutputSinThetaSkip(0),
+fOutputallPointTrue(0),
+fOutputpostvTracTrue(0),
+fOutputnegtvTracTrue(0),
+fOutputpullAllpointTrue(0),
+fOutputphiAllpointSkip(0),
+fOutputphiPostvtracSkip(0),
+fOutputphiNegtvtracSkip(0),
+fOutputclusterTypeSPD01Skip(0),
+fOutputclusterTypeSPD02Skip(0),
+fOutputclusterTypeSPD03Skip(0),
+fOutputclusterTypeSPD11Skip(0),
+fOutputclusterTypeSPD12Skip(0),
+fOutputclusterTypeSPD13Skip(0),
 fOutputPt(0),
 fNentries(0),
 fEstimVtx(0)
@@ -74,7 +90,7 @@ AliAnalysisTaskSEImpParRes::AliAnalysisTaskSEImpParRes(const char *name):
 AliAnalysisTaskSE(name),
 fReadMC(kFALSE),
 fSelectedPdg(-1),
-fUseDiamond(kTRUE),
+fUseDiamond(kFALSE),
 fOutputitspureSARec(0),
 fOutputitspureSASkip(0), 
 fOutputallPointRec(0),
@@ -93,6 +109,19 @@ fOutputOnlyRefitRec(0),
 fOutputOnlyRefitSkip(0),
 fOutputSinThetaRec(0),
 fOutputSinThetaSkip(0),
+fOutputallPointTrue(0),
+fOutputpostvTracTrue(0),
+fOutputnegtvTracTrue(0),
+fOutputpullAllpointTrue(0),
+fOutputphiAllpointSkip(0),
+fOutputphiPostvtracSkip(0),
+fOutputphiNegtvtracSkip(0),
+fOutputclusterTypeSPD01Skip(0),
+fOutputclusterTypeSPD02Skip(0),
+fOutputclusterTypeSPD03Skip(0),
+fOutputclusterTypeSPD11Skip(0),
+fOutputclusterTypeSPD12Skip(0),
+fOutputclusterTypeSPD13Skip(0),
 fOutputPt(0),
 fNentries(0),
 fEstimVtx(0)
@@ -120,8 +149,21 @@ fEstimVtx(0)
   DefineOutput(17, TList::Class());  //My private output
   DefineOutput(18, TList::Class());
   DefineOutput(19, TList::Class());  //My private output
-  DefineOutput(20, TH1F::Class());
-  DefineOutput(21, TH1F::Class());
+  DefineOutput(20, TList::Class());  //My private output
+  DefineOutput(21, TList::Class());
+  DefineOutput(22, TList::Class());  //My private output
+  DefineOutput(23, TList::Class());
+  DefineOutput(24, TList::Class());  //My private output
+  DefineOutput(25, TList::Class());
+  DefineOutput(26, TList::Class());  //My private output
+  DefineOutput(27, TList::Class());
+  DefineOutput(28, TList::Class());  //My private output
+  DefineOutput(29, TList::Class());
+  DefineOutput(30, TList::Class());  //My private output
+  DefineOutput(31, TList::Class());
+  DefineOutput(32, TList::Class());  //My private output
+  DefineOutput(33, TH1F::Class());
+  DefineOutput(34, TH1F::Class());
 }
 
 //________________________________________________________________________
@@ -130,27 +172,40 @@ AliAnalysisTaskSEImpParRes::~AliAnalysisTaskSEImpParRes()
   //
   // default distructor  
   // 
-  if (fOutputitspureSARec)            { delete fOutputitspureSARec; fOutputitspureSARec=0x0;}
-  if (fOutputitspureSASkip)         { delete fOutputitspureSASkip; fOutputitspureSASkip=0x0;}
-  if (fOutputallPointRec)              { delete fOutputallPointRec; fOutputallPointRec=0x0; }
-  if (fOutputallPointSkip)           { delete fOutputallPointSkip; fOutputallPointSkip=0x0; }
-  if (fOutputpartPointRec)           { delete fOutputpartPointRec; fOutputpartPointRec=0x0; }
-  if (fOutputpartPointSkip)        { delete fOutputpartPointSkip; fOutputpartPointSkip=0x0; }
-  if (fOutputonepointSPDRec)       { delete fOutputonepointSPDRec;fOutputonepointSPDRec=0x0;}
-  if (fOutputonepointSPDSkip)    { delete fOutputonepointSPDSkip;fOutputonepointSPDSkip=0x0;}
-  if (fOutputpostvTracRec)            { delete fOutputpostvTracRec; fOutputpostvTracRec=0x0;}
-  if (fOutputpostvTracSkip)        {  delete fOutputpostvTracSkip; fOutputpostvTracSkip=0x0;}
-  if (fOutputnegtvTracRec)            { delete fOutputnegtvTracRec; fOutputnegtvTracRec=0x0;}
-  if (fOutputnegtvTracSkip)         { delete fOutputnegtvTracSkip; fOutputnegtvTracSkip=0x0;}
-  if (fOutputpullAllpointRec)    {delete fOutputpullAllpointRec; fOutputpullAllpointRec=0x0;}
-  if (fOutputpullAllpointSkip) {delete fOutputpullAllpointSkip; fOutputpullAllpointSkip=0x0;}
-  if (fOutputOnlyRefitRec)             {delete fOutputOnlyRefitRec; fOutputOnlyRefitRec=0x0;}
-  if (fOutputOnlyRefitSkip)          {delete fOutputOnlyRefitSkip; fOutputOnlyRefitSkip=0x0;}
-  if (fOutputSinThetaRec)                {delete fOutputSinThetaRec; fOutputSinThetaRec=0x0;}  
-  if (fOutputSinThetaSkip)             {delete fOutputSinThetaSkip; fOutputSinThetaSkip=0x0;}
-  if (fOutputPt)                                          { delete fOutputPt; fOutputPt=0x0;}
-  if (fNentries)                                 { delete fNentries;     fNentries    =0x0; }
-  if (fEstimVtx)                                 { delete fEstimVtx;     fEstimVtx    =0x0; }
+  if (fOutputitspureSARec)                      { delete fOutputitspureSARec; fOutputitspureSARec=0x0;}
+  if (fOutputitspureSASkip)                   { delete fOutputitspureSASkip; fOutputitspureSASkip=0x0;}
+  if (fOutputallPointRec)                        { delete fOutputallPointRec; fOutputallPointRec=0x0; }
+  if (fOutputallPointSkip)                     { delete fOutputallPointSkip; fOutputallPointSkip=0x0; }
+  if (fOutputpartPointRec)                     { delete fOutputpartPointRec; fOutputpartPointRec=0x0; }
+  if (fOutputpartPointSkip)                  { delete fOutputpartPointSkip; fOutputpartPointSkip=0x0; }
+  if (fOutputonepointSPDRec)                 { delete fOutputonepointSPDRec;fOutputonepointSPDRec=0x0;}
+  if (fOutputonepointSPDSkip)              { delete fOutputonepointSPDSkip;fOutputonepointSPDSkip=0x0;}
+  if (fOutputpostvTracRec)                      { delete fOutputpostvTracRec; fOutputpostvTracRec=0x0;}
+  if (fOutputpostvTracSkip)                  {  delete fOutputpostvTracSkip; fOutputpostvTracSkip=0x0;}
+  if (fOutputnegtvTracRec)                      { delete fOutputnegtvTracRec; fOutputnegtvTracRec=0x0;}
+  if (fOutputnegtvTracSkip)                   { delete fOutputnegtvTracSkip; fOutputnegtvTracSkip=0x0;}
+  if (fOutputpullAllpointRec)              {delete fOutputpullAllpointRec; fOutputpullAllpointRec=0x0;}
+  if (fOutputpullAllpointSkip)           {delete fOutputpullAllpointSkip; fOutputpullAllpointSkip=0x0;}
+  if (fOutputOnlyRefitRec)                       {delete fOutputOnlyRefitRec; fOutputOnlyRefitRec=0x0;}
+  if (fOutputOnlyRefitSkip)                    {delete fOutputOnlyRefitSkip; fOutputOnlyRefitSkip=0x0;}
+  if (fOutputSinThetaRec)                          {delete fOutputSinThetaRec; fOutputSinThetaRec=0x0;}  
+  if (fOutputSinThetaSkip)                       {delete fOutputSinThetaSkip; fOutputSinThetaSkip=0x0;}
+  if (fOutputallPointTrue)                       {delete fOutputallPointTrue; fOutputallPointTrue=0x0;}
+  if (fOutputpostvTracTrue)                     {delete fOutputpostvTracTrue;fOutputpostvTracTrue=0x0;}
+  if (fOutputnegtvTracTrue)                     {delete fOutputnegtvTracTrue;fOutputnegtvTracTrue=0x0;}
+  if (fOutputpullAllpointTrue)            {delete fOutputpullAllpointTrue;fOutputpullAllpointTrue=0x0;}
+  if (fOutputphiAllpointSkip)               {delete fOutputphiAllpointSkip;fOutputphiAllpointSkip=0x0;}
+  if (fOutputphiPostvtracSkip)             {delete fOutputphiPostvtracSkip;fOutputphiPostvtracSkip=0x0;}
+  if (fOutputphiNegtvtracSkip)            {delete fOutputphiNegtvtracSkip;fOutputphiNegtvtracSkip=0x0;}
+  if (fOutputclusterTypeSPD01Skip){delete fOutputclusterTypeSPD01Skip;fOutputclusterTypeSPD01Skip=0x0;}
+  if (fOutputclusterTypeSPD02Skip){delete fOutputclusterTypeSPD02Skip;fOutputclusterTypeSPD02Skip=0x0;}
+  if (fOutputclusterTypeSPD03Skip){delete fOutputclusterTypeSPD03Skip;fOutputclusterTypeSPD03Skip=0x0;}
+  if (fOutputclusterTypeSPD11Skip){delete fOutputclusterTypeSPD11Skip;fOutputclusterTypeSPD11Skip=0x0;}
+  if (fOutputclusterTypeSPD12Skip){delete fOutputclusterTypeSPD12Skip;fOutputclusterTypeSPD12Skip=0x0;}
+  if (fOutputclusterTypeSPD13Skip){delete fOutputclusterTypeSPD13Skip;fOutputclusterTypeSPD13Skip=0x0;}
+  if (fOutputPt)                                                      {delete fOutputPt;fOutputPt=0x0;}
+  if (fNentries)                                           { delete fNentries;     fNentries    =0x0; }
+  if (fEstimVtx)                                           { delete fEstimVtx;     fEstimVtx    =0x0; }
 
 } 
 
@@ -235,30 +290,91 @@ void AliAnalysisTaskSEImpParRes::UserCreateOutputObjects()
     fOutputnegtvTracSkip->SetOwner();
     fOutputnegtvTracSkip->SetName("negtvtracSkip");
   }
-
+  
   if (!fOutputpullAllpointSkip) {
     fOutputpullAllpointSkip = new TList();
     fOutputpullAllpointSkip->SetOwner();
     fOutputpullAllpointSkip->SetName("pullAllpointSkip");
   }
-
+  
   if (!fOutputpullAllpointRec) {
     fOutputpullAllpointRec = new TList();
     fOutputpullAllpointRec->SetOwner();
     fOutputpullAllpointRec->SetName("pullAllpointRec");
   }
-
+  
   if (!fOutputOnlyRefitRec) {
     fOutputOnlyRefitRec = new TList();
     fOutputOnlyRefitRec->SetOwner();
     fOutputOnlyRefitRec->SetName("onlyRefitRec");
   }
-
+  
   if (!fOutputOnlyRefitSkip) {
     fOutputOnlyRefitSkip = new TList();
     fOutputOnlyRefitSkip->SetOwner();
     fOutputOnlyRefitSkip->SetName("onlyRefitRec");
   }
+  
+  if (!fOutputallPointTrue) {
+    fOutputallPointTrue = new TList();
+    fOutputallPointTrue->SetOwner();
+    fOutputallPointTrue->SetName("allpointTrue");
+  }
+  
+  if (!fOutputpostvTracTrue) {
+    fOutputpostvTracTrue = new TList();
+    fOutputpostvTracTrue->SetOwner();
+    fOutputpostvTracTrue->SetName("postvtracTrue");
+  }
+  
+  if (!fOutputnegtvTracTrue) {
+    fOutputnegtvTracTrue = new TList();
+    fOutputnegtvTracTrue->SetOwner();
+    fOutputnegtvTracTrue->SetName("negtvtracTrue");
+  }
+  
+  if (!fOutputpullAllpointTrue) {
+    fOutputpullAllpointTrue = new TList();
+    fOutputpullAllpointTrue->SetOwner();
+    fOutputpullAllpointTrue->SetName("pullAllpointTrue");
+  } 
+  
+  if (!fOutputclusterTypeSPD01Skip) {
+    fOutputclusterTypeSPD01Skip = new TList();
+    fOutputclusterTypeSPD01Skip->SetOwner();
+    fOutputclusterTypeSPD01Skip->SetName("clustertypeSPD01Skip");
+  }
+  
+  
+  if (!fOutputclusterTypeSPD02Skip) {
+    fOutputclusterTypeSPD02Skip = new TList();
+    fOutputclusterTypeSPD02Skip->SetOwner();
+    fOutputclusterTypeSPD02Skip->SetName("clustertypeSPD02Skip");
+  }
+  
+  if (!fOutputclusterTypeSPD03Skip) {
+    fOutputclusterTypeSPD03Skip = new TList();
+    fOutputclusterTypeSPD03Skip->SetOwner();
+    fOutputclusterTypeSPD03Skip->SetName("clustertypeSPD03Skip");
+  }
+  
+  if (!fOutputclusterTypeSPD11Skip) {
+    fOutputclusterTypeSPD11Skip = new TList();
+    fOutputclusterTypeSPD11Skip->SetOwner();
+    fOutputclusterTypeSPD11Skip->SetName("clustertypeSPD11Skip");
+  }
+  
+  if (!fOutputclusterTypeSPD12Skip) {
+    fOutputclusterTypeSPD12Skip = new TList();
+    fOutputclusterTypeSPD12Skip->SetOwner();
+    fOutputclusterTypeSPD12Skip->SetName("clustertypeSPD12Skip");
+  }
+  
+  if (!fOutputclusterTypeSPD13Skip) {
+    fOutputclusterTypeSPD13Skip = new TList();
+    fOutputclusterTypeSPD13Skip->SetOwner();
+    fOutputclusterTypeSPD13Skip->SetName("clustertypeSPD13Skip");
+  }
 
   if (!fOutputPt) {
     fOutputPt = new TList();
@@ -284,13 +400,29 @@ void AliAnalysisTaskSEImpParRes::UserCreateOutputObjects()
   const TString d0onlyRefitrphiTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
   const TString d0onlyRefitzTitle  = "d_{0} Distribution_z; d_{0} [#mum]; Entries";
   const TString d0ptTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+  const TString d0clusterTypeSPD01rphiTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+  const TString d0clusterTypeSPD01zTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries"; 
+  const TString d0clusterTypeSPD02rphiTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+  const TString d0clusterTypeSPD02zTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+  const TString d0clusterTypeSPD03rphiTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+  const TString d0clusterTypeSPD03zTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+  const TString d0clusterTypeSPD11rphiTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+  const TString d0clusterTypeSPD11zTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+  const TString d0clusterTypeSPD12rphiTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+  const TString d0clusterTypeSPD12zTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+  const TString d0clusterTypeSPD13rphiTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+  const TString d0clusterTypeSPD13zTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+  const TString d0rphiTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+  const TString d0zTitle  = "d_{0} Distribution_z; d_{0} [#mum]; Entries";
+
   TString  named0itspureSArphiRec,named0itspureSAzRec,named0allpointrphiRec, named0allpointzRec,named0partpointrphiRec, named0partpointzRec,named0onepointSPDrphiRec, named0onepointSPDzRec,named0postvtracrphiRec, named0postvtraczRec,named0negtvtracrphiRec, named0negtvtraczRec,named0pt,named0pullAllpointrphiRec,named0pullAllpointzRec,named0onlyRefitrphiRec,named0onlyRefitzRec;
   TH1F *d0ITSpureSArphiRec=0,*d0ITSpureSAzRec=0,*d0AllpointrphiRec=0, *d0AllpointzRec=0,*d0PartpointrphiRec=0, *d0PartpointzRec=0,
-    *d0OnepointSPDrphiRec=0,*d0OnepointSPDzRec=0,*d0PostvtracrphiRec=0, *d0PostvtraczRec=0,*d0NegtvtracrphiRec=0, *d0NegtvtraczRec=0,*d0Pt=0,*d0PullAllpointrphiRec,*d0PullAllpointzRec,*d0OnlyRefitrphiRec,*d0OnlyRefitzRec;
+    *d0OnepointSPDrphiRec=0,*d0OnepointSPDzRec=0,*d0PostvtracrphiRec=0, *d0PostvtraczRec=0,*d0NegtvtracrphiRec=0, *d0NegtvtraczRec=0,*d0Pt=0,*d0PullAllpointrphiRec=0,*d0PullAllpointzRec=0,*d0OnlyRefitrphiRec=0,*d0OnlyRefitzRec=0;
 
-  TString  named0itspureSArphiSkip,named0itspureSAzSkip,named0allpointrphiSkip, named0allpointzSkip,named0partpointrphiSkip, named0partpointzSkip,named0onepointSPDrphiSkip, named0onepointSPDzSkip,named0postvtracrphiSkip, named0postvtraczSkip,named0negtvtracrphiSkip, named0negtvtraczSkip,named0ptSkip,named0pullAllpointrphiSkip,named0pullAllpointzSkip,named0onlyRefitrphiSkip,named0onlyRefitzSkip;
-  TH1F *d0ITSpureSArphiSkip=0,*d0ITSpureSAzSkip=0,*d0AllpointrphiSkip=0, *d0AllpointzSkip=0,*d0PartpointrphiSkip=0, *d0PartpointzSkip=0,*d0OnepointSPDrphiSkip=0,*d0OnepointSPDzSkip=0,*d0PostvtracrphiSkip=0, *d0PostvtraczSkip=0,*d0NegtvtracrphiSkip=0,*d0NegtvtraczSkip=0,*d0PullAllpointrphiSkip,*d0PullAllpointzSkip,*d0OnlyRefitrphiSkip,*d0OnlyRefitzSkip;
+  TString  named0itspureSArphiSkip,named0itspureSAzSkip,named0allpointrphiSkip, named0allpointzSkip,named0partpointrphiSkip, named0partpointzSkip,named0onepointSPDrphiSkip, named0onepointSPDzSkip,named0postvtracrphiSkip, named0postvtraczSkip,named0negtvtracrphiSkip, named0negtvtraczSkip,named0ptSkip,named0pullAllpointrphiSkip,named0pullAllpointzSkip,named0onlyRefitrphiSkip,named0onlyRefitzSkip,named0allpointrphiTrue, named0allpointzTrue,named0postvtracrphiTrue, named0postvtraczTrue,named0negtvtracrphiTrue, named0negtvtraczTrue,named0pullAllpointrphiTrue,named0pullAllpointzTrue,named0clusterTypeSPD01rphiSkip,named0clusterTypeSPD01zSkip,named0clusterTypeSPD02rphiSkip,named0clusterTypeSPD02zSkip,named0clusterTypeSPD03rphiSkip,named0clusterTypeSPD03zSkip,named0clusterTypeSPD11rphiSkip,named0clusterTypeSPD11zSkip,named0clusterTypeSPD12rphiSkip,named0clusterTypeSPD12zSkip,named0clusterTypeSPD13rphiSkip,named0clusterTypeSPD13zSkip;
 
+  TH1F *d0ITSpureSArphiSkip=0,*d0ITSpureSAzSkip=0,*d0AllpointrphiSkip=0, *d0AllpointzSkip=0,*d0PartpointrphiSkip=0, *d0PartpointzSkip=0,*d0OnepointSPDrphiSkip=0,*d0OnepointSPDzSkip=0,*d0PostvtracrphiSkip=0, *d0PostvtraczSkip=0,*d0NegtvtracrphiSkip=0,*d0NegtvtraczSkip=0,*d0PullAllpointrphiSkip=0,*d0PullAllpointzSkip=0,*d0OnlyRefitrphiSkip=0,*d0OnlyRefitzSkip=0,*d0AllpointrphiTrue=0, *d0AllpointzTrue=0,*d0PostvtracrphiTrue=0, *d0PostvtraczTrue=0,*d0NegtvtracrphiTrue=0,*d0NegtvtraczTrue=0,*d0PullAllpointrphiTrue,*d0PullAllpointzTrue,*d0ClustertypeSPD01rphiSkip=0,*d0ClustertypeSPD01zSkip=0,*d0ClustertypeSPD02rphiSkip=0,*d0ClustertypeSPD02zSkip=0,*d0ClustertypeSPD03rphiSkip=0,*d0ClustertypeSPD03zSkip=0,*d0ClustertypeSPD11rphiSkip=0,*d0ClustertypeSPD11zSkip=0,*d0ClustertypeSPD12rphiSkip=0,*d0ClustertypeSPD12zSkip=0,*d0ClustertypeSPD13rphiSkip=0,*d0ClustertypeSPD13zSkip=0;
 
   for(Int_t i=1; i<=nhist; i++) {
 
@@ -504,17 +636,146 @@ void AliAnalysisTaskSEImpParRes::UserCreateOutputObjects()
     d0OnlyRefitzSkip->SetMinimum(0);
     fOutputOnlyRefitSkip->Add(d0OnlyRefitzSkip);
 
+    named0allpointrphiTrue = "d0allpointrphiTrue_";
+    named0allpointrphiTrue += i;
+    named0allpointzTrue = "d0allpointzTrue_";
+    named0allpointzTrue += i;
+    d0AllpointrphiTrue = new TH1F(named0allpointrphiTrue.Data(), d0allpointrphiTitle.Data(), 400, -Getd0HistRange(i), Getd0HistRange(i));
+    d0AllpointrphiTrue->Sumw2();
+    d0AllpointrphiTrue->SetMinimum(0);  
+    fOutputallPointTrue->Add(d0AllpointrphiTrue);
+    d0AllpointzTrue = new TH1F(named0allpointzTrue.Data(), d0allpointzTitle.Data(), 400, -Getd0HistRange(i), Getd0HistRange(i));
+    d0AllpointzTrue->Sumw2();
+    d0AllpointzTrue->SetMinimum(0);  
+    fOutputallPointTrue->Add(d0AllpointzTrue);
+
+    named0postvtracrphiTrue = "d0postvtracrphiTrue_";
+    named0postvtracrphiTrue += i;
+    named0postvtraczTrue = "d0postvtraczTrue_";
+    named0postvtraczTrue += i;
+    d0PostvtracrphiTrue = new TH1F(named0postvtracrphiTrue.Data(), d0postvtracrphiTitle.Data(), 400, -Getd0HistRange(i), Getd0HistRange(i));
+    d0PostvtracrphiTrue->Sumw2();
+    d0PostvtracrphiTrue->SetMinimum(0);  
+    fOutputpostvTracTrue->Add(d0PostvtracrphiTrue);
+    d0PostvtraczTrue = new TH1F(named0postvtraczTrue.Data(), d0postvtraczTitle.Data(), 400, -Getd0HistRange(i), Getd0HistRange(i));
+    d0PostvtraczTrue->Sumw2();
+    d0PostvtraczTrue->SetMinimum(0);  
+    fOutputpostvTracTrue->Add(d0PostvtraczTrue);
+
+    named0negtvtracrphiTrue = "d0negtvtracrphiTrue_";
+    named0negtvtracrphiTrue += i;
+    named0negtvtraczTrue = "d0negtvtraczTrue_";
+    named0negtvtraczTrue += i;
+    d0NegtvtracrphiTrue = new TH1F(named0negtvtracrphiTrue.Data(), d0negtvtracrphiTitle.Data(), 400, -Getd0HistRange(i), Getd0HistRange(i));
+    d0NegtvtracrphiTrue->Sumw2();
+    d0NegtvtracrphiTrue->SetMinimum(0);  
+    fOutputnegtvTracTrue->Add(d0NegtvtracrphiTrue);
+    d0NegtvtraczTrue = new TH1F(named0negtvtraczTrue.Data(), d0negtvtraczTitle.Data(), 400, -Getd0HistRange(i), Getd0HistRange(i));
+    d0NegtvtraczTrue->Sumw2();
+    d0NegtvtraczTrue->SetMinimum(0);  
+    fOutputnegtvTracTrue->Add(d0NegtvtraczTrue);
+
+    named0pullAllpointrphiTrue = "d0pullAllpointrphiTrue_";
+    named0pullAllpointrphiTrue +=i;
+    named0pullAllpointzTrue = "d0pullAllpointzTrue_";
+    named0pullAllpointzTrue +=i;
+    d0PullAllpointrphiTrue = new TH1F(named0pullAllpointrphiTrue.Data(),d0pullAllpointrphiTitle.Data(),400,-10.,10.);
+    d0PullAllpointrphiTrue->Sumw2();
+    d0PullAllpointrphiTrue->SetMinimum(0);
+    fOutputpullAllpointTrue->Add(d0PullAllpointrphiTrue);
+    d0PullAllpointzTrue = new TH1F(named0pullAllpointzTrue.Data(),d0pullAllpointzTitle.Data(),400,-10.,10.);
+    d0PullAllpointzTrue->Sumw2();
+    d0PullAllpointzTrue->SetMinimum(0);
+    fOutputpullAllpointTrue->Add(d0PullAllpointzTrue);
+
+    named0clusterTypeSPD01rphiSkip = "d0clustertypeSPD01rphiSkip_";
+    named0clusterTypeSPD01rphiSkip +=i;
+    named0clusterTypeSPD01zSkip = "d0clustertypeSPD01zSkip_";
+    named0clusterTypeSPD01zSkip +=i;
+    d0ClustertypeSPD01rphiSkip = new TH1F(named0clusterTypeSPD01rphiSkip.Data(),d0clusterTypeSPD01rphiTitle.Data(),400,-10.,10.);
+    d0ClustertypeSPD01rphiSkip->Sumw2();
+    d0ClustertypeSPD01rphiSkip->SetMinimum(0);
+    fOutputclusterTypeSPD01Skip->Add(d0ClustertypeSPD01rphiSkip);
+    d0ClustertypeSPD01zSkip = new TH1F(named0clusterTypeSPD01zSkip.Data(),d0clusterTypeSPD01zTitle.Data(),400,-10.,10.);
+    d0ClustertypeSPD01zSkip->Sumw2();
+    d0ClustertypeSPD01zSkip->SetMinimum(0);
+    fOutputclusterTypeSPD01Skip->Add(d0ClustertypeSPD01zSkip);
+
+    named0clusterTypeSPD02rphiSkip = "d0clustertypeSPD02rphiSkip_";
+    named0clusterTypeSPD02rphiSkip +=i;
+    named0clusterTypeSPD02zSkip = "d0clustertypeSPD02zSkip_";
+    named0clusterTypeSPD02zSkip +=i;
+    d0ClustertypeSPD02rphiSkip = new TH1F(named0clusterTypeSPD02rphiSkip.Data(),d0clusterTypeSPD02rphiTitle.Data(),400,-10.,10.);
+    d0ClustertypeSPD02rphiSkip->Sumw2();
+    d0ClustertypeSPD02rphiSkip->SetMinimum(0);
+    fOutputclusterTypeSPD02Skip->Add(d0ClustertypeSPD02rphiSkip);
+    d0ClustertypeSPD02zSkip = new TH1F(named0clusterTypeSPD02zSkip.Data(),d0clusterTypeSPD02zTitle.Data(),400,-10.,10.);
+    d0ClustertypeSPD02zSkip->Sumw2();
+    d0ClustertypeSPD02zSkip->SetMinimum(0);
+    fOutputclusterTypeSPD02Skip->Add(d0ClustertypeSPD02zSkip);
+
+    named0clusterTypeSPD03rphiSkip = "d0clustertypeSPD03rphiSkip_";
+    named0clusterTypeSPD03rphiSkip +=i;
+    named0clusterTypeSPD03zSkip = "d0clustertypeSPD03zSkip_";
+    named0clusterTypeSPD03zSkip +=i;
+    d0ClustertypeSPD03rphiSkip = new TH1F(named0clusterTypeSPD03rphiSkip.Data(),d0clusterTypeSPD03rphiTitle.Data(),400,-10.,10.);
+    d0ClustertypeSPD03rphiSkip->Sumw2();
+    d0ClustertypeSPD03rphiSkip->SetMinimum(0);
+    fOutputclusterTypeSPD03Skip->Add(d0ClustertypeSPD03rphiSkip);
+    d0ClustertypeSPD03zSkip = new TH1F(named0clusterTypeSPD03zSkip.Data(),d0clusterTypeSPD03zTitle.Data(),400,-10.,10.);
+    d0ClustertypeSPD03zSkip->Sumw2();
+    d0ClustertypeSPD03zSkip->SetMinimum(0);
+    fOutputclusterTypeSPD03Skip->Add(d0ClustertypeSPD03zSkip);
+
+    named0clusterTypeSPD11rphiSkip = "d0clustertypeSPD11rphiSkip_";
+    named0clusterTypeSPD11rphiSkip +=i;
+    named0clusterTypeSPD11zSkip = "d0clustertypeSPD11zSkip_";
+    named0clusterTypeSPD11zSkip +=i;
+    d0ClustertypeSPD11rphiSkip = new TH1F(named0clusterTypeSPD11rphiSkip.Data(),d0clusterTypeSPD11rphiTitle.Data(),400,-10.,10.);
+    d0ClustertypeSPD11rphiSkip->Sumw2();
+    d0ClustertypeSPD11rphiSkip->SetMinimum(0);
+    fOutputclusterTypeSPD11Skip->Add(d0ClustertypeSPD11rphiSkip);
+    d0ClustertypeSPD11zSkip = new TH1F(named0clusterTypeSPD11zSkip.Data(),d0clusterTypeSPD11zTitle.Data(),400,-10.,10.);
+    d0ClustertypeSPD11zSkip->Sumw2();
+    d0ClustertypeSPD11zSkip->SetMinimum(0);
+    fOutputclusterTypeSPD11Skip->Add(d0ClustertypeSPD11zSkip);
+
+    named0clusterTypeSPD12rphiSkip = "d0clustertypeSPD12rphiSkip_";
+    named0clusterTypeSPD12rphiSkip +=i;
+    named0clusterTypeSPD12zSkip = "d0clustertypeSPD12zSkip_";
+    named0clusterTypeSPD12zSkip +=i;
+    d0ClustertypeSPD12rphiSkip = new TH1F(named0clusterTypeSPD12rphiSkip.Data(),d0clusterTypeSPD12rphiTitle.Data(),400,-10.,10.);
+    d0ClustertypeSPD12rphiSkip->Sumw2();
+    d0ClustertypeSPD12rphiSkip->SetMinimum(0);
+    fOutputclusterTypeSPD12Skip->Add(d0ClustertypeSPD12rphiSkip);
+    d0ClustertypeSPD12zSkip = new TH1F(named0clusterTypeSPD12zSkip.Data(),d0clusterTypeSPD12zTitle.Data(),400,-10.,10.);
+    d0ClustertypeSPD12zSkip->Sumw2();
+    d0ClustertypeSPD12zSkip->SetMinimum(0);
+    fOutputclusterTypeSPD12Skip->Add(d0ClustertypeSPD12zSkip);
+
+    named0clusterTypeSPD13rphiSkip = "d0clustertypeSPD13rphiSkip_";
+    named0clusterTypeSPD13rphiSkip +=i;
+    named0clusterTypeSPD13zSkip = "d0clustertypeSPD13zSkip_";
+    named0clusterTypeSPD13zSkip +=i;
+    d0ClustertypeSPD13rphiSkip = new TH1F(named0clusterTypeSPD13rphiSkip.Data(),d0clusterTypeSPD13rphiTitle.Data(),400,-10.,10.);
+    d0ClustertypeSPD13rphiSkip->Sumw2();
+    d0ClustertypeSPD13rphiSkip->SetMinimum(0);
+    fOutputclusterTypeSPD13Skip->Add(d0ClustertypeSPD13rphiSkip);
+    d0ClustertypeSPD13zSkip = new TH1F(named0clusterTypeSPD13zSkip.Data(),d0clusterTypeSPD13zTitle.Data(),400,-10.,10.);
+    d0ClustertypeSPD13zSkip->Sumw2();
+    d0ClustertypeSPD13zSkip->SetMinimum(0);
+    fOutputclusterTypeSPD13Skip->Add(d0ClustertypeSPD13zSkip);
+
     named0pt = "d0pt_";
     named0pt += i;
     d0Pt = new TH1F(named0pt.Data(), d0ptTitle.Data(), 100, 0, 35.);
     d0Pt->Sumw2();
     d0Pt->SetMinimum(0);  
     fOutputPt->Add(d0Pt);
-
   }
 
   const Int_t nhistm=10;
-  for(Int_t i=1; i<=nhistm; i++) {
+  for(Int_t i=0; i<=nhistm; i++) {
     if (!fOutputSinThetaRec){
       fOutputSinThetaRec = new TList();
       fOutputSinThetaRec->SetOwner();
@@ -526,17 +787,41 @@ void AliAnalysisTaskSEImpParRes::UserCreateOutputObjects()
       fOutputSinThetaSkip->SetOwner();
       fOutputSinThetaSkip->SetName("thetaSkip");
     }
+
+    if (!fOutputphiAllpointSkip) {
+      fOutputphiAllpointSkip = new TList();
+      fOutputphiAllpointSkip->SetOwner();
+      fOutputphiAllpointSkip->SetName("phiallpointSkip");
+    }
     
-    const TString d0sinThetarphiTitle ="d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
-    const TString d0sinThetazTitle ="d_{0} Distribution_z; d_{0} [#mum]; Entries";
+    if (!fOutputphiPostvtracSkip) {
+      fOutputphiPostvtracSkip = new TList();
+      fOutputphiPostvtracSkip->SetOwner();
+      fOutputphiPostvtracSkip->SetName("postvtracSkip");
+    }
+    
+    if (!fOutputphiNegtvtracSkip) {
+      fOutputphiNegtvtracSkip = new TList();
+      fOutputphiNegtvtracSkip->SetOwner();
+      fOutputphiNegtvtracSkip->SetName("negtvtracSkip");
+    }
     
+    const TString d0sinThetarphiTitle ="d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+    const TString d0sinThetazTitle ="d_{0} Distribution_z; d_{0} [#mum]; Entries";  
+    const TString d0phiAllpointrphiTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+    const TString d0phiAllpointzTitle  = "d_{0} Distribution_z; d_{0} [#mum]; Entries";    
+    const TString  d0phiPostvtracrphiTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+    const TString d0phiPostvtraczTitle  = "d_{0} Distribution_z; d_{0} [#mum]; Entries";  
+    const TString  d0phiNegtvtracrphiTitle = "d_{0} Distribution_rphi; d_{0} [#mum]; Entries";
+    const TString d0phiNegtvtraczTitle  = "d_{0} Distribution_z; d_{0} [#mum]; Entries";   
     TString named0sinThetaonerphiRec,named0sinThetaonezRec,named0sinThetatworphiRec,named0sinThetatwozRec,named0sinThetathreerphiRec,named0sinThetathreezRec,named0sinThetafourrphiRec,named0sinThetafourzRec;
     
     TH1F *d0SinThetaonerphiRec,*d0SinThetaonezRec,*d0SinThetatworphiRec,*d0SinThetatwozRec,*d0SinThetathreerphiRec,*d0SinThetathreezRec,*d0SinThetafourrphiRec,*d0SinThetafourzRec;
     
-    TString  named0sinThetaonerphiSkip,named0sinThetaonezSkip,named0sinThetatworphiSkip,named0sinThetatwozSkip,named0sinThetathreerphiSkip,named0sinThetathreezSkip,named0sinThetafourrphiSkip,named0sinThetafourzSkip;
+    TString  named0sinThetaonerphiSkip,named0sinThetaonezSkip,named0sinThetatworphiSkip,named0sinThetatwozSkip,named0sinThetathreerphiSkip,named0sinThetathreezSkip,named0sinThetafourrphiSkip,named0sinThetafourzSkip,named0phiAllpointrphiSkip, named0phiAllpointzSkip,named0phiPostvtracrphiSkip, named0phiPostvtraczSkip,named0phiNegtvtracrphiSkip,named0phiNegtvtraczSkip;
     
-    TH1F*d0SinThetaonerphiSkip,*d0SinThetaonezSkip,*d0SinThetatworphiSkip,*d0SinThetatwozSkip,*d0SinThetathreerphiSkip,*d0SinThetathreezSkip,*d0SinThetafourrphiSkip,*d0SinThetafourzSkip;
+    TH1F*d0SinThetaonerphiSkip,*d0SinThetaonezSkip,*d0SinThetatworphiSkip,*d0SinThetatwozSkip,*d0SinThetathreerphiSkip,*d0SinThetathreezSkip,*d0SinThetafourrphiSkip,*d0SinThetafourzSkip, *d0PhiAllpointrphiSkip,*d0PhiAllpointzSkip,*d0PhiPostvtracrphiSkip,*d0PhiPostvtraczSkip,*d0PhiNegtvtracrphiSkip,*d0PhiNegtvtraczSkip;
+
     named0sinThetaonerphiRec = "d0sinthetaonerphiRec_";
     named0sinThetaonerphiRec += i;
     named0sinThetaonezRec ="d0sinthetaonezRec_";
@@ -642,11 +927,51 @@ void AliAnalysisTaskSEImpParRes::UserCreateOutputObjects()
     d0SinThetafourzSkip->Sumw2();
     d0SinThetafourzSkip->SetMinimum(0);
     fOutputSinThetaSkip->Add(d0SinThetafourzSkip);
+
+    named0phiAllpointrphiSkip = "d0phiallpointrphiSkip_";
+    named0phiAllpointrphiSkip += i;
+    named0phiAllpointzSkip ="d0phiallpointzSkip_";
+    named0phiAllpointzSkip += i;
+    d0PhiAllpointrphiSkip = new TH1F(named0phiAllpointrphiSkip.Data(),d0phiAllpointrphiTitle.Data(),400,-2000,2000);
+    d0PhiAllpointrphiSkip->Sumw2();
+    d0PhiAllpointrphiSkip->SetMinimum(0);
+    fOutputphiAllpointSkip->Add(d0PhiAllpointrphiSkip);
+    d0PhiAllpointzSkip = new TH1F(named0phiAllpointzSkip.Data(),d0phiAllpointzTitle.Data(),400,-2000,2000);
+    d0PhiAllpointzSkip->Sumw2();
+    d0PhiAllpointzSkip->SetMinimum(0);
+    fOutputphiAllpointSkip->Add(d0PhiAllpointzSkip);
+
+
+    named0phiPostvtracrphiSkip = "d0phipostvtracrphiSkip_";
+    named0phiPostvtracrphiSkip += i;
+    named0phiPostvtraczSkip ="d0phipostvtraczSkip_";
+    named0phiPostvtraczSkip += i;
+    d0PhiPostvtracrphiSkip = new TH1F(named0phiPostvtracrphiSkip.Data(),d0phiPostvtracrphiTitle.Data(),400,-2000,2000);
+    d0PhiPostvtracrphiSkip->Sumw2();
+    d0PhiPostvtracrphiSkip->SetMinimum(0);
+    fOutputphiPostvtracSkip->Add(d0PhiPostvtracrphiSkip);
+    d0PhiPostvtraczSkip = new TH1F(named0phiPostvtraczSkip.Data(),d0phiPostvtraczTitle.Data(),400,-2000,2000);
+    d0PhiPostvtraczSkip->Sumw2();
+    d0PhiPostvtraczSkip->SetMinimum(0);
+    fOutputphiPostvtracSkip->Add(d0PhiPostvtraczSkip);
+
+
+    named0phiNegtvtracrphiSkip = "d0phinegtvtracrphiSkip_";
+    named0phiNegtvtracrphiSkip += i;
+    named0phiNegtvtraczSkip ="d0phinegtvtraczSkip_";
+    named0phiNegtvtraczSkip += i;
+    d0PhiNegtvtracrphiSkip = new TH1F(named0phiNegtvtracrphiSkip.Data(),d0phiNegtvtracrphiTitle.Data(),400,-2000,2000);
+    d0PhiNegtvtracrphiSkip->Sumw2();
+    d0PhiNegtvtracrphiSkip->SetMinimum(0);
+    fOutputphiNegtvtracSkip->Add(d0PhiNegtvtracrphiSkip);
+    d0PhiNegtvtraczSkip = new TH1F(named0phiNegtvtraczSkip.Data(),d0phiNegtvtraczTitle.Data(),400,-2000,2000);
+    d0PhiNegtvtraczSkip->Sumw2();
+    d0PhiNegtvtraczSkip->SetMinimum(0);
+    fOutputphiNegtvtracSkip->Add(d0PhiNegtvtraczSkip);
   }
 
   if(!fNentries) fNentries = new TH1F("hNentries", "number of entries", 26, 0., 40.);
   if(!fEstimVtx) fEstimVtx = new TH1F("vtxRes","Resolution of vertex",400,-1000.,1000);
-
   return;
 }
 
@@ -678,9 +1003,9 @@ void AliAnalysisTaskSEImpParRes::UserExec(Option_t */*option*/)
   delete vertexer0; vertexer0=0;
   if(vtxESDRec->GetNContributors()<1) return;
 
-
-  AliStack *stack=0; 
-  if (fReadMC) { 
+  AliStack *stack=0;
+  AliESDVertex *vtxESDTrue=0;
+   if (fReadMC) { 
     AliMCEventHandler *eventHandler = dynamic_cast<AliMCEventHandler*>(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); 
     if (!eventHandler) { 
       Printf("ERROR: Could not retrieve MC event handler"); 
@@ -698,9 +1023,26 @@ void AliAnalysisTaskSEImpParRes::UserExec(Option_t */*option*/)
       AliDebug(AliLog::kError, "Stack not available"); 
       return; 
     } 
-  } 
 
-  
+    //load MC header for ESD;//see $ALICE_ROOT/PWG1/global/AliAnalysisTaskSEVertexESD.cxx
+    AliHeader *mcHeader = eventHandler->MCEvent()->Header();
+    if (!mcHeader) {
+      AliDebug(AliLog::kError, "Header not available");
+      return;
+    }
+
+    AliGenEventHeader* genHeader = mcHeader->GenEventHeader();
+    Double_t vtxTrue[3];
+    TArrayF mcVertex(3);
+    mcVertex[0]=9999.; mcVertex[1]=9999.; mcVertex[2]=9999.;
+    genHeader->PrimaryVertex(mcVertex);
+    vtxTrue[0]=mcVertex[0];vtxTrue[1]=mcVertex[1];vtxTrue[2]=mcVertex[2];
+    Double_t sigmaTrue[3]={0., 0., 0.,};
+    //mcHeader->GetVertex(vtxTrue);//note the vtxTrue is void here,so must need the next line.
+    //AliESDVertex *vtxESDTrue = new AliESDVertex(vtxTrue,sigmaTrue);
+    vtxESDTrue = new AliESDVertex(vtxTrue,sigmaTrue);
+    }
+
   Int_t nTrks = esd->GetNumberOfTracks();
   for (Int_t it=0; it<nTrks; it++) {  // loop over tracks
     // read track
@@ -742,7 +1084,7 @@ void AliAnalysisTaskSEImpParRes::UserExec(Option_t */*option*/)
     if(vtxESDSkip->GetNContributors()<1) continue;
      
 
-    Double_t dzRec[2], covdzRec[3], dzRecSkip[2], covdzRecSkip[3];
+    Double_t dzRec[2], covdzRec[3], dzRecSkip[2], covdzRecSkip[3],dzTrue[2], covdzTrue[3];
     Double_t beampiperadius=3.;
     Double_t pt= esdtrack->Pt();
     Int_t bin = PtBin(pt);
@@ -752,10 +1094,9 @@ void AliAnalysisTaskSEImpParRes::UserExec(Option_t */*option*/)
       continue;
     }
 
-
     esdtrack->PropagateToDCA(vtxESDRec, esd->GetMagneticField(), beampiperadius, dzRec, covdzRec);
     esdtrack->PropagateToDCA(vtxESDSkip, esd->GetMagneticField(), beampiperadius, dzRecSkip, covdzRecSkip);
-
+    if(fReadMC) esdtrack->PropagateToDCA(vtxESDTrue, esd->GetMagneticField(), beampiperadius, dzTrue, covdzTrue);
     if(covdzRec[0]<0 || covdzRec[2]<0 || covdzRecSkip[0]<0 || covdzRecSkip[2]<0) {
       delete vtxESDSkip; vtxESDSkip = 0x0;
       continue;
@@ -841,30 +1182,8 @@ void AliAnalysisTaskSEImpParRes::UserExec(Option_t */*option*/)
     ((TH1F*)(fOutputOnlyRefitRec->FindObject(named0OnlyrefitzRec)))->Fill(10000.*dzRec[1]);
     ((TH1F*)(fOutputOnlyRefitSkip->FindObject(named0OnlyrefitrphiSkip)))->Fill(10000.*dzRecSkip[0]);
     ((TH1F*)(fOutputOnlyRefitSkip->FindObject(named0OnlyrefitzSkip)))->Fill(10000.*dzRecSkip[1]);  
-    
-    // with 6 ITS points
-    if(npointsITS==6) {
-      char *named0AllpointrphiRec = Form("d0allpointrphiRec_%d", bin);
-      char *named0AllpointrphiSkip = Form("d0allpointrphiSkip_%d", bin);
-      char *named0AllpointzRec = Form("d0allpointzRec_%d", bin);
-      char *named0AllpointzSkip = Form("d0allpointzSkip_%d", bin); 
-      ((TH1F*)(fOutputallPointRec->FindObject(named0AllpointrphiRec)))->Fill(10000.*dzRec[0]);
-      ((TH1F*)(fOutputallPointRec->FindObject(named0AllpointzRec)))->Fill(10000.*dzRec[1]);
-      ((TH1F*)(fOutputallPointSkip->FindObject(named0AllpointrphiSkip)))->Fill(10000.*dzRecSkip[0]);
-      ((TH1F*)(fOutputallPointSkip->FindObject(named0AllpointzSkip)))->Fill(10000.*dzRecSkip[1]);
-      // pulls
-      char *named0PullAllpointrphiRec = Form("d0pullAllpointrphiRec_%d", bin);
-      char *named0PullAllpointrphiSkip = Form("d0pullAllpointrphiSkip_%d", bin);
-      char *named0PullAllpointzRec = Form("d0pullAllpointzRec_%d", bin);
-      char *named0PullAllpointzSkip = Form("d0pullAllpointzSkip_%d", bin); 
-      ((TH1F*)(fOutputpullAllpointRec->FindObject(named0PullAllpointrphiRec)))->Fill(dzRec[0]/TMath::Sqrt(covdzRec[0]));
-      
-      ((TH1F*)(fOutputpullAllpointRec->FindObject(named0PullAllpointzRec)))->Fill(dzRec[1]/TMath::Sqrt(covdzRec[2]));
-      ((TH1F*)(fOutputpullAllpointSkip->FindObject(named0PullAllpointrphiSkip)))->Fill(dzRecSkip[0]/TMath::Sqrt(covdzRecSkip[0]));
-      ((TH1F*)(fOutputpullAllpointSkip->FindObject(named0PullAllpointzSkip)))->Fill(dzRecSkip[1]/TMath::Sqrt(covdzRecSkip[2]));
-    }
    
+
     if(npointsITS>=4 && npointsSPD>0) {
       char *named0PartpointrphiRec = Form("d0partpointrphiRec_%d", bin);
       char *named0PartpointrphiSkip = Form("d0partpointrphiSkip_%d", bin);
@@ -887,90 +1206,197 @@ void AliAnalysisTaskSEImpParRes::UserExec(Option_t */*option*/)
       ((TH1F*)(fOutputonepointSPDSkip->FindObject(named0OnepointSPDzSkip)))->Fill(10000.*dzRecSkip[1]);
     }
 
-    Short_t charge=esdtrack->Charge();
-    if(charge==1 && npointsITS==6) {
-      char *named0PostvtracrphiRec = Form("d0postvtracrphiRec_%d", bin);
-      char *named0PostvtracrphiSkip = Form("d0postvtracrphiSkip_%d", bin);
-      char *named0PostvtraczRec = Form("d0postvtraczRec_%d", bin); 
-      char *named0PostvtraczSkip = Form("d0postvtraczSkip_%d", bin); 
-      ((TH1F*)(fOutputpostvTracRec->FindObject(named0PostvtracrphiRec)))->Fill(10000.*dzRec[0]);
-      ((TH1F*)(fOutputpostvTracRec->FindObject(named0PostvtraczRec)))->Fill(10000.*dzRec[1]);
-      ((TH1F*)(fOutputpostvTracSkip->FindObject(named0PostvtracrphiSkip)))->Fill(10000.*dzRecSkip[0]);
-      ((TH1F*)(fOutputpostvTracSkip->FindObject(named0PostvtraczSkip)))->Fill(10000.*dzRecSkip[1]);
-    }
-
-    if(charge==-1 && npointsITS==6) {
-      char *named0NegtvtracrphiRec = Form("d0negtvtracrphiRec_%d", bin);
-      char *named0NegtvtracrphiSkip = Form("d0negtvtracrphiSkip_%d", bin);
-      char *named0NegtvtraczRec = Form("d0negtvtraczRec_%d", bin); 
-      char *named0NegtvtraczSkip = Form("d0negtvtraczSkip_%d", bin); 
-      ((TH1F*)(fOutputnegtvTracRec->FindObject(named0NegtvtracrphiRec)))->Fill(10000.*dzRec[0]);
-      ((TH1F*)(fOutputnegtvTracRec->FindObject(named0NegtvtraczRec)))->Fill(10000.*dzRec[1]);
-      ((TH1F*)(fOutputnegtvTracSkip->FindObject(named0NegtvtracrphiSkip)))->Fill(10000.*dzRecSkip[0]);
-      ((TH1F*)(fOutputnegtvTracSkip->FindObject(named0NegtvtraczSkip)))->Fill(10000.*dzRecSkip[1]);
-    }
-
-
-    //fill the d0 impact parameter with SinTheta distribution at fix Ptbin.
-    Double_t theta=esdtrack->Theta(); 
-    Double_t Sintheta=TMath::Sin(theta);
-    Int_t thetabin = SinThetaBin(Sintheta);
-    if(thetabin<0) {delete vtxESDSkip;continue;}
-
-    if(bin==1 && npointsITS==6) {
-      char *named0SinthetaonerphiRec = Form("d0sinthetaonerphiRec_%d", thetabin);
-      char *named0SinthetaonezRec = Form("d0sinthetaonezRec_%d", thetabin);
-      char *named0SinthetaonerphiSkip = Form("d0sinthetaonerphiSkip_%d", thetabin);
-      char *named0SinthetaonezSkip = Form("d0sinthetaonezSkip_%d", thetabin);
-      ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetaonerphiRec)))->Fill(10000*dzRec[0]);
-      ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetaonezRec)))->Fill(10000*dzRec[1]);
-      ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetaonerphiSkip)))->Fill(10000*dzRecSkip[0]);
-      ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetaonezSkip)))->Fill(10000*dzRecSkip[1]);
-    }
-
-
-    if(bin==5 && npointsITS==6) {
-      char *named0SinthetatworphiRec = Form("d0sinthetatworphiRec_%d", thetabin);
-      char *named0SinthetatwozRec = Form("d0sinthetatwozRec_%d", thetabin);
-      char *named0SinthetatworphiSkip = Form("d0sinthetatworphiSkip_%d", thetabin);
-      char *named0SinthetatwozSkip = Form("d0sinthetatwozSkip_%d", thetabin);
-      ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetatworphiRec)))->Fill(10000*dzRec[0]);
-      ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetatwozRec)))->Fill(10000*dzRec[1]);
-      ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetatworphiSkip)))->Fill(10000*dzRecSkip[0]);
-      ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetatwozSkip)))->Fill(10000*dzRecSkip[1]);
-    }
+    // with 6 ITS points (including different selection)
+    if(npointsITS==6) {
 
+       //pt 
+      char *named0Pt = Form("d0pt_%d",bin);
+      ((TH1F*)(fOutputPt->FindObject(named0Pt)))->Fill(pt);
 
-    if(bin==10 && npointsITS==6) {
-      char *named0SinthetathreerphiRec = Form("d0sinthetathreerphiRec_%d", thetabin);
-      char *named0SinthetathreezRec = Form("d0sinthetathreezRec_%d", thetabin);
-      char *named0SinthetathreerphiSkip = Form("d0sinthetathreerphiSkip_%d", thetabin);
-      char *named0SinthetathreezSkip = Form("d0sinthetathreezSkip_%d", thetabin);
-      ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetathreerphiRec)))->Fill(10000*dzRec[0]);
-      ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetathreezRec)))->Fill(10000*dzRec[1]);
-      ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetathreerphiSkip)))->Fill(10000*dzRecSkip[0]);
-      ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetathreezSkip)))->Fill(10000*dzRecSkip[1]);
+      // allpoint
+      char *named0AllpointrphiRec = Form("d0allpointrphiRec_%d", bin);
+      char *named0AllpointrphiSkip = Form("d0allpointrphiSkip_%d", bin);
+      char *named0AllpointrphiTrue = Form("d0allpointrphiTrue_%d", bin);
+      char *named0AllpointzRec = Form("d0allpointzRec_%d", bin);
+      char *named0AllpointzSkip = Form("d0allpointzSkip_%d", bin); 
+      char *named0AllpointzTrue = Form("d0allpointzTrue_%d", bin);
+      ((TH1F*)(fOutputallPointRec->FindObject(named0AllpointrphiRec)))->Fill(10000.*dzRec[0]);
+      ((TH1F*)(fOutputallPointRec->FindObject(named0AllpointzRec)))->Fill(10000.*dzRec[1]);
+      ((TH1F*)(fOutputallPointSkip->FindObject(named0AllpointrphiSkip)))->Fill(10000.*dzRecSkip[0]);
+      ((TH1F*)(fOutputallPointSkip->FindObject(named0AllpointzSkip)))->Fill(10000.*dzRecSkip[1]);
+      ((TH1F*)(fOutputallPointTrue->FindObject(named0AllpointrphiTrue)))->Fill(10000.*dzTrue[0]);
+      ((TH1F*)(fOutputallPointTrue->FindObject(named0AllpointzTrue)))->Fill(10000.*dzTrue[1]);
+      
+      // pulls
+      char *named0PullAllpointrphiRec = Form("d0pullAllpointrphiRec_%d", bin);
+      char *named0PullAllpointrphiSkip = Form("d0pullAllpointrphiSkip_%d", bin);
+      char *named0PullAllpointrphiTrue = Form("d0pullAllpointrphiTrue_%d", bin);
+      char *named0PullAllpointzRec = Form("d0pullAllpointzRec_%d", bin);
+      char *named0PullAllpointzSkip = Form("d0pullAllpointzSkip_%d", bin); 
+      char *named0PullAllpointzTrue = Form("d0pullAllpointzTrue_%d", bin);
+      ((TH1F*)(fOutputpullAllpointRec->FindObject(named0PullAllpointrphiRec)))->Fill(dzRec[0]/TMath::Sqrt(covdzRec[0]));     
+      ((TH1F*)(fOutputpullAllpointRec->FindObject(named0PullAllpointzRec)))->Fill(dzRec[1]/TMath::Sqrt(covdzRec[2]));
+      ((TH1F*)(fOutputpullAllpointSkip->FindObject(named0PullAllpointrphiSkip)))->Fill(dzRecSkip[0]/TMath::Sqrt(covdzRecSkip[0]));
+      ((TH1F*)(fOutputpullAllpointSkip->FindObject(named0PullAllpointzSkip)))->Fill(dzRecSkip[1]/TMath::Sqrt(covdzRecSkip[2]));
+      ((TH1F*)(fOutputpullAllpointTrue->FindObject(named0PullAllpointrphiTrue)))->Fill(dzTrue[0]/TMath::Sqrt(covdzTrue[0]));
+      ((TH1F*)(fOutputpullAllpointTrue->FindObject(named0PullAllpointzTrue)))->Fill(dzTrue[1]/TMath::Sqrt(covdzTrue[2]));
+      
+      //postive and negative track
+      Short_t charge=esdtrack->Charge();
+      if(charge==1 ) {
+       char *named0PostvtracrphiRec = Form("d0postvtracrphiRec_%d", bin);
+       char *named0PostvtracrphiSkip = Form("d0postvtracrphiSkip_%d", bin);
+       char *named0PostvtracrphiTrue = Form("d0postvtracrphiTrue_%d", bin);
+       char *named0PostvtraczRec = Form("d0postvtraczRec_%d", bin); 
+       char *named0PostvtraczSkip = Form("d0postvtraczSkip_%d", bin);
+       char *named0PostvtraczTrue = Form("d0postvtraczTrue_%d", bin);
+       ((TH1F*)(fOutputpostvTracRec->FindObject(named0PostvtracrphiRec)))->Fill(10000.*dzRec[0]);
+       ((TH1F*)(fOutputpostvTracRec->FindObject(named0PostvtraczRec)))->Fill(10000.*dzRec[1]);
+       ((TH1F*)(fOutputpostvTracSkip->FindObject(named0PostvtracrphiSkip)))->Fill(10000.*dzRecSkip[0]);
+       ((TH1F*)(fOutputpostvTracSkip->FindObject(named0PostvtraczSkip)))->Fill(10000.*dzRecSkip[1]);
+       ((TH1F*)(fOutputpostvTracTrue->FindObject(named0PostvtracrphiTrue)))->Fill(10000.*dzTrue[0]);
+       ((TH1F*)(fOutputpostvTracTrue->FindObject(named0PostvtraczTrue)))->Fill(10000.*dzTrue[1]);
+      }
+      
+      if(charge==-1 ) {
+       char *named0NegtvtracrphiRec = Form("d0negtvtracrphiRec_%d", bin);
+       char *named0NegtvtracrphiSkip = Form("d0negtvtracrphiSkip_%d", bin);
+       char *named0NegtvtracrphiTrue = Form("d0negtvtracrphiTrue_%d", bin);
+       char *named0NegtvtraczRec = Form("d0negtvtraczRec_%d", bin); 
+       char *named0NegtvtraczSkip = Form("d0negtvtraczSkip_%d", bin);
+       char *named0NegtvtraczTrue = Form("d0negtvtraczTrue_%d", bin);
+       ((TH1F*)(fOutputnegtvTracRec->FindObject(named0NegtvtracrphiRec)))->Fill(10000.*dzRec[0]);
+       ((TH1F*)(fOutputnegtvTracRec->FindObject(named0NegtvtraczRec)))->Fill(10000.*dzRec[1]);
+       ((TH1F*)(fOutputnegtvTracSkip->FindObject(named0NegtvtracrphiSkip)))->Fill(10000.*dzRecSkip[0]);
+       ((TH1F*)(fOutputnegtvTracSkip->FindObject(named0NegtvtraczSkip)))->Fill(10000.*dzRecSkip[1]);
+       ((TH1F*)(fOutputnegtvTracTrue->FindObject(named0NegtvtracrphiTrue)))->Fill(10000.*dzTrue[0]);
+       ((TH1F*)(fOutputnegtvTracTrue->FindObject(named0NegtvtraczTrue)))->Fill(10000.*dzTrue[1]);      
+      }    
+      
+      // SinTheta 
+      Double_t theta=esdtrack->Theta(); 
+      Double_t Sintheta=TMath::Sin(theta);
+      Int_t thetabin = SinThetaBin(Sintheta);
+      if(thetabin<0) {delete vtxESDSkip;continue;}
+      
+      if(bin==1) {
+       char *named0SinthetaonerphiRec = Form("d0sinthetaonerphiRec_%d", thetabin);
+       char *named0SinthetaonezRec = Form("d0sinthetaonezRec_%d", thetabin);
+       char *named0SinthetaonerphiSkip = Form("d0sinthetaonerphiSkip_%d", thetabin);
+       char *named0SinthetaonezSkip = Form("d0sinthetaonezSkip_%d", thetabin);
+       ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetaonerphiRec)))->Fill(10000*dzRec[0]);
+       ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetaonezRec)))->Fill(10000*dzRec[1]);
+       ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetaonerphiSkip)))->Fill(10000*dzRecSkip[0]);
+       ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetaonezSkip)))->Fill(10000*dzRecSkip[1]);
+      }
+      
+      if(bin==5) {
+       char *named0SinthetatworphiRec = Form("d0sinthetatworphiRec_%d", thetabin);
+       char *named0SinthetatwozRec = Form("d0sinthetatwozRec_%d", thetabin);
+       char *named0SinthetatworphiSkip = Form("d0sinthetatworphiSkip_%d", thetabin);
+       char *named0SinthetatwozSkip = Form("d0sinthetatwozSkip_%d", thetabin);
+       ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetatworphiRec)))->Fill(10000*dzRec[0]);
+       ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetatwozRec)))->Fill(10000*dzRec[1]);
+       ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetatworphiSkip)))->Fill(10000*dzRecSkip[0]);
+       ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetatwozSkip)))->Fill(10000*dzRecSkip[1]);
+      }
+      
+      if(bin==10) {
+       char *named0SinthetathreerphiRec = Form("d0sinthetathreerphiRec_%d", thetabin);
+       char *named0SinthetathreezRec = Form("d0sinthetathreezRec_%d", thetabin);
+       char *named0SinthetathreerphiSkip = Form("d0sinthetathreerphiSkip_%d", thetabin);
+       char *named0SinthetathreezSkip = Form("d0sinthetathreezSkip_%d", thetabin);
+       ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetathreerphiRec)))->Fill(10000*dzRec[0]);
+       ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetathreezRec)))->Fill(10000*dzRec[1]);
+       ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetathreerphiSkip)))->Fill(10000*dzRecSkip[0]);
+       ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetathreezSkip)))->Fill(10000*dzRecSkip[1]);
+      }
+      
+      if(bin==15) {
+       char *named0SinthetafourrphiRec = Form("d0sinthetafourrphiRec_%d", thetabin);
+       char *named0SinthetafourzRec = Form("d0sinthetafourzRec_%d", thetabin);
+       char *named0SinthetafourrphiSkip = Form("d0sinthetafourrphiSkip_%d", thetabin);
+       char *named0SinthetafourzSkip = Form("d0sinthetafourzSkip_%d", thetabin);
+       ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetafourrphiRec)))->Fill(10000*dzRec[0]);
+       ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetafourzRec)))->Fill(10000*dzRec[1]);
+       ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetafourrphiSkip)))->Fill(10000*dzRecSkip[0]);
+       ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetafourzSkip)))->Fill(10000*dzRecSkip[1]);
+      }
+      
+      //Phi
+      Double_t phi=esdtrack->Phi(); 
+      //Double_t pi=TMath::Pi();
+      Int_t phibin=PhiBin(phi);
+      if(phibin<0) {delete vtxESDSkip;continue;}
+      if(pt>0.4 && pt<0.6){
+       char *named0PhiallpointrphiSkip =Form("d0phiallpointrphiSkip_%d",phibin);
+       char *named0PhiallpointzSkip = Form("d0phiallpointzSkip_%d",phibin);
+       char *named0PhipostvtracrphiSkip =Form("d0phipostvtracrphiSkip_%d",phibin);
+       char *named0PhipostvtraczSkip = Form("d0phipostvtraczSkip_%d",phibin);
+       char *named0PhinegtvtracrphiSkip =Form("d0phinegtvtracrphiSkip_%d",phibin);
+       char *named0PhinegtvtraczSkip = Form("d0phinegtvtraczSkip_%d",phibin);
+       ((TH1F*)(fOutputphiAllpointSkip->FindObject(named0PhiallpointrphiSkip)))->Fill(10000*dzRecSkip[0]);
+       ((TH1F*)(fOutputphiAllpointSkip->FindObject(named0PhiallpointzSkip)))->Fill(10000*dzRecSkip[1]);
+       ((TH1F*)(fOutputphiPostvtracSkip->FindObject(named0PhipostvtracrphiSkip)))->Fill(10000*dzRecSkip[0]);
+       ((TH1F*)(fOutputphiPostvtracSkip->FindObject(named0PhipostvtraczSkip)))->Fill(10000*dzRecSkip[1]);
+       ((TH1F*)(fOutputphiNegtvtracSkip->FindObject(named0PhinegtvtracrphiSkip)))->Fill(10000*dzRecSkip[0]);
+       ((TH1F*)(fOutputphiNegtvtracSkip->FindObject(named0PhinegtvtraczSkip)))->Fill(10000*dzRecSkip[1]);
+      }
+      
+      //cluster type
+      Int_t ctypeSPD0 = ClusterTypeOnITSLayer(esdtrack,0);
+      if(ctypeSPD0==-1) {delete vtxESDSkip;continue;}
+      Int_t ctypeSPD1 = ClusterTypeOnITSLayer(esdtrack,1);
+      if(ctypeSPD1==-1) {delete vtxESDSkip;continue;}
+
+      if(ctypeSPD0==1) {
+       char *named0ClustertypeSPD01rphiSkip = Form("d0clustertypeSPD01rphiSkip_%d",phibin);
+       char *named0ClustertypeSPD01zSkip = Form("d0clustertypeSPD01rphiSkip_%d",phibin);
+       ((TH1F*)(fOutputclusterTypeSPD01Skip->FindObject(named0ClustertypeSPD01rphiSkip)))->Fill(10000*dzRecSkip[0]);
+       ((TH1F*)(fOutputclusterTypeSPD01Skip->FindObject(named0ClustertypeSPD01zSkip)))->Fill(10000*dzRecSkip[1]);
+      }
+      
+      if(ctypeSPD0==2) {
+       char *named0ClustertypeSPD02rphiSkip = Form("d0clustertypeSPD02rphiSkip_%d",phibin);
+       char *named0ClustertypeSPD02zSkip = Form("d0clustertypeSPD02rphiSkip_%d",phibin);
+       ((TH1F*)(fOutputclusterTypeSPD02Skip->FindObject(named0ClustertypeSPD02rphiSkip)))->Fill(10000*dzRecSkip[0]);
+       ((TH1F*)(fOutputclusterTypeSPD02Skip->FindObject(named0ClustertypeSPD02zSkip)))->Fill(10000*dzRecSkip[1]);
+      }
+      
+      if(ctypeSPD0==3) {
+       char *named0ClustertypeSPD03rphiSkip = Form("d0clustertypeSPD03rphiSkip_%d",phibin);
+       char *named0ClustertypeSPD03zSkip = Form("d0clustertypeSPD03zSkip_%d",phibin);
+       ((TH1F*)(fOutputclusterTypeSPD03Skip->FindObject(named0ClustertypeSPD03rphiSkip)))->Fill(10000*dzRecSkip[0]);
+       ((TH1F*)(fOutputclusterTypeSPD03Skip->FindObject(named0ClustertypeSPD03zSkip)))->Fill(10000*dzRecSkip[1]);
+      }
+      
+      if(ctypeSPD1==1){
+       char *named0ClustertypeSPD11rphiSkip = Form("d0clustertypeSPD11rphiSkip_%d",phibin);
+       char *named0ClustertypeSPD11zSkip = Form("d0clustertypeSPD11rphiSkip_%d",phibin);
+       ((TH1F*)(fOutputclusterTypeSPD11Skip->FindObject(named0ClustertypeSPD11rphiSkip)))->Fill(10000*dzRecSkip[0]);
+       ((TH1F*)(fOutputclusterTypeSPD11Skip->FindObject(named0ClustertypeSPD11zSkip)))->Fill(10000*dzRecSkip[1]);
+      } 
+      if(ctypeSPD1==2){
+       char *named0ClustertypeSPD12rphiSkip = Form("d0clustertypeSPD12rphiSkip_%d",phibin);
+       char *named0ClustertypeSPD12zSkip = Form("d0clustertypeSPD12rphiSkip_%d",phibin);
+       ((TH1F*)(fOutputclusterTypeSPD12Skip->FindObject(named0ClustertypeSPD12rphiSkip)))->Fill(10000*dzRecSkip[0]);
+       ((TH1F*)(fOutputclusterTypeSPD12Skip->FindObject(named0ClustertypeSPD12zSkip)))->Fill(10000*dzRecSkip[1]);
+      } 
+      
+      if(ctypeSPD1==3){
+       char *named0ClustertypeSPD13rphiSkip = Form("d0clustertypeSPD13rphiSkip_%d",phibin);
+       char *named0ClustertypeSPD13zSkip = Form("d0clustertypeSPD13rphiSkip_%d",phibin);
+       ((TH1F*)(fOutputclusterTypeSPD13Skip->FindObject(named0ClustertypeSPD13rphiSkip)))->Fill(10000*dzRecSkip[0]);
+       ((TH1F*)(fOutputclusterTypeSPD13Skip->FindObject(named0ClustertypeSPD13zSkip)))->Fill(10000*dzRecSkip[1]);
+      }  
     }
     
-    if(bin==15 && npointsITS==6) {
-      char *named0SinthetafourrphiRec = Form("d0sinthetafourrphiRec_%d", thetabin);
-      char *named0SinthetafourzRec = Form("d0sinthetafourzRec_%d", thetabin);
-      char *named0SinthetafourrphiSkip = Form("d0sinthetafourrphiSkip_%d", thetabin);
-      char *named0SinthetafourzSkip = Form("d0sinthetafourzSkip_%d", thetabin);
-      ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetafourrphiRec)))->Fill(10000*dzRec[0]);
-      ((TH1F*)(fOutputSinThetaRec->FindObject(named0SinthetafourzRec)))->Fill(10000*dzRec[1]);
-      ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetafourrphiSkip)))->Fill(10000*dzRecSkip[0]);
-      ((TH1F*)(fOutputSinThetaSkip->FindObject(named0SinthetafourzSkip)))->Fill(10000*dzRecSkip[1]);
-    }
-
-    char *named0Pt = Form("d0pt_%d",bin);
-    if(npointsITS==6) ((TH1F*)(fOutputPt->FindObject(named0Pt)))->Fill(pt);
-
     delete vtxESDSkip; vtxESDSkip = 0x0;
   }  // end loop of tracks
   
   delete diamond; diamond=NULL;
   delete vtxESDRec; vtxESDRec = 0x0;
+  delete vtxESDTrue;vtxESDTrue = 0x0;
   fNentries->Fill(1);
   PostData(1, fOutputitspureSARec);
   PostData(2, fOutputitspureSASkip);
@@ -988,11 +1414,24 @@ void AliAnalysisTaskSEImpParRes::UserExec(Option_t */*option*/)
   PostData(14, fOutputpullAllpointSkip);
   PostData(15, fOutputOnlyRefitRec);
   PostData(16, fOutputOnlyRefitSkip);
-  PostData(17,fOutputSinThetaRec);
-  PostData(18,fOutputSinThetaSkip);
-  PostData(19, fOutputPt);
-  PostData(20, fNentries);
-  PostData(21,fEstimVtx);
+  PostData(17, fOutputSinThetaRec);
+  PostData(18, fOutputSinThetaSkip);
+  PostData(19, fOutputallPointTrue);
+  PostData(20, fOutputpostvTracTrue);
+  PostData(21, fOutputnegtvTracTrue);
+  PostData(22, fOutputpullAllpointTrue);
+  PostData(23, fOutputphiAllpointSkip);
+  PostData(24, fOutputphiPostvtracSkip);
+  PostData(25, fOutputphiNegtvtracSkip);
+  PostData(26, fOutputclusterTypeSPD01Skip);
+  PostData(27, fOutputclusterTypeSPD02Skip);
+  PostData(28, fOutputclusterTypeSPD03Skip);
+  PostData(29, fOutputclusterTypeSPD11Skip);
+  PostData(30, fOutputclusterTypeSPD12Skip);
+  PostData(31, fOutputclusterTypeSPD13Skip);
+  PostData(32, fOutputPt);
+  PostData(33, fNentries);
+  PostData(34, fEstimVtx);
   
   return;
 }
@@ -1003,15 +1442,15 @@ Int_t AliAnalysisTaskSEImpParRes::PtBin(Double_t pt) const {
   // return the number of the pt bin
   //
 
-  if (pt>0.22 && pt<0.23) return 1 ;
-  if (pt>0.26 && pt<0.27) return 2 ; 
-  if (pt>0.35 && pt<0.36) return 3 ;
-  if (pt>0.45 && pt<0.46) return 4 ; 
-  if (pt>0.55 && pt<0.56) return 5 ;
-  if (pt>0.65 && pt<0.66) return 6 ; 
-  if (pt>0.75 && pt<0.76) return 7 ; 
-  if (pt>0.85 && pt<0.865) return 8 ; 
-  if (pt>1.05 && pt<1.07) return 9 ;
+  if (pt>0.22 && pt<0.23) return 1;
+  if (pt>0.26 && pt<0.27) return 2; 
+  if (pt>0.35 && pt<0.36) return 3;
+  if (pt>0.45 && pt<0.46) return 4; 
+  if (pt>0.55 && pt<0.56) return 5;
+  if (pt>0.65 && pt<0.66) return 6; 
+  if (pt>0.75 && pt<0.76) return 7; 
+  if (pt>0.85 && pt<0.865) return 8; 
+  if (pt>1.05 && pt<1.07) return 9;
   if (pt>1.25 && pt<1.30) return 10; 
   if (pt>1.4 && pt<1.55) return 11; 
   if (pt>1.6 && pt<1.8) return 12; 
@@ -1113,7 +1552,24 @@ Int_t AliAnalysisTaskSEImpParRes::SinThetaBin(Double_t sintheta) const {
   return -1;
 }
 
-//_________________________________________________________________________
+//___________________________________________________________________________
+Int_t AliAnalysisTaskSEImpParRes::PhiBin(Double_t phi) const { 
+  Double_t pi=TMath::Pi();
+  if(phi>2.*pi || phi<0.) return -1;
+  if(phi<0.2*pi) return 1;
+  if(phi<0.4*pi) return 2;
+  if(phi<0.6*pi) return 3;
+  if(phi<0.8*pi) return 4;
+  if(phi<1.0*pi) return 5;
+  if(phi<1.2*pi) return 6;
+  if(phi<1.4*pi) return 7;
+  if(phi<1.6*pi) return 8;
+  if(phi<1.8*pi) return 9;
+  if(phi<2.*pi) return 10;
+  return -1;
+}
+
+//___________________________________________________________________________
 void AliAnalysisTaskSEImpParRes::Terminate(Option_t */*option*/) {
   //
   // Terminate analysis
@@ -1175,15 +1631,84 @@ void AliAnalysisTaskSEImpParRes::Terminate(Option_t */*option*/) {
 
   fOutputSinThetaSkip = dynamic_cast<TList*>(GetOutputData(18));
   if (!fOutputSinThetaSkip) printf("ERROR:fOutputSinThetaSkip not available\n");
-
-  fOutputPt = dynamic_cast<TList*>(GetOutputData(19));
+  
+  fOutputallPointTrue = dynamic_cast<TList*>(GetOutputData(19));
+  if (!fOutputallPointTrue) printf("ERROR:fOutputallPointTrue not available\n");
+  
+  fOutputpostvTracTrue = dynamic_cast<TList*>(GetOutputData(20));
+  if (!fOutputpostvTracTrue) printf("ERROR:fOutputpostvTracTrue not available\n");
+  
+  fOutputnegtvTracTrue = dynamic_cast<TList*>(GetOutputData(21));
+  if (!fOutputnegtvTracTrue) printf("ERROR:fOutputnegtvTracTrue not available\n");
+  
+  fOutputpullAllpointTrue = dynamic_cast<TList*>(GetOutputData(22));
+  if (!fOutputpullAllpointTrue) printf("ERROR:fOutputpullAllpointTrue not available\n");
+  
+  fOutputphiAllpointSkip = dynamic_cast<TList*>(GetOutputData(23));
+  if (!fOutputphiAllpointSkip) printf("ERROR:fOutputphiAllpointSkip not available\n");
+  
+  fOutputphiPostvtracSkip = dynamic_cast<TList*>(GetOutputData(24));
+  if (!fOutputphiPostvtracSkip) printf("ERROR:fOutputphiPostvtracSkip not available\n");
+  
+  fOutputphiNegtvtracSkip = dynamic_cast<TList*>(GetOutputData(25));
+  if (!fOutputphiNegtvtracSkip) printf("ERROR:fOutputphiNegtvtracSkip not available\n");
+  
+  fOutputclusterTypeSPD01Skip = dynamic_cast<TList*>(GetOutputData(26));
+  if (!fOutputclusterTypeSPD01Skip) printf("ERROR:fOutputclusterTypeSPD01Skip not available\n");
+  
+  fOutputclusterTypeSPD02Skip = dynamic_cast<TList*>(GetOutputData(27));
+  if (!fOutputclusterTypeSPD02Skip) printf("ERROR:fOutputclusterTypeSPD02Skip not available\n");
+  
+  fOutputclusterTypeSPD03Skip = dynamic_cast<TList*>(GetOutputData(28));
+  if (!fOutputclusterTypeSPD03Skip) printf("ERROR:fOutputclusterTypeSPD03Skip not available\n");
+  
+  fOutputclusterTypeSPD11Skip = dynamic_cast<TList*>(GetOutputData(29));
+  if (!fOutputclusterTypeSPD11Skip) printf("ERROR:fOutputclusterTypeSPD11Skip not available\n");
+  
+  fOutputclusterTypeSPD12Skip = dynamic_cast<TList*>(GetOutputData(30));
+  if (!fOutputclusterTypeSPD12Skip) printf("ERROR:fOutputclusterTypeSPD12Skip not available\n");
+  
+  fOutputclusterTypeSPD13Skip = dynamic_cast<TList*>(GetOutputData(31));
+  if (!fOutputclusterTypeSPD13Skip) printf("ERROR:fOutputclusterTypeSPD13Skip not available\n");
+  
+  fOutputPt = dynamic_cast<TList*>(GetOutputData(32));
   if (!fOutputPt) printf("ERROR: fOutputPt not available\n");
-
-  fNentries = dynamic_cast<TH1F*>(GetOutputData(20));
+  
+  fNentries = dynamic_cast<TH1F*>(GetOutputData(33));
   if (!fNentries) printf("ERROR: fNentries not available\n");
   
-  fEstimVtx = dynamic_cast<TH1F*>(GetOutputData(21));
+  fEstimVtx = dynamic_cast<TH1F*>(GetOutputData(34));
   if (!fEstimVtx) printf("ERROR: fEstimVtx not available\n");
-  
   return;
 }
+
+
+Int_t AliAnalysisTaskSEImpParRes::ClusterTypeOnITSLayer(AliESDtrack *track,Int_t layer) const {
+//
+// Returns cluster type on ITS layer. Returns -1 if no cluster on this layer
+//
+   Int_t ctype=-1;
+
+  if(layer<0 || layer>5) return ctype;
+  if(!track->HasPointOnITSLayer(layer)) return ctype;
+
+  const AliTrackPointArray *array = track->GetTrackPointArray();
+    if(!array) {
+      printf("No tracks points avaialble: check ESDfriends\n");
+      return ctype;
+   }
+  AliTrackPoint point;
+  Int_t ipt,volId,modId,layerId;
+   for(ipt=0; ipt<array->GetNPoints(); ipt++) {
+      array->GetPoint(point,ipt);
+      volId = point.GetVolumeID();
+      if(volId<=0) continue;
+      layerId = AliGeomManager::VolUIDToLayer(volId,modId);
+      if(layerId==layer+1 && !point.IsExtra()) {
+           ctype = point.GetClusterType();
+           break;
+      }
+  }
+   return ctype;
+} 
+
index f11cfbc..6f689f2 100644 (file)
@@ -32,7 +32,7 @@ class AliAnalysisTaskSEImpParRes : public AliAnalysisTaskSE {
   virtual void Terminate(Option_t *option);
   void SetReadMC(Bool_t readMC) { fReadMC=readMC; return; }
   void SetSelectedPdg(Int_t pdg) { fSelectedPdg=pdg; return; }
-  void SetUseDiamond(Bool_t use=kTRUE) { fUseDiamond=use; return; }
+  void SetUseDiamond(Bool_t use=kFALSE) { fUseDiamond=use; return; }
 
  private:
   
@@ -42,6 +42,8 @@ class AliAnalysisTaskSEImpParRes : public AliAnalysisTaskSE {
   Int_t PtBin(Double_t pt) const;
   Int_t SinThetaBin(Double_t sintheta) const;
   Double_t Getd0HistRange(Int_t i) const;
+  Int_t PhiBin(Double_t phi) const;
+  Int_t ClusterTypeOnITSLayer(AliESDtrack *t,Int_t layer) const;
   Bool_t fReadMC;       // flag used to switch on/off MC reading
   Int_t  fSelectedPdg;  // only for a given particle species (-1 takes all tracks)
   Bool_t fUseDiamond;   // use diamond constraint in primary vertex
@@ -63,6 +65,19 @@ class AliAnalysisTaskSEImpParRes : public AliAnalysisTaskSE {
   TList *fOutputOnlyRefitSkip; //! ITS+TPC: any ITScls, w/o track in vtx
   TList *fOutputSinThetaRec;              //! ITS+TPC: TH2F(pt,sintheta), with track in vtx
   TList *fOutputSinThetaSkip;             //! ITS+TPC: TH2F(pt,sintheta), w/o track in vtx
+  TList *fOutputallPointTrue;    //!
+  TList *fOutputpostvTracTrue;   //!
+  TList *fOutputnegtvTracTrue;   //!
+  TList *fOutputpullAllpointTrue;  //!
+  TList *fOutputphiAllpointSkip;  //!
+  TList *fOutputphiPostvtracSkip;  //!
+  TList *fOutputphiNegtvtracSkip;  //!
+  TList *fOutputclusterTypeSPD01Skip;  //!
+  TList *fOutputclusterTypeSPD02Skip;  //!
+  TList *fOutputclusterTypeSPD03Skip;  //!
+  TList *fOutputclusterTypeSPD11Skip;  //!
+  TList *fOutputclusterTypeSPD12Skip;  //!
+  TList *fOutputclusterTypeSPD13Skip;  //!
   TList *fOutputPt;     //!           
   TH1F  *fNentries;   //! histogram of number of events
   TH1F  *fEstimVtx;   //! vertex resolution
index 027800e..8c77d50 100644 (file)
@@ -14,7 +14,6 @@ AliAnalysisTaskSEImpParRes *AddTaskImpParRes(Bool_t readMC=kFALSE,Int_t selPdg=-
     ::Error("AddTaskImpParRes", "No analysis manager to connect to.");
     return NULL;
   }   
-
   
   // Aanalysis task    
   AliAnalysisTaskSEImpParRes *d0ResTask = new AliAnalysisTaskSEImpParRes("d0ResAnalysis");
@@ -23,6 +22,11 @@ AliAnalysisTaskSEImpParRes *AddTaskImpParRes(Bool_t readMC=kFALSE,Int_t selPdg=-
   d0ResTask->SetSelectedPdg(selPdg);
   d0ResTask->SetUseDiamond(diamond);
   mgr->AddTask(d0ResTask);
+
+  TString fname="ImpParRes.Performance";
+  if(selPdg>0) {fname+=selPdg;}
+  fname.Append(".root");
+
  
   //
   // Create containers for input/output
@@ -31,96 +35,147 @@ AliAnalysisTaskSEImpParRes *AddTaskImpParRes(Bool_t readMC=kFALSE,Int_t selPdg=-
 
   AliAnalysisDataContainer *coutputd0ITSpureSARec = mgr->CreateContainer("coutputd0ITSpureSARec",TList::Class(), 
                                                                   AliAnalysisManager::kOutputContainer,
-                                                                  "ImpParRes.Performance.root");
+                                                                  fname.Data());
 
   AliAnalysisDataContainer *coutputd0ITSpureSASkip = mgr->CreateContainer("coutputd0ITSpureSASkip",TList::Class(), 
                                                                   AliAnalysisManager::kOutputContainer,
-                                                                  "ImpParRes.Performance.root");
+                                                                  fname.Data());
 
   AliAnalysisDataContainer *coutputd0allPointRec = mgr->CreateContainer("coutputd0allPointRec",TList::Class(), 
                                                                   AliAnalysisManager::kOutputContainer,
-                                                                  "ImpParRes.Performance.root");
+                                                                  fname.Data());
   
   AliAnalysisDataContainer *coutputd0allPointSkip = mgr->CreateContainer("coutputd0allPointSkip",TList::Class(), 
                                                                   AliAnalysisManager::kOutputContainer,
-                                                                  "ImpParRes.Performance.root");
+                                                                  fname.Data());
  
   AliAnalysisDataContainer *coutputd0partPointRec = mgr->CreateContainer("coutputd0partPointRec",TList::Class(),
                                                                        AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
+                                                                       fname.Data());
 
   AliAnalysisDataContainer *coutputd0partPointSkip = mgr->CreateContainer("coutputd0partPointSkip",TList::Class(),
                                                                        AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
+                                                                       fname.Data());
 
   AliAnalysisDataContainer *coutputd0onepointSPDRec = mgr->CreateContainer("coutputd0onepointSPDRec",TList::Class(),
                                                                        AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
+                                                                       fname.Data());
 
   AliAnalysisDataContainer *coutputd0onepointSPDSkip = mgr->CreateContainer("coutputd0onepointSPDSkip",TList::Class(),
                                                                        AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
+                                                                       fname.Data());
 
   AliAnalysisDataContainer *coutputd0postvTracRec = mgr->CreateContainer("coutputd0postvTracRec",TList::Class(),
                                                                        AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
+                                                                       fname.Data());
  
  
   AliAnalysisDataContainer *coutputd0postvTracSkip = mgr->CreateContainer("coutputd0postvTracSkip",TList::Class(),
                                                                        AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
+                                                                       fname.Data());
  
   AliAnalysisDataContainer *coutputd0negtvTracRec = mgr->CreateContainer("coutputd0negtvTracRec",TList::Class(),
                                                                        AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
+                                                                       fname.Data());
  
   AliAnalysisDataContainer *coutputd0negtvTracSkip = mgr->CreateContainer("coutputd0negtvTracSkip",TList::Class(),
                                                                        AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
-
-
+                                                                       fname.Data());
 
   AliAnalysisDataContainer *coutputd0pullAllpointRec = mgr->CreateContainer("coutputd0pullAllpointRec",TList::Class(),
                                                                        AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
+                                                                       fname.Data());
 
 
   AliAnalysisDataContainer *coutputd0pullAllpointSkip = mgr->CreateContainer("coutputd0pullAllpointSkip",TList::Class(),
                                                                        AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
+                                                                       fname.Data());
 
   AliAnalysisDataContainer *coutputd0onlyRefitRec = mgr->CreateContainer("coutputd0onlyRefitRec",TList::Class(),
                                                                        AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
+                                                                       fname.Data());
 
   AliAnalysisDataContainer *coutputd0onlyRefitSkip = mgr->CreateContainer("coutputd0onlyRefitSkip",TList::Class(),
                                                                        AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
+                                                                       fname.Data());
+
 
   AliAnalysisDataContainer *coutputd0sinThetaRec = mgr->CreateContainer("coutputd0sinThetaRec",TList::Class(),
-                                                                       AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
-  
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
+
+
   AliAnalysisDataContainer *coutputd0sinThetaSkip = mgr->CreateContainer("coutputd0sinThetaSkip",TList::Class(),
-                                                                        AliAnalysisManager::kOutputContainer,
-                                                                        "ImpParRes.Performance.root");
-  
-  AliAnalysisDataContainer *coutputd0Pt = mgr->CreateContainer("coutputd0Pt",TList::Class(),
                                                                        AliAnalysisManager::kOutputContainer,
-                                                                       "ImpParRes.Performance.root");
+                                                                       fname.Data());
 
-  
+
+ AliAnalysisDataContainer *coutputd0allPointTrue = mgr->CreateContainer("coutputd0allPointTrue",TList::Class(),
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
+
+ AliAnalysisDataContainer *coutputd0postvTracTrue = mgr->CreateContainer("coutputd0postvTracTrue",TList::Class(),
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
+
+ AliAnalysisDataContainer *coutputd0negtvTracTrue = mgr->CreateContainer("coutputd0negtvTracTrue",TList::Class(),
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
+
+ AliAnalysisDataContainer *coutputd0pullAllpointTrue = mgr->CreateContainer("coutputd0pullAllpointTrue",TList::Class(),
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
+
+
+ AliAnalysisDataContainer *coutputd0phiAllpointSkip = mgr->CreateContainer("coutputd0phiAllpointSkip",TList::Class(),
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
+
+ AliAnalysisDataContainer *coutputd0phiPostvtracSkip = mgr->CreateContainer("coutputd0phiPostvtracSkip",TList::Class(),
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
+ AliAnalysisDataContainer *coutputd0phiNegtvtracSkip = mgr->CreateContainer("coutputd0phiNegtvtracSkip",TList::Class(),
+                                                                           AliAnalysisManager::kOutputContainer,
+                                                                         fname.Data());
+
+ AliAnalysisDataContainer *coutputd0clusterTypeSPD01Skip = mgr->CreateContainer("coutputd0clusterTypeSPD01Skip",TList::Class(),
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
+
+ AliAnalysisDataContainer *coutputd0clusterTypeSPD02Skip = mgr->CreateContainer("coutputd0clusterTypeSPD02Skip",TList::Class(),
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
+
+ AliAnalysisDataContainer *coutputd0clusterTypeSPD03Skip = mgr->CreateContainer("coutputd0clusterTypeSPD03Skip",TList::Class(),
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
+
+ AliAnalysisDataContainer *coutputd0clusterTypeSPD11Skip = mgr->CreateContainer("coutputd0clusterTypeSPD11Skip",TList::Class(),
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
+
+ AliAnalysisDataContainer *coutputd0clusterTypeSPD12Skip = mgr->CreateContainer("coutputd0clusterTypeSPD12Skip",TList::Class(),
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
+
+ AliAnalysisDataContainer *coutputd0clusterTypeSPD13Skip = mgr->CreateContainer("coutputd0clusterTypeSPD13Skip",TList::Class(),
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
+  AliAnalysisDataContainer *coutputd0Pt = mgr->CreateContainer("coutputd0Pt",TList::Class(),
+                                                                       AliAnalysisManager::kOutputContainer,
+                                                                       fname.Data());
   AliAnalysisDataContainer *coutputNentries = mgr->CreateContainer("coutputNentries",TH1F::Class(),
                                                                     AliAnalysisManager::kOutputContainer, 
-                                                                  "ImpParRes.Performance.root");
+                                                                  fname.Data());
 
   AliAnalysisDataContainer *coutputEstimVtx = mgr->CreateContainer("coutputEstimVtx",TH1F::Class(),
                                                                     AliAnalysisManager::kOutputContainer, 
-                                                                  "ImpParRes.Performance.root");
-
+                                                                  fname.Data());
+  
   mgr->ConnectInput(d0ResTask,0,mgr->GetCommonInputContainer()); 
   //mgr->ConnectOutput(d0ResTask,0,mgr->GetCommonOutputContainer());
   mgr->ConnectOutput(d0ResTask,1,coutputd0ITSpureSARec);
@@ -141,9 +196,21 @@ AliAnalysisTaskSEImpParRes *AddTaskImpParRes(Bool_t readMC=kFALSE,Int_t selPdg=-
   mgr->ConnectOutput(d0ResTask,16,coutputd0onlyRefitSkip);
   mgr->ConnectOutput(d0ResTask,17,coutputd0sinThetaRec);
   mgr->ConnectOutput(d0ResTask,18,coutputd0sinThetaSkip);
-  mgr->ConnectOutput(d0ResTask,19,coutputd0Pt);
-  mgr->ConnectOutput(d0ResTask,20,coutputNentries);
-  mgr->ConnectOutput(d0ResTask,21,coutputEstimVtx);
-
+  mgr->ConnectOutput(d0ResTask,19,coutputd0allPointTrue);
+  mgr->ConnectOutput(d0ResTask,20,coutputd0postvTracTrue);
+  mgr->ConnectOutput(d0ResTask,21,coutputd0negtvTracTrue);
+  mgr->ConnectOutput(d0ResTask,22,coutputd0pullAllpointTrue);
+  mgr->ConnectOutput(d0ResTask,23,coutputd0phiAllpointSkip);
+  mgr->ConnectOutput(d0ResTask,24,coutputd0phiPostvtracSkip);
+  mgr->ConnectOutput(d0ResTask,25,coutputd0phiNegtvtracSkip);
+  mgr->ConnectOutput(d0ResTask,26,coutputd0clusterTypeSPD01Skip);
+  mgr->ConnectOutput(d0ResTask,27,coutputd0clusterTypeSPD02Skip);
+  mgr->ConnectOutput(d0ResTask,28,coutputd0clusterTypeSPD03Skip);
+  mgr->ConnectOutput(d0ResTask,29,coutputd0clusterTypeSPD11Skip);
+  mgr->ConnectOutput(d0ResTask,30,coutputd0clusterTypeSPD12Skip);
+  mgr->ConnectOutput(d0ResTask,31,coutputd0clusterTypeSPD13Skip);
+  mgr->ConnectOutput(d0ResTask,32,coutputd0Pt);
+  mgr->ConnectOutput(d0ResTask,33,coutputNentries);
+  mgr->ConnectOutput(d0ResTask,34,coutputEstimVtx);
   return d0ResTask;
 }