committing on behalf of Silvia... new macros for HFE analysis on the train (Markus
[u/mrichter/AliRoot.git] / PWG3 / hfe / macros / AddTaskHFE.C
CommitLineData
d3338371 1AliAnalysisTask *AddTaskHFE(){
2 //get the current analysis manager
3 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
4 if (!mgr) {
5 Error("AddTaskHFE", "No analysis manager found.");
6 return NULL;
7 }
8 if (!mgr->GetInputEventHandler()) {
9 ::Error("AddTaskHFE", "This task requires an input event handler");
10 return NULL;
11 }
12 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
13 if (type=="AOD"){
14 ::Error("AddTaskHFE", "The tasks exits because AODs are in input");
15 return NULL;
16 }
17 Bool_t MCthere=kTRUE;
18 AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*>(mgr->GetMCtruthEventHandler());
19 if(!mcH){
20 MCthere=kFALSE;
21 }
22
23 //============= Set Task Name ===================
24 //TString taskName=("AliAnalysisTaskHFE.cxx+");
25 //===============================================
26
27 gROOT->LoadMacro(Form("%s/PWG3/hfe/macros/ConfigHFEstandard.C", gSystem->Getenv("ALICE_ROOT")));
28 //gROOT->LoadMacro(Form("%s/PWG3/hfe/macros/ConfigHFEtrd.C", gSystem->Getenv("ALICE_ROOT")));
29
30 AliAnalysisTaskHFE *hfetask = ConfigHFEstandard(MCthere);
31 mgr->AddTask(hfetask);
32
33 //----------------------
34 //create data containers
35 //----------------------
36
37 //find input container
38 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
39 TString containerName = mgr->GetCommonFileName();
40 containerName += ":PWG3_hfe";
41
42 hfetask->ConnectOutput(1, mgr->CreateContainer("HFE_Results", TList::Class(),
43 AliAnalysisManager::kOutputContainer, containerName.Data()));
44 hfetask->ConnectOutput(2, mgr->CreateContainer("HFE_QA", TList::Class(),
45 AliAnalysisManager::kOutputContainer, containerName.Data()));
46 mgr->ConnectInput (hfetask, 0, cinput );
47
48/*
49 AliAnalysisTaskHFE *trdtask = ConfigHFEtrd(MCthere);
50
51 //----------------------
52 //create data containers
53 //----------------------
54
55 trdtask->ConnectOutput(1, mgr->CreateContainer("HFE_Results", TList::Class(),
56 AliAnalysisManager::kOutputContainer, containerName.Data()));
57 trdtask->ConnectOutput(2, mgr->CreateContainer("HFE_QA", TList::Class(),
58 AliAnalysisManager::kOutputContainer, containerName.Data()));
59 mgr->ConnectInput (trdtask, 0, cinput );
60*/
61
62 return hfetask;
63}