]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG4/macros/AddTaskomega3pi.C
new class for omega measurement via 3 pion combinationomega3pi/
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskomega3pi.C
diff --git a/PWG4/macros/AddTaskomega3pi.C b/PWG4/macros/AddTaskomega3pi.C
new file mode 100644 (file)
index 0000000..4a2d561
--- /dev/null
@@ -0,0 +1,34 @@
+AliAnalysisTaskOmegaPi0PiPi* AddTaskomega3pi()
+{
+  // Creates an omega(782) --> pi0 pi+ pi- analysis task, 
+  // configures it and adds it to the analysis manager.
+
+  // Get the pointer to the existing analysis manager via the static access method.
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    ::Error("AddTaskomega3pi", "No analysis manager to connect to.");
+    return NULL;
+  }  
+
+  // Check the analysis type using the event handlers connected to the analysis manager.
+  if (!mgr->GetInputEventHandler()) {
+    ::Error("AddTaskomega3pi", "This task requires an input event handler");
+    return NULL;
+  }
+  
+  // Add task
+  AliAnalysisTaskOmegaPi0PiPi *omegaTask = new AliAnalysisTaskOmegaPi0PiPi("OmegaPi0PiPi");
+  mgr->AddTask(omegaTask);
+
+  // Create containers for input/output
+  AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
+  AliAnalysisDataContainer *coutput = mgr->CreateContainer("histos",TList::Class(),AliAnalysisManager::kOutputContainer,"histos.root");
+  
+  // Connect input/output
+  mgr->ConnectInput(omegaTask, 0, cinput);
+  mgr->ConnectOutput(omegaTask, 1, coutput);
+  
+  return omegaTask;
+}
+
+