macro that adds the HFE task to the official analysis train (Silvia)
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 14:37:25 +0000 (14:37 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Oct 2009 14:37:25 +0000 (14:37 +0000)
PWG3/hfe/AddTaskHFE.C [new file with mode: 0644]

diff --git a/PWG3/hfe/AddTaskHFE.C b/PWG3/hfe/AddTaskHFE.C
new file mode 100644 (file)
index 0000000..890f346
--- /dev/null
@@ -0,0 +1,51 @@
+AliAnalysisTask *AddTaskHFE(){
+  //get the current analysis manager
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    Error("AddTaskHFE", "No analysis manager found.");
+    return NULL;
+  }
+  if (!mgr->GetInputEventHandler()) {
+    ::Error("AddTaskHFE", "This task requires an input event handler");
+    return NULL;
+  }  
+  TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+  if (type=="AOD"){
+    ::Error("AddTaskHFE", "The tasks exits because AODs are in input");
+    return NULL;
+  }
+
+  //============= Set Task Name ===================
+  //TString taskName=("AliAnalysisTaskHFE.cxx+");
+  //===============================================
+
+  AliHFEcuts *hfecuts = new AliHFEcuts;
+  hfecuts->CreateStandardCuts();
+  hfecuts->SetCutITSpixel(AliHFEextraCuts::kFirst);
+  //hfecuts->SetCheckITSLayerStatus(kFALSE);
+
+  AliAnalysisTaskHFE *task = new AliAnalysisTaskHFE;
+  task->AddPIDdetector("TPC");
+  //task->SetPIDStrategy(3);  
+  task->SetHFECuts(hfecuts);
+  task->SetQAOn(AliAnalysisTaskHFE::kMCqa);
+  task->SetSecVtxOn();
+  mgr->AddTask(task);
+
+  //----------------------
+  //create data containers
+  //----------------------
+
+  //find input container
+  AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
+  
+  task->ConnectOutput(0, mgr->CreateContainer("nEvents", TH1I::Class(),
+                                             AliAnalysisManager::kOutputContainer, "HFEtask.root"));
+  task->ConnectOutput(1, mgr->CreateContainer("Results", TList::Class(),
+                                             AliAnalysisManager::kOutputContainer, "HFEtask.root"));
+  task->ConnectOutput(2, mgr->CreateContainer("QA", TList::Class(),
+                                             AliAnalysisManager::kOutputContainer, "HFEtask.root"));
+  mgr->ConnectInput  (task,  0, cinput );
+  
+  return task;
+}