-- modified cut analysis for Pb-Pb
authorjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 May 2011 07:18:37 +0000 (07:18 +0000)
committerjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 May 2011 07:18:37 +0000 (07:18 +0000)
M    dNdPt/AlidNdPtCutAnalysisPbPb.cxx
M    dNdPt/AlidNdPtCutAnalysisPbPb.h
-- create log axis functionality
M    dNdPt/AlidNdPt.h
M    dNdPt/AlidNdPt.cxx

PWG0/dNdPt/AlidNdPt.cxx
PWG0/dNdPt/AlidNdPt.h
PWG0/dNdPt/AlidNdPtCutAnalysisPbPb.cxx
PWG0/dNdPt/AlidNdPtCutAnalysisPbPb.h

index 38b66ce..4954a54 100644 (file)
@@ -91,3 +91,22 @@ AlidNdPt::~AlidNdPt() {
   if(fPhysicsSelection) delete fPhysicsSelection; fPhysicsSelection=NULL;\r
   if(fdNdPtBackgroundCuts) delete fdNdPtBackgroundCuts; fdNdPtBackgroundCuts=NULL;\r
 }\r
+\r
+//_____________________________________________________________________________\r
+Double_t * AlidNdPt::CreateLogAxis(Int_t nbins, Double_t xmin, Double_t xmax) {\r
+  // retun pointer to the array with log axis\r
+  // it is user responsibility to delete the array\r
\r
+  Double_t logxmin = TMath::Log10(xmin);\r
+  Double_t logxmax = TMath::Log10(xmax);\r
+  Double_t binwidth = (logxmax-logxmin)/nbins;\r
+  \r
+  Double_t *xbins =  new Double_t[nbins+1];\r
+\r
+  xbins[0] = xmin;\r
+  for (Int_t i=1;i<=nbins;i++) {\r
+    xbins[i] = xmin + TMath::Power(10,logxmin+i*binwidth);\r
+  }\r
+\r
+return xbins;\r
+}\r
index a6a0e72..3050fd7 100644 (file)
@@ -68,6 +68,7 @@ public:
   AlidNdPtHelper::ParticleMode GetParticleMode() const          { return fParticleMode; }
   AliPhysicsSelection* GetPhysicsTriggerSelection() const       { return fPhysicsSelection; }
   AlidNdPtBackgroundCuts* GetBackgroundCuts() const             { return fdNdPtBackgroundCuts; }
+  Double_t* CreateLogAxis(Int_t nbins, Double_t xmin, Double_t xmax);
 
 private:
 
@@ -88,7 +89,7 @@ private:
   AliPhysicsSelection* fPhysicsSelection; // physics trigger selection class
   AlidNdPtBackgroundCuts *fdNdPtBackgroundCuts; // background cuts (cosmics and splitted tracks)
 
-  ClassDef(AlidNdPt,2);
+  ClassDef(AlidNdPt,3);
 };
 
 #endif
index 9d9306c..2d226a2 100644 (file)
@@ -30,6 +30,8 @@
 \r
 #include "AliHeader.h"  \r
 #include "AliGenEventHeader.h"  \r
+#include "AliInputEventHandler.h"  \r
+#include "AliCentrality.h"  \r
 #include "AliStack.h"  \r
 #include "AliESDEvent.h"  \r
 #include "AliMCEvent.h"  \r
@@ -58,7 +60,8 @@ ClassImp(AlidNdPtCutAnalysisPbPb)
   fRecEventHist(0),\r
   fMCEventHist(0),\r
   fRecMCEventHist(0),\r
-  fRecMCTrackHist(0)\r
+  fRecMCTrackHist(0),\r
+  fCentralityEstimator(0)\r
 {\r
   // default constructor\r
   Init();\r
@@ -71,7 +74,8 @@ AlidNdPtCutAnalysisPbPb::AlidNdPtCutAnalysisPbPb(Char_t* name, Char_t* title): A
   fRecEventHist(0),\r
   fMCEventHist(0),\r
   fRecMCEventHist(0),\r
-  fRecMCTrackHist(0)\r
+  fRecMCTrackHist(0),\r
+  fCentralityEstimator(0)\r
 {\r
   // constructor\r
   Init();\r
@@ -94,11 +98,22 @@ void AlidNdPtCutAnalysisPbPb::Init(){
   //\r
   // Init histograms\r
   //\r
-  const Int_t ptNbins = 58; \r
-  const Double_t ptMin = 0.; \r
-  const Double_t ptMax = 20.; \r
-\r
+  //const Int_t ptNbins = 58; \r
+  //const Double_t ptMin = 0.; \r
+  //const Double_t ptMax = 20.; \r
+  /*\r
   Double_t binsPt[ptNbins+1] = {0.,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.6,3.8,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,18.0, 20.};\r
+  */\r
+\r
+  // set pt bins\r
+  const Int_t ptNbins = 50;\r
+  const Double_t ptMin = 1.e-2, ptMax = 50.;\r
+  Double_t *binsPt = CreateLogAxis(ptNbins,ptMin,ptMax);\r
+\r
+  // centrality bins\r
+  const Int_t centrNbins = 3;\r
+  const Double_t centrMin = 0, centrMax = 1;\r
+  Double_t binsCentr[centrNbins+1] = {0.0, 0.2, 0.5, 1.0};\r
 \r
   // \r
   Int_t binsEventCount[2]={2,2};\r
@@ -110,11 +125,11 @@ void AlidNdPtCutAnalysisPbPb::Init(){
   fEventCount->Sumw2();\r
 \r
   //Xv:Yv:Zv:ResZv:Mult\r
-  Double_t kFact = 1.0;\r
+  Double_t kFact = 0.1;\r
 \r
   Int_t binsRecEventHist[5]={80,80,100,80,150};\r
-  Double_t minRecEventHist[5]={-3.*kFact,-3.*kFact,-35.,0.,0.}; \r
-  Double_t maxRecEventHist[5]={3.*kFact,3.*kFact,35.,10.,150.}; \r
+  Double_t minRecEventHist[5]={-1.*kFact,-1.*kFact,-35.,0.,0.}; \r
+  Double_t maxRecEventHist[5]={1.*kFact,1.*kFact,35.,10.,150.}; \r
   fRecEventHist = new THnSparseF("fRecEventHist","Xv:Yv:Zv:ResZv:Mult",5,binsRecEventHist,minRecEventHist,maxRecEventHist);\r
   fRecEventHist->GetAxis(0)->SetTitle("Xv (cm)");\r
   fRecEventHist->GetAxis(1)->SetTitle("Yv (cm)");\r
@@ -147,15 +162,43 @@ void AlidNdPtCutAnalysisPbPb::Init(){
   //\r
   // THnSparse track histograms\r
   //\r
-  //nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromMaterial:isPrim:charge\r
-  Int_t binsRecMCTrackHist[12]={160,20,40,100,100,30,90,ptNbins, 2, 2, 2, 3};\r
-  //Double_t minRecMCTrackHist[12]={0., 0., 0., -10.,-10.,-1.5, 0., ptMin, 0., 0., 0., -1.};\r
-  //Double_t maxRecMCTrackHist[12]={160.,10.,1.2, 10.,10.,1.5, 2.*TMath::Pi(), ptMax, 2., 2., 2., 2.};\r
-  Double_t minRecMCTrackHist[12]={0., 0., 0., -1.,-1.,-1.5, 0., ptMin, 0., 0., 0., -1.};\r
-  Double_t maxRecMCTrackHist[12]={160.,10.,1.2, 1.,1.,1.5, 2.*TMath::Pi(), ptMax, 2., 2., 2., 2.};\r
+  //\r
+  //\r
+  //nCrossRows:chi2PerClust:nCrossRows/nFindableClust:fracSharedClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromMaterial:isPrim:charge:centr\r
+  Int_t binsRecMCTrackHist[14]=  {160, 10, 20, 20, 50,  50,  20,  90,             ptNbins, 2,  2,  2,  3,  centrNbins};\r
+  Double_t minRecMCTrackHist[14]={0.,  0., 0., 0.,-0.5,-0.5,-1.0, 0.,             ptMin,   0., 0., 0.,-1., centrMin};\r
+  Double_t maxRecMCTrackHist[14]={160.,10.,1,  1., 0.5, 0.5, 1.0, 2.*TMath::Pi(), ptMax,   2., 2., 2., 2., centrMax};\r
+\r
+  fRecMCTrackHist = new THnSparseF("fRecMCTrackHist","nCrossRows:chi2PerClust:nCrossRows/nFindableClust:fracSharedClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromMaterial:isPrim:charge:centr",14,binsRecMCTrackHist,minRecMCTrackHist,maxRecMCTrackHist);\r
+  fRecMCTrackHist->SetBinEdges(8,binsPt);\r
+  fRecMCTrackHist->SetBinEdges(13,binsCentr);\r
+\r
+  fRecMCTrackHist->GetAxis(0)->SetTitle("nCrossRows");\r
+  fRecMCTrackHist->GetAxis(1)->SetTitle("chi2PerClust");\r
+  fRecMCTrackHist->GetAxis(2)->SetTitle("nCrossRows/nFindableClust");\r
+  fRecMCTrackHist->GetAxis(3)->SetTitle("fracSharedClust");\r
+  fRecMCTrackHist->GetAxis(4)->SetTitle("DCAy (cm)");\r
+  fRecMCTrackHist->GetAxis(5)->SetTitle("DCAz (cm)");\r
+  fRecMCTrackHist->GetAxis(6)->SetTitle("#eta");\r
+  fRecMCTrackHist->GetAxis(7)->SetTitle("#phi (rad)");\r
+  fRecMCTrackHist->GetAxis(8)->SetTitle("p_{T} (GeV/c)");\r
+  fRecMCTrackHist->GetAxis(9)->SetTitle("hasStrangeMother");\r
+  fRecMCTrackHist->GetAxis(10)->SetTitle("isFromMaterial");\r
+  fRecMCTrackHist->GetAxis(11)->SetTitle("isPrim");\r
+  fRecMCTrackHist->GetAxis(12)->SetTitle("charge");\r
+  fRecMCTrackHist->GetAxis(13)->SetTitle("centrality");\r
+  fRecMCTrackHist->Sumw2();\r
+\r
+\r
+  //nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromMaterial:isPrim:charge:centr\r
+  /*\r
+  Int_t binsRecMCTrackHist[13]={160,20,40,50,50,20,90,ptNbins,2,2,2,3,centrNbins};\r
+  Double_t minRecMCTrackHist[13]={0., 0., 0., -0.5,-0.5,-1.0, 0., ptMin, 0., 0., 0., -1., centrMin};\r
+  Double_t maxRecMCTrackHist[13]={160.,10.,1.2, 0.5,0.5,1.0, 2.*TMath::Pi(), ptMax, 2., 2., 2., 2.,centrMax};\r
 \r
   fRecMCTrackHist = new THnSparseF("fRecMCTrackHist","nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromMaterial:isPrim:charge",12,binsRecMCTrackHist,minRecMCTrackHist,maxRecMCTrackHist);\r
   fRecMCTrackHist->SetBinEdges(7,binsPt);\r
+  fRecMCTrackHist->SetBinEdges(12,binsCentr);\r
 \r
   fRecMCTrackHist->GetAxis(0)->SetTitle("nClust");\r
   fRecMCTrackHist->GetAxis(1)->SetTitle("chi2PerClust");\r
@@ -169,7 +212,9 @@ void AlidNdPtCutAnalysisPbPb::Init(){
   fRecMCTrackHist->GetAxis(9)->SetTitle("isFromMaterial");\r
   fRecMCTrackHist->GetAxis(10)->SetTitle("isPrim");\r
   fRecMCTrackHist->GetAxis(11)->SetTitle("charge");\r
+  fRecMCTrackHist->GetAxis(12)->SetTitle("centrality");\r
   fRecMCTrackHist->Sumw2();\r
+  */\r
 \r
   // init output folder\r
   fAnalysisFolder = CreateFolder("folderdNdPt","Analysis dNdPt Folder");\r
@@ -198,37 +243,40 @@ void AlidNdPtCutAnalysisPbPb::Process(AliESDEvent *const esdEvent, AliMCEvent *
   }\r
 \r
   // trigger selection\r
+\r
   Bool_t isEventTriggered = kTRUE;\r
-  AliPhysicsSelection *trigSel = NULL;\r
-  AliTriggerAnalysis *trigAna = NULL; // needed for andV0\r
+  AliPhysicsSelection *physicsSelection = NULL;\r
+  AliTriggerAnalysis* triggerAnalysis = NULL;\r
+\r
+  // \r
+  AliInputEventHandler* inputHandler = (AliInputEventHandler*) AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler();\r
+  if (!inputHandler)\r
+  {\r
+    Printf("ERROR: Could not receive input handler");\r
+    return;\r
+  }\r
 \r
   if(evtCuts->IsTriggerRequired())  \r
   {\r
-    //\r
-    trigSel = GetPhysicsTriggerSelection();\r
-    if(!trigSel) {\r
-      printf("cannot get trigSel \n");\r
-      return;\r
+    // always MB\r
+    isEventTriggered = inputHandler->IsEventSelected() & AliVEvent::kMB;\r
+\r
+    physicsSelection = static_cast<AliPhysicsSelection*> (inputHandler->GetEventSelection());\r
+    if(!physicsSelection) return;\r
+    //SetPhysicsTriggerSelection(physicsSelection);\r
+\r
+    if (isEventTriggered && (GetTrigger() == AliTriggerAnalysis::kV0AND)) {\r
+      // set trigger (V0AND)\r
+      triggerAnalysis = physicsSelection->GetTriggerAnalysis();\r
+      if(!triggerAnalysis) return;\r
+      isEventTriggered = triggerAnalysis->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
     }\r
+  }\r
 \r
-    //\r
-    if(IsUseMCInfo()) \r
-    { \r
-      trigSel->SetAnalyzeMC();\r
-\r
-      \r
-        isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
-       \r
-        if(GetTrigger() == AliTriggerAnalysis::kV0AND) \r
-       {\r
-          trigAna = trigSel->GetTriggerAnalysis();\r
-          if(!trigAna) \r
-            return;\r
-\r
-          isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
-        }//if(GetTrigger() == AliTriggerAnalysis::kV0AND)\r
-     }//if(IsUseMCInfo())\r
-  }//if(evtCuts->IsTriggerRequired())\r
+  // centrality determination\r
+  Float_t centralityF = -1;\r
+  AliCentrality *esdCentrality = esdEvent->GetCentrality();\r
+  centralityF = esdCentrality->GetCentralityPercentile(fCentralityEstimator.Data());\r
 \r
   // use MC information\r
   AliHeader* header = 0;\r
@@ -319,7 +367,7 @@ void AlidNdPtCutAnalysisPbPb::Process(AliESDEvent *const esdEvent, AliMCEvent *
       if(!track) continue;\r
 \r
       if(!esdTrackCuts->AcceptTrack(track)) continue;\r
-      FillHistograms(track, stack);\r
+      FillHistograms(track, stack, centralityF);\r
       multAll++;\r
     }\r
 \r
@@ -337,7 +385,7 @@ void AlidNdPtCutAnalysisPbPb::Process(AliESDEvent *const esdEvent, AliMCEvent *
 }\r
 \r
 //_____________________________________________________________________________\r
-void AlidNdPtCutAnalysisPbPb::FillHistograms(AliESDtrack *const esdTrack, AliStack *const stack) const\r
+void AlidNdPtCutAnalysisPbPb::FillHistograms(AliESDtrack *const esdTrack, AliStack *const stack, Float_t centralityF) const\r
 {\r
   //\r
   // Fill ESD track and MC histograms \r
@@ -370,6 +418,20 @@ void AlidNdPtCutAnalysisPbPb::FillHistograms(AliESDtrack *const esdTrack, AliSta
   Float_t b[2], bCov[3];\r
   esdTrack->GetImpactParameters(b,bCov);\r
 \r
+  // \r
+  Float_t nCrossedRowsTPC = esdTrack->GetTPCClusterInfo(2,1);\r
+\r
+  Float_t  ratioCrossedRowsOverFindableClustersTPC = 1.0;\r
+  if (esdTrack->GetTPCNclsF()>0) {\r
+     ratioCrossedRowsOverFindableClustersTPC = esdTrack->GetTPCClusterInfo(2,1)/esdTrack->GetTPCNclsF();\r
+  }\r
+\r
+  //\r
+  Int_t nClustersTPCShared = esdTrack->GetTPCnclsS();\r
+  Float_t fracClustersTPCShared = -1.;\r
+  fracClustersTPCShared = Float_t(nClustersTPCShared)/Float_t(nClust);\r
+\r
+  // \r
   // kink idx\r
   Int_t kinkIdx = 0;\r
   //if(esdTrack->GetKinkIndex(0) > 0.)   isKink  = kTRUE;\r
@@ -417,11 +479,11 @@ void AlidNdPtCutAnalysisPbPb::FillHistograms(AliESDtrack *const esdTrack, AliSta
       if(!isPrim) isFromMaterial = kTRUE; \r
     }\r
   }\r
-\r
   \r
   // fill histo\r
   Int_t charge = esdTrack->Charge();\r
-  Double_t vRecMCTrackHist[12] = { nClust,chi2PerCluster,clustPerFindClust,b[0],b[1],eta,phi,pt,hasStrangeMother,isFromMaterial,isPrim,charge }; \r
+  //Double_t vRecMCTrackHist[13] = { nClust,chi2PerCluster,clustPerFindClust,b[0],b[1],eta,phi,pt,hasStrangeMother,isFromMaterial,isPrim,charge, centralityF }; \r
+  Double_t vRecMCTrackHist[14] = { nCrossedRowsTPC, chi2PerCluster, ratioCrossedRowsOverFindableClustersTPC, fracClustersTPCShared , b[0], b[1], eta, phi, pt, hasStrangeMother, isFromMaterial, isPrim, charge, centralityF }; \r
   fRecMCTrackHist->Fill(vRecMCTrackHist);\r
 }\r
 \r
index c4f4bef..2a02370 100644 (file)
@@ -53,7 +53,7 @@ public :
   TFolder *CreateFolder(TString folder = "folderdNdPtAnalysis",TString title = "Analysed dNdPt histograms");
 
   // Fill histograms
-  void FillHistograms(AliESDtrack *const esdTrack, AliStack *const stack) const;
+  void FillHistograms(AliESDtrack *const esdTrack, AliStack *const stack, Float_t centralityF) const;
 
   // Getters
   THnSparseF *GetEventCount()   const {return fEventCount;}
@@ -64,6 +64,10 @@ public :
   //
   THnSparseF *GetRecMCTrackHist() const {return fRecMCTrackHist;}
   
+
+  TString GetCentralityEstimator() const {return fCentralityEstimator; }
+  void SetCentralityEstimator(TString centEst="V0M") { fCentralityEstimator = centEst; }
+
 private:
 
   // analysis folder 
@@ -81,12 +85,14 @@ private:
   //
   // THnSparse track histograms
   //
-  THnSparseF *fRecMCTrackHist; //-> nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromMaterial:isPrim:charge
+  //THnSparseF *fRecMCTrackHist; //-> nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromMaterial:isPrim:charge:centr
+  THnSparseF *fRecMCTrackHist; //-> nCrossRows:chi2PerClust:nCrossRows/nFindableClust:fracSharedClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromMaterial:isPrim:charge:centr
+  TString fCentralityEstimator;     // use centrality can be "VOM" (default), "FMD", "TRK", "TKL", "CL0", "CL1", "V0MvsFMD", "TKLvsV0M", "ZEMvsZDC"
 
   AlidNdPtCutAnalysisPbPb(const AlidNdPtCutAnalysisPbPb&); // not implemented
   AlidNdPtCutAnalysisPbPb& operator=(const AlidNdPtCutAnalysisPbPb&); // not implemented
 
-  ClassDef(AlidNdPtCutAnalysisPbPb,1);
+  ClassDef(AlidNdPtCutAnalysisPbPb,2);
 };
 
 #endif