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

diff --git a/PWGHF/hfe/macros/AddTaskHFECalPbPb.C b/PWGHF/hfe/macros/AddTaskHFECalPbPb.C
new file mode 100644 (file)
index 0000000..704fa66
--- /dev/null
@@ -0,0 +1,78 @@
+AliAnalysisTask *AddTaskHFECalPbPb(){
+  //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;
+  }
+  Bool_t MCthere=kFALSE;
+  AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*>(mgr->GetMCtruthEventHandler());
+  if(!mcH){
+    MCthere=kFALSE;
+  }else{
+    MCthere=kTRUE;
+  }
+  cout<<"AddTaskHFE - MC config is: "<<MCthere<<endl;
+
+  //============= Set Task Name ===================
+  //TString taskName=("AliAnalysisTaskHFE.cxx+");
+  //===============================================
+  
+  //cout<<"BLEH!"<<endl;
+  //gROOT->LoadMacro(Form("%s/PWG3/hfe/macros/ConfigHFEstandard.C",gSystem->Getenv("ALICE_ROOT")));
+  //gROOT->LoadMacro("$ETRAIN_ROOT/hfe/ConfigHFEemcalMod.C");
+  gROOT->LoadMacro("$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/ConfigHFECalstandard_PbPb.C");
+  //cout<<"BLEH2!"<<endl;
+  //gROOT->LoadMacro(Form("%s/PWG3/hfe/macros/ConfigHFEtrd.C", gSystem->Getenv("ALICE_ROOT")));
+
+  //AliAnalysisTaskHFEMod *hfetask = ConfigHFEemcalMod(MCthere);
+  AliAnalysisTaskHFE *hfetask = ConfigHFECalstandard_PbPb(MCthere);
+  //RequestMemory(hfetask, 250*1024);
+
+  //Added by Irakli's request
+  hfetask->SelectCollisionCandidates(AliVEvent::kEMCEGA);
+  mgr->AddTask(hfetask);
+
+  //----------------------
+  //create data containers
+  //----------------------
+  //find input container
+  AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
+  TString containerName = mgr->GetCommonFileName();
+  containerName += ":PWGHF_hfe";
+  
+  TString outname = Form("HFEtaskCalPbPb.root");
+
+  hfetask->ConnectOutput(1, mgr->CreateContainer("HFE_Results_EMCAL", TList::Class(),
+                                                AliAnalysisManager::kOutputContainer, outname.Data()));
+  hfetask->ConnectOutput(2, mgr->CreateContainer("HFE_QA_EMCAL", TList::Class(),
+                                             AliAnalysisManager::kOutputContainer, outname.Data()));
+
+  mgr->ConnectInput  (hfetask,  0, cinput );
+  
+/*
+  AliAnalysisTaskHFE *trdtask = ConfigHFEtrd(MCthere);
+
+  //----------------------
+  //create data containers
+  //----------------------
+  trdtask->ConnectOutput(1, mgr->CreateContainer("HFE_Results", TList::Class(),
+                                             AliAnalysisManager::kOutputContainer, containerName.Data()));
+  trdtask->ConnectOutput(2, mgr->CreateContainer("HFE_QA", TList::Class(),
+                                             AliAnalysisManager::kOutputContainer, containerName.Data()));
+  mgr->ConnectInput  (trdtask,  0, cinput );
+*/
+
+  return hfetask;
+}