new add task for PbPb
authorssakai <ssakai@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 18 Mar 2012 11:14:03 +0000 (11:14 +0000)
committerssakai <ssakai@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 18 Mar 2012 11:14:03 +0000 (11:14 +0000)
PWGHF/hfe/macros/AddTaskHFEElecHadronCorrl.C [new file with mode: 0644]

diff --git a/PWGHF/hfe/macros/AddTaskHFEElecHadronCorrl.C b/PWGHF/hfe/macros/AddTaskHFEElecHadronCorrl.C
new file mode 100644 (file)
index 0000000..d9462b2
--- /dev/null
@@ -0,0 +1,41 @@
+AliAnalysisTask AddTaskHFEElecHadronCorrl()
+{
+  //get the current analysis manager
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    Error("AddTaskHFEElecHadronCorrl", "No analysis manager found.");
+    return 0;
+  }
+
+  if (!mgr->GetInputEventHandler()) {
+    ::Error("AddTaskHFEElecHadronCorrl", "This task requires an input event handler");
+    return NULL;
+  }
+  TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+  if (type=="AOD"){
+    ::Error("AddTaskHFEElecHadronCorrl", "The tasks exits because AODs are in input");
+    return NULL;
+  }
+  Bool_t MCthere=kTRUE;
+  AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*>(mgr->GetMCtruthEventHandler());
+  if(!mcH){
+    MCthere=kFALSE;
+  }
+
+  //analysis task 
+  gROOT->LoadMacro("AliAnalysisTaskElecHadronCorrel2.cxx++g");
+  //gROOT->LoadMacro("ConfigHFEemcalMod.C");
+  gROOT->LoadMacro("$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/ConfigHFEElecHadronCorl.C");
+  AliAnalysisTaskElecHadronCorrel2 *taskHFE = ConfigHFEemcalMod(MCthere);
+
+  // output list of histos
+  TString foutputName = "ElecHadronCorrelAna.root";
+  AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("ccontainer0",TList::Class(),AliAnalysisManager::kOutputContainer,foutputName.Data());
+
+  mgr->ConnectInput(taskHFE,0,mgr->GetCommonInputContainer());
+  mgr->ConnectOutput(taskHFE,1,coutput3);
+
+  mgr->AddTask(taskHFE);
+
+  return taskHFE;
+}