]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGLF/FORWARD/analysis2/AddTaskCentralMult.C
Updates to Trains. create a job-script to help
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AddTaskCentralMult.C
index abc99c5b13419dc78ae7d219410ec5c87015f7f1..b61fb6694811a4077e02caaf3962416a08948b30 100644 (file)
  * @ingroup pwglf_forward_aod
  */
 AliAnalysisTask* 
-AddTaskCentralMult(Bool_t mc=false, 
-                  UShort_t sys=0, UShort_t sNN=0, Short_t field=0)
+AddTaskCentralMult(Bool_t   mc=false, 
+                  UShort_t sys=0, 
+                  UShort_t sNN=0, 
+                  Short_t  field=0, 
+                  Int_t    debug=0)
 {
   // --- Load libraries ----------------------------------------------
   gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
@@ -32,28 +35,17 @@ AddTaskCentralMult(Bool_t mc=false,
   AliCentralMultiplicityTask* task = 0;
   if (!mc) task = new AliCentralMultiplicityTask("Central");
   else     task = new AliCentralMCMultiplicityTask("Central");
-  if(sys>0 && sNN > 0)
+  if(sys>0 && sNN > 0) {
     task->GetManager().Init(sys, sNN, field);
+    if (!task->GetManager().HasSecondaryCorrection()) 
+      Fatal("AddTaskCentralMult", "No secondary correction defined!");
+    if (!task->GetManager().HasAcceptanceCorrection()) 
+      Fatal("AddTaskCentralMult", "No acceptance correction defined!");
+  }
+  task->SetDebugLevel(debug);
+  task->Configure("CentralAODConfig.C");
   mgr->AddTask(task);
 
-  // --- Configure the task ------------------------------------------
-  TString macroPath(gROOT->GetMacroPath());
-  if (!macroPath.Contains("$(ALICE_ROOT)/PWGLF/FORWARD/analysis2")) { 
-    macroPath.Append(":$(ALICE_ROOT)/PWGLF/FORWARD/analysis2");
-    gROOT->SetMacroPath(macroPath);
-  }
-  const char* config = gSystem->Which(gROOT->GetMacroPath(),
-                                     "CentralAODConfig.C");
-  if (!config) 
-    Warning("AddTaskCentralMult", "CentralAODConfig.C not found in %s",
-           gROOT->GetMacroPath());
-  else {
-    Info("AddTaskCentralMult", 
-        "Loading configuration of '%s' from %s",
-        task->ClassName(), config);
-    gROOT->Macro(Form("%s((AliCentralMultiplicityTask*)%p)", config, task));
-    delete config;
-  }
 
   // --- Make the output container and connect it --------------------
   TString outputfile = AliAnalysisManager::GetCommonFileName();