]>
Commit | Line | Data |
---|---|---|
3c8cbb48 | 1 | AliAnalysisTask AddTaskHFEElecHadronCorrlPbPb() |
2 | { | |
3 | //get the current analysis manager | |
4 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
5 | if (!mgr) { | |
6 | Error("AddTaskHFEElecHadronCorrlPbPb", "No analysis manager found."); | |
7 | return 0; | |
8 | } | |
9 | ||
10 | if (!mgr->GetInputEventHandler()) { | |
11 | ::Error("AddTaskHFEElecHadronCorrlPbPb", "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("AddTaskHFEElecHadronCorrlPbPb", "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 | |
26 | gROOT->LoadMacro("$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/ConfigHFEElecHadronCorrelPbPb.C"); | |
27 | AliAnalysisTaskElecHadronCorrel *taskHFEeh = ConfigHFEElecHadronCorrelPbPb(MCthere); | |
28 | ||
29 | TString containerName = mgr->GetCommonFileName(); | |
30 | containerName += ":PWGHF_hfeCalPbPbeh"; | |
31 | AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("ccontainer0",TList::Class(),AliAnalysisManager::kOutputContainer,containerName.Data()); | |
32 | ||
33 | mgr->ConnectInput(taskHFEeh,0,mgr->GetCommonInputContainer()); | |
34 | mgr->ConnectOutput(taskHFEeh,1,coutput3); | |
35 | ||
36 | mgr->AddTask(taskHFEeh); | |
37 | ||
38 | return taskHFEeh; | |
39 | } |