removed duplications in AlidNdPtHelper and AliPWG0Helper and small changes
authorjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 19 Nov 2009 22:34:25 +0000 (22:34 +0000)
committerjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 19 Nov 2009 22:34:25 +0000 (22:34 +0000)
13 files changed:
PWG0/dNdPt/AlidNdPt.cxx
PWG0/dNdPt/AlidNdPt.h
PWG0/dNdPt/AlidNdPtAnalysis.cxx
PWG0/dNdPt/AlidNdPtAnalysis.h
PWG0/dNdPt/AlidNdPtCorrection.cxx
PWG0/dNdPt/AlidNdPtCorrection.h
PWG0/dNdPt/AlidNdPtCutAnalysis.cxx
PWG0/dNdPt/AlidNdPtCutAnalysis.h
PWG0/dNdPt/AlidNdPtEventCuts.cxx
PWG0/dNdPt/AlidNdPtEventCuts.h
PWG0/dNdPt/AlidNdPtHelper.cxx
PWG0/dNdPt/AlidNdPtHelper.h
PWG0/dNdPt/macros/rundNdPt.C

index 5b05203..1068392 100644 (file)
@@ -29,7 +29,7 @@ AlidNdPt::AlidNdPt(): TNamed()
 , fEsdTrackCuts(0)\r
 , fUseMCInfo(kFALSE)\r
 , fAnalysisMode(AlidNdPtHelper::kTPC) \r
-, fTrigger(AlidNdPtHelper::kMB1) \r
+, fTrigger(AliPWG0Helper::kMB1) \r
 {\r
   // default constructor\r
 }\r
@@ -41,7 +41,7 @@ AlidNdPt::AlidNdPt(Char_t* name, Char_t* title): TNamed(name,title)
 , fEsdTrackCuts(0)\r
 , fUseMCInfo(kFALSE)\r
 , fAnalysisMode(AlidNdPtHelper::kTPC) \r
-, fTrigger(AlidNdPtHelper::kMB1) \r
+, fTrigger(AliPWG0Helper::kMB1) \r
 {\r
   // constructor\r
 }\r
index 03c7951..874a4bb 100644 (file)
@@ -15,6 +15,7 @@ class AlidNdPtAcceptanceCuts;
 
 #include "TNamed.h"
 #include "TFolder.h"
+#include "AliPWG0Helper.h"
 #include "AlidNdPtHelper.h"
 
 class AlidNdPt : public TNamed {
@@ -43,19 +44,19 @@ public:
   AlidNdPt& operator=(const AlidNdPt&); // not implemented
 
   //
-  void SetEventCuts(AlidNdPtEventCuts* const cuts) { fdNdPtEventCuts = cuts; }
-  void SetAcceptanceCuts(AlidNdPtAcceptanceCuts* const cuts) { fdNdPtAcceptanceCuts = cuts; }
-  void SetTrackCuts(AliESDtrackCuts* const cuts) { fEsdTrackCuts = cuts; }
-  void SetUseMCInfo(Bool_t info) { fUseMCInfo = info; }
-  void SetAnalysisMode(AlidNdPtHelper::AnalysisMode mode) { fAnalysisMode = mode; }
-  void SetTrigger(AlidNdPtHelper::Trigger trigger) { fTrigger = trigger; }
-
-  AlidNdPtEventCuts* GetEventCuts() const { return fdNdPtEventCuts; }
-  AlidNdPtAcceptanceCuts* GetAcceptanceCuts() const { return fdNdPtAcceptanceCuts; }
-  AliESDtrackCuts* GetTrackCuts() const { return fEsdTrackCuts; }
-  Bool_t IsUseMCInfo() { return fUseMCInfo; }
-  AlidNdPtHelper::AnalysisMode GetAnalysisMode() { return fAnalysisMode; }
-  AlidNdPtHelper::Trigger GetTrigger() { return fTrigger; }
+  void SetEventCuts(AlidNdPtEventCuts* const cuts)              { fdNdPtEventCuts = cuts; }
+  void SetAcceptanceCuts(AlidNdPtAcceptanceCuts* const cuts)    { fdNdPtAcceptanceCuts = cuts; }
+  void SetTrackCuts(AliESDtrackCuts* const cuts)                { fEsdTrackCuts = cuts; }
+  void SetUseMCInfo(const Bool_t info)                          { fUseMCInfo = info; }
+  void SetAnalysisMode(const AlidNdPtHelper::AnalysisMode mode) { fAnalysisMode = mode; }
+  void SetTrigger(const AliPWG0Helper::Trigger trigger)         { fTrigger = trigger; }
+
+  AlidNdPtEventCuts* GetEventCuts() const                       { return fdNdPtEventCuts; }
+  AlidNdPtAcceptanceCuts* GetAcceptanceCuts() const             { return fdNdPtAcceptanceCuts; }
+  AliESDtrackCuts* GetTrackCuts() const                         { return fEsdTrackCuts; }
+  Bool_t IsUseMCInfo() const                                    { return fUseMCInfo; }
+  AlidNdPtHelper::AnalysisMode GetAnalysisMode() const          { return fAnalysisMode; }
+  AliPWG0Helper::Trigger GetTrigger() const                     { return fTrigger; }
 
 private:
 
@@ -65,7 +66,7 @@ private:
 
   Bool_t fUseMCInfo;                            // use MC information
   AlidNdPtHelper::AnalysisMode fAnalysisMode;   // analysis mode TPC only, TPC + ITS
-  AlidNdPtHelper::Trigger fTrigger;             // trigger definition MB1, MB2 ...
+  AliPWG0Helper::Trigger fTrigger;              // trigger definition MB1, MB2 ...
 
   ClassDef(AlidNdPt,1);
 };
index d53815e..24957c6 100644 (file)
@@ -32,6 +32,8 @@
 #include "AlidNdPtEventCuts.h"\r
 #include "AlidNdPtAcceptanceCuts.h"\r
 \r
+#include "AliPWG0Helper.h"\r
+#include "AlidNdPtHelper.h"\r
 #include "AlidNdPtAnalysis.h"\r
 \r
 using namespace std;\r
@@ -336,96 +338,96 @@ void AlidNdPtAnalysis::Init(){
   Double_t minEventMatrix[2]={-25.,-0.5}; \r
   Double_t maxEventMatrix[2]={25.,149.5}; \r
 \r
-  fGenEventMatrix = new THnSparseF("fGenEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fGenEventMatrix = new THnSparseF("fGenEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fGenEventMatrix->SetBinEdges(0,binsZv);\r
   fGenEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fGenEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fGenEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fGenEventMatrix->Sumw2();\r
   \r
-  fGenSDEventMatrix = new THnSparseF("fGenSDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fGenSDEventMatrix = new THnSparseF("fGenSDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fGenSDEventMatrix->SetBinEdges(0,binsZv);\r
   fGenSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fGenSDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fGenSDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fGenSDEventMatrix->Sumw2();\r
   \r
-  fGenDDEventMatrix = new THnSparseF("fGenDDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fGenDDEventMatrix = new THnSparseF("fGenDDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fGenDDEventMatrix->SetBinEdges(0,binsZv);\r
   fGenDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fGenDDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fGenDDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fGenDDEventMatrix->Sumw2();\r
   \r
-  fGenNDEventMatrix = new THnSparseF("fGenNDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fGenNDEventMatrix = new THnSparseF("fGenNDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fGenNDEventMatrix->SetBinEdges(0,binsZv);\r
   fGenNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fGenNDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fGenNDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fGenNDEventMatrix->Sumw2();\r
 \r
-  fGenNSDEventMatrix = new THnSparseF("fGenNSDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fGenNSDEventMatrix = new THnSparseF("fGenNSDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fGenNSDEventMatrix->SetBinEdges(0,binsZv);\r
   fGenNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fGenNSDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fGenNSDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fGenNSDEventMatrix->Sumw2();\r
 \r
   //\r
-  fTriggerEventMatrix = new THnSparseF("fTriggerEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fTriggerEventMatrix = new THnSparseF("fTriggerEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fTriggerEventMatrix->SetBinEdges(0,binsZv);\r
   fTriggerEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fTriggerEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fTriggerEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fTriggerEventMatrix->Sumw2();\r
 \r
-  fTriggerSDEventMatrix = new THnSparseF("fTriggerSDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fTriggerSDEventMatrix = new THnSparseF("fTriggerSDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fTriggerSDEventMatrix->SetBinEdges(0,binsZv);\r
   fTriggerSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fTriggerSDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fTriggerSDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fTriggerSDEventMatrix->Sumw2();\r
   \r
-  fTriggerDDEventMatrix = new THnSparseF("fTriggerDDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fTriggerDDEventMatrix = new THnSparseF("fTriggerDDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fTriggerDDEventMatrix->SetBinEdges(0,binsZv);\r
   fTriggerDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fTriggerDDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fTriggerDDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fTriggerDDEventMatrix->Sumw2();\r
   \r
-  fTriggerNDEventMatrix = new THnSparseF("fTriggerNDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fTriggerNDEventMatrix = new THnSparseF("fTriggerNDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fTriggerNDEventMatrix->SetBinEdges(0,binsZv);\r
   fTriggerNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fTriggerNDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fTriggerNDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fTriggerNDEventMatrix->Sumw2();\r
  \r
-  fTriggerNSDEventMatrix = new THnSparseF("fTriggerNSDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fTriggerNSDEventMatrix = new THnSparseF("fTriggerNSDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fTriggerNSDEventMatrix->SetBinEdges(0,binsZv);\r
   fTriggerNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fTriggerNSDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fTriggerNSDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fTriggerNSDEventMatrix->Sumw2();\r
  \r
   //\r
-  fRecEventMatrix = new THnSparseF("fRecEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fRecEventMatrix = new THnSparseF("fRecEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fRecEventMatrix->SetBinEdges(0,binsZv);\r
   fRecEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fRecEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fRecEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fRecEventMatrix->Sumw2();\r
 \r
-  fRecSDEventMatrix = new THnSparseF("fRecSDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fRecSDEventMatrix = new THnSparseF("fRecSDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fRecSDEventMatrix->SetBinEdges(0,binsZv);\r
   fRecSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fRecSDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fRecSDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fRecSDEventMatrix->Sumw2();\r
   \r
-  fRecDDEventMatrix = new THnSparseF("fRecDDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fRecDDEventMatrix = new THnSparseF("fRecDDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fRecDDEventMatrix->SetBinEdges(0,binsZv);\r
   fRecDDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fRecDDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fRecDDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fRecDDEventMatrix->Sumw2();\r
   \r
-  fRecNDEventMatrix = new THnSparseF("fRecNDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fRecNDEventMatrix = new THnSparseF("fRecNDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fRecNDEventMatrix->SetBinEdges(0,binsZv);\r
   fRecNDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fRecNDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fRecNDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fRecNDEventMatrix->Sumw2();\r
  \r
-  fRecNSDEventMatrix = new THnSparseF("fRecNSDEventMatrix","mcZv:mult",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
+  fRecNSDEventMatrix = new THnSparseF("fRecNSDEventMatrix","mcZv:multMB",2,binsEventMatrix,minEventMatrix,maxEventMatrix);\r
   fRecNSDEventMatrix->SetBinEdges(0,binsZv);\r
   fRecNSDEventMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
-  fRecNSDEventMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fRecNSDEventMatrix->GetAxis(1)->SetTitle("multiplicity MB");\r
   fRecNSDEventMatrix->Sumw2();\r
 \r
   // \r
@@ -645,14 +647,15 @@ void AlidNdPtAnalysis::Init(){
   fRecEventHist1->Sumw2();\r
 \r
   //\r
-  Int_t binsRecEventHist2[2]={zvNbins,150};\r
-  Double_t minRecEventHist2[2]={-25.,-0.5}; \r
-  Double_t maxRecEventHist2[2]={25.,149.5}; \r
+  Int_t binsRecEventHist2[3]={zvNbins,150,150};\r
+  Double_t minRecEventHist2[3]={-25.,-0.5,-0.5}; \r
+  Double_t maxRecEventHist2[3]={25.,149.5,149.5}; \r
   \r
-  fRecEventHist2 = new THnSparseF("fRecEventHist2","Zv:multMB",2,binsRecEventHist2,minRecEventHist2,maxRecEventHist2);\r
+  fRecEventHist2 = new THnSparseF("fRecEventHist2","Zv:multMB:mult",3,binsRecEventHist2,minRecEventHist2,maxRecEventHist2);\r
   fRecEventHist2->SetBinEdges(0,binsZv);\r
   fRecEventHist2->GetAxis(0)->SetTitle("Zv (cm)");\r
-  fRecEventHist2->GetAxis(1)->SetTitle("multMB");\r
+  fRecEventHist2->GetAxis(1)->SetTitle("multiplicity MB");\r
+  fRecEventHist2->GetAxis(2)->SetTitle("multiplicity");\r
   fRecEventHist2->Sumw2();\r
 \r
   //\r
@@ -663,10 +666,10 @@ void AlidNdPtAnalysis::Init(){
   Double_t minRecMCEventHist1[3]={-10.0*kFact,-10.0*kFact,-10.0*kFact}; \r
   Double_t maxRecMCEventHist1[3]={10.0*kFact,10.0*kFact,10.0*kFact}; \r
    \r
-  fRecMCEventHist1 = new THnSparseF("fRecMCEventHist1","mcXv-Xv:mcYv-Yv:mcZv-Zv",3,binsRecMCEventHist1,minRecMCEventHist1,maxRecMCEventHist1);\r
-  fRecMCEventHist1->GetAxis(0)->SetTitle("mcXv-Xv (cm)");\r
-  fRecMCEventHist1->GetAxis(1)->SetTitle("mcYv-Yv (cm)");\r
-  fRecMCEventHist1->GetAxis(2)->SetTitle("mcZv-Zv (cm)");\r
+  fRecMCEventHist1 = new THnSparseF("fRecMCEventHist1","Xv-mcXv:Yv-mcYv:Zv-mcZv",3,binsRecMCEventHist1,minRecMCEventHist1,maxRecMCEventHist1);\r
+  fRecMCEventHist1->GetAxis(0)->SetTitle("Xv-mcXv (cm)");\r
+  fRecMCEventHist1->GetAxis(1)->SetTitle("Yv-mcYv (cm)");\r
+  fRecMCEventHist1->GetAxis(2)->SetTitle("Zv-mcZv (cm)");\r
   fRecMCEventHist1->Sumw2();\r
 \r
   //\r
@@ -674,17 +677,17 @@ void AlidNdPtAnalysis::Init(){
   Double_t minRecMCEventHist2[3]={-10.0*kFact,-10.0*kFact,0.0}; \r
   Double_t maxRecMCEventHist2[3]={10.0*kFact,10.0*kFact,149.50}; \r
 \r
-  fRecMCEventHist2 = new THnSparseF("fRecMCEventHist2","mcXv-Xv:mcZv-Zv:Mult",3,binsRecMCEventHist2,minRecMCEventHist2,maxRecMCEventHist2);\r
-  fRecMCEventHist2->GetAxis(0)->SetTitle("mcXv-Xv (cm)");\r
-  fRecMCEventHist2->GetAxis(1)->SetTitle("mcZv-Zv (cm)");\r
-  fRecMCEventHist2->GetAxis(2)->SetTitle("Mult");\r
+  fRecMCEventHist2 = new THnSparseF("fRecMCEventHist2","Xv-mcXv:Zv-mcZv:mult",3,binsRecMCEventHist2,minRecMCEventHist2,maxRecMCEventHist2);\r
+  fRecMCEventHist2->GetAxis(0)->SetTitle("Xv-mcXv (cm)");\r
+  fRecMCEventHist2->GetAxis(1)->SetTitle("Zv-mcZv (cm)");\r
+  fRecMCEventHist2->GetAxis(2)->SetTitle("multiplicity");\r
   fRecMCEventHist2->Sumw2();\r
 \r
   Int_t binsRecMCEventHist3[2]={150,5};\r
   Double_t minRecMCEventHist3[2]={-0.5,0.0}; \r
   Double_t maxRecMCEventHist3[2]={149.50,5.0}; \r
-  fRecMCEventHist3 = new THnSparseF("fRecMCEventHist3","Mult:EventType (ND, DD, SD)",2,binsRecMCEventHist3,minRecMCEventHist3,maxRecMCEventHist3);\r
-  fRecMCEventHist3->GetAxis(0)->SetTitle("Mult");\r
+  fRecMCEventHist3 = new THnSparseF("fRecMCEventHist3","mult:EventType (ND, DD, SD)",2,binsRecMCEventHist3,minRecMCEventHist3,maxRecMCEventHist3);\r
+  fRecMCEventHist3->GetAxis(0)->SetTitle("multiplicity");\r
   fRecMCEventHist3->GetAxis(1)->SetTitle("EventType");\r
   fRecMCEventHist3->Sumw2();\r
 \r
@@ -810,12 +813,8 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
     AliDebug(AliLog::kError, "esdEvent not available");\r
     return;\r
   }\r
-  // trigger definition\r
-  Bool_t isEventTriggered = AlidNdPtHelper::IsEventTriggered(esdEvent->GetTriggerMask(), GetTrigger());\r
-  //if(!isEventTriggered) printf("no MB1 trigger ... \n");\r
-  //\r
 \r
-  // cuts\r
+  // get selection cuts\r
   AlidNdPtEventCuts *evtCuts = GetEventCuts(); \r
   AlidNdPtAcceptanceCuts *accCuts = GetAcceptanceCuts(); \r
   AliESDtrackCuts *esdTrackCuts = GetTrackCuts(); \r
@@ -824,14 +823,20 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
     AliDebug(AliLog::kError, "cuts not available");\r
     return;\r
   }\r
-  //if(!evtCuts->IsTriggerRequired()) isEventTriggered = kTRUE;\r
+\r
+  // trigger selection\r
+  Bool_t isEventTriggered = kTRUE;\r
+  if(evtCuts->IsTriggerRequired())  {\r
+    isEventTriggered = AliPWG0Helper::IsEventTriggered(esdEvent->GetTriggerMask(), GetTrigger());\r
+  }\r
 \r
   // use MC information\r
   AliHeader* header = 0;\r
   AliGenEventHeader* genHeader = 0;\r
   AliStack* stack = 0;\r
   TArrayF vtxMC(3);\r
-  AlidNdPtHelper::MCProcessType evtType = AlidNdPtHelper::kInvalidProcess;\r
+  //AlidNdPtHelper::MCProcessType evtType = AlidNdPtHelper::kInvalidProcess;\r
+  AliPWG0Helper::MCProcessType evtType = AliPWG0Helper::kInvalidProcess;\r
 \r
   Int_t multMCTrueTracks = 0;\r
   if(IsUseMCInfo())\r
@@ -854,7 +859,8 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
       return;\r
     }\r
     // get event type (ND=0x1, DD=0x2, SD=0x4)\r
-    evtType = AlidNdPtHelper::GetEventProcessType(header);\r
+    //evtType = AlidNdPtHelper::GetEventProcessType(header);\r
+    evtType = AliPWG0Helper::GetEventProcessType(header);\r
     AliDebug(AliLog::kDebug+1, Form("Found process type %d", evtType));\r
 \r
     // get MC vertex\r
@@ -879,8 +885,10 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
   Bool_t isRecVertex = kFALSE;\r
   if(evtCuts->IsRecVertexRequired()) \r
   {\r
-    vtxESD = AlidNdPtHelper::GetVertex(esdEvent, evtCuts,  accCuts, esdTrackCuts, GetAnalysisMode(), kFALSE, kTRUE, kTRUE);\r
-    isRecVertex = AlidNdPtHelper::TestVertex(vtxESD, GetAnalysisMode(), kFALSE); // should be moved to AcceptEvent\r
+    Bool_t bRedoTPCVertex = evtCuts->IsRedoTPCVertex();\r
+    Bool_t bUseConstraints = evtCuts->IsUseBeamSpotConstraint();\r
+    vtxESD = AlidNdPtHelper::GetVertex(esdEvent,evtCuts,accCuts,esdTrackCuts,GetAnalysisMode(),kFALSE,bRedoTPCVertex,bUseConstraints); \r
+    isRecVertex = AlidNdPtHelper::TestRecVertex(vtxESD, GetAnalysisMode(), kFALSE);\r
   }\r
   if( IsUseMCInfo() && !evtCuts->IsRecVertexRequired() ) {\r
     vtxESD = new AliESDVertex(vtxMC[2],10.,genHeader->NProduced(),"smearMC");\r
@@ -916,7 +924,8 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
   if(isEventOK && isEventTriggered)\r
   {\r
     // get all charged tracks\r
-    allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,vtxESD,GetAnalysisMode());\r
+    //allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,vtxESD,GetAnalysisMode());\r
+    allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,GetAnalysisMode());\r
     if(!allChargedTracks) return;\r
 \r
     Int_t entries = allChargedTracks->GetEntries();\r
@@ -951,7 +960,7 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
      Double_t vRecEventHist1[3] = {vtxESD->GetXv(),vtxESD->GetYv(),vtxESD->GetZv()};\r
      fRecEventHist1->Fill(vRecEventHist1);\r
 \r
-     Double_t vRecEventHist2[2] = {vtxESD->GetZv(),multMBTracks};\r
+     Double_t vRecEventHist2[3] = {vtxESD->GetZv(),multMBTracks,multRec};\r
      fRecEventHist2->Fill(vRecEventHist2);\r
    } \r
 \r
@@ -977,28 +986,32 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
      if(isEventOK && isEventTriggered) fRecEventMatrix->Fill(vEventMatrix);\r
 \r
      // single diffractive\r
-     if(evtType == AlidNdPtHelper::kSD) {\r
+     //if(evtType == AlidNdPtHelper::kSD) {\r
+     if(evtType == AliPWG0Helper::kSD) {\r
        fGenSDEventMatrix->Fill(vEventMatrix); \r
        if(isEventTriggered) fTriggerSDEventMatrix->Fill(vEventMatrix);\r
        if(isEventOK && isEventTriggered) fRecSDEventMatrix->Fill(vEventMatrix);\r
      }\r
 \r
      // double diffractive\r
-     if(evtType == AlidNdPtHelper::kDD) {\r
+     //if(evtType == AlidNdPtHelper::kDD) {\r
+     if(evtType == AliPWG0Helper::kDD) {\r
        fGenDDEventMatrix->Fill(vEventMatrix); \r
        if(isEventTriggered) fTriggerDDEventMatrix->Fill(vEventMatrix);\r
        if(isEventOK && isEventTriggered)  fRecDDEventMatrix->Fill(vEventMatrix);\r
      }\r
 \r
      // non diffractive\r
-     if(evtType == AlidNdPtHelper::kND) {\r
+     //if(evtType == AlidNdPtHelper::kND) {\r
+     if(evtType == AliPWG0Helper::kND) {\r
        fGenNDEventMatrix->Fill(vEventMatrix); \r
        if(isEventTriggered) fTriggerNDEventMatrix->Fill(vEventMatrix);\r
        if(isEventOK && isEventTriggered) fRecNDEventMatrix->Fill(vEventMatrix);\r
      }\r
 \r
      // non single diffractive\r
-     if(evtType != AlidNdPtHelper::kSD) {\r
+     //if(evtType != AlidNdPtHelper::kSD) {\r
+     if(evtType != AliPWG0Helper::kSD) {\r
        fGenNSDEventMatrix->Fill(vEventMatrix); \r
        if(isEventTriggered) fTriggerNSDEventMatrix->Fill(vEventMatrix);\r
        if(isEventOK && isEventTriggered) fRecNSDEventMatrix->Fill(vEventMatrix);\r
@@ -1036,16 +1049,16 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
          Double_t vTrackEventMatrix[3] = {vtxMC[2], particle->Pt(), particle->Eta()}; \r
          fGenTrackEventMatrix->Fill(vTrackEventMatrix);\r
 \r
-         if(evtType == AlidNdPtHelper::kSD) {\r
+         if(evtType == AliPWG0Helper::kSD) {\r
            fGenTrackSDEventMatrix->Fill(vTrackEventMatrix);\r
         }\r
-         if(evtType == AlidNdPtHelper::kDD) {\r
+         if(evtType == AliPWG0Helper::kDD) {\r
            fGenTrackDDEventMatrix->Fill(vTrackEventMatrix);\r
         }\r
-         if(evtType == AlidNdPtHelper::kND) {\r
+         if(evtType == AliPWG0Helper::kND) {\r
            fGenTrackNDEventMatrix->Fill(vTrackEventMatrix);\r
         }\r
-         if(evtType != AlidNdPtHelper::kSD) {\r
+         if(evtType != AliPWG0Helper::kSD) {\r
            fGenTrackNSDEventMatrix->Fill(vTrackEventMatrix);\r
         }\r
 \r
@@ -1053,16 +1066,16 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
          if(!isEventTriggered) continue;  \r
 \r
          fTriggerTrackEventMatrix->Fill(vTrackEventMatrix);\r
-         if(evtType == AlidNdPtHelper::kSD) {\r
+         if(evtType == AliPWG0Helper::kSD) {\r
            fTriggerTrackSDEventMatrix->Fill(vTrackEventMatrix);\r
         }\r
-         if(evtType == AlidNdPtHelper::kDD) {\r
+         if(evtType == AliPWG0Helper::kDD) {\r
            fTriggerTrackDDEventMatrix->Fill(vTrackEventMatrix);\r
         }\r
-         if(evtType == AlidNdPtHelper::kND) {\r
+         if(evtType == AliPWG0Helper::kND) {\r
            fTriggerTrackNDEventMatrix->Fill(vTrackEventMatrix);\r
         }\r
-         if(evtType != AlidNdPtHelper::kSD) {\r
+         if(evtType != AliPWG0Helper::kSD) {\r
            fTriggerTrackNSDEventMatrix->Fill(vTrackEventMatrix);\r
         }\r
 \r
@@ -1070,16 +1083,16 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
         if(!isEventOK) continue;  \r
 \r
          fRecTrackEventMatrix->Fill(vTrackEventMatrix);\r
-         if(evtType == AlidNdPtHelper::kSD) {\r
+         if(evtType == AliPWG0Helper::kSD) {\r
            fRecTrackSDEventMatrix->Fill(vTrackEventMatrix);\r
         }\r
-         if(evtType == AlidNdPtHelper::kDD) {\r
+         if(evtType == AliPWG0Helper::kDD) {\r
            fRecTrackDDEventMatrix->Fill(vTrackEventMatrix);\r
         }\r
-         if(evtType == AlidNdPtHelper::kND) {\r
+         if(evtType == AliPWG0Helper::kND) {\r
            fRecTrackNDEventMatrix->Fill(vTrackEventMatrix);\r
         }\r
-         if(evtType != AlidNdPtHelper::kSD) {\r
+         if(evtType != AliPWG0Helper::kSD) {\r
            fRecTrackNSDEventMatrix->Fill(vTrackEventMatrix);\r
         }\r
        }\r
@@ -1093,10 +1106,10 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
 \r
        // fill MC and rec event control histograms\r
        if(fHistogramsOn) {\r
-         Double_t vRecMCEventHist1[3] = {vtxMC[0]-vtxESD->GetXv(),vtxMC[1]-vtxESD->GetYv(),vtxMC[2]-vtxESD->GetZv()};\r
+         Double_t vRecMCEventHist1[3] = {vtxESD->GetXv()-vtxMC[0],vtxESD->GetYv()-vtxMC[1],vtxESD->GetZv()-vtxMC[2]};\r
          fRecMCEventHist1->Fill(vRecMCEventHist1);\r
 \r
-         Double_t vRecMCEventHist2[3] = {vtxMC[0]-vtxESD->GetXv(),vtxMC[2]-vtxESD->GetZv(),multMBTracks};\r
+         Double_t vRecMCEventHist2[3] = {vtxESD->GetXv()-vtxMC[0],vtxESD->GetZv()-vtxMC[2],multMBTracks};\r
          fRecMCEventHist2->Fill(vRecMCEventHist2);\r
 \r
          Double_t vRecMCEventHist3[2] = {multRec,evtType};\r
@@ -1452,10 +1465,8 @@ void AlidNdPtAnalysis::Analyse()
   //\r
   TH1::AddDirectory(kFALSE);\r
   TH1 *h=0, *h1=0, *h2=0, *h2c = 0; \r
-  TH2D *hgen2D=0;\r
   THnSparse *hs=0; \r
   TH2 *h2D=0; \r
-  TH1 *h1D=0; \r
 \r
   char name[256];\r
   TObjArray *aFolderObj = new TObjArray;\r
@@ -1483,6 +1494,126 @@ void AlidNdPtAnalysis::Analyse()
   Double_t maxEta = accCuts->GetMaxEta()-0.00001;\r
 \r
   //\r
+  // Reconstructed event vertex\r
+  //\r
+  h = fRecEventHist1->Projection(0);\r
+  h->SetName("Xv");\r
+  aFolderObj->Add(h);\r
+\r
+  h = fRecEventHist1->Projection(1);\r
+  h->SetName("Yv");\r
+  aFolderObj->Add(h);\r
+\r
+  h = fRecEventHist1->Projection(2);\r
+  h->SetName("Zv");\r
+  aFolderObj->Add(h);\r
+\r
+  //\r
+  // multiplicity\r
+  //\r
+  h = fRecEventHist2->Projection(1);\r
+  h->SetName("multMB");\r
+  aFolderObj->Add(h);\r
+\r
+  h = fRecEventHist2->Projection(2);\r
+  h->SetName("multiplicity");\r
+  aFolderObj->Add(h);\r
+\r
+  h2D = fRecEventHist2->Projection(0,1); \r
+  h2D->SetName("Zv_vs_multiplicity_MB");\r
+  aFolderObj->Add(h2D);\r
+\r
+  //\r
+  // reconstructed pt histograms\r
+  //\r
+  h = fRecTrackHist1[0]->Projection(0);\r
+  h->SetName("pt_all_ch");\r
+  aFolderObj->Add(h);\r
+\r
+  h = fRecTrackHist1[1]->Projection(0);\r
+  h->SetName("pt_acc");\r
+  aFolderObj->Add(h);\r
+\r
+  h = fRecTrackHist1[2]->Projection(0);\r
+  h->SetName("pt_rec");\r
+  aFolderObj->Add(h);\r
+\r
+  //\r
+  // reconstructed eta histograms\r
+  //\r
+  h = fRecTrackHist1[0]->Projection(1);\r
+  h->SetName("eta_all_ch");\r
+  aFolderObj->Add(h);\r
+\r
+  h = fRecTrackHist1[1]->Projection(1);\r
+  h->SetName("eta_acc");\r
+  aFolderObj->Add(h);\r
+\r
+  h = fRecTrackHist1[2]->Projection(1);\r
+  h->SetName("eta_rec");\r
+  aFolderObj->Add(h);\r
+\r
+  //\r
+  // reconstructed phi histograms\r
+  //\r
+  h = fRecTrackHist1[0]->Projection(2);\r
+  h->SetName("phi_all_ch");\r
+  aFolderObj->Add(h);\r
+\r
+  h = fRecTrackHist1[1]->Projection(2);\r
+  h->SetName("phi_acc");\r
+  aFolderObj->Add(h);\r
+\r
+  h = fRecTrackHist1[2]->Projection(2);\r
+  h->SetName("phi_rec");\r
+  aFolderObj->Add(h);\r
+\r
+  //\r
+  // reconstructed eta:pt histograms\r
+  //\r
+  h2D = fRecTrackHist1[0]->Projection(1,0);\r
+  h2D->SetName("pt_eta_all_ch");\r
+  aFolderObj->Add(h2D);\r
+\r
+  h2D = fRecTrackHist1[1]->Projection(1,0);\r
+  h2D->SetName("pt_eta_acc");\r
+  aFolderObj->Add(h2D);\r
+\r
+  h2D = fRecTrackHist1[2]->Projection(1,0);\r
+  h2D->SetName("pt_eta_rec");\r
+  aFolderObj->Add(h2D);\r
+\r
+  //\r
+  // reconstructed phi:pt histograms\r
+  //\r
+  h2D = fRecTrackHist1[0]->Projection(2,0);\r
+  h2D->SetName("pt_phi_all_ch");\r
+  aFolderObj->Add(h2D);\r
+\r
+  h2D = fRecTrackHist1[1]->Projection(2,0);\r
+  h2D->SetName("pt_phi_acc");\r
+  aFolderObj->Add(h2D);\r
+\r
+  h2D = fRecTrackHist1[2]->Projection(2,0);\r
+  h2D->SetName("pt_phi_rec");\r
+  aFolderObj->Add(h2D);\r
+\r
+  //\r
+  // reconstructed phi:eta histograms\r
+  //\r
+  h2D = fRecTrackHist1[0]->Projection(2,1);\r
+  h2D->SetName("eta_phi_all_ch");\r
+  aFolderObj->Add(h2D);\r
+\r
+  h2D = fRecTrackHist1[1]->Projection(2,1);\r
+  h2D->SetName("eta_phi_acc");\r
+  aFolderObj->Add(h2D);\r
+\r
+  h2D = fRecTrackHist1[2]->Projection(2,1);\r
+  h2D->SetName("eta_phi_rec");\r
+  aFolderObj->Add(h2D);\r
+\r
+  //\r
   // calculate corrections for empty events\r
   // with multMB==0 \r
   //\r
@@ -1494,6 +1625,22 @@ void AlidNdPtAnalysis::Analyse()
   if( h->Integral() ) h->Scale(1./h->Integral());\r
   h->SetName("zv_distribution_norm");\r
   aFolderObj->Add(h);\r
\r
+  //\r
+  // MC available\r
+  //\r
+  if(IsUseMCInfo()) {\r
+\r
+  //\r
+  // Event vertex resolution\r
+  //\r
+  h2D = fRecMCEventHist2->Projection(0,2);\r
+  h2D->SetName("DeltaXv_vs_mult");\r
+  aFolderObj->Add(h2D);\r
+\r
+  h2D = fRecMCEventHist2->Projection(1,2);\r
+  h2D->SetName("DeltaZv_vs_mult");\r
+  aFolderObj->Add(h2D);\r
 \r
   //\r
   // normalised zv to get trigger/trigger+vertex event differences\r
@@ -1501,12 +1648,12 @@ void AlidNdPtAnalysis::Analyse()
   //\r
   fTriggerEventMatrix->GetAxis(1)->SetRangeUser(0.,0.);\r
   h = fTriggerEventMatrix->Projection(0);\r
-  hgen2D = fTriggerEventMatrix->Projection(0,1);\r
-  if(hgen2D->Integral()) h->Scale(1./hgen2D->Integral());\r
+  h2D = fTriggerEventMatrix->Projection(0,1);\r
+  if(h2D->Integral()) h->Scale(1./h2D->Integral());\r
 \r
   h1 = fRecEventMatrix->Projection(0);\r
-  hgen2D = fRecEventMatrix->Projection(0,1);\r
-  if(hgen2D->Integral()) h1->Scale(1./hgen2D->Integral());\r
+  h2D = fRecEventMatrix->Projection(0,1);\r
+  if(h2D->Integral()) h1->Scale(1./h2D->Integral());\r
 \r
   h->Divide(h1);\r
   h->SetName("zv_empty_events_norm");\r
@@ -1529,14 +1676,14 @@ void AlidNdPtAnalysis::Analyse()
   //\r
   // trigger efficiency for INEL\r
   //\r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(0),fGenEventMatrix->Projection(0),"zv_trig_INEL_eff_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(0),fGenEventMatrix->Projection(0),"zv_trig_INEL_eff_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   //\r
   // trigger efficiency for NSD\r
   //\r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerNSDEventMatrix->Projection(0),fGenNSDEventMatrix->Projection(0),"zv_trig_NSD_eff_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fTriggerNSDEventMatrix->Projection(0),fGenNSDEventMatrix->Projection(0),"zv_trig_NSD_eff_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   //\r
   // trigger bias correction (MB to ND)\r
@@ -1544,15 +1691,15 @@ void AlidNdPtAnalysis::Analyse()
   hs = AlidNdPtHelper::GenerateCorrMatrix(fGenNDEventMatrix,fTriggerEventMatrix,"zv_mult_trig_MBtoND_corr_matrix");\r
   aFolderObj->Add(hs);\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenNDEventMatrix->Projection(0),fTriggerEventMatrix->Projection(0),"zv_trig_MBtoND_corr_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fGenNDEventMatrix->Projection(0),fTriggerEventMatrix->Projection(0),"zv_trig_MBtoND_corr_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fGenNDEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
   fTriggerEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenNDEventMatrix->Projection(1),fTriggerEventMatrix->Projection(1),"mult_trig_MBtoND_corr_matrix");\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fGenNDEventMatrix->Projection(1),fTriggerEventMatrix->Projection(1),"mult_trig_MBtoND_corr_matrix");\r
 \r
-  aFolderObj->Add(h1D);\r
+  aFolderObj->Add(h);\r
   fGenNDEventMatrix->GetAxis(0)->SetRange(1,fGenNDEventMatrix->GetAxis(0)->GetNbins());\r
   fTriggerEventMatrix->GetAxis(0)->SetRange(1,fTriggerEventMatrix->GetAxis(0)->GetNbins());\r
 \r
@@ -1565,14 +1712,14 @@ void AlidNdPtAnalysis::Analyse()
   h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenNSDEventMatrix->Projection(0,1),fTriggerEventMatrix->Projection(0,1),"zv_mult_trig_MBtoNSD_corr_matrix_2D");\r
   aFolderObj->Add(h2D);\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenNSDEventMatrix->Projection(0),fTriggerEventMatrix->Projection(0),"zv_trig_MBtoNSD_corr_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fGenNSDEventMatrix->Projection(0),fTriggerEventMatrix->Projection(0),"zv_trig_MBtoNSD_corr_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fGenNSDEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
   fTriggerEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenNSDEventMatrix->Projection(1),fTriggerEventMatrix->Projection(1),"mult_trig_MBtoNSD_corr_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fGenNSDEventMatrix->Projection(1),fTriggerEventMatrix->Projection(1),"mult_trig_MBtoNSD_corr_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fGenNSDEventMatrix->GetAxis(0)->SetRange(1,fGenNSDEventMatrix->GetAxis(0)->GetNbins());\r
   fTriggerEventMatrix->GetAxis(0)->SetRange(1,fTriggerEventMatrix->GetAxis(0)->GetNbins());\r
@@ -1583,8 +1730,8 @@ void AlidNdPtAnalysis::Analyse()
   hs = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix,fTriggerEventMatrix,"zv_mult_trig_MBtoInel_corr_matrix");\r
   aFolderObj->Add(hs);\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix->Projection(0),fTriggerEventMatrix->Projection(0),"zv_trig_MBtoInel_corr_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix->Projection(0),fTriggerEventMatrix->Projection(0),"zv_trig_MBtoInel_corr_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   h2D = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix->Projection(0,1),fTriggerEventMatrix->Projection(0,1),"zv_mult_trig_MBtoInel_corr_matrix_2D");\r
   aFolderObj->Add(h2D);\r
@@ -1592,8 +1739,8 @@ void AlidNdPtAnalysis::Analyse()
   fGenEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
   fTriggerEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix->Projection(1),fTriggerEventMatrix->Projection(1),"mult_trig_MBtoInel_corr_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fGenEventMatrix->Projection(1),fTriggerEventMatrix->Projection(1),"mult_trig_MBtoInel_corr_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fGenEventMatrix->GetAxis(0)->SetRange(1,fGenEventMatrix->GetAxis(0)->GetNbins());\r
   fTriggerEventMatrix->GetAxis(0)->SetRange(1,fTriggerEventMatrix->GetAxis(0)->GetNbins());\r
@@ -1610,14 +1757,14 @@ void AlidNdPtAnalysis::Analyse()
   fTriggerEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
   fRecEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(1),fRecEventMatrix->Projection(1),"mult_event_corr_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(1),fRecEventMatrix->Projection(1),"mult_event_corr_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fTriggerEventMatrix->GetAxis(0)->SetRange(1,fTriggerEventMatrix->GetAxis(0)->GetNbins());\r
   fRecEventMatrix->GetAxis(0)->SetRange(1,fRecEventMatrix->GetAxis(0)->GetNbins());\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(0),fRecEventMatrix->Projection(0),"zv_event_corr_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fTriggerEventMatrix->Projection(0),fRecEventMatrix->Projection(0),"zv_event_corr_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   //\r
   // track-event trigger bias correction (MB to ND)\r
@@ -1672,8 +1819,8 @@ void AlidNdPtAnalysis::Analyse()
   fTriggerTrackEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
   fGenTrackEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fTriggerTrackEventMatrix->Projection(1),fGenTrackEventMatrix->Projection(1),"pt_track_trig_MBtoInel_eff_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fTriggerTrackEventMatrix->Projection(1),fGenTrackEventMatrix->Projection(1),"pt_track_trig_MBtoInel_eff_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fTriggerTrackEventMatrix->GetAxis(2)->SetRange(1,fTriggerTrackEventMatrix->GetAxis(2)->GetNbins());\r
   fGenTrackEventMatrix->GetAxis(2)->SetRange(1,fGenTrackEventMatrix->GetAxis(2)->GetNbins());\r
@@ -1702,8 +1849,8 @@ void AlidNdPtAnalysis::Analyse()
   fTriggerTrackEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
   fRecTrackEventMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecTrackEventMatrix->Projection(1),fTriggerTrackEventMatrix->Projection(1),"pt_track_event_eff_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fRecTrackEventMatrix->Projection(1),fTriggerTrackEventMatrix->Projection(1),"pt_track_event_eff_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fTriggerTrackEventMatrix->GetAxis(2)->SetRange(1,fTriggerTrackEventMatrix->GetAxis(2)->GetNbins());\r
   fRecTrackEventMatrix->GetAxis(2)->SetRange(1,fRecTrackEventMatrix->GetAxis(2)->GetNbins());\r
@@ -1730,28 +1877,28 @@ void AlidNdPtAnalysis::Analyse()
   fGenPrimTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
   fRecPrimTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
   \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(0),fRecPrimTrackMatrix->Projection(0),"zv_track_corr_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(0),fRecPrimTrackMatrix->Projection(0),"zv_track_corr_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fGenPrimTrackMatrix->GetAxis(1)->SetRange(1,fGenPrimTrackMatrix->GetAxis(1)->GetNbins());\r
   fRecPrimTrackMatrix->GetAxis(1)->SetRange(1,fRecPrimTrackMatrix->GetAxis(1)->GetNbins());\r
   fGenPrimTrackMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
   fRecPrimTrackMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(1),fRecPrimTrackMatrix->Projection(1),"pt_track_corr_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(1),fRecPrimTrackMatrix->Projection(1),"pt_track_corr_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   // efficiency\r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecPrimTrackMatrix->Projection(1), fGenPrimTrackMatrix->Projection(1),"pt_track_eff_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fRecPrimTrackMatrix->Projection(1), fGenPrimTrackMatrix->Projection(1),"pt_track_eff_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fGenPrimTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
   fRecPrimTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
   fGenPrimTrackMatrix->GetAxis(2)->SetRange(1,fGenPrimTrackMatrix->GetAxis(2)->GetNbins());\r
   fRecPrimTrackMatrix->GetAxis(2)->SetRange(1,fRecPrimTrackMatrix->GetAxis(2)->GetNbins());\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(2),fRecPrimTrackMatrix->Projection(2),"eta_track_corr_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fGenPrimTrackMatrix->Projection(2),fRecPrimTrackMatrix->Projection(2),"eta_track_corr_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fGenPrimTrackMatrix->GetAxis(1)->SetRange(1,fGenPrimTrackMatrix->GetAxis(1)->GetNbins());\r
   fRecPrimTrackMatrix->GetAxis(1)->SetRange(1,fRecPrimTrackMatrix->GetAxis(1)->GetNbins());\r
@@ -1779,16 +1926,16 @@ void AlidNdPtAnalysis::Analyse()
   fRecSecTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
   fRecTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
   \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(0),fRecTrackMatrix->Projection(0),"zv_track_cont_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(0),fRecTrackMatrix->Projection(0),"zv_track_cont_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fRecSecTrackMatrix->GetAxis(1)->SetRange(1,fRecSecTrackMatrix->GetAxis(1)->GetNbins());\r
   fRecTrackMatrix->GetAxis(1)->SetRange(1,fRecTrackMatrix->GetAxis(1)->GetNbins());\r
   fRecSecTrackMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
   fRecTrackMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(1),fRecTrackMatrix->Projection(1),"pt_track_cont_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(1),fRecTrackMatrix->Projection(1),"pt_track_cont_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fRecSecTrackMatrix->GetAxis(2)->SetRange(1,fRecSecTrackMatrix->GetAxis(2)->GetNbins());\r
   fRecTrackMatrix->GetAxis(2)->SetRange(1,fRecTrackMatrix->GetAxis(2)->GetNbins());\r
@@ -1796,8 +1943,8 @@ void AlidNdPtAnalysis::Analyse()
   fRecSecTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
   fRecTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(2),fRecTrackMatrix->Projection(2),"eta_track_cont_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fRecSecTrackMatrix->Projection(2),fRecTrackMatrix->Projection(2),"eta_track_cont_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fRecSecTrackMatrix->GetAxis(0)->SetRange(1,fRecSecTrackMatrix->GetAxis(0)->GetNbins());\r
   fRecTrackMatrix->GetAxis(0)->SetRange(1,fRecTrackMatrix->GetAxis(0)->GetNbins());\r
@@ -1825,16 +1972,16 @@ void AlidNdPtAnalysis::Analyse()
   fRecMultTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
   fRecTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
   \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(0),fRecTrackMatrix->Projection(0),"zv_mult_track_cont_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(0),fRecTrackMatrix->Projection(0),"zv_mult_track_cont_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fRecMultTrackMatrix->GetAxis(1)->SetRangeUser(0.,maxPt);\r
   fRecTrackMatrix->GetAxis(1)->SetRangeUser(0.,maxPt);\r
   fRecMultTrackMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
   fRecTrackMatrix->GetAxis(0)->SetRangeUser(minZv,maxZv);\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(1),fRecTrackMatrix->Projection(1),"pt_mult_track_cont_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(1),fRecTrackMatrix->Projection(1),"pt_mult_track_cont_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fRecMultTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
   fRecTrackMatrix->GetAxis(1)->SetRangeUser(minPt,maxPt);\r
@@ -1842,8 +1989,8 @@ void AlidNdPtAnalysis::Analyse()
   fRecMultTrackMatrix->GetAxis(2)->SetRange(1,fRecMultTrackMatrix->GetAxis(2)->GetNbins());\r
   fRecTrackMatrix->GetAxis(2)->SetRange(1,fRecTrackMatrix->GetAxis(2)->GetNbins());\r
 \r
-  h1D = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(2),fRecTrackMatrix->Projection(2),"eta_mult_track_cont_matrix");\r
-  aFolderObj->Add(h1D);\r
+  h = AlidNdPtHelper::GenerateCorrMatrix(fRecMultTrackMatrix->Projection(2),fRecTrackMatrix->Projection(2),"eta_mult_track_cont_matrix");\r
+  aFolderObj->Add(h);\r
 \r
   fRecMultTrackMatrix->GetAxis(1)->SetRangeUser(0.,maxPt);\r
   fRecTrackMatrix->GetAxis(1)->SetRangeUser(0.,maxPt);\r
@@ -1858,6 +2005,9 @@ void AlidNdPtAnalysis::Analyse()
   if(fHistogramsOn) {\r
 \r
   // Efficiency electrons, muons, pions, kaons, protons, all\r
+  fMCPrimTrackHist1[1]->GetAxis(1)->SetRangeUser(minEta,maxEta); \r
+  fMCPrimTrackHist1[2]->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
+\r
   fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(1,1); \r
   fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(1,1); \r
   h1 = fMCPrimTrackHist1[1]->Projection(0);\r
@@ -1912,6 +2062,9 @@ void AlidNdPtAnalysis::Analyse()
   h2c->SetName("eff_pt_all");\r
   aFolderObj->Add(h2c);\r
 \r
+  fMCPrimTrackHist1[1]->GetAxis(1)->SetRange(1,fMCPrimTrackHist1[1]->GetAxis(1)->GetNbins()); \r
+  fMCPrimTrackHist1[2]->GetAxis(1)->SetRange(1,fMCPrimTrackHist1[2]->GetAxis(1)->GetNbins());\r
+\r
   //  pt spetra\r
   // - rec, primaries, secondaries\r
   // - primaries (pid) \r
@@ -1919,13 +2072,6 @@ void AlidNdPtAnalysis::Analyse()
   // - secondaries (mech)\r
   // - secondaries (mother)\r
   //\r
-  TH1D *pt_acc = fRecTrackHist1[1]->Projection(0);\r
-  pt_acc->SetName("pt_acc");\r
-  aFolderObj->Add(pt_acc);\r
-\r
-  TH1D *pt_rec = fRecTrackHist1[2]->Projection(0);\r
-  pt_rec->SetName("pt_rec");\r
-  aFolderObj->Add(pt_rec);\r
 \r
   TH1D *mc_pt_acc_all = fMCTrackHist1[1]->Projection(0);\r
   mc_pt_acc_all->SetName("mc_pt_acc_all");\r
@@ -2132,6 +2278,8 @@ void AlidNdPtAnalysis::Analyse()
 \r
   fRecMCTrackHist1->GetAxis(0)->SetRange(1,fRecMCTrackHist1->GetAxis(0)->GetNbins()); \r
 \r
+  } // end use MC info\r
+\r
   // export objects to analysis folder\r
   fAnalysisFolder = ExportToFolder(aFolderObj);\r
 \r
index d19372c..cf2974b 100644 (file)
@@ -27,9 +27,10 @@ class AliESD;
 class AliESDfriend;
 class AliESDfriendTrack;
 
+class AlidNdPtHelper;
+
 #include "THnSparse.h"
 #include "AlidNdPt.h"
-#include "AlidNdPtHelper.h"
 
 class AlidNdPtAnalysis : public AlidNdPt {
 public :
@@ -160,25 +161,25 @@ private:
   //
 
   // all genertated
-  THnSparseF *fGenEventMatrix; //-> mcZv:mult (inelastic)
-  THnSparseF *fGenSDEventMatrix; //-> mcZv:mult (single diffractive)
-  THnSparseF *fGenDDEventMatrix; //-> mcZv:mult (single diffractive)
-  THnSparseF *fGenNDEventMatrix; //-> mcZv:mult (non diffractive)
-  THnSparseF *fGenNSDEventMatrix; //-> mcZv:mult (non single diffractive)
+  THnSparseF *fGenEventMatrix; //-> mcZv:multMB (inelastic)
+  THnSparseF *fGenSDEventMatrix; //-> mcZv:multMB (single diffractive)
+  THnSparseF *fGenDDEventMatrix; //-> mcZv:multMB (single diffractive)
+  THnSparseF *fGenNDEventMatrix; //-> mcZv:multMB (non diffractive)
+  THnSparseF *fGenNSDEventMatrix; //-> mcZv:multMB (non single diffractive)
 
   // trigger bias corrections (fTriggerEventMatrix / fGenEventMatrix)
-  THnSparseF *fTriggerEventMatrix; //-> mcZv:mult
-  THnSparseF *fTriggerSDEventMatrix; //-> mcZv:mult
-  THnSparseF *fTriggerDDEventMatrix; //-> mcZv:mult
-  THnSparseF *fTriggerNDEventMatrix; //-> mcZv:mult
-  THnSparseF *fTriggerNSDEventMatrix; //-> mcZv:mult
+  THnSparseF *fTriggerEventMatrix; //-> mcZv:multMB
+  THnSparseF *fTriggerSDEventMatrix; //-> mcZv:multMB
+  THnSparseF *fTriggerDDEventMatrix; //-> mcZv:multMB
+  THnSparseF *fTriggerNDEventMatrix; //-> mcZv:multMB
+  THnSparseF *fTriggerNSDEventMatrix; //-> mcZv:multMB
 
   // event vertex rec. eff correction (fRecEventMatrix / fTriggerEventMatrix)
-  THnSparseF *fRecEventMatrix; //-> mcZv:mult 
-  THnSparseF *fRecSDEventMatrix; //-> mcZv:mult
-  THnSparseF *fRecDDEventMatrix; //-> mcZv:mult
-  THnSparseF *fRecNDEventMatrix; //-> mcZv:mult
-  THnSparseF *fRecNSDEventMatrix; //-> mcZv:mult
+  THnSparseF *fRecEventMatrix; //-> mcZv:multMB 
+  THnSparseF *fRecSDEventMatrix; //-> mcZv:multMB
+  THnSparseF *fRecDDEventMatrix; //-> mcZv:multMB
+  THnSparseF *fRecNDEventMatrix; //-> mcZv:multMB
+  THnSparseF *fRecNSDEventMatrix; //-> mcZv:multMB
 
   //
   // track-event level correction 
@@ -226,10 +227,10 @@ private:
   // THnSparse event histograms
   THnSparseF *fMCEventHist1;  //-> mcXv:mcYv:mcZv
   THnSparseF *fRecEventHist1; //-> Xv:Yv:Zv
-  THnSparseF *fRecEventHist2; //-> Zv:multMB
+  THnSparseF *fRecEventHist2; //-> Zv:multMB:mult
   THnSparseF *fRecMCEventHist1; //-> Xv-mcXv:Yv-mcYv:Zv-mcZv
-  THnSparseF *fRecMCEventHist2; //-> Xv-mcXv:Zv-mcZv:Mult
-  THnSparseF *fRecMCEventHist3; //-> Mult:EventType (ND, DD, SD)
+  THnSparseF *fRecMCEventHist2; //-> Xv-mcXv:Zv-mcZv:mult
+  THnSparseF *fRecMCEventHist3; //-> mult:EventType (ND, DD, SD)
 
   // THnSparse track histograms
   // [0] - after charged track selection, [1] - after acceptance cuts, [2] - after esd track cuts
@@ -239,7 +240,7 @@ private:
   THnSparseF *fMCSecTrackHist1[AlidNdPtHelper::kCutSteps];  //-> mcPt:mcEta:pid:mech:mother
 
   THnSparseF *fRecTrackHist1[AlidNdPtHelper::kCutSteps];     //-> Pt:Eta:Phi
-  THnSparseF *fRecTrackMultHist1[AlidNdPtHelper::kCutSteps]; //-> Pt:Mult
+  THnSparseF *fRecTrackMultHist1[AlidNdPtHelper::kCutSteps]; //-> Pt:mult
 
   THnSparseF *fRecMCTrackHist1; //-> mcPt:mcEta:(Pt-mcPt)/mcPt:(Eta-mcEta)
 
index 761f4b3..a825c86 100644 (file)
@@ -31,6 +31,8 @@
 #include "AlidNdPtEventCuts.h"\r
 #include "AlidNdPtAcceptanceCuts.h"\r
 \r
+#include "AliPWG0Helper.h"\r
+#include "AlidNdPtHelper.h"\r
 #include "AlidNdPtCorrection.h"\r
 \r
 using namespace std;\r
@@ -53,7 +55,6 @@ ClassImp(AlidNdPtCorrection)
   fMCNSDEventAllPrimTrackMultHist1(0),\r
   fMCTriggerPrimTrackMultHist1(0),\r
   fMCEventPrimTrackMultHist1(0),\r
-  //fPtvsPt(0),\r
   fEventMultCorrelationMatrix(0),\r
   fZvNorm(0),\r
   fZvEmptyEventsNorm(0),\r
@@ -102,7 +103,6 @@ AlidNdPtCorrection::AlidNdPtCorrection(Char_t* name, Char_t* title, TString corr
   fMCNSDEventAllPrimTrackMultHist1(0),\r
   fMCTriggerPrimTrackMultHist1(0),\r
   fMCEventPrimTrackMultHist1(0),\r
-  //fPtvsPt(0),\r
   fEventMultCorrelationMatrix(0),\r
   fZvNorm(0),\r
   fZvEmptyEventsNorm(0),\r
@@ -126,6 +126,7 @@ 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
   }\r
 \r
   for(Int_t i=0; i<5; i++) { \r
@@ -162,6 +163,7 @@ 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
   }\r
 \r
   for(Int_t i=0; i<5; i++) { \r
@@ -170,7 +172,6 @@ AlidNdPtCorrection::~AlidNdPtCorrection() {
   }\r
 \r
   if(fCorrectionFolder) delete fCorrectionFolder; fCorrectionFolder=0;\r
-  //if(fPtvsPt) delete fPtvsPt; fPtvsPt=0;\r
 }\r
 \r
 //_____________________________________________________________________________\r
@@ -190,10 +191,6 @@ void AlidNdPtCorrection::Init(){
   Double_t binsEta[etaNbins+1] = {-1.5,-1.4,-1.3,-1.2,-1.1,-1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0.,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5};\r
   Double_t binsZv[zvNbins+1] = {-30.,-25.,-20.,-15.,-10.,-5.,0.,5.,10.,15.,20.,25.,30.};\r
 \r
-  //TProfile *fPtvsPt = new TProfile("fPtvsPt","pt profile",ptNbins,binsPt); \r
-  //fPtvsPt->GetXaxis()->SetTitle("Pt (GeV/c)"); \r
-  //fPtvsPt->GetYaxis()->SetTitle("<Pt> (GeV/c)"); \r
-  //fPtvsPt->Sumw2();\r
 \r
   //\r
   Int_t binsMCEventHist1[3]={100,100,140};\r
@@ -311,6 +308,11 @@ void AlidNdPtCorrection::Init(){
   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
+\r
   for(Int_t i=0; i<8; i++) \r
   {\r
     // THnSparse track histograms\r
@@ -323,6 +325,14 @@ void AlidNdPtCorrection::Init(){
     fCorrRecTrackMultHist1[i]->GetAxis(1)->SetTitle("Eta");\r
     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
   }\r
 \r
   Int_t binsEventMatrix[2]={zvNbins,150};\r
@@ -502,27 +512,28 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
     return;\r
   }\r
 \r
-  // trigger definition\r
-  Bool_t isEventTriggered = AlidNdPtHelper::IsEventTriggered(esdEvent->GetTriggerMask(), GetTrigger());\r
-  //if(!isEventTriggered) printf("no MB1 trigger ... \n");\r
-\r
-  // cuts\r
+  // get selection cuts\r
   AlidNdPtEventCuts *evtCuts = GetEventCuts(); \r
   AlidNdPtAcceptanceCuts *accCuts = GetAcceptanceCuts(); \r
   AliESDtrackCuts *esdTrackCuts = GetTrackCuts(); \r
 \r
-  if(!evtCuts || !accCuts || !esdTrackCuts) {\r
+  if(!evtCuts || !accCuts  || !esdTrackCuts) {\r
     AliDebug(AliLog::kError, "cuts not available");\r
     return;\r
   }\r
 \r
-  // use MC information\r
+  // trigger selection\r
+  Bool_t isEventTriggered = kTRUE;\r
+  if(evtCuts->IsTriggerRequired())  {\r
+    isEventTriggered = AliPWG0Helper::IsEventTriggered(esdEvent->GetTriggerMask(), GetTrigger());\r
+  }\r
 \r
+  // use MC information\r
   AliHeader* header = 0;\r
   AliGenEventHeader* genHeader = 0;\r
   AliStack* stack = 0;\r
   TArrayF vtxMC(3);\r
-  AlidNdPtHelper::MCProcessType evtType = AlidNdPtHelper::kInvalidProcess;\r
+  AliPWG0Helper::MCProcessType evtType = AliPWG0Helper::kInvalidProcess;\r
   Int_t multMCTrueTracks = 0;\r
 \r
   if(IsUseMCInfo())\r
@@ -546,7 +557,7 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
     }\r
 \r
     // get event type (ND=0x1, DD=0x2, SD=0x4)\r
-    evtType = AlidNdPtHelper::GetEventProcessType(header);\r
+    evtType = AliPWG0Helper::GetEventProcessType(header);\r
     //Printf("evtType %d \n", evtType);\r
     AliDebug(AliLog::kDebug+1, Form("Found process type %d", evtType));\r
 \r
@@ -573,8 +584,10 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
   Bool_t isRecVertex = kFALSE;\r
   if(evtCuts->IsRecVertexRequired()) \r
   {\r
-    vtxESD = AlidNdPtHelper::GetVertex(esdEvent, evtCuts,  accCuts, esdTrackCuts, GetAnalysisMode(), kFALSE, kTRUE, kTRUE);\r
-    isRecVertex = AlidNdPtHelper::TestVertex(vtxESD, GetAnalysisMode(), kFALSE); // should be moved to AcceptEvent\r
+    Bool_t bRedoTPCVertex = evtCuts->IsRedoTPCVertex();\r
+    Bool_t bUseConstraints = evtCuts->IsUseBeamSpotConstraint();\r
+    vtxESD = AlidNdPtHelper::GetVertex(esdEvent,evtCuts,accCuts,esdTrackCuts,GetAnalysisMode(),kFALSE,bRedoTPCVertex,bUseConstraints); \r
+    isRecVertex = AlidNdPtHelper::TestRecVertex(vtxESD, GetAnalysisMode(), kFALSE); // should be moved to AcceptEvent\r
   }\r
   if( IsUseMCInfo() &&  !evtCuts->IsRecVertexRequired() ) {\r
     vtxESD = new AliESDVertex(vtxMC[2],10.,genHeader->NProduced());\r
@@ -608,7 +621,8 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
   if(isEventOK && isEventTriggered)\r
   {\r
     // get all charged tracks\r
-    allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,vtxESD,GetAnalysisMode());\r
+    //allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,vtxESD,GetAnalysisMode());\r
+    allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,GetAnalysisMode());\r
     if(!allChargedTracks) return;\r
 \r
     Int_t entries = allChargedTracks->GetEntries();\r
@@ -683,10 +697,10 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
       //\r
       Double_t vMCEventMatrix[2] = {vtxMC[2],multMBTracks};\r
       fMCAllEventMultHist1->Fill(vMCEventMatrix);\r
-      if(evtType == AlidNdPtHelper::kND) {\r
+      if(evtType == AliPWG0Helper::kND) {\r
         fMCAllNDEventMultHist1->Fill(vMCEventMatrix);\r
       }\r
-      if(evtType != AlidNdPtHelper::kSD) {\r
+      if(evtType != AliPWG0Helper::kSD) {\r
         fMCAllNSDEventMultHist1->Fill(vMCEventMatrix);\r
       }\r
       if(isEventTriggered) fMCTriggerMultHist1->Fill(vMCEventMatrix);\r
@@ -722,10 +736,10 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
 \r
         Double_t valMCAllTrackMultHist1[3] = {gpt,geta,multRec};         \r
         fMCAllPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
-        if(evtType == AlidNdPtHelper::kND) {\r
+        if(evtType == AliPWG0Helper::kND) {\r
           fMCNDEventAllPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
         }\r
-        if(evtType != AlidNdPtHelper::kSD) {\r
+        if(evtType != AliPWG0Helper::kSD) {\r
           fMCNSDEventAllPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
         }\r
         if(isEventTriggered) fMCTriggerPrimTrackMultHist1->Fill(valMCAllTrackMultHist1);\r
@@ -840,23 +854,24 @@ void AlidNdPtCorrection::FillHistograms(AliESDtrack *esdTrack, AliStack *stack,
     Double_t trigMBToND = GetCorrFactZvPtEta(fCorrTriggerMBtoNDTrackEventMatrix,zv,pt,eta);\r
     Double_t trigMBToNSD = GetCorrFactZvPtEta(fCorrTriggerMBtoNSDTrackEventMatrix,zv,pt,eta);\r
     //printf("vertexEffF %f, trigMBToInel %f, trigMBToNSD %f \n", vertexEffF, trigMBToInel, trigMBToNSD);\r
-\r
+    \r
+    Double_t corrF[8] = { 1.0, \r
+                          trackContF,\r
+                         trackContF*trackEffF,\r
+                         trackContF*trackEffF*multTrackContF,\r
+                         trackContF*trackEffF*multTrackContF*vertexEffF,\r
+                         trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToInel,\r
+                          trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToND,\r
+                          trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToNSD\r
+                         }; \r
\r
+    // Fill histograms\r
     Double_t valCorrRecTrackMultHist1[3] = {pt,eta,mult};        \r
-    fCorrRecTrackMultHist1[0]->Fill(valCorrRecTrackMultHist1);\r
-    fCorrRecTrackMultHist1[1]->Fill(valCorrRecTrackMultHist1,trackContF);\r
-    fCorrRecTrackMultHist1[2]->Fill(valCorrRecTrackMultHist1,trackContF*trackEffF);\r
-    fCorrRecTrackMultHist1[3]->Fill(valCorrRecTrackMultHist1,trackContF*trackEffF*multTrackContF);\r
-\r
-    fCorrRecTrackMultHist1[4]->Fill(valCorrRecTrackMultHist1,trackContF*trackEffF*multTrackContF*vertexEffF);\r
-    fCorrRecTrackMultHist1[5]->Fill(valCorrRecTrackMultHist1,trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToInel);\r
-    fCorrRecTrackMultHist1[6]->Fill(valCorrRecTrackMultHist1,trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToND);\r
-    fCorrRecTrackMultHist1[7]->Fill(valCorrRecTrackMultHist1,trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToNSD);\r
-\r
-    //\r
-    //Double_t valPtvsPt[2]={pt, pt};    \r
-    //fPtvsPt->Fill(valPtvsPt,trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToNSD);\r
-    //printf("\n histo %p pt %f \n",fPtvsPt,pt);\r
-    //fPtvsPt->Fill(pt,pt,trackContF*trackEffF*multTrackContF*vertexEffF*trigMBToNSD);\r
+    Double_t valPtvsPt[2] = {pt,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
+    }\r
   }\r
 }\r
 \r
@@ -1021,6 +1036,7 @@ Long64_t AlidNdPtCorrection::Merge(TCollection* 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
     }\r
 \r
     for(Int_t i=0; i<5; i++) {\r
@@ -1028,8 +1044,6 @@ Long64_t AlidNdPtCorrection::Merge(TCollection* list)
       fCorrRecEventHist2[i]->Add(entry->fCorrRecEventHist2[i]);\r
     }\r
 \r
-    //fPtvsPt->Add(entry->fPtvsPt);\r
-\r
   count++;\r
   }\r
 \r
@@ -1091,9 +1105,12 @@ void AlidNdPtCorrection::Analyse()
   //\r
   // pt profile\r
   //\r
-  //h2D = fPtvsPt->Projection(1,0);\r
-  //h2D->ProfileX("pt_profile_pt_corrected_NSD");\r
-  //aFolderObj->Add(fPtvsPt);\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
+    aFolderObj->Add(h2D);\r
+  }\r
 \r
   //\r
   // event level \r
@@ -1138,7 +1155,11 @@ void AlidNdPtCorrection::Analyse()
   h = fCorrRecEventHist2[4]->Projection(1);\r
   h->SetName("mult_empty_NSD_trigger_vertex_corrected");\r
   aFolderObj->Add(h);\r
-\r
\r
+  //\r
+  // MC available\r
+  //\r
+  if(IsUseMCInfo()) {\r
 \r
   // mc \r
   h = fMCAllEventMultHist1->Projection(1);\r
@@ -1185,6 +1206,8 @@ void AlidNdPtCorrection::Analyse()
 \r
   fMCEventPrimTrackMultHist1->GetAxis(0)->SetRangeUser(minPt,maxPt);\r
   fMCEventPrimTrackMultHist1->GetAxis(1)->SetRangeUser(minEta,maxEta);\r
+\r
+  } // end use MC info \r
   \r
   //\r
   h2D = fCorrRecTrackMultHist1[3]->Projection(1,0);\r
@@ -1362,7 +1385,10 @@ void AlidNdPtCorrection::Analyse()
   aFolderObj->Add(h);\r
 \r
 \r
-\r
+  //\r
+  // MC available\r
+  //\r
+  if(IsUseMCInfo()) {\r
 \r
   //\r
   h2D = fMCAllPrimTrackMultHist1->Projection(2,0);\r
@@ -1536,6 +1562,8 @@ void AlidNdPtCorrection::Analyse()
   hsc->Divide((TH1*)aFolderObj->FindObject("mc_all_eta_acc_trig_event_prim"));\r
   aFolderObj->Add(hsc);\r
 \r
+  } // end MC infor available\r
+\r
   // export objects to analysis folder\r
   fCorrectionFolder = ExportToFolder(aFolderObj);\r
 \r
index 85ae0c9..24d6060 100644 (file)
@@ -18,7 +18,6 @@
 //------------------------------------------------------------------------------
 
 
-class TProfile;
 class TFolder;
 class TObjArray;
 class TString;
@@ -33,10 +32,10 @@ class AlidNdPtEventCuts;
 class AlidNdPtAcceptanceCuts;
 class AlidNdPtCorrection;
 class AlidNdPt;
+class AlidNdPtHelper;
 
 #include "THnSparse.h"
 #include "AlidNdPt.h"
-#include "AlidNdPtHelper.h"
 
 class AlidNdPtCorrection : public AlidNdPt {
 public :
@@ -93,8 +92,7 @@ public :
   THnSparseF *GetCorrRecEventHist1(Int_t i) {return fCorrRecEventHist1[i];}
   THnSparseF *GetCorrRecEventHist2(Int_t i) {return fCorrRecEventHist2[i];}
 
-  //THnSparseF *GetPtvsPt() {return fPtvsPt;}
-  //TProfile *GetPtvsPt() {return fPtvsPt;}
+  THnSparseF *GetPtvsPt(Int_t i) {return fPtvsPt[i];}
 
   // correlation matrix
   void SetEventMultCorrelationMatrix(THnSparseF *const matrix=0) {fEventMultCorrelationMatrix = matrix;}
@@ -191,9 +189,6 @@ private:
   //mc primary tracks in acceptance (triggered and event vertex reconstructed)
   THnSparseF *fMCEventPrimTrackMultHist1; //-> mcPt:mcEta:multiplicity
 
-  // pt vs pt to get proper pt bin (center of gravity)
-  // THnSparseF *fPtvsPt; //-> pt:pt 
-  //TProfile *fPtvsPt; //-> pt profile
 
   // track histograms 
   // [0]=all charged tracks, 
@@ -212,6 +207,9 @@ private:
   // [7]=[4]+trigger MBToNSD)
   THnSparseF *fCorrRecTrackMultHist1[8]; //-> Pt:Eta:mult corrected histograms 
 
+  // pt vs pt to get proper pt bin (center of gravity)
+  THnSparseF *fPtvsPt[8]; //-> pt:pt 
+
   // corrected event histograms
   // [0]-not corrected, 
   // [1]=event vertex, 
@@ -220,6 +218,7 @@ private:
   // [4]=[1]+trigger MBtoNSD 
   THnSparseF *fCorrRecEventHist1[5]; //-> mcZv:multMB 
 
+
   // corrected event histograms (empty events)
   // [0]=not corrected,
   // [1]=trigger/trigger+vertex correction,
index b40c27c..2dab337 100644 (file)
@@ -31,6 +31,8 @@
 #include "AlidNdPtEventCuts.h"\r
 #include "AlidNdPtAcceptanceCuts.h"\r
 \r
+#include "AliPWG0Helper.h"\r
+#include "AlidNdPtHelper.h"\r
 #include "AlidNdPtCutAnalysis.h"\r
 \r
 using namespace std;\r
@@ -156,26 +158,29 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
     return;\r
   }\r
 \r
-  // trigger definition\r
-  Bool_t isEventTriggered = AlidNdPtHelper::IsEventTriggered(esdEvent->GetTriggerMask(), GetTrigger());\r
-  //if(!isEventTriggered) printf("no MB1 trigger ... \n");\r
-\r
-  // cuts\r
+  // get selection cuts\r
   AlidNdPtEventCuts *evtCuts = GetEventCuts(); \r
   AlidNdPtAcceptanceCuts *accCuts = GetAcceptanceCuts(); \r
   AliESDtrackCuts *esdTrackCuts = GetTrackCuts(); \r
 \r
-  if(!evtCuts || !accCuts || !esdTrackCuts) {\r
+  if(!evtCuts || !accCuts  || !esdTrackCuts) {\r
     AliDebug(AliLog::kError, "cuts not available");\r
     return;\r
   }\r
 \r
+  // trigger selection\r
+  Bool_t isEventTriggered = kTRUE;\r
+  if(evtCuts->IsTriggerRequired())  {\r
+    isEventTriggered = AliPWG0Helper::IsEventTriggered(esdEvent->GetTriggerMask(), GetTrigger());\r
+  }\r
+\r
   // use MC information\r
   AliHeader* header = 0;\r
   AliGenEventHeader* genHeader = 0;\r
   AliStack* stack = 0;\r
   TArrayF vtxMC(3);\r
-  AlidNdPtHelper::MCProcessType evtType = AlidNdPtHelper::kInvalidProcess;\r
+  //AlidNdPtHelper::MCProcessType evtType = AlidNdPtHelper::kInvalidProcess;\r
+  AliPWG0Helper::MCProcessType evtType = AliPWG0Helper::kInvalidProcess;\r
 \r
   if(IsUseMCInfo())\r
   {\r
@@ -199,7 +204,7 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
     }\r
 \r
     // get event type (ND=0x1, DD=0x2, SD=0x4)\r
-    evtType = AlidNdPtHelper::GetEventProcessType(header);\r
+    evtType = AliPWG0Helper::GetEventProcessType(header);\r
     AliDebug(AliLog::kDebug+1, Form("Found process type %d", evtType));\r
 \r
     // get MC vertex\r
@@ -217,10 +222,12 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
   } // end bUseMC\r
 \r
   // get reconstructed vertex  \r
-  const AliESDVertex* vtxESD = AlidNdPtHelper::GetVertex(esdEvent,evtCuts,accCuts,esdTrackCuts,GetAnalysisMode(), kFALSE, kTRUE, kTRUE); // redo TPC vertex & vertex constraints\r
+  Bool_t bRedoTPCVertex = evtCuts->IsRedoTPCVertex();\r
+  Bool_t bUseConstraints = evtCuts->IsUseBeamSpotConstraint();\r
+  const AliESDVertex* vtxESD = AlidNdPtHelper::GetVertex(esdEvent,evtCuts,accCuts,esdTrackCuts,GetAnalysisMode(),kFALSE,bRedoTPCVertex,bUseConstraints); \r
   if(!vtxESD) return; \r
 \r
-  Bool_t isRecVertex = AlidNdPtHelper::TestVertex(vtxESD, GetAnalysisMode(), kFALSE);  // should be moved to AcceptEvent\r
+  Bool_t isRecVertex = AlidNdPtHelper::TestRecVertex(vtxESD, GetAnalysisMode(), kFALSE);\r
   Bool_t isEventOK = evtCuts->AcceptEvent(esdEvent,mcEvent,vtxESD) && isRecVertex;\r
 \r
   TObjArray *allChargedTracks=0;\r
@@ -230,8 +237,7 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
   if(isEventOK && isEventTriggered)\r
   {\r
     // get all charged tracks\r
-    allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,vtxESD,GetAnalysisMode());\r
-    //allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,GetAnalysisMode());\r
+    allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,GetAnalysisMode());\r
     if(!allChargedTracks) return;\r
 \r
     Int_t entries = allChargedTracks->GetEntries();\r
@@ -243,7 +249,6 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
       FillHistograms(track, stack);\r
       multAll++;\r
     }\r
-  } \r
 \r
   Double_t vRecEventHist[5] = {vtxESD->GetXv(),vtxESD->GetYv(),vtxESD->GetZv(),vtxESD->GetZRes(),multAll};\r
   fRecEventHist->Fill(vRecEventHist);\r
@@ -252,6 +257,7 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
     Double_t vRecMCEventHist[5] = {vtxESD->GetXv()-vtxMC[0],vtxESD->GetYv()-vtxMC[1],vtxESD->GetZv()-vtxMC[2],multAll};\r
     fRecMCEventHist->Fill(vRecMCEventHist);\r
   }\r
+  }\r
 \r
   if(allChargedTracks) delete allChargedTracks; allChargedTracks = 0;\r
 }\r
@@ -263,8 +269,8 @@ void AlidNdPtCutAnalysis::FillHistograms(AliESDtrack *const esdTrack, AliStack *
   // Fill ESD track and MC histograms \r
   //\r
   if(!esdTrack) return;\r
+  if(esdTrack->Charge() == 0.) return;\r
 \r
-  //Float_t q = esdTrack->Charge();\r
   Float_t pt = esdTrack->Pt();\r
   Float_t eta = esdTrack->Eta();\r
   Float_t phi = esdTrack->Phi();\r
@@ -287,11 +293,17 @@ void AlidNdPtCutAnalysis::FillHistograms(AliESDtrack *const esdTrack, AliStack *
   //\r
   // Fill rec vs MC information\r
   //\r
-  if(!stack) return;\r
-  Int_t label = TMath::Abs(esdTrack->GetLabel()); \r
-  TParticle* particle = stack->Particle(label);\r
-  if(!particle) return;\r
-  Bool_t isPrim = stack->IsPhysicalPrimary(label);\r
+\r
+  Bool_t isPrim = kTRUE;\r
+\r
+  if(IsUseMCInfo()) {\r
+    if(!stack) return;\r
+    Int_t label = TMath::Abs(esdTrack->GetLabel()); \r
+    TParticle* particle = stack->Particle(label);\r
+    if(!particle) return;\r
+    if(particle->GetPDG() && particle->GetPDG()->Charge()==0.) return;\r
+    isPrim = stack->IsPhysicalPrimary(label);\r
+  }\r
 \r
   // fill histo\r
   Double_t vRecMCTrackHist[10] = {nClust,chi2PerCluster,clustPerFindClust,b[0],b[1],eta,phi,pt,isKink,isPrim}; \r
@@ -364,6 +376,8 @@ void AlidNdPtCutAnalysis::Analyse()
   Double_t minEta = accCuts->GetMinEta();\r
   Double_t maxEta = accCuts->GetMaxEta()-0.00001;\r
 \r
+  Double_t maxDCAr = accCuts->GetMaxDCAr();\r
+\r
   //\r
   // Create rec. event histograms\r
   //\r
@@ -375,10 +389,16 @@ void AlidNdPtCutAnalysis::Analyse()
   h2D->SetName("rec_xv_vs_zv");\r
   aFolderObj->Add(h2D);\r
 \r
-  h2D = (TH2D *)fRecEventHist->Projection(0,2);\r
+  h2D = (TH2D *)fRecEventHist->Projection(3,4);\r
   h2D->SetName("rec_resZv_vs_Mult");\r
   aFolderObj->Add(h2D);\r
 \r
+\r
+  //\r
+  // MC available\r
+  //\r
+  if(IsUseMCInfo()) {\r
+\r
   //\r
   // Create mc event histograms\r
   //\r
@@ -405,13 +425,22 @@ void AlidNdPtCutAnalysis::Analyse()
   h2D->SetName("rec_mc_deltaZv_vs_mult");\r
   aFolderObj->Add(h2D);\r
 \r
+  } // end use MC info \r
+\r
+\r
+\r
   //\r
   // Create rec-mc track track histograms \r
   //\r
 \r
   // DCA cuts\r
-  fRecMCTrackHist->GetAxis(3)->SetRangeUser(-0.3,0.3);\r
-  fRecMCTrackHist->GetAxis(4)->SetRangeUser(-0.3,0.3);\r
+  fRecMCTrackHist->GetAxis(3)->SetRangeUser(-maxDCAr,maxDCAr);\r
+  fRecMCTrackHist->GetAxis(4)->SetRangeUser(-maxDCAr,maxDCAr);\r
+\r
+  h2D = (TH2D *)fRecMCTrackHist->Projection(7,5);\r
+  h2D->SetName("pt_vs_eta");\r
+  aFolderObj->Add(h2D);\r
+\r
   fRecMCTrackHist->GetAxis(7)->SetRangeUser(minPt,maxPt);  \r
 \r
   h2D = (TH2D *)fRecMCTrackHist->Projection(0,5);\r
@@ -427,6 +456,8 @@ void AlidNdPtCutAnalysis::Analyse()
   aFolderObj->Add(h2D);\r
 \r
   //\r
+  fRecMCTrackHist->GetAxis(7)->SetRangeUser(minEta,maxEta);  \r
+\r
   h2D = (TH2D *)fRecMCTrackHist->Projection(0,6);\r
   h2D->SetName("nClust_vs_phi");\r
   aFolderObj->Add(h2D);\r
@@ -439,6 +470,10 @@ void AlidNdPtCutAnalysis::Analyse()
   h2D->SetName("ratio_nClust_nFindableClust_vs_phi");\r
   aFolderObj->Add(h2D);\r
 \r
+  h2D = (TH2D *)fRecMCTrackHist->Projection(5,6);\r
+  h2D->SetName("eta_vs_phi");\r
+  aFolderObj->Add(h2D);\r
+\r
   //\r
   fRecMCTrackHist->GetAxis(7)->SetRangeUser(0.0,maxPt);  \r
 \r
@@ -454,13 +489,18 @@ void AlidNdPtCutAnalysis::Analyse()
   h2D->SetName("ratio_nClust_nFindableClust_vs_pt");\r
   aFolderObj->Add(h2D);\r
 \r
+  h2D = (TH2D *)fRecMCTrackHist->Projection(6,7);\r
+  h2D->SetName("phi_vs_pt");\r
+  aFolderObj->Add(h2D);\r
+\r
+\r
   // fiducial volume\r
   fRecMCTrackHist->GetAxis(5)->SetRangeUser(minEta,maxEta);  \r
   fRecMCTrackHist->GetAxis(7)->SetRangeUser(minPt,maxPt);  \r
 \r
   // DCA cuts\r
-  fRecMCTrackHist->GetAxis(3)->SetRangeUser(-0.3,0.3);\r
-  fRecMCTrackHist->GetAxis(4)->SetRangeUser(-0.3,0.3);\r
+  fRecMCTrackHist->GetAxis(3)->SetRangeUser(-maxDCAr,maxDCAr);\r
+  fRecMCTrackHist->GetAxis(4)->SetRangeUser(-maxDCAr,maxDCAr);\r
 \r
   h2D = (TH2D *)fRecMCTrackHist->Projection(0,1);\r
   h2D->SetName("nClust_vs_chi2PerClust");\r
@@ -471,7 +511,7 @@ void AlidNdPtCutAnalysis::Analyse()
   aFolderObj->Add(h2D);\r
 \r
   // DCAy cuts\r
-  fRecMCTrackHist->GetAxis(3)->SetRangeUser(-10.0,10.0);\r
+  fRecMCTrackHist->GetAxis(3)->SetRange(1,fRecMCTrackHist->GetAxis(3)->GetNbins());\r
   fRecMCTrackHist->GetAxis(4)->SetRangeUser(-1.0,1.0);\r
 \r
   // sec\r
@@ -488,7 +528,7 @@ void AlidNdPtCutAnalysis::Analyse()
 \r
   // DCAz cuts\r
   fRecMCTrackHist->GetAxis(3)->SetRangeUser(-1.0,1.0);\r
-  fRecMCTrackHist->GetAxis(4)->SetRangeUser(-10.0,10.0);\r
+  fRecMCTrackHist->GetAxis(4)->SetRange(1,fRecMCTrackHist->GetAxis(4)->GetNbins());\r
 \r
   // sec\r
   fRecMCTrackHist->GetAxis(9)->SetRange(1,1);\r
index befa61c..8034435 100644 (file)
@@ -28,7 +28,6 @@ class AliESDfriendTrack;
 
 #include "THnSparse.h"
 #include "AlidNdPt.h"
-#include "AlidNdPtHelper.h"
 
 class AlidNdPtCutAnalysis : public AlidNdPt {
 public :
@@ -61,14 +60,14 @@ public :
   void FillHistograms(AliESDtrack *const esdTrack, AliStack *const stack);
 
   // Getters
-  THnSparseF *GetRecEventHist() {return fRecEventHist;}
-  THnSparseF *GetMCEventHist() {return fMCEventHist;}
+  THnSparseF *GetRecEventHist()   {return fRecEventHist;}
+  THnSparseF *GetMCEventHist()    {return fMCEventHist;}
   THnSparseF *GetRecMCEventHist() {return fRecMCEventHist;}
 
   //
   THnSparseF *GetRecMCTrackHist() {return fRecMCTrackHist;}
   
-  private:
+private:
 
   // analysis folder 
   TFolder *fAnalysisFolder; // folder for analysed histograms
index 548a796..6d606d6 100644 (file)
@@ -23,7 +23,6 @@
 #include "AliHeader.h"
 #include "AliGenEventHeader.h"
 
-#include "AlidNdPtHelper.h"
 #include "AlidNdPtEventCuts.h"
 
 using namespace std;
@@ -33,8 +32,9 @@ ClassImp(AlidNdPtEventCuts)
 //_____________________________________________________________________________
 AlidNdPtEventCuts::AlidNdPtEventCuts(const Char_t* name,const Char_t *title) : 
 AliAnalysisCuts(name, title)
+, fTriggerRequired(kTRUE)
 , fRecVertexRequired(kTRUE)
-, fEventProcessType(AlidNdPtHelper::kInvalidProcess)
+, fEventProcessType(AliPWG0Helper::kInvalidProcess)
 , fMinNContributors(0)
 , fMaxNContributors(0)
 , fMaxR(0)
@@ -46,6 +46,8 @@ AliAnalysisCuts(name, title)
 , fSigmaMeanXv(0)
 , fSigmaMeanYv(0)
 , fSigmaMeanZv(0)
+, fRedoTPCVertex(kTRUE)
+, fUseBeamSpotConstraint(kTRUE)
 {
   // default constructor 
   
@@ -63,6 +65,7 @@ AlidNdPtEventCuts::~AlidNdPtEventCuts()
 void AlidNdPtEventCuts::Init()  
 {
   // set default values
+  SetTriggerRequired();
   SetRecVertexRequired();
   SetEventProcessType();
   SetNContributorsRange();
@@ -70,6 +73,8 @@ void AlidNdPtEventCuts::Init()
   SetZvRange();
   SetMeanXYZv();
   SetSigmaMeanXYZv();
+  SetRedoTPCVertex();
+  SetUseBeamSpotConstraint();
 }
 
 //_____________________________________________________________________________
@@ -89,15 +94,15 @@ Bool_t AlidNdPtEventCuts::AcceptEvent(AliESDEvent *esdEvent,AliMCEvent *mcEvent,
    if(!header) return kFALSE;
   
     // select event type (ND-non diffractive, SD-single diffractive, DD-double diffractive)
-    if(fEventProcessType == AlidNdPtHelper::kInvalidProcess) { 
+    if(fEventProcessType == AliPWG0Helper::kInvalidProcess) { 
       retValue=kTRUE;
     } 
-    else if(fEventProcessType == AlidNdPtHelper::kDiffractiveProcess) {
-      AlidNdPtHelper::MCProcessType processType = AlidNdPtHelper::GetEventProcessType(header);
-      if(processType == AlidNdPtHelper::kND) retValue=kFALSE;
+    else if(fEventProcessType == AliPWG0Helper::kSD || fEventProcessType == AliPWG0Helper::kDD) {
+      AliPWG0Helper::MCProcessType processType = AliPWG0Helper::GetEventProcessType(header);
+      if(processType == AliPWG0Helper::kND) retValue=kFALSE;
       else retValue=kTRUE;
     }
-    else if(fEventProcessType == AlidNdPtHelper::GetEventProcessType(header)) { 
+    else if(fEventProcessType == AliPWG0Helper::GetEventProcessType(header)) { 
       retValue=kTRUE;
     }
     else 
@@ -136,10 +141,10 @@ Bool_t AlidNdPtEventCuts::AcceptMCEvent(AliMCEvent *mcEvent)
   genHeader->PrimaryVertex(vtxMC);
   
   // select event type (ND-non diffractive, SD-single diffractive, DD-double diffractive)
-  if(fEventProcessType == AlidNdPtHelper::kInvalidProcess) { 
+  if(fEventProcessType == AliPWG0Helper::kInvalidProcess) { 
      retValue=kTRUE;
   } else {
-     if(fEventProcessType == AlidNdPtHelper::GetEventProcessType(header)) retValue=kTRUE;
+     if(fEventProcessType == AliPWG0Helper::GetEventProcessType(header)) retValue=kTRUE;
      else retValue=kFALSE;
   }
 
index 3650fde..7125259 100644 (file)
@@ -8,7 +8,6 @@
 //------------------------------------------------------------------------------\r
 \r
 #include "AliAnalysisCuts.h"\r
-#include "dNdPt/AlidNdPtHelper.h"\r
 \r
 class AliESDEvent;\r
 class AliESDVertex;\r
@@ -16,6 +15,9 @@ class AliMCEvent;
 class AliHeader;\r
 class AliGenEventHeader;\r
 \r
+#include "AliPWG0Helper.h"\r
+#include "AlidNdPtHelper.h"\r
+\r
 class AlidNdPtEventCuts : public AliAnalysisCuts\r
 {\r
 public:\r
@@ -23,8 +25,9 @@ public:
   virtual ~AlidNdPtEventCuts(); \r
  \r
   // setters \r
+  void SetTriggerRequired(const Bool_t bFlag=kTRUE)  {fTriggerRequired=bFlag;}\r
   void SetRecVertexRequired(const Bool_t bFlag=kTRUE)  {fRecVertexRequired=bFlag;}\r
-  void SetEventProcessType(AlidNdPtHelper::MCProcessType type=AlidNdPtHelper::kInvalidProcess)  {fEventProcessType=type;}\r
+  void SetEventProcessType(AliPWG0Helper::MCProcessType type=AliPWG0Helper::kInvalidProcess)  {fEventProcessType=type;}\r
   void SetNContributorsRange(const Float_t min=0.,const Float_t max=1e99) {fMinNContributors=min; fMaxNContributors=max;}\r
   void SetMaxR(const Float_t max=1e99) {fMaxR=max;}\r
   void SetZvRange(const Float_t min=-1e99, const Float_t max=1e99) {fMinZv=min; fMaxZv=max;}\r
@@ -37,7 +40,11 @@ public:
     fSigmaMeanXv = sxv; fSigmaMeanYv = syv; fSigmaMeanZv = szv;\r
   }\r
 \r
+  void SetRedoTPCVertex(const Bool_t redo = kTRUE) {fRedoTPCVertex = redo;}\r
+  void SetUseBeamSpotConstraint(const Bool_t useConstr = kTRUE) {fUseBeamSpotConstraint = useConstr;}\r
+\r
   // getters \r
+  Bool_t  IsTriggerRequired() const {return fTriggerRequired;}\r
   Bool_t  IsRecVertexRequired() const {return fRecVertexRequired;}\r
   Int_t   GetEventProcessType() const {return fEventProcessType;}  \r
   Float_t GetMinNContributors() const {return fMinNContributors;}\r
@@ -54,6 +61,9 @@ public:
   Float_t GetSigmaMeanYv() const {return fSigmaMeanYv;}\r
   Float_t GetSigmaMeanZv() const {return fSigmaMeanZv;}\r
  \r
+  Bool_t IsRedoTPCVertex() const {return fRedoTPCVertex;}\r
+  Bool_t IsUseBeamSpotConstraint() const {return fUseBeamSpotConstraint;}\r
+\r
   // cuts init function\r
   void Init();\r
 \r
@@ -69,6 +79,7 @@ public:
   virtual Long64_t Merge(TCollection* list);\r
 \r
 private:\r
+  Bool_t fTriggerRequired; // trigger required  \r
   Bool_t fRecVertexRequired; // reconstructed event vertex required  \r
   Int_t fEventProcessType;   // select MC event process type (ND, SD, DD)\r
   Float_t fMinNContributors; // min. number of contributing vertex tracks\r
@@ -86,6 +97,9 @@ private:
   Float_t fSigmaMeanYv; // sigma mean Yv position\r
   Float_t fSigmaMeanZv; // sigma mean Zv position\r
  \r
+  Bool_t fRedoTPCVertex;         // redo vertex\r
+  Bool_t fUseBeamSpotConstraint; // use beam spot contraints  \r
+\r
   AlidNdPtEventCuts(const AlidNdPtEventCuts&); // not implemented\r
   AlidNdPtEventCuts& operator=(const AlidNdPtEventCuts&); // not implemented\r
 \r
index 95f500a..73f76d7 100644 (file)
 //____________________________________________________________________
 ClassImp(AlidNdPtHelper)
 
-Int_t AlidNdPtHelper::fgLastProcessType = -1;
-
-//____________________________________________________________________
-Bool_t AlidNdPtHelper::IsEventTriggered(const AliESD* aEsd, Trigger trigger)
-{
-  // see function with ULong64_t argument
-
-  ULong64_t triggerMask = aEsd->GetTriggerMask();
-  return IsEventTriggered(triggerMask, trigger);
-}
-
-//____________________________________________________________________
-Bool_t AlidNdPtHelper::IsEventTriggered(ULong64_t triggerMask, Trigger trigger)
-{
-  // check if the event was triggered
-  //
-  // this function needs the branch fTriggerMask
-  
-  // definitions from p-p.cfg
-  ULong64_t spdFO = (1 << 14);
-  ULong64_t v0left = (1 << 11);
-  ULong64_t v0right = (1 << 12);
-
-  switch (trigger)
-  {
-    case kMB1:
-    {
-      if (triggerMask & spdFO || ((triggerMask & v0left) || (triggerMask & v0right)))
-        return kTRUE;
-      break;
-    }
-    case kMB2:
-    {
-      if (triggerMask & spdFO && ((triggerMask & v0left) || (triggerMask & v0right)))
-        return kTRUE;
-      break;
-    }
-    case kSPDFASTOR:
-    {
-      if (triggerMask & spdFO)
-        return kTRUE;
-      break;
-    }
-  }
-
-  return kFALSE;
-}
-
-//____________________________________________________________________
-Bool_t AlidNdPtHelper::TestVertex(const AliESDVertex* vertex, AnalysisMode analysisMode, Bool_t debug)
-{
-  // Checks if a vertex meets the needed quality criteria
-  if(!vertex) return kFALSE;
-
-  Float_t requiredZResolution = -1;
-  if (analysisMode == kSPD || analysisMode == kTPCITS || analysisMode == kTPCSPDvtx)
-  {
-    requiredZResolution = 0.1;
-  }
-  else if (analysisMode == kTPC || analysisMode == kMCRec || 
-           analysisMode == kMCPion || analysisMode == kMCKaon || 
-          analysisMode == kMCProton || analysisMode ==kPlus || analysisMode ==kMinus)
-    requiredZResolution = 10.;
-
-  // check Ncontributors
-  if (vertex->GetNContributors() <= 0) {
-    if (debug){
-      Printf("AlidNdPtHelper::GetVertex: NContributors() <= 0: %d",vertex->GetNContributors());
-      Printf("AlidNdPtHelper::GetVertex: NIndices(): %d",vertex->GetNIndices());
-      vertex->Print();
-    }
-    return kFALSE;
-  }
-
-  // check resolution
-  Double_t zRes = vertex->GetZRes();
-  if (zRes == 0) {
-    Printf("AlidNdPtHelper::GetVertex: UNEXPECTED: resolution is 0.");
-    return kFALSE;
-  }
-
-  if (zRes > requiredZResolution) {
-    if (debug)
-      Printf("AlidNdPtHelper::TestVertex: Resolution too poor %f (required: %f", zRes, requiredZResolution);
-    return kFALSE;
-  }
-
-  return kTRUE;
-}
-
 //____________________________________________________________________
 const AliESDVertex* AlidNdPtHelper::GetVertex(AliESDEvent* aEsd, AlidNdPtEventCuts *evtCuts, AlidNdPtAcceptanceCuts *accCuts, AliESDtrackCuts *trackCuts, AnalysisMode analysisMode, Bool_t debug, Bool_t bRedoTPC, Bool_t bUseMeanVertex)
 {
@@ -184,18 +94,16 @@ const AliESDVertex* AlidNdPtHelper::GetVertex(AliESDEvent* aEsd, AlidNdPtEventCu
       if(bUseMeanVertex) {
         Double_t pos[3]={evtCuts->GetMeanXv(),evtCuts->GetMeanYv(),evtCuts->GetMeanZv()};
         Double_t err[3]={evtCuts->GetSigmaMeanXv(),evtCuts->GetSigmaMeanYv(),evtCuts->GetSigmaMeanZv()};
-        //printf("pos[0] %f, pos[1] %f, pos[2] %f \n", pos[0], pos[1], pos[2]);
         initVertex = new AliESDVertex(pos,err);
         vertexer.SetVtxStart(initVertex);
         vertexer.SetConstraintOn();
       }
 
-      //vertexer.SetTPCMode(Double_t dcacut=0.1, Double_t dcacutIter0=1.0, Double_t maxd0z0=5.0, Int_t minCls=10, Int_t mintrks=1, Double_t nsigma=3., Double_t mindetfitter=0.1, Double_t maxtgl=1.5, Double_t fidR=3., Double_t fidZ=30., Int_t finderAlgo=1, Int_t finderAlgoIter0=4);
-
       Double_t maxDCAr = accCuts->GetMaxDCAr();
       Double_t maxDCAz = accCuts->GetMaxDCAz();
       Int_t minTPCClust = trackCuts->GetMinNClusterTPC();
 
+      //vertexer.SetTPCMode(Double_t dcacut=0.1, Double_t dcacutIter0=1.0, Double_t maxd0z0=5.0, Int_t minCls=10, Int_t mintrks=1, Double_t nsigma=3., Double_t mindetfitter=0.1, Double_t maxtgl=1.5, Double_t fidR=3., Double_t fidZ=30., Int_t finderAlgo=1, Int_t finderAlgoIter0=4);
       vertexer.SetTPCMode(0.1,1.0,5.0,minTPCClust,1,3.,0.1,2.0,maxDCAr,maxDCAz,1,4);
 
       // TPC track preselection
@@ -218,6 +126,8 @@ const AliESDVertex* AlidNdPtHelper::GetVertex(AliESDEvent* aEsd, AlidNdPtEventCu
        }
       } 
       AliESDVertex *vTPC = vertexer.VertexForSelectedTracks(&array,id, kTRUE, kTRUE, bUseMeanVertex);
+      
+      // set recreated TPC vertex
       aEsd->SetPrimaryVertexTPC(vTPC);
 
       for (Int_t i=0; i<aEsd->GetNumberOfTracks(); i++) {
@@ -254,6 +164,48 @@ const AliESDVertex* AlidNdPtHelper::GetVertex(AliESDEvent* aEsd, AlidNdPtEventCu
 }
 
 //____________________________________________________________________
+Bool_t AlidNdPtHelper::TestRecVertex(const AliESDVertex* vertex, AnalysisMode analysisMode, Bool_t debug)
+{
+  // Checks if a vertex meets the needed quality criteria
+  if(!vertex) return kFALSE;
+
+  Float_t requiredZResolution = -1;
+  if (analysisMode == kSPD || analysisMode == kTPCITS || analysisMode == kTPCSPDvtx)
+  {
+    requiredZResolution = 0.1;
+  }
+  else if (analysisMode == kTPC || analysisMode == kMCRec || 
+           analysisMode == kMCPion || analysisMode == kMCKaon || 
+          analysisMode == kMCProton || analysisMode ==kPlus || analysisMode ==kMinus)
+    requiredZResolution = 10.;
+
+  // check Ncontributors
+  if (vertex->GetNContributors() <= 0) {
+    if (debug){
+      Printf("AlidNdPtHelper::GetVertex: NContributors() <= 0: %d",vertex->GetNContributors());
+      Printf("AlidNdPtHelper::GetVertex: NIndices(): %d",vertex->GetNIndices());
+      vertex->Print();
+    }
+    return kFALSE;
+  }
+
+  // check resolution
+  Double_t zRes = vertex->GetZRes();
+  if (zRes == 0) {
+    Printf("AlidNdPtHelper::GetVertex: UNEXPECTED: resolution is 0.");
+    return kFALSE;
+  }
+
+  if (zRes > requiredZResolution) {
+    if (debug)
+      Printf("AlidNdPtHelper::TestVertex: Resolution too poor %f (required: %f", zRes, requiredZResolution);
+    return kFALSE;
+  }
+
+  return kTRUE;
+}
+
+//____________________________________________________________________
 Bool_t AlidNdPtHelper::IsPrimaryParticle(AliStack* stack, Int_t idx, AnalysisMode analysisMode)
 {
 // check primary particles 
@@ -292,381 +244,7 @@ return prim;
 }
 
 //____________________________________________________________________
-Bool_t AlidNdPtHelper::IsPrimaryCharged(TParticle* aParticle, Int_t aTotalPrimaries, Bool_t adebug)
-{
-  //
-  // this function checks if a particle from the event generator (i.e. among the nPrim particles in the stack)
-  // shall be counted as a primary particle
-  //
-  // This function or a equivalent should be available in some common place of AliRoot
-  //
-  // WARNING: Call this function only for particles that are among the particles from the event generator!
-  // --> stack->Particle(id) with id < stack->GetNprimary()
-
-  // if the particle has a daughter primary, we do not want to count it
-  if (aParticle->GetFirstDaughter() != -1 && aParticle->GetFirstDaughter() < aTotalPrimaries)
-  {
-    if (adebug)
-      printf("Dropping particle because it has a daughter among the primaries.\n");
-    return kFALSE;
-  }
-
-  Int_t pdgCode = TMath::Abs(aParticle->GetPdgCode());
-  
-
-  // skip quarks and gluon
-  if (pdgCode <= 10 || pdgCode == 21)
-  {
-    if (adebug)
-      printf("Dropping particle because it is a quark or gluon.\n");
-    return kFALSE;
-  }
-
-  Int_t status = aParticle->GetStatusCode();
-  // skip non final state particles..
-  if(status!=1){
-    if (adebug)
-      printf("Dropping particle because it is not a final state particle.\n");
-    return kFALSE;
-  }
-
-  if (strcmp(aParticle->GetName(),"XXX") == 0)
-  {
-    Printf("WARNING: There is a particle named XXX (pdg code %d).", pdgCode);
-    return kFALSE;
-  }
-
-  TParticlePDG* pdgPart = aParticle->GetPDG();
-
-  if (strcmp(pdgPart->ParticleClass(),"Unknown") == 0)
-  {
-    Printf("WARNING: There is a particle with an unknown particle class (pdg code %d).", pdgCode);
-    return kFALSE;
-  }
-
-  if (pdgPart->Charge() == 0)
-  {
-    if (adebug)
-      printf("Dropping particle because it is not charged.\n");
-    return kFALSE;
-  }
-
-  return kTRUE;
-}
-
-//____________________________________________________________________
-void AlidNdPtHelper::CreateProjections(TH3* hist, Bool_t save)
-{
-  // create projections of 3d hists to all 2d combinations
-  // the histograms are not returned, just use them from memory or use this to create them in a file
-
-  TH1* proj = hist->Project3D("yx");
-  proj->SetXTitle(hist->GetXaxis()->GetTitle());
-  proj->SetYTitle(hist->GetYaxis()->GetTitle());
-  if (save)
-    proj->Write();
-
-  proj = hist->Project3D("zx");
-  proj->SetXTitle(hist->GetXaxis()->GetTitle());
-  proj->SetYTitle(hist->GetZaxis()->GetTitle());
-  if (save)
-    proj->Write();
-
-  proj = hist->Project3D("zy");
-  proj->SetXTitle(hist->GetYaxis()->GetTitle());
-  proj->SetYTitle(hist->GetZaxis()->GetTitle());
-  if (save)
-    proj->Write();
-}
-
-//____________________________________________________________________
-void AlidNdPtHelper::CreateDividedProjections(TH3* hist, TH3* hist2, const char* axis, Bool_t putErrors, Bool_t save)
-{
-  // create projections of the 3d hists divides them
-  // axis decides to which plane, if axis is 0 to all planes
-  // the histograms are not returned, just use them from memory or use this to create them in a file
-
-  if (axis == 0)
-  {
-    CreateDividedProjections(hist, hist2, "yx", putErrors, save);
-    CreateDividedProjections(hist, hist2, "zx", putErrors, save);
-    CreateDividedProjections(hist, hist2, "zy", putErrors, save);
-
-    return;
-  }
-
-  TH1* proj = hist->Project3D(axis);
-
-  if (strlen(axis) == 2)
-  {
-    proj->SetYTitle(GetAxisTitle(hist, axis[0]));
-    proj->SetXTitle(GetAxisTitle(hist, axis[1]));
-  }
-  else if (strlen(axis) == 1)
-    proj->SetXTitle(GetAxisTitle(hist, axis[0]));
-
-  TH1* proj2 = hist2->Project3D(axis);
-  if (strlen(axis) == 2)
-  {
-    proj2->SetYTitle(GetAxisTitle(hist2, axis[0]));
-    proj2->SetXTitle(GetAxisTitle(hist2, axis[1]));
-  }
-  else if (strlen(axis) == 1)
-    proj2->SetXTitle(GetAxisTitle(hist2, axis[0]));
-
-  TH1* division = dynamic_cast<TH1*> (proj->Clone(Form("%s_div_%s", proj->GetName(), proj2->GetName())));
-  //printf("doing axis: %s, x axis has %d %d bins, min %f %f max %f %f\n", axis, division->GetNbinsX(), proj2->GetNbinsX(), division->GetXaxis()->GetBinLowEdge(1), proj2->GetXaxis()->GetBinLowEdge(1), division->GetXaxis()->GetBinUpEdge(division->GetNbinsX()), proj2->GetXaxis()->GetBinUpEdge(proj2->GetNbinsX()));
-  //printf("doing axis: %s, y axis has %d %d bins, min %f %f max %f %f\n", axis, division->GetNbinsY(), proj2->GetNbinsY(), division->GetYaxis()->GetBinLowEdge(1), proj2->GetYaxis()->GetBinLowEdge(1), division->GetYaxis()->GetBinUpEdge(division->GetNbinsY()), proj2->GetYaxis()->GetBinUpEdge(proj2->GetNbinsY()));
-  division->Divide(proj, proj2, 1, 1, "B");
-  division->SetTitle(Form("%s divided %s", proj->GetTitle(), proj2->GetTitle()));
-
-  if (putErrors)
-  {
-    division->Sumw2();
-    if (division->GetDimension() == 1)
-    {
-      Int_t nBins = division->GetNbinsX();
-      for (Int_t i = 1; i <= nBins; ++i)
-        if (proj2->GetBinContent(i) != 0)
-          division->SetBinError(i, TMath::Sqrt(proj->GetBinContent(i)) / proj2->GetBinContent(i));
-    }
-    else if (division->GetDimension() == 2)
-    {
-      Int_t nBinsX = division->GetNbinsX();
-      Int_t nBinsY = division->GetNbinsY();
-      for (Int_t i = 1; i <= nBinsX; ++i)
-        for (Int_t j = 1; j <= nBinsY; ++j)
-          if (proj2->GetBinContent(i, j) != 0)
-            division->SetBinError(i, j, TMath::Sqrt(proj->GetBinContent(i, j)) / proj2->GetBinContent(i, j));
-    }
-  }
-
-  if (save)
-  {
-    proj->Write();
-    proj2->Write();
-    division->Write();
-  }
-}
-
-//____________________________________________________________________
-const char* AlidNdPtHelper::GetAxisTitle(TH3* hist, const char axis)
-{
-  // returns the title of the axis given in axis (x, y, z)
-
-  if (axis == 'x')
-    return hist->GetXaxis()->GetTitle();
-  else if (axis == 'y')
-    return hist->GetYaxis()->GetTitle();
-  else if (axis == 'z')
-    return hist->GetZaxis()->GetTitle();
-
-  return 0;
-}
-
-
-AlidNdPtHelper::MCProcessType AlidNdPtHelper::GetPythiaEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug) {
-
-  AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(aHeader);
-
-  if (!pythiaGenHeader) {
-    printf("AlidNdPtHelper::GetProcessType : Unknown gen Header type). \n");
-    return kInvalidProcess;
-  }
-
-
-  Int_t pythiaType = pythiaGenHeader->ProcessType();
-  fgLastProcessType = pythiaType;
-  MCProcessType globalType = kInvalidProcess;  
-
-
-  if (adebug) {
-    printf("AlidNdPtHelper::GetProcessType : Pythia process type found: %d \n",pythiaType);
-  }
-
-
-  if(pythiaType==92||pythiaType==93){
-    globalType = kSD;
-  }
-  else if(pythiaType==94){
-    globalType = kDD;
-  }
-  //else if(pythiaType != 91){ // also exclude elastic to be sure... CKB??
-  else {
-    globalType = kND;
-  }
-  return globalType;
-}
-
-
-AlidNdPtHelper::MCProcessType AlidNdPtHelper::GetDPMjetEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug) {
-  //
-  // get the process type of the event.
-  //
-
-  // can only read pythia headers, either directly or from cocktalil header
-  AliGenDPMjetEventHeader* dpmJetGenHeader = dynamic_cast<AliGenDPMjetEventHeader*>(aHeader);
-
-  if (!dpmJetGenHeader) {
-    printf("AlidNdPtHelper::GetDPMjetProcessType : Unknown header type (not DPMjet or). \n");
-    return kInvalidProcess;
-  }
-
-  Int_t dpmJetType = dpmJetGenHeader->ProcessType();
-  fgLastProcessType = dpmJetType;
-  MCProcessType globalType = kInvalidProcess;  
-
-
-  if (adebug) {
-    printf("AlidNdPtHelper::GetDPMJetProcessType : DPMJet process type found: %d \n",dpmJetType);
-  }
-
-
-  if(dpmJetType == 1){ // this is explicitly inelastic
-    globalType = kND;
-  }  
-  else if(dpmJetType==5||dpmJetType==6){
-    globalType = kSD;
-  }
-  else if(dpmJetType==7||dpmJetType==4){// DD and double pomeron
-    globalType = kDD;
-  }
-  return globalType;
-}
-
-
-AlidNdPtHelper::MCProcessType AlidNdPtHelper::GetEventProcessType(AliHeader* aHeader, Bool_t adebug) {
-  //
-  // get the process type of the event.
-  //
-
-
-  // Check for simple headers first
-
-  AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(aHeader->GenEventHeader());
-  if (pythiaGenHeader) {
-    return GetPythiaEventProcessType(pythiaGenHeader,adebug);
-  }
-
-  AliGenDPMjetEventHeader* dpmJetGenHeader = dynamic_cast<AliGenDPMjetEventHeader*>(aHeader->GenEventHeader());
-  if (dpmJetGenHeader) {
-    return GetDPMjetEventProcessType(dpmJetGenHeader,adebug);
-  }
-  
-
-  // check for cocktail
-
-  AliGenCocktailEventHeader* genCocktailHeader = dynamic_cast<AliGenCocktailEventHeader*>(aHeader->GenEventHeader());
-  if (!genCocktailHeader) {
-    printf("AlidNdPtHelper::GetProcessType : Unknown header type (not Pythia or Cocktail). \n");
-    return kInvalidProcess;
-  }
-
-  TList* headerList = genCocktailHeader->GetHeaders();
-  if (!headerList) {
-    return kInvalidProcess;
-  }
-
-  for (Int_t i=0; i<headerList->GetEntries(); i++) {
-
-    pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(headerList->At(i));
-    if (pythiaGenHeader) {
-      return GetPythiaEventProcessType(pythiaGenHeader,adebug);
-    }
-
-    dpmJetGenHeader = dynamic_cast<AliGenDPMjetEventHeader*>(headerList->At(i));
-    if (dpmJetGenHeader) {
-      return GetDPMjetEventProcessType(dpmJetGenHeader,adebug);
-    }
-  }
-  return kInvalidProcess;
-}
-
-
-
-//____________________________________________________________________
-TParticle* AlidNdPtHelper::FindPrimaryMother(AliStack* stack, Int_t label)
-{
-  //
-  // Finds the first mother among the primary particles of the particle identified by <label>,
-  // i.e. the primary that "caused" this particle
-  //
-
-  Int_t motherLabel = FindPrimaryMotherLabel(stack, label);
-  if (motherLabel < 0)
-    return 0;
-
-  return stack->Particle(motherLabel);
-}
-
-//____________________________________________________________________
-Int_t AlidNdPtHelper::FindPrimaryMotherLabel(AliStack* stack, Int_t label)
-{
-  //
-  // Finds the first mother among the primary particles of the particle identified by <label>,
-  // i.e. the primary that "caused" this particle
-  //
-  // returns its label
-  //
-
-  Int_t nPrim  = stack->GetNprimary();
-
-  while (label >= nPrim)
-  {
-    //printf("Particle %d (pdg %d) is not a primary. Let's check its mother %d\n", label, mother->GetPdgCode(), mother->GetMother(0));
-
-    TParticle* particle = stack->Particle(label);
-    if (!particle)
-    {
-      AliDebugGeneral("FindPrimaryMother", AliLog::kError, Form("UNEXPECTED: particle with label %d not found in stack.", label));
-      return -1;
-    }
-    // find mother
-    if (particle->GetMother(0) < 0)
-    {
-      AliDebugGeneral("FindPrimaryMother", AliLog::kError, Form("UNEXPECTED: Could not find mother of secondary particle %d.", label));
-      return -1;
-    }
-
-    label = particle->GetMother(0);
-  }
-
-  return label;
-}
-
-//____________________________________________________________________
-void AlidNdPtHelper::NormalizeToBinWidth(TH1* hist)
-{
-  //
-  // normalizes a 1-d histogram to its bin width
-  //
-
-  for (Int_t i=1; i<=hist->GetNbinsX(); ++i)
-  {
-    hist->SetBinContent(i, hist->GetBinContent(i) / hist->GetBinWidth(i));
-    hist->SetBinError(i, hist->GetBinError(i) / hist->GetBinWidth(i));
-  }
-}
-
-//____________________________________________________________________
-void AlidNdPtHelper::NormalizeToBinWidth(TH2* hist)
-{
-  //
-  // normalizes a 2-d histogram to its bin width (x width * y width)
-  //
-
-  for (Int_t i=1; i<=hist->GetNbinsX(); ++i)
-    for (Int_t j=1; j<=hist->GetNbinsY(); ++j)
-    {
-      Double_t factor = hist->GetXaxis()->GetBinWidth(i) * hist->GetYaxis()->GetBinWidth(j);
-      hist->SetBinContent(i, j, hist->GetBinContent(i, j) / factor);
-      hist->SetBinError(i, j, hist->GetBinError(i, j) / factor);
-    }
-}
-
-//____________________________________________________________________
-void AlidNdPtHelper::PrintConf(AnalysisMode analysisMode, Trigger trigger)
+void AlidNdPtHelper::PrintConf(AnalysisMode analysisMode, AliPWG0Helper::Trigger trigger)
 {
   //
   // Prints the given configuration
@@ -692,9 +270,21 @@ void AlidNdPtHelper::PrintConf(AnalysisMode analysisMode, Trigger trigger)
 
   switch (trigger)
   {
-    case kMB1 : str += "MB1"; break;
-    case kMB2 : str += "MB2"; break;
-    case kSPDFASTOR : str += "SPD FASTOR"; break;
+    case AliPWG0Helper::kAcceptAll : str += "kAcceptAll"; break;
+    case AliPWG0Helper::kMB1 : str += "MB1"; break;
+    case AliPWG0Helper::kMB2 : str += "MB2"; break;
+    case AliPWG0Helper::kMB3 : str += "MB3"; break;
+    case AliPWG0Helper::kSPDGFO : str += "SPDGFO"; break;
+    case AliPWG0Helper::kV0A : str += "V0A"; break;
+    case AliPWG0Helper::kV0C : str += "V0C"; break;
+    case AliPWG0Helper::kZDC : str += "ZDC"; break;
+    case AliPWG0Helper::kZDCA : str += "ZDCA"; break;
+    case AliPWG0Helper::kZDCC : str += "ZDCC"; break;
+    case AliPWG0Helper::kFMDA : str += "FMDA"; break;
+    case AliPWG0Helper::kFMDC : str += "FMDC"; break;
+    case AliPWG0Helper::kFPANY : str += "FPANY"; break;
+    case AliPWG0Helper::kStartOfFlags : str += "StartOfFlags"; break;
+    case AliPWG0Helper::kOfflineFlag  : str += "kOfflineFlag"; break;
   }
 
   str += " <<<<";
@@ -723,6 +313,10 @@ return pid;
 //_____________________________________________________________________________
 TH1F* AlidNdPtHelper::CreateResHisto(TH2F* hRes2, TH1F **phMean, Int_t integ,  Bool_t drawBinFits, Int_t minHistEntries)
 {
+//
+// Create mean and resolution 
+// histograms
+//
   TVirtualPad* currentPad = gPad;
   TAxis* axis = hRes2->GetXaxis();
   Int_t nBins = axis->GetNbins();
@@ -830,7 +424,6 @@ TH1F* AlidNdPtHelper::MakeResol(TH2F * his, Int_t integ, Bool_t type, Bool_t dra
   
      TH1F *hisr=0, *hism=0;
      if (!gPad) new TCanvas;
-         //hisr = AliTreeDraw::CreateResHistoI(his,&hism,integ);
          hisr = CreateResHisto(his,&hism,integ,drawBins,minHistEntries);
          if (type) return hism;
          else return hisr;
@@ -839,55 +432,7 @@ return hisr;
 }
 
 //_____________________________________________________________________________
-AliESDtrack* AlidNdPtHelper::GetTPCOnlyTrack(AliESDEvent* esd, const AliESDVertex *vtx, Int_t iTrack)
-{
-  // creates a TPC only track from the given esd track
-  // the track has to be deleted by the user
-  //
-  // NB. most of the functionality to get a TPC only track from an ESD track is in AliESDtrack, where it should be
-  // there are only missing propagations here that are needed for old data
-  // this function will therefore become obsolete
-  //
-  // adapted from code provided by CKB
-
-  // no vertex
-  if (!vtx) return 0;  
-  if(!vtx->GetStatus()) return 0; 
-
-  AliESDtrack* track = esd->GetTrack(iTrack);
-  if (!track)
-    return 0;
-
-  AliESDtrack *tpcTrack = new AliESDtrack();
-
-  // This should have been done during the reconstruction
-  // fixed by Juri in r26675
-  // but recalculate for older data CKB
-  Float_t p[2],cov[3];
-  track->GetImpactParametersTPC(p,cov);
-  if(p[0]==0&&p[1]==0)
-    //track->RelateToVertexTPC(esd->GetPrimaryVertexTPC(),esd->GetMagneticField(),kVeryBig);
-    track->RelateToVertexTPC(vtx,esd->GetMagneticField(),kVeryBig);
-  // BKC
-
-  // only true if we have a tpc track
-  if (!track->FillTPCOnlyTrack(*tpcTrack))
-  {
-    delete tpcTrack;
-    return 0;
-  }
-
-  // propagate to Vertex
-  // not needed for normal reconstructed ESDs...
-  // Double_t pTPC[2],covTPC[3];
-  //tpcTrack->PropagateToDCA(esd->GetPrimaryVertexTPC(), esd->GetMagneticField(), 10000,  pTPC, covTPC);
-  //tpcTrack->PropagateToDCA(vtx, esd->GetMagneticField(), 10000,  pTPC, covTPC);
-
-  return tpcTrack;
-}
-
-//_____________________________________________________________________________
-TObjArray* AlidNdPtHelper::GetAllChargedTracks(AliESDEvent *esdEvent, const AliESDVertex *vtx, AnalysisMode analysisMode)
+TObjArray* AlidNdPtHelper::GetAllChargedTracks(AliESDEvent *esdEvent, AnalysisMode analysisMode)
 {
   //
   // all charged TPC particles 
@@ -898,17 +443,22 @@ TObjArray* AlidNdPtHelper::GetAllChargedTracks(AliESDEvent *esdEvent, const AliE
   AliESDtrack *track=0;
   for (Int_t iTrack = 0; iTrack < esdEvent->GetNumberOfTracks(); iTrack++) 
   { 
-    if(analysisMode == AlidNdPtHelper::kTPC || analysisMode == AlidNdPtHelper::kTPCSPDvtx || analysisMode == AlidNdPtHelper::kMCRec || analysisMode == kMCPion || analysisMode == kMCKaon || analysisMode == kMCProton || analysisMode ==kPlus || analysisMode ==kMinus) { 
+    if(analysisMode == AlidNdPtHelper::kTPC || analysisMode == AlidNdPtHelper::kTPCSPDvtx || 
+       analysisMode == AlidNdPtHelper::kMCRec || analysisMode == kMCPion || analysisMode == kMCKaon || 
+       analysisMode == kMCProton || analysisMode ==kPlus || analysisMode ==kMinus) { 
+
       // track must be deleted by the user 
-      track = GetTPCOnlyTrack(esdEvent,vtx,iTrack);
-      //track = AliESDtrackCuts::GetTPCOnlyTrack(esdEvent,iTrack);
+      track = AliESDtrackCuts::GetTPCOnlyTrack(esdEvent,iTrack);
     } else {
       track=esdEvent->GetTrack(iTrack);
     }
     if(!track) continue;
 
     if(track->Charge()==0) { 
-      if(analysisMode == AlidNdPtHelper::kTPC || analysisMode == AlidNdPtHelper::kTPCSPDvtx ||  analysisMode == AlidNdPtHelper::kMCRec || analysisMode == kMCPion || analysisMode == kMCKaon || analysisMode == kMCProton || analysisMode ==kPlus || analysisMode ==kMinus) {
+      if(analysisMode == AlidNdPtHelper::kTPC || analysisMode == AlidNdPtHelper::kTPCSPDvtx ||  
+         analysisMode == AlidNdPtHelper::kMCRec || analysisMode == kMCPion || analysisMode == kMCKaon || 
+        analysisMode == kMCProton || analysisMode ==kPlus || analysisMode ==kMinus) {
+
         delete track; continue; 
       } else {
         continue;
@@ -917,7 +467,13 @@ TObjArray* AlidNdPtHelper::GetAllChargedTracks(AliESDEvent *esdEvent, const AliE
 
     allTracks->Add(track);
   }
-  if(analysisMode == AlidNdPtHelper::kTPC || analysisMode == AlidNdPtHelper::kTPCSPDvtx || analysisMode == AlidNdPtHelper::kMCRec || analysisMode == kMCPion || analysisMode == kMCKaon || analysisMode == kMCProton || analysisMode ==kPlus || analysisMode ==kMinus) allTracks->SetOwner(kTRUE);
+
+  if(analysisMode == AlidNdPtHelper::kTPC || analysisMode == AlidNdPtHelper::kTPCSPDvtx || 
+     analysisMode == AlidNdPtHelper::kMCRec || analysisMode == kMCPion || analysisMode == kMCKaon || 
+     analysisMode == kMCProton || analysisMode ==kPlus || analysisMode ==kMinus) {
+     
+     allTracks->SetOwner(kTRUE);
+  }
 
 return allTracks;
 }
@@ -1345,50 +901,55 @@ return hist;
 }
 
 //_____________________________________________________________________________
-const AliESDVertex* AlidNdPtHelper::GetTPCVertexZ(AliESDEvent* esdEvent, Float_t sigmaXYcut, Float_t distXYcut, Float_t distZcut, Int_t nclCut, Float_t fraction, Int_t ntracksMin){
+const AliESDVertex* AlidNdPtHelper::GetTPCVertexZ(AliESDEvent* esdEvent, AlidNdPtEventCuts *evtCuts, AlidNdPtAcceptanceCuts *accCuts, AliESDtrackCuts *trackCuts, Float_t fraction, Int_t ntracksMin){
   //
   // TPC Z vertexer
   //
-  Double_t vtxpos[3]={0.,0.,0.};
-  Double_t vtxsigma[3]={.2,.2,100.};
+  if(!esdEvent)
+  { 
+    ::Error("AlidNdPtHelper::GetTPCVertexZ()","cuts not available");
+    return NULL;  
+  }
+
+  if(!evtCuts || !accCuts || !trackCuts) 
+  { 
+    ::Error("AlidNdPtHelper::GetTPCVertexZ()","cuts not available");
+    return NULL;  
+  }
+
+  Double_t vtxpos[3]={evtCuts->GetMeanXv(),evtCuts->GetMeanYv(),evtCuts->GetMeanZv()};
+  Double_t vtxsigma[3]={evtCuts->GetSigmaMeanXv(),evtCuts->GetSigmaMeanYv(),evtCuts->GetSigmaMeanZv()};
   AliESDVertex vtx0(vtxpos,vtxsigma);
+
+  Double_t maxDCAr = accCuts->GetMaxDCAr();
+  Double_t maxDCAz = accCuts->GetMaxDCAz();
+  Int_t minTPCClust = trackCuts->GetMinNClusterTPC();
+
   //
   Int_t ntracks = esdEvent->GetNumberOfTracks();
   TVectorD ztrack(ntracks);
-  //Float_t dcar, dcaz;
-  //Float_t point[2],cov[3];
   Double_t dca[2],cov[3];
   Int_t counter=0;
   for (Int_t i=0;i <ntracks; i++){
     AliESDtrack *t = esdEvent->GetTrack(i);
     if (!t) continue;
     if (!t->GetTPCInnerParam()) continue;
-    if (t->GetTPCNcls()<nclCut) continue;
+    if (t->GetTPCNcls()<minTPCClust) continue;
     //
     AliExternalTrackParam  *tpcTrack  = new AliExternalTrackParam(*(t->GetTPCInnerParam()));
     if (!tpcTrack->PropagateToDCA(&vtx0,esdEvent->GetMagneticField(),100.,dca,cov)) continue;
 
     //
-    if (TMath::Abs(dca[0])>distXYcut) continue;
-    if (TMath::Sqrt(cov[0])>sigmaXYcut) continue;    
-    if (TMath::Abs(tpcTrack->GetZ())>distZcut) continue;
+    if (TMath::Abs(dca[0])>maxDCAr) continue;
+    //if (TMath::Sqrt(cov[0])>sigmaXYcut) continue;    
+    if (TMath::Abs(tpcTrack->GetZ())>maxDCAz) continue;
 
-    /*
-    t->GetImpactParametersTPC(dcar,dcaz);
-    if (TMath::Abs(dcar)>distXYcut) continue;
-    //
-    t->GetImpactParametersTPC(point,cov);
-    if (TMath::Sqrt(cov[0])>sigmaXYcut) continue;    
-    //
-    AliExternalTrackParam  tpcTrack(*(t->GetTPCInnerParam()));
-    if (!tpcTrack.PropagateToDCA(&vtx0,esdEvent->GetMagneticField(), 100)) continue;
-    if (TMath::Abs(tpcTrack.GetZ())>distZcut) continue;
-    */
     ztrack[counter]=tpcTrack->GetZ();
     counter++;    
 
     if(tpcTrack) delete tpcTrack;
   }
+
   //
   // Find LTM z position
   //
index c1c9cae..dbd68f5 100644 (file)
@@ -1,11 +1,11 @@
-/* $Id: AlidNdPtHelper.h 28655 2008-09-10 12:57:42Z jgrosseo $ */
-
 #ifndef ALIDNDPTHELPER_H
 #define ALIDNDPTHELPER_H
 
 //
-// static helper functions
-// origin PWG0 (Jan Fiete, CKB) and extended by Jacek Otwinowski (JO)
+// static dNdPt helper functions
+//
+// Origin: Jan Fiete Grosse-Oetringhaus
+// Modified and Extended: Jacek Otwinowski 19/11/2009
 //
 
 #include <TObject.h>
@@ -32,46 +32,21 @@ class AliESDtrackCuts;
 class AlidNdPtAcceptanceCuts;
 class AlidNdPtEventCuts;
 
+#include "AliPWG0Helper.h"
 #include "THnSparse.h"
+
 class AlidNdPtHelper : public TObject
 {
   public:
-    enum Trigger { kMB1 = 0, kMB2, kSPDFASTOR }; // definition from ALICE-INT-2005-025
     enum AnalysisMode { kInvalid = -1, kSPD = 0, kTPC, kTPCITS, kTPCSPDvtx, kMCRec, kMCPion, kMCKaon, kMCProton, kPlus, kMinus };
-    // in case we want to use bitmaps...
-    // kDiffractiveProcess is artifficial
-    enum MCProcessType { kInvalidProcess = -1, kND = 0x1, kDD = 0x2, kSD = 0x4, kDiffractiveProcess = 0x9 }; 
-
-    static Bool_t IsEventTriggered(const AliESD* aEsd, Trigger trigger = kMB2);
-    static Bool_t IsEventTriggered(ULong64_t triggerMask, Trigger trigger = kMB2);
     static const AliESDVertex* GetVertex(AliESDEvent* aEsd, AlidNdPtEventCuts *evtCuts, AlidNdPtAcceptanceCuts *accCuts, AliESDtrackCuts *trackCuts,  AnalysisMode analysisMethod, Bool_t debug = kFALSE,Bool_t bRedoTPC = kFALSE, Bool_t bUseMeanVertex = kFALSE);
-    //static const AliESDVertex* GetVertex(AliESDEvent* aEsd, AnalysisMode analysisMethod, Bool_t debug = kFALSE,Bool_t bRedoTPC = kFALSE, Bool_t bUseMeanVertex = kFALSE);
 
-    static const AliESDVertex* GetTPCVertexZ(AliESDEvent* aEsd, Float_t sigmaXYcut=3., Float_t distXYcut=3., Float_t distZcut=30., Int_t nclCut=50, Float_t fraction=0.8, Int_t ntracksMin=2);
+    static const AliESDVertex* GetTPCVertexZ(AliESDEvent* aEsd, AlidNdPtEventCuts *evtCuts, AlidNdPtAcceptanceCuts *accCuts, AliESDtrackCuts *trackCuts, Float_t fraction=0.8, Int_t ntracksMin=2);
 
-    static Bool_t TestVertex(const AliESDVertex* vertex, AnalysisMode analysisMode, Bool_t debug = kFALSE);
+    static Bool_t TestRecVertex(const AliESDVertex* vertex, AnalysisMode analysisMode, Bool_t debug = kFALSE);
 
-    static Bool_t IsPrimaryCharged(TParticle* aParticle, Int_t aTotalPrimaries, Bool_t adebug = kFALSE);
     static Bool_t IsPrimaryParticle(AliStack *stack, Int_t idx, AnalysisMode analysisMode);
-
-    static AlidNdPtHelper::MCProcessType GetEventProcessType(AliHeader* aHeader, Bool_t adebug = kFALSE);
-    static AlidNdPtHelper::MCProcessType GetPythiaEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug = kFALSE);
-    static AlidNdPtHelper::MCProcessType GetDPMjetEventProcessType(AliGenEventHeader* aHeader, Bool_t adebug = kFALSE);
-    static Int_t GetLastProcessType() { return fgLastProcessType; }
-
-    static TParticle* FindPrimaryMother(AliStack* stack, Int_t label);
-    static Int_t FindPrimaryMotherLabel(AliStack* stack, Int_t label);
-
-    static void CreateProjections(TH3* hist, Bool_t save = kFALSE);
-    static void CreateDividedProjections(TH3* hist, TH3* hist2, const char* axis = 0, Bool_t putErrors = kFALSE, Bool_t save = kFALSE);
-    static const char* GetAxisTitle(TH3* hist, const char axis);
-
-    static void NormalizeToBinWidth(TH1* hist);
-    static void NormalizeToBinWidth(TH2* hist);
-
-    static void PrintConf(AnalysisMode analysisMode, Trigger trigger);
-
-    // added by JO
+    static void PrintConf(AnalysisMode analysisMode, AliPWG0Helper::Trigger trigger);
     static Int_t ConvertPdgToPid(TParticle *particle);
 
     enum OutputObject { kInvalidObject = -1, kCutAnalysis = 0, kAnalysis, kCorrection, kSystematics };
@@ -79,9 +54,7 @@ class AlidNdPtHelper : public TObject
     enum EventObject  { kInvalidEventObject = -1, kAllEvents = 0, kTriggeredEvents, kAccEvents, kRecEvents, kMCEvents };
     enum CutSteps     { kCutSteps = 3 };
 
-    //static TObjArray *GetAllChargedTracks(AliESDEvent *esdEvent, AnalysisMode analysisMode);
-    static TObjArray *GetAllChargedTracks(AliESDEvent *esdEvent, const AliESDVertex *vtx, AnalysisMode analysisMode);
-    static AliESDtrack* GetTPCOnlyTrack(AliESDEvent* esd, const AliESDVertex *vtx, Int_t iTrack);
+    static TObjArray *GetAllChargedTracks(AliESDEvent *esdEvent, AnalysisMode analysisMode);
 
     static TH1F* MakeResol(TH2F * his, Int_t integ, Bool_t type, Bool_t drawBins, Int_t minHistEntries);
     static TH1F* CreateResHisto(TH2F* hRes2, TH1F **phMean, Int_t integ,  Bool_t drawBinFits, Int_t minHistEntries);
@@ -109,9 +82,6 @@ class AlidNdPtHelper : public TObject
     static TH2* GenerateContCorrMatrix(TH2 *hist1, TH2 *hist2, char *name);
     static TH1* GenerateContCorrMatrix(TH1 *hist1, TH1 *hist2, char *name);
 
-  protected:
-    static Int_t fgLastProcessType;    // stores the raw value of the last process type extracnted
     ClassDef(AlidNdPtHelper, 0);
 
   private:
index 0e81c59..df18662 100644 (file)
@@ -7,12 +7,13 @@ void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outpu
     //TProof::Open(""); // 1. Enter your username here
     
     TProofMgr * proofmgr = TProof::Mgr("lxialpod2.gsi.de:21001");
+    //TProofMgr * proofmgr = TProof::Mgr("lxial39.gsi.de:21001");
     TProof * proof = proofmgr->CreateSession();
     proof->SetParameter("PROOF_MaxSlavesPerNode", (Long_t)1000);
 
     // -- Load AliRoot Libraries
     gROOT->LoadMacro("ProofEnableAliRootGSI.C");
-    ProofEnableAliRoot("/u/jacek/alice/AliRoot/trunk");
+    ProofEnableAliRootGSI("/u/jacek/alice/AliRoot/trunk");
   }
 
   // Swtich off all AliInfo (too much output!!!)
@@ -28,7 +29,7 @@ void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outpu
   evtCuts->SetZvRange(-zvWindow,zvWindow);
   evtCuts->SetMeanXYZv(0.0,0.0,0.0);
   evtCuts->SetSigmaMeanXYZv(1.0,1.0,10.0);
-  //evtCuts->SetTriggerRequired(kFALSE);
+  evtCuts->SetTriggerRequired(kTRUE);
 
   // Create geom. acceptance cuts
   AlidNdPtAcceptanceCuts *accCuts = new AlidNdPtAcceptanceCuts("AlidNdPtAcceptanceCuts","Geom. acceptance cuts");
@@ -39,7 +40,7 @@ void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outpu
 
   // Create standard esd track cuts
   gROOT->LoadMacro("CreatedNdPtTrackCuts.C");
-  AliESDtrackCuts* esdTrackCuts = CreateTrackCuts(cutMode);
+  AliESDtrackCuts* esdTrackCuts = CreatedNdPtTrackCuts(cutMode);
   if (!esdTrackCuts) {
     printf("ERROR: esdTrackCuts could not be created\n");
     return;
@@ -61,7 +62,7 @@ void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outpu
     fdNdPtCutAnalysis->SetAcceptanceCuts(accCuts);
     fdNdPtCutAnalysis->SetTrackCuts(esdTrackCuts);
     fdNdPtCutAnalysis->SetAnalysisMode(analysisMode); 
-    fdNdPtCutAnalysis->SetTrigger(AlidNdPtHelper::kMB1); 
+    fdNdPtCutAnalysis->SetTrigger(AliPWG0Helper::kMB1); 
     if (bUseMCInfo) fdNdPtCutAnalysis->SetUseMCInfo(kTRUE);
 
     task->AddAnalysisObject( fdNdPtCutAnalysis );
@@ -75,7 +76,7 @@ void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outpu
     fdNdPtAnalysis->SetAcceptanceCuts(accCuts);
     fdNdPtAnalysis->SetTrackCuts(esdTrackCuts);
     fdNdPtAnalysis->SetAnalysisMode(analysisMode); 
-    fdNdPtAnalysis->SetTrigger(AlidNdPtHelper::kMB1); 
+    fdNdPtAnalysis->SetTrigger(AliPWG0Helper::kMB1); 
     if (bUseMCInfo) fdNdPtAnalysis->SetUseMCInfo(kTRUE);
 
     fdNdPtAnalysis->SetHistogramsOn(kTRUE);
@@ -92,7 +93,7 @@ void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outpu
     fdNdPtCorrection->SetAcceptanceCuts(accCuts);
     fdNdPtCorrection->SetTrackCuts(esdTrackCuts);
     fdNdPtCorrection->SetAnalysisMode(analysisMode); 
-    fdNdPtCorrection->SetTrigger(AlidNdPtHelper::kMB1); 
+    fdNdPtCorrection->SetTrigger(AliPWG0Helper::kMB1); 
     if (bUseMCInfo) fdNdPtCorrection->SetUseMCInfo(kTRUE);
 
     task->AddAnalysisObject( fdNdPtCorrection );
@@ -123,7 +124,6 @@ void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outpu
   }
 
   // Create containers for input
-  //AliAnalysisDataContainer *cinput = mgr->CreateContainer("cchain", TChain::Class(), AliAnalysisManager::kInputContainer);
   AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
   mgr->ConnectInput(task, 0, cinput);