modification added
authorjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 May 2011 15:27:07 +0000 (15:27 +0000)
committerjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 11 May 2011 15:27:07 +0000 (15:27 +0000)
PWG0/dNdPt/AlidNdPtCutAnalysis.cxx
PWG0/dNdPt/AlidNdPtCutAnalysis.h

index 277be60..51ea9fe 100644 (file)
@@ -30,6 +30,7 @@
 \r
 #include "AliHeader.h"  \r
 #include "AliGenEventHeader.h"  \r
+#include "AliInputEventHandler.h"  \r
 #include "AliStack.h"  \r
 #include "AliESDEvent.h"  \r
 #include "AliMCEvent.h"  \r
@@ -94,11 +95,16 @@ void AlidNdPtCutAnalysis::Init(){
   //\r
   // Init histograms\r
   //\r
+  /*\r
   const Int_t ptNbins = 56; \r
   const Double_t ptMin = 0.; \r
   const Double_t ptMax = 16.; \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};\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
   // \r
   Int_t binsEventCount[2]={2,2};\r
@@ -148,7 +154,30 @@ void AlidNdPtCutAnalysis::Init(){
   // THnSparse track histograms\r
   //\r
 \r
+ //nCrossRows:chi2PerClust:nCrossRows/nFindableClust:fracSharedClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromMaterial:isPrim:charge\r
+  Int_t binsRecMCTrackHist[13]=  {160, 10, 20, 20, 50,  50,  20,  90,             ptNbins, 2,  2,  2,  3};\r
+  Double_t minRecMCTrackHist[13]={0.,  0., 0., 0.,-0.5,-0.5,-1.0, 0.,             ptMin,   0., 0., 0.,-1.};\r
+  Double_t maxRecMCTrackHist[13]={160.,10.,1.,  1., 0.5, 0.5, 1.0, 2.*TMath::Pi(), ptMax,   2., 2., 2., 2.};\r
+\r
+  fRecMCTrackHist = new THnSparseF("fRecMCTrackHist","nCrossRows:chi2PerClust:nCrossRows/nFindableClust:fracSharedClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromMaterial:isPrim:charge",13,binsRecMCTrackHist,minRecMCTrackHist,maxRecMCTrackHist);\r
+  fRecMCTrackHist->SetBinEdges(8,binsPt);\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->Sumw2();\r
+\r
   //nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:kinkIdx:isPrim:polarity\r
+  /*\r
   Int_t binsRecMCTrackHist[11]={160,80,80,100,100,90,90,ptNbins, 3, 2, 2};\r
   Double_t minRecMCTrackHist[11]={0., 0., 0., -1.,-1.,-1.5, 0., ptMin, -1., 0., 0.};\r
   Double_t maxRecMCTrackHist[11]={160.,10.,1.2, 1.,1.,1.5, 2.*TMath::Pi(), ptMax, 2., 2., 2.};\r
@@ -168,6 +197,7 @@ void AlidNdPtCutAnalysis::Init(){
   fRecMCTrackHist->GetAxis(9)->SetTitle("isPrim");\r
   fRecMCTrackHist->GetAxis(10)->SetTitle("polarity");\r
   fRecMCTrackHist->Sumw2();\r
+  */\r
 \r
   // init output folder\r
   fAnalysisFolder = CreateFolder("folderdNdPt","Analysis dNdPt Folder");\r
@@ -196,50 +226,33 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
   }\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
-  if(evtCuts->IsTriggerRequired())  \r
+  // \r
+  AliInputEventHandler* inputHandler = (AliInputEventHandler*) AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler();\r
+  if (!inputHandler)\r
   {\r
-    //\r
-    trigSel = GetPhysicsTriggerSelection();\r
-    if(!trigSel) {\r
-      AliDebug(AliLog::kError, "cannot get trigSel");\r
-      return;\r
-    }\r
-    \r
-    if(IsUseMCInfo()) { \r
-      trigSel->SetAnalyzeMC();\r
-      isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
-\r
-      trigAna = trigSel->GetTriggerAnalysis();\r
-      if(!trigAna) \r
-        return;\r
-\r
-      if(GetTrigger() == AliTriggerAnalysis::kV0AND)\r
-        isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
-    }\r
-    else {\r
-      //\r
-      // 0-multiplicity bin for LHC background correction\r
-      //\r
-      if(GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtxUpdate || \r
-         GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtxDCArPt) \r
-      {\r
-        trigSel->SetBin0CallbackViaPointer(&AlidNdPtAnalysis::IsBinZeroTrackSPDvtx);\r
-      } else {\r
-        trigSel->SetBin0CallbackViaPointer(&AlidNdPtAnalysis::IsBinZeroSPDvtx);\r
-      }\r
-\r
-      isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
-\r
-      trigAna = trigSel->GetTriggerAnalysis();\r
-      if(!trigAna) \r
-        return;\r
+    Printf("ERROR: Could not receive input handler");\r
+    return;\r
+  }\r
 \r
-      if(GetTrigger() == AliTriggerAnalysis::kV0AND)\r
-        isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
+  if(evtCuts->IsTriggerRequired())  \r
+  {\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
@@ -415,20 +428,45 @@ void AlidNdPtCutAnalysis::FillHistograms(AliESDtrack *const esdTrack, AliStack *
   Float_t pt = esdTrack->Pt();\r
   Float_t eta = esdTrack->Eta();\r
   Float_t phi = esdTrack->Phi();\r
-  //Int_t nClust = esdTrack->GetTPCclusters(0);\r
-  Int_t nClust = esdTrack->GetTPCNclsIter1();\r
-  Int_t nFindableClust = esdTrack->GetTPCNclsF();\r
+\r
+\r
+  Int_t nClust = 0;\r
+  if(GetAnalysisMode() == AlidNdPtHelper::kTPC) { \r
+    nClust = esdTrack->GetTPCNclsIter1();\r
+  } else {\r
+    nClust = esdTrack->GetTPCclusters(0);\r
+  }\r
 \r
   Float_t chi2PerCluster = 0.;\r
-  //if(nClust>0.) chi2PerCluster = esdTrack->GetTPCchi2()/Float_t(nClust);\r
-  if(nClust>0.) chi2PerCluster = esdTrack->GetTPCchi2Iter1()/Float_t(nClust);\r
+  if(GetAnalysisMode() == AlidNdPtHelper::kTPC) { \r
+    if(nClust>0.) chi2PerCluster = esdTrack->GetTPCchi2Iter1()/Float_t(nClust);\r
+  } else {\r
+    chi2PerCluster = esdTrack->GetTPCchi2()/Float_t(nClust);\r
+  }\r
 \r
+  Int_t nFindableClust = esdTrack->GetTPCNclsF();\r
+\r
+  \r
   Float_t clustPerFindClust = 0.;\r
   if(nFindableClust>0.) clustPerFindClust = Float_t(nClust)/nFindableClust;\r
 \r
   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
@@ -445,6 +483,8 @@ void AlidNdPtCutAnalysis::FillHistograms(AliESDtrack *const esdTrack, AliStack *
   // Fill rec vs MC information\r
   //\r
   Bool_t isPrim = kTRUE;\r
+  Bool_t hasStrangeMother = kFALSE;\r
+  Bool_t isFromMaterial = kFALSE;\r
 \r
   if(IsUseMCInfo()) {\r
     if(!stack) return;\r
@@ -454,15 +494,38 @@ void AlidNdPtCutAnalysis::FillHistograms(AliESDtrack *const esdTrack, AliStack *
     if(particle->GetPDG() && particle->GetPDG()->Charge()==0.) return;\r
     isPrim = stack->IsPhysicalPrimary(label);\r
 \r
+    // check whether has stange mother\r
+    //\r
+    Int_t motherPdg = -1; \r
+    TParticle* mother = 0; \r
+       \r
+    Int_t motherLabel = particle->GetMother(0);  \r
+    if(motherLabel>0) mother = stack->Particle(motherLabel); \r
+    if(mother) motherPdg = TMath::Abs(mother->GetPdgCode()); // take abs for visualisation only \r
+    Int_t mech = particle->GetUniqueID(); // production mechanism \r
+\r
+    if( (motherPdg == 3122) || (motherPdg == -3122) || (motherPdg == 310)) // lambda, antilambda, k0s\r
+    {\r
+      if( (mech == 4) || (mech == 5) ) hasStrangeMother = kTRUE;\r
+    } \r
+    else {\r
+      //if(isPrim==0 && mech == 13)   \r
+      //printf("mech %d \n", mech);\r
+      if(!isPrim) isFromMaterial = kTRUE; \r
+    }\r
+\r
     //if(isPrim && pt > 1.5 && kinkIdx == -1) printf("nClust  %d \n", nClust);\r
   }\r
   \r
   // fill histo\r
-  Int_t polarity = -2;\r
-  if (esdTrack->Charge() < 0.) polarity = 0; \r
-  else polarity = 1; \r
-  Double_t vRecMCTrackHist[11] = { nClust,chi2PerCluster,clustPerFindClust,b[0],b[1],eta,phi,pt,kinkIdx,isPrim, polarity }; \r
+  Int_t charge = esdTrack->Charge(); \r
+\r
+  //Double_t vRecMCTrackHist[11] = { nClust,chi2PerCluster,clustPerFindClust,b[0],b[1],eta,phi,pt,kinkIdx,isPrim, polarity }; \r
+  //fRecMCTrackHist->Fill(vRecMCTrackHist);\r
+\r
+  Double_t vRecMCTrackHist[13] = { nCrossedRowsTPC, chi2PerCluster, ratioCrossedRowsOverFindableClustersTPC, fracClustersTPCShared , b[0], b[1], eta, phi, pt, hasStrangeMother, isFromMaterial, isPrim, charge }; \r
   fRecMCTrackHist->Fill(vRecMCTrackHist);\r
+\r
 }\r
 \r
 //_____________________________________________________________________________\r
index d52a423..94618e7 100644 (file)
@@ -81,12 +81,13 @@ private:
   //
   // THnSparse track histograms
   //
-  THnSparseF *fRecMCTrackHist; //-> nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:kinkIdx:isPrim:polarity
+  //THnSparseF *fRecMCTrackHist; //-> nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:kinkIdx:isPrim:polarity
+  THnSparseF *fRecMCTrackHist; //-> nCrossRows:chi2PerClust:nCrossRows/nFindableClust:fracSharedClust:DCAy:DCAz:eta:phi:pt:hasStrangeMother:isFromMaterial:isPrim:charge
 
   AlidNdPtCutAnalysis(const AlidNdPtCutAnalysis&); // not implemented
   AlidNdPtCutAnalysis& operator=(const AlidNdPtCutAnalysis&); // not implemented
 
-  ClassDef(AlidNdPtCutAnalysis,1);
+  ClassDef(AlidNdPtCutAnalysis,2);
 };
 
 #endif