]>
Commit | Line | Data |
---|---|---|
fc2726be | 1 | AliAnalysisTask AddTaskHFEElecHadronCorrl() |
2 | { | |
3 | //get the current analysis manager | |
4 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
5 | if (!mgr) { | |
6 | Error("AddTaskHFEElecHadronCorrl", "No analysis manager found."); | |
7 | return 0; | |
8 | } | |
9 | ||
10 | if (!mgr->GetInputEventHandler()) { | |
11 | ::Error("AddTaskHFEElecHadronCorrl", "This task requires an input event handler"); | |
12 | return NULL; | |
13 | } | |
14 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
15 | if (type=="AOD"){ | |
16 | ::Error("AddTaskHFEElecHadronCorrl", "The tasks exits because AODs are in input"); | |
17 | return NULL; | |
18 | } | |
19 | Bool_t MCthere=kTRUE; | |
20 | AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*>(mgr->GetMCtruthEventHandler()); | |
21 | if(!mcH){ | |
22 | MCthere=kFALSE; | |
23 | } | |
24 | ||
25 | //analysis task | |
0614a0b1 | 26 | //gROOT->LoadMacro("$ALICE_ROOT/PWGHF/hfe/AliAnalysisTaskElecHadronCorrel.cxx++g"); |
fc2726be | 27 | //gROOT->LoadMacro("ConfigHFEemcalMod.C"); |
28 | gROOT->LoadMacro("$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/ConfigHFEElecHadronCorl.C"); | |
84074834 | 29 | AliAnalysisTaskElecHadronCorrel *taskHFE = ConfigHFEElecHadronCorl(MCthere); |
fc2726be | 30 | |
31 | // output list of histos | |
84074834 | 32 | //TString foutputName = "ElecHadronCorrelAna.root"; |
33 | //AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("ccontainer0",TList::Class(),AliAnalysisManager::kOutputContainer,foutputName.Data()); | |
fc2726be | 34 | |
84074834 | 35 | TString containerName = mgr->GetCommonFileName(); |
36 | containerName += ":PWGHF_hfeCalPbPbeh"; | |
37 | AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("ccontainer0",TList::Class(),AliAnalysisManager::kOutputContainer,containerName.Data()); | |
38 | ||
fc2726be | 39 | mgr->ConnectInput(taskHFE,0,mgr->GetCommonInputContainer()); |
40 | mgr->ConnectOutput(taskHFE,1,coutput3); | |
41 | ||
42 | mgr->AddTask(taskHFE); | |
43 | ||
44 | return taskHFE; | |
45 | } |