additional functionality
authorjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Mar 2010 21:50:34 +0000 (21:50 +0000)
committerjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 25 Mar 2010 21:50:34 +0000 (21:50 +0000)
PWG0/dNdPt/AlidNdPtAnalysis.cxx
PWG0/dNdPt/AlidNdPtCorrection.cxx
PWG0/dNdPt/AlidNdPtCorrection.h
PWG0/dNdPt/AlidNdPtCutAnalysis.cxx
PWG0/dNdPt/AlidNdPtHelper.cxx
PWG0/dNdPt/AlidNdPtHelper.h

index 79cb513..08f1310 100644 (file)
@@ -45,6 +45,7 @@
 #include "AlidNdPtEventCuts.h"\r
 #include "AlidNdPtAcceptanceCuts.h"\r
 #include "AliPhysicsSelection.h"\r
+#include "AliTriggerAnalysis.h"\r
 \r
 #include "AliPWG0Helper.h"\r
 #include "AlidNdPtHelper.h"\r
@@ -346,7 +347,7 @@ void AlidNdPtAnalysis::Init(){
   Double_t binsZv[zvNbins+1] = {-30.,-25.,-20.,-15.,-10.,-5.,0.,5.,10.,15.,20.,25.,30.};\r
   //Double_t binsMult[multNbins+1] = {0.,1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,12.,14.,16.,18.,20.,30.,40.,50.,70.,90.,110.,150.};\r
 \r
-  Int_t binsTrackMatrix[3]={zvNbins,ptNbins,etaNbins};\r
+  //Int_t binsTrackMatrix[3]={zvNbins,ptNbins,etaNbins};\r
   Int_t binsTrackEventCorrMatrix[3]={zvNbins,ptNbinsTrackEventCorr,etaNbins};\r
 \r
   //\r
@@ -629,27 +630,33 @@ void AlidNdPtAnalysis::Init(){
   //\r
   // tracks correction matrices\r
   //\r
-  fGenTrackMatrix = new THnSparseF("fGenTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
+  //fGenTrackMatrix = new THnSparseF("fGenTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
+  fGenTrackMatrix = new THnSparseF("fGenTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
   fGenTrackMatrix->SetBinEdges(0,binsZv);\r
-  fGenTrackMatrix->SetBinEdges(1,binsPt);\r
+  //fGenTrackMatrix->SetBinEdges(1,binsPt);\r
+  fGenTrackMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
   fGenTrackMatrix->SetBinEdges(2,binsEta);\r
   fGenTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
   fGenTrackMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
   fGenTrackMatrix->GetAxis(2)->SetTitle("mcEta");\r
   fGenTrackMatrix->Sumw2();\r
 \r
-  fGenPrimTrackMatrix = new THnSparseF("fGenPrimTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
+  //fGenPrimTrackMatrix = new THnSparseF("fGenPrimTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
+  fGenPrimTrackMatrix = new THnSparseF("fGenPrimTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
   fGenPrimTrackMatrix->SetBinEdges(0,binsZv);\r
-  fGenPrimTrackMatrix->SetBinEdges(1,binsPt);\r
+  //fGenPrimTrackMatrix->SetBinEdges(1,binsPt);\r
+  fGenPrimTrackMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
   fGenPrimTrackMatrix->SetBinEdges(2,binsEta);\r
   fGenPrimTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
   fGenPrimTrackMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
   fGenPrimTrackMatrix->GetAxis(2)->SetTitle("mcEta");\r
   fGenPrimTrackMatrix->Sumw2();\r
 \r
-  fRecPrimTrackMatrix = new THnSparseF("fRecPrimTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
+  //fRecPrimTrackMatrix = new THnSparseF("fRecPrimTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
+  fRecPrimTrackMatrix = new THnSparseF("fRecPrimTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
   fRecPrimTrackMatrix->SetBinEdges(0,binsZv);\r
-  fRecPrimTrackMatrix->SetBinEdges(1,binsPt);\r
+  //fRecPrimTrackMatrix->SetBinEdges(1,binsPt);\r
+  fRecPrimTrackMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
   fRecPrimTrackMatrix->SetBinEdges(2,binsEta);\r
   fRecPrimTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
   fRecPrimTrackMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
@@ -657,18 +664,22 @@ void AlidNdPtAnalysis::Init(){
   fRecPrimTrackMatrix->Sumw2();\r
 \r
   //\r
-  fRecTrackMatrix = new THnSparseF("fRecTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
+  //fRecTrackMatrix = new THnSparseF("fRecTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
+  fRecTrackMatrix = new THnSparseF("fRecTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
   fRecTrackMatrix->SetBinEdges(0,binsZv);\r
-  fRecTrackMatrix->SetBinEdges(1,binsPt);\r
+  //fRecTrackMatrix->SetBinEdges(1,binsPt);\r
+  fRecTrackMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
   fRecTrackMatrix->SetBinEdges(2,binsEta);\r
   fRecTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
   fRecTrackMatrix->GetAxis(1)->SetTitle("Pt (GeV/c)");\r
   fRecTrackMatrix->GetAxis(2)->SetTitle("Eta");\r
   fRecTrackMatrix->Sumw2();\r
 \r
-  fRecSecTrackMatrix = new THnSparseF("fRecSecTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
+  //fRecSecTrackMatrix = new THnSparseF("fRecSecTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
+  fRecSecTrackMatrix = new THnSparseF("fRecSecTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
   fRecSecTrackMatrix->SetBinEdges(0,binsZv);\r
-  fRecSecTrackMatrix->SetBinEdges(1,binsPt);\r
+  //fRecSecTrackMatrix->SetBinEdges(1,binsPt);\r
+  fRecSecTrackMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
   fRecSecTrackMatrix->SetBinEdges(2,binsEta);\r
   fRecSecTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
   fRecSecTrackMatrix->GetAxis(1)->SetTitle("Pt (GeV/c)");\r
@@ -676,9 +687,11 @@ void AlidNdPtAnalysis::Init(){
   fRecSecTrackMatrix->Sumw2();\r
 \r
   //\r
-  fRecMultTrackMatrix = new THnSparseF("fRecMultTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
+  //fRecMultTrackMatrix = new THnSparseF("fRecMultTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
+  fRecMultTrackMatrix = new THnSparseF("fRecMultTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackEventCorrMatrix);\r
   fRecMultTrackMatrix->SetBinEdges(0,binsZv);\r
-  fRecMultTrackMatrix->SetBinEdges(1,binsPt);\r
+  //fRecMultTrackMatrix->SetBinEdges(1,binsPt);\r
+  fRecMultTrackMatrix->SetBinEdges(1,binsPtTrackEventCorr);\r
   fRecMultTrackMatrix->SetBinEdges(2,binsEta);\r
   fRecMultTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
   fRecMultTrackMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
@@ -915,17 +928,30 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
   // trigger selection\r
   Bool_t isEventTriggered = kTRUE;\r
   AliPhysicsSelection *trigSel = NULL;\r
+  AliTriggerAnalysis *trigAna = NULL;\r
+\r
   if(evtCuts->IsTriggerRequired())  \r
   {\r
+    //\r
     trigSel = GetPhysicsTriggerSelection();\r
     if(!trigSel) {\r
       AliDebug(AliLog::kError, "cannot get trigSel");\r
       return;\r
     }\r
-\r
-    if(IsUseMCInfo()) { \r
+    \r
+    if(IsUseMCInfo()) \r
+    { \r
       trigSel->SetAnalyzeMC();\r
       isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
+      //printf("MB1 %d \n",isEventTriggered);\r
+\r
+      trigAna = trigSel->GetTriggerAnalysis();\r
+      if(!trigAna) \r
+        return;\r
+\r
+      if(GetTrigger() == AliTriggerAnalysis::kV0AND)\r
+        isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
+       //printf("V0AND %d \n",isEventTriggered);\r
     }\r
     else {\r
       //\r
@@ -934,13 +960,22 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
       if(GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtxUpdate || \r
          GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtxDCArPt) \r
       {\r
-        //trigSel->SetBin0Callback(&IsBinZeroTrackSPDvtx);\r
         trigSel->SetBin0CallbackViaPointer(&IsBinZeroTrackSPDvtx);\r
       } else {\r
-        //trigSel->SetBin0Callback(&IsBinZeroSPDvtx);\r
         trigSel->SetBin0CallbackViaPointer(&IsBinZeroSPDvtx);\r
       }\r
+\r
       isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
+       //printf("MB1 %d \n",isEventTriggered);\r
+\r
+      trigAna = trigSel->GetTriggerAnalysis();\r
+      if(!trigAna) \r
+        return;\r
+\r
+      if(GetTrigger() == AliTriggerAnalysis::kV0AND)\r
+        isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
+       //printf("V0AND %d \n",isEventTriggered);\r
+\r
     }\r
   }\r
 \r
@@ -1039,20 +1074,6 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
     return; \r
   }\r
 \r
-  /*\r
-  //\r
-  // set 0-bin\r
-  //\r
-  if( GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtx || \r
-      GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtxUpdate || \r
-      GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtxDCArPt) \r
-  {\r
-      if(AlidNdPtAnalysis::IsBinZeroTrackSPDvtx(esdEvent)) multMBTracks = 0;\r
-  } else {\r
-      if(AlidNdPtAnalysis::IsBinZeroSPDvtx(esdEvent)) multMBTracks = 0;\r
-  }\r
-  */\r
-\r
   TObjArray *allChargedTracks=0;\r
   Int_t multAll=0, multAcc=0, multRec=0;\r
   Int_t *labelsAll=0, *labelsAcc=0, *labelsRec=0;\r
@@ -1201,6 +1222,8 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
 \r
    if(IsUseMCInfo())  \r
    {\r
+    \r
+     /*\r
      //\r
      // multiplicity correlation matrix\r
      //\r
@@ -1214,7 +1237,9 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
         }\r
      }\r
      Double_t vMultTrueEventMatrix[2] = { trackletMult,multMCTrueTracks };\r
-     //Double_t vMultTrueEventMatrix[2] = { multRec,multMCTrueTracks };\r
+     */\r
+     Double_t vMultTrueEventMatrix[2] = { multRec,multMCTrueTracks };\r
+\r
      if(isEventOK && isEventTriggered) fEventMultCorrelationMatrix->Fill(vMultTrueEventMatrix);\r
 \r
      // \r
@@ -1448,6 +1473,7 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
   if(labelsRec) delete [] labelsRec; labelsRec = 0;\r
 \r
   if(!evtCuts->IsRecVertexRequired() && vtxESD != NULL) delete vtxESD;\r
+  //if(trigAna) delete trigAna;\r
 \r
 }\r
 \r
index 7f754d3..452c933 100644 (file)
@@ -109,7 +109,8 @@ ClassImp(AlidNdPtCorrection)
   fContTrackMatrix(0),\r
   fContMultTrackMatrix(0),\r
   fCorrMatrixFileName(""),\r
-  fCosmicsHisto(0)\r
+  fCosmicsHisto(0),\r
+  fEventCount(0)\r
 {\r
   // default constructor\r
   for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
@@ -186,7 +187,8 @@ AlidNdPtCorrection::AlidNdPtCorrection(Char_t* name, Char_t* title, TString corr
   fContTrackMatrix(0),\r
   fContMultTrackMatrix(0),\r
   fCorrMatrixFileName(corrMatrixFileName),\r
-  fCosmicsHisto(0)\r
+  fCosmicsHisto(0),\r
+  fEventCount(0)\r
 {\r
   // constructor\r
   for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
@@ -259,6 +261,7 @@ AlidNdPtCorrection::~AlidNdPtCorrection() {
   if(fMCEventPrimTrackMeanPtTrueMult1) delete fMCEventPrimTrackMeanPtTrueMult1; fMCEventPrimTrackMeanPtTrueMult1=0;\r
 \r
   if(fCosmicsHisto) delete fCosmicsHisto; fCosmicsHisto=0;\r
+  if(fEventCount) delete fEventCount; fEventCount=0;\r
 \r
   for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
     if(fRecTrackHist1[i]) delete fRecTrackHist1[i]; fRecTrackHist1[i]=0;\r
@@ -850,6 +853,19 @@ void AlidNdPtCorrection::Init(){
   fCosmicsHisto->GetAxis(2)->SetTitle("pt (GV/c)");\r
   fCosmicsHisto->Sumw2();\r
 \r
+  //\r
+  Int_t binsEventCount[2]={2,2};\r
+  Double_t minEventCount[2]={0,0}; \r
+  Double_t maxEventCount[2]={2,2}; \r
+  fEventCount = new THnSparseF("fEventCount","trig vs trig+vertex",2,binsEventCount,minEventCount,maxEventCount);\r
+  fEventCount->GetAxis(0)->SetTitle("trig");\r
+  fEventCount->GetAxis(1)->SetTitle("trig+vert");\r
+  fEventCount->Sumw2();\r
+\r
+\r
+\r
+\r
+\r
   // init output folder\r
   fCorrectionFolder = CreateFolder("folderdNdPt","Correction dNdPt Folder");\r
 \r
@@ -868,6 +884,7 @@ void AlidNdPtCorrection::Init(){
       fEventMultCorrelationMatrix = (THnSparseF*)folder->FindObject("event_mult_correlation_matrix");\r
       if(!fEventMultCorrelationMatrix) {\r
          Printf("No %s matrix \n", "event_mult_correlation_matrix");\r
+        return;\r
       }\r
 \r
       //\r
@@ -878,24 +895,28 @@ void AlidNdPtCorrection::Init(){
       fCorrTriggerMBtoNDEventMatrix = (THnSparseF*)folder->FindObject("zv_mult_trig_MBtoND_corr_matrix");\r
       if(!fCorrTriggerMBtoNDEventMatrix) {\r
          Printf("No %s matrix \n", "zv_mult_trig_MBtoND_corr_matrix");\r
+        return;\r
       }\r
 \r
       // trigger bias correction (MBtoNSD)\r
       fCorrTriggerMBtoNSDEventMatrix = (THnSparseF*)folder->FindObject("zv_mult_trig_MBtoNSD_corr_matrix");\r
       if(!fCorrTriggerMBtoNSDEventMatrix) {\r
          Printf("No %s matrix \n", "zv_mult_trig_MBtoNSD_corr_matrix");\r
+        return;\r
       }\r
 \r
       // trigger bias correction (MBtoInel)\r
       fCorrTriggerMBtoInelEventMatrix = (THnSparseF*)folder->FindObject("zv_mult_trig_MBtoInel_corr_matrix");\r
       if(!fCorrTriggerMBtoInelEventMatrix) {\r
          Printf("No %s matrix \n", "zv_mult_trig_MBtoInel_corr_matrix"); \r
+        return;\r
       }\r
      \r
       // vertex reconstruction efficiency correction\r
       fCorrEventMatrix = (THnSparseF*)folder->FindObject("zv_mult_event_corr_matrix");\r
       if(!fCorrEventMatrix) {\r
          Printf("No %s matrix \n", "zv_mult_event_corr_matrix");\r
+        return;\r
       }\r
 \r
       //\r
@@ -904,16 +925,19 @@ void AlidNdPtCorrection::Init(){
       fZvNorm = (TH1D*)folder->FindObject("zv_distribution_norm");\r
       if(!fZvNorm) {\r
          Printf("No %s matrix \n", "fZvNorm");\r
+        return;\r
       }\r
 \r
       fZvEmptyEventsNorm = (TH1D*)folder->FindObject("zv_empty_events_norm");\r
       if(!fZvEmptyEventsNorm) {\r
          Printf("No %s matrix \n", "fZvEmptyEventsNorm");\r
+        return;\r
       }\r
 \r
       fLHCBin0Background = (TH1D*)folder->FindObject("hLHCBin0Background");\r
       if(!fLHCBin0Background) {\r
          Printf("No %s matrix \n", "fLHCBin0Background");\r
+        return;\r
       }\r
 \r
       //\r
@@ -924,48 +948,56 @@ void AlidNdPtCorrection::Init(){
       fCorrTriggerMBtoNDTrackEventMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_trig_MBtoND_corr_matrix");\r
       if(!fCorrTriggerMBtoNDTrackEventMatrix) {\r
          Printf("No %s matrix \n", "zv_pt_eta_track_trig_MBtoND_corr_matrix");\r
+        return;\r
       }\r
 \r
       // trigger bias correction (MBtoNSD)\r
       fCorrTriggerMBtoNSDTrackEventMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_trig_MBtoNSD_corr_matrix");\r
       if(!fCorrTriggerMBtoNSDTrackEventMatrix) {\r
          Printf("No %s matrix \n", "zv_pt_eta_track_trig_MBtoNSD_corr_matrix");\r
+        return;\r
       }\r
 \r
       // trigger bias correction (MBtoInel) \r
       fCorrTriggerMBtoInelTrackEventMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_trig_MBtoInel_corr_matrix");\r
       if(!fCorrTriggerMBtoInelTrackEventMatrix) {\r
          Printf("No %s matrix \n", "zv_pt_eta_track_trig_MBtoInel_corr_matrix");\r
+        return;\r
       }\r
     \r
       // vertex reconstruction efficiency correction (zv,pt,eta)\r
       fCorrTrackEventMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_event_corr_matrix");\r
       if(!fCorrTrackEventMatrix) {\r
          Printf("No %s matrix \n", "zv_pt_eta_track_event_corr_matrix");\r
+        return;\r
       }\r
 \r
       // track reconstruction efficiency correction (zv,pt,eta)\r
       fCorrTrackMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_corr_matrix");\r
       if(!fCorrTrackMatrix) {\r
          Printf("No %s matrix \n", "zv_pt_eta_track_corr_matrix");\r
+        return;\r
       }\r
 \r
       // high pt track reconstruction efficiency correction (zv,pt,eta)\r
       fCorrHighPtTrackMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_highPt_track_corr_matrix");\r
       if(!fCorrHighPtTrackMatrix) {\r
          Printf("No %s matrix \n", "zv_pt_eta_highPt_track_corr_matrix");\r
+        return;\r
       }\r
 \r
       // secondary tracks contamination correction (zv,pt,eta)\r
       fContTrackMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_track_cont_matrix");\r
       if(!fContTrackMatrix) {\r
          Printf("No %s matrix \n", "zv_pt_eta_track_cont_matrix");\r
+        return;\r
       }\r
 \r
       // multiply reconstructed tracks correction\r
       fContMultTrackMatrix = (THnSparseF*)folder->FindObject("zv_pt_eta_mult_track_cont_matrix");\r
       if(!fContMultTrackMatrix) {\r
          Printf("No %s matrix \n", "zv_pt_eta_mult_track_cont_matrix");\r
+        return;\r
       }\r
     }\r
   }\r
@@ -995,20 +1027,48 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
 \r
   // trigger selection\r
   Bool_t isEventTriggered = kTRUE;\r
+  AliPhysicsSelection *trigSel = NULL;\r
+  AliTriggerAnalysis *trigAna = NULL; // needed for andV0\r
   if(evtCuts->IsTriggerRequired())  \r
   {\r
-    AliPhysicsSelection *trigSel = GetPhysicsTriggerSelection();\r
+    //\r
+    trigSel = GetPhysicsTriggerSelection();\r
     if(!trigSel) {\r
       AliDebug(AliLog::kError, "cannot get trigSel");\r
       return;\r
     }\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
+\r
+      if(GetTrigger() == AliTriggerAnalysis::kV0AND)\r
+        isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
     }\r
   }\r
   \r
@@ -1111,20 +1171,9 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
     return; \r
   }\r
 \r
-\r
-  /*\r
-  //\r
-  // set 0-bin\r
-  //\r
-  if( GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtx || \r
-      GetAnalysisMode() == AlidNdPtHelper::kTPCTrackSPDvtxUpdate || \r
-      GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtx || GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybridTrackSPDvtxDCArPt) \r
-  {\r
-      if(AlidNdPtAnalysis::IsBinZeroTrackSPDvtx(esdEvent)) multMBTracks = 0;\r
-  } else {\r
-      if(AlidNdPtAnalysis::IsBinZeroSPDvtx(esdEvent)) multMBTracks = 0;\r
-  }\r
-  */\r
+  Bool_t isTrigAndVertex = isEventTriggered && isEventOK;\r
+  Double_t vEventCount[2] = { isEventTriggered, isTrigAndVertex};\r
+  fEventCount->Fill(vEventCount);\r
 \r
   //\r
   // correct event and track histograms\r
@@ -1134,6 +1183,7 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
   Int_t *labelsRec=0;\r
   Bool_t isCosmic = kFALSE;\r
 \r
+\r
   if(isEventOK && isEventTriggered)\r
   {\r
     // get all charged tracks\r
@@ -1196,6 +1246,7 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
       }  \r
     }\r
 \r
+    /*\r
     // check multiplicity\r
     const AliMultiplicity* mult = esdEvent->GetMultiplicity();\r
     Int_t trackletMult = 0;\r
@@ -1207,6 +1258,7 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
     }\r
     // use tracklet multiplicity\r
     multRecTemp = trackletMult;\r
+    */\r
 \r
     //\r
     for(Int_t i=0; i<entries;++i) \r
@@ -1341,7 +1393,7 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
     Double_t vRecEventHist1[3] = {vtxESD->GetXv(),vtxESD->GetYv(),vtxESD->GetZv()};\r
     fRecEventHist1->Fill(vRecEventHist1);\r
 \r
-    // correlation track multiplicity vs tracklet multiplicity\r
+    // correlation track multiplicity vs MB track multiplicity\r
     Double_t vRecEventMultHist1[3] = {multRec, multMBTracks};\r
     fRecEventMultHist1->Fill(vRecEventMultHist1);\r
   }\r
@@ -1536,7 +1588,7 @@ void AlidNdPtCorrection::FillHistograms(AlidNdPtHelper::EventObject eventObj, Do
     Double_t corrToInelF0 = GetCorrFactZvMult(fCorrTriggerMBtoInelEventMatrix,zv,multMBTracks);\r
     Double_t corrToNDF0 = GetCorrFactZvMult(fCorrTriggerMBtoNDEventMatrix,zv,multMBTracks);\r
     Double_t corrToNSDF0 = GetCorrFactZvMult(fCorrTriggerMBtoNSDEventMatrix,zv,multMBTracks);\r
-    printf("factLHCBack %f, factZ %f, corrToInelF0 %f, corrToNDF0 %f, corrToNSDF0 %f \n",factLHCBack,factZ,corrToInelF0,corrToNDF0,corrToNSDF0);\r
+    //printf("factLHCBack %f, factZ %f, corrToInelF0 %f, corrToNDF0 %f, corrToNSDF0 %f \n",factLHCBack,factZ,corrToInelF0,corrToNDF0,corrToNSDF0);\r
 \r
     fCorrRecEventHist2[0]->Fill(vEventMatrix);\r
     fCorrRecEventHist2[1]->Fill(vEventMatrix,factLHCBack*factZ);\r
@@ -1776,11 +1828,18 @@ Long64_t AlidNdPtCorrection::Merge(TCollection* const list)
 \r
   // collection of generated histograms\r
 \r
+  // physics selection\r
+  TList *collPhysSelection = new TList;\r
+\r
   Int_t count=0;\r
   while((obj = iter->Next()) != 0) {\r
     AlidNdPtCorrection* entry = dynamic_cast<AlidNdPtCorrection*>(obj);\r
     if (entry == 0) continue; \r
   \r
+    collPhysSelection->Add(entry->GetPhysicsTriggerSelection());\r
+\r
+    fEventCount->Add(entry->fEventCount);\r
+\r
     fMCEventHist1->Add(entry->fMCEventHist1);\r
     fRecEventHist1->Add(entry->fRecEventHist1);\r
     fRecEventMultHist1->Add(entry->fRecEventMultHist1);\r
@@ -1846,6 +1905,11 @@ Long64_t AlidNdPtCorrection::Merge(TCollection* const list)
   count++;\r
   }\r
 \r
+  //\r
+  AliPhysicsSelection *trigSelection = GetPhysicsTriggerSelection();\r
+  trigSelection->Merge(collPhysSelection);\r
+  if(collPhysSelection) delete collPhysSelection;\r
+\r
 return count;\r
 }\r
  \r
index 3155cce..41e7bc9 100644 (file)
@@ -119,6 +119,7 @@ public :
   THnSparseF *GetCorrRecEventHist1(Int_t i) const {return fCorrRecEventHist1[i];}
   THnSparseF *GetCorrRecEventHist2(Int_t i) const {return fCorrRecEventHist2[i];}
 
+  THnSparseF *GetEventCount()   const {return fEventCount;}
 
   // correlation matrix
   void SetEventMultCorrelationMatrix(THnSparseF *const matrix=0) {fEventMultCorrelationMatrix = matrix;}
@@ -340,6 +341,8 @@ private:
   //  deta, dphi, pt1 for cosmics
   THnSparseF *fCosmicsHisto; //-> deta:dphi:pt
   
+  THnSparseF *fEventCount; //-> trig, trig + vertex
+
   AlidNdPtCorrection(const AlidNdPtCorrection&); // not implemented
   AlidNdPtCorrection& operator=(const AlidNdPtCorrection&); // not implemented
 
index 19d7069..818a52b 100644 (file)
@@ -40,6 +40,7 @@
 #include "AlidNdPtEventCuts.h"\r
 #include "AlidNdPtAcceptanceCuts.h"\r
 #include "AlidNdPtBackgroundCuts.h"\r
+#include "AlidNdPtAnalysis.h"\r
 #include "AliPhysicsSelection.h"\r
 \r
 #include "AliPWG0Helper.h"\r
@@ -196,19 +197,49 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
 \r
   // trigger selection\r
   Bool_t isEventTriggered = kTRUE;\r
+  AliPhysicsSelection *trigSel = NULL;\r
+  AliTriggerAnalysis *trigAna = NULL; // needed for andV0\r
+\r
   if(evtCuts->IsTriggerRequired())  \r
   {\r
-    AliPhysicsSelection *trigSel = GetPhysicsTriggerSelection();\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
+\r
+      if(GetTrigger() == AliTriggerAnalysis::kV0AND)\r
+        isEventTriggered = trigAna->IsOfflineTriggerFired(esdEvent, GetTrigger());\r
     }\r
   }\r
 \r
index e61e59f..bffd3a0 100644 (file)
@@ -278,6 +278,11 @@ Bool_t AlidNdPtHelper::IsPrimaryParticle(AliStack* const stack, Int_t idx, Parti
     else return kFALSE;
   }
 
+  if(particleMode==kMCRest) {
+    if(prim && pdg!=kPiPlus && pdg!=kKPlus && pdg!=kProton) return kTRUE;
+    else return kFALSE;
+  }
+
 return prim;
 }
 
index d009876..58abf40 100644 (file)
@@ -40,7 +40,7 @@ class AlidNdPtHelper : public TObject
 {
   public:
     enum AnalysisMode { kInvalid = -1, kSPD = 0, kTPC, kTPCITS, kTPCSPDvtx, kTPCSPDvtxUpdate, kTPCTrackSPDvtx, kTPCTrackSPDvtxUpdate, kTPCITSHybrid, kTPCITSHybridTrackSPDvtx, kTPCITSHybridTrackSPDvtxDCArPt, kMCRec };
-    enum ParticleMode { kAllPart = 0, kMCPion, kMCKaon, kMCProton, kPlus, kMinus, kCosmic, kBackgroundTrack };
+    enum ParticleMode { kAllPart = 0, kMCPion, kMCKaon, kMCProton, kPlus, kMinus, kCosmic, kBackgroundTrack, kMCRest };
 
     enum OutputObject { kInvalidObject = -1, kCutAnalysis = 0, kAnalysis, kCorrection, kSystematics };
     enum TrackObject  { kInvalidTrackObject = -1, kAllTracks = 0, kAccTracks, kRecTracks, kMCTracks };