Modifications to allow to use tracks from 1/2 of TPC for event plane resolution ...
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TPCTOF / AddTaskCombinedHadronSpectra.C
CommitLineData
c1466b2c 1\r
2\r
3AliAnalysisTask *AddTaskAlex(Int_t identifier = 0, Bool_t isMC = kFALSE, Bool_t isTPConly = kFALSE, Bool_t setTrackCuts = kFALSE, AliESDtrackCuts *ESDtrackCuts = 0){\r
4\r
5\r
6 //get the current analysis manager\r
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
8 if (!mgr) {\r
9 Error("AddTask_akalweit_CombinedHadron", "No analysis manager found.");\r
10 return 0;\r
11 }\r
12 //============= Set Task Name ===================\r
13 TString taskName=("AliAnalysisCombinedHadronSpectra.cxx+g");\r
14 //===============================================\r
15 // Load the task\r
16 gROOT->LoadMacro(taskName.Data());\r
17\r
18\r
19 \r
20 //========= Add task to the ANALYSIS manager =====\r
21\r
22 //normal tracks\r
23 AliAnalysisCombinedHadronSpectra *task = new AliAnalysisCombinedHadronSpectra("akalweitTaskCombinedHadron");\r
24 task->SelectCollisionCandidates(AliVEvent::kMB);\r
25\r
26 //switches\r
27 if (isMC) task->SetIsMCtrue(isMC);\r
28 if (isTPConly)task->SetUseTPConlyTracks(isTPConly);\r
29\r
30\r
31 //initialize task\r
32 task->Initialize();\r
33\r
34 //esd cuts need to be set after initialize or cuts will be replaced by standard cuts in initialize\r
35 if (setTrackCuts) task->SetESDtrackCuts(ESDtrackCuts);\r
36\r
37 //add task to manager\r
38 mgr->AddTask(task);\r
39\r
40\r
41 \r
42\r
43 //================================================\r
44 // data containers\r
45 //================================================\r
46 // find input container\r
47 //below the trunk version\r
48 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();\r
49\r
50 //dumm output container\r
51 AliAnalysisDataContainer *coutput0 =\r
52 mgr->CreateContainer(Form("akalweit_tree%i",identifier),\r
53 TTree::Class(),\r
54 AliAnalysisManager::kExchangeContainer,\r
55 Form("akalweit_default%i",identifier));\r
56\r
57\r
58 //define output containers, please use 'username'_'somename'\r
59 AliAnalysisDataContainer *coutput1 = \r
60 mgr->CreateContainer(Form("akalweit_CombinedHadron%i",identifier), TList::Class(),\r
61 AliAnalysisManager::kOutputContainer,Form("akalweit_CombinedHadron%i.root",identifier));\r
62\r
63\r
64\r
65 //connect containers\r
66\r
67 //\r
68 mgr->ConnectInput (task, 0, cinput );\r
69 mgr->ConnectOutput (task, 0, coutput0);\r
70 mgr->ConnectOutput (task, 1, coutput1);\r
71\r
72 return task;\r
73}\r