train version for AddTaskCentrality for testing
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 20 Nov 2010 12:54:40 +0000 (12:54 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 20 Nov 2010 12:54:40 +0000 (12:54 +0000)
PWG4/macros/AddTaskCentralitySelection.C [new file with mode: 0644]

diff --git a/PWG4/macros/AddTaskCentralitySelection.C b/PWG4/macros/AddTaskCentralitySelection.C
new file mode 100644 (file)
index 0000000..83f7f6c
--- /dev/null
@@ -0,0 +1,25 @@
+AliCentralitySelectionTask *AddTaskCentralitySelection(const char* percentilefile1, const char* percentilefile2){
+
+
+    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+    if(!mgr){
+       ::Error("AddTaskCentralitySelection", "No analysis manager to connect ot.");
+       return NULL;
+    }
+    if(!mgr->GetInputEventHandler()){
+        ::Error("AddTaskCentralitySelection", "This task requires an input event handler.");
+       return NULL;
+    }
+
+
+    AliCentralitySelectionTask *task = new AliCentralitySelectionTask("CentralitySelection");
+
+    if(percentilefile1) task->SetPercentileFile(percentilefile1);
+    if(percentilefile2) task->SetPercentileFile2(percentilefile2);
+
+    mgr->AddTask(task);
+
+    mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
+
+    return task;
+}