Add PHOSTender for AOD
authorprsnko <prsnko@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Dec 2012 16:35:06 +0000 (16:35 +0000)
committerprsnko <prsnko@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Dec 2012 16:35:06 +0000 (16:35 +0000)
PWGGA/PHOSTasks/PHOS_PbPb/AddAODPHOSTender.C [new file with mode: 0644]

diff --git a/PWGGA/PHOSTasks/PHOS_PbPb/AddAODPHOSTender.C b/PWGGA/PHOSTasks/PHOS_PbPb/AddAODPHOSTender.C
new file mode 100644 (file)
index 0000000..37efa80
--- /dev/null
@@ -0,0 +1,30 @@
+AliPHOSTenderTask* AddAODPHOSTender()
+{
+  //Add a task with PHOS tender which works with AOD to the analysis train
+  //Author: D.Peressounko
+
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    ::Error("AddTaskPHOSPi0Flow", "No analysis manager to connect to");
+    return NULL;
+  }
+  
+  if (!mgr->GetInputEventHandler()) {
+    ::Error("AddTaskPHOSPi0Flow", "This task requires an input event handler");
+    return NULL;
+  }
+
+  AliPHOSTenderTask * tenderTask = new AliPHOSTenderTask("AODPHOSTender") ;
+  mgr->AddTask(tenderTask);
+
+  AliPHOSTenderSupply *PHOSSupply=new AliPHOSTenderSupply("PHOStender");
+  PHOSSupply->SetReconstructionPass(1) ;
+  tenderTask->SetPHOSTenderSupply(PHOSSupply);
+
+  AliAnalysisDataContainer *cinput   = mgr->GetCommonInputContainer();
+
+  // Connect input/output
+  mgr->ConnectInput(tenderTask , 0, cinput);
+
+  return tenderTask;
+}