Centrality estimator added; centrality bin edges are defined (P.Batzing)
authorYuri Kharlov <Yuri.Kharlov@cern.ch>
Thu, 16 Jan 2014 11:48:31 +0000 (15:48 +0400)
committerYuri Kharlov <Yuri.Kharlov@cern.ch>
Thu, 16 Jan 2014 11:48:31 +0000 (15:48 +0400)
PWGGA/PHOSTasks/PHOS_pPb/AddTaskPHOSPi0pPbMC.C

index 2d7e19f..6d61858 100644 (file)
@@ -1,37 +1,60 @@
 AliAnalysisTaskPi0FlowMC* AddTaskPHOSPi0pPbMC (const char* name = "PHOSPi0pPbMC",
                                            const char* options = "",
-                                              UInt_t offlineTriggerMask = AliVEvent::kINT7)
+                                              UInt_t offlineTriggerMask = AliVEvent::kINT7,
+                                              const char* centrality = "V0M",
+                                              const Int_t nCentBins = 5,
+                                              const Int_t centEdge0 = 0,
+                                              const Int_t centEdge1 = 20,
+                                              const Int_t centEdge2 = 40,
+                                              const Int_t centEdge3 = 60,
+                                              const Int_t centEdge4 = 80,
+                                              const Int_t centEdge5 = 100)
 {
-  //Add a task AliAnalysisTaskPi0FlowMC to the analysis train, for LHC13 PbP data
+  //Add a task AliAnalysisTaskPi0FlowMC to the analysis train, for LHC13 PbP MC productions
   //Author:  Paul Baetzing
   /* $Id$ */
 
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) {
-    ::Error("AddTaskPHOSPi0FlowMC", "No analysis manager to connect to");
+    ::Error("AddTaskPHOSPi0pPbMC", "No analysis manager to connect to");
     return NULL;
   }
   
   if (!mgr->GetInputEventHandler()) {
-    ::Error("AddTaskPHOSPi0FlowMC", "This task requires an input event handler");
+    ::Error("AddTaskPHOSPi0pPbMC", "This task requires an input event handler");
     return NULL;
   }
 
   AliAnalysisTaskPi0FlowMC* task = new AliAnalysisTaskPi0FlowMC(Form("%sTask", name));
 
+  if( AliVEvent::kINT7 == offlineTriggerMask ) {
+    if (nCentBins<1) {
+      ::Error("AddTaskPHOSPi0pPb", Form("Invalid number of centrality bins: %d",nCentBins));
+      return NULL;
+    }
+    Double_t *cbin = new Double_t[nCentBins+1];
+    cbin[0] = centEdge0;
+    cbin[1] = centEdge1;
+    if (nCentBins > 1) cbin[2] = centEdge2;
+    if (nCentBins > 2) cbin[3] = centEdge3;
+    if (nCentBins > 3) cbin[4] = centEdge4;
+    if (nCentBins > 4) cbin[5] = centEdge5;
+    TArrayD tbin(nCentBins+1, cbin);
+
+    Int_t    *nMixed = new Int_t[nCentBins];
+    for (Int_t ibin=0; ibin<nCentBins; ibin++) nMixed[ibin] = 20;
+    TArrayI tNMixed(nCentBins, nMixed);
+    task->SetCentralityBinning(tbin, tNMixed);
+  }
+
+  task->SetCentralityEstimator(centrality);
 
-  // Binning
-  const int nbins = 5;
-  Double_t cbin[nbins+1] = {0., 20., 40., 60., 80.,100.};
-  TArrayD tbin(nbins+1, cbin);
-  Int_t    nMixed[nbins] = {40, 40, 40, 40, 40};
-  TArrayI tNMixed(nbins, nMixed);
-  task->SetCentralityBinning(tbin, tNMixed);
 
   //task->SetEventMixingRPBinning(9);
   //task->SetMixingArraysLength(10);
   task->SelectCollisionCandidates(offlineTriggerMask);
   
+  task->SetEnablePHOSModule(2, kFALSE);
 
   mgr->AddTask(task);
   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer() );