Modifications for TPC only tracks (J. Anielski)
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / PiKaPr / TPCTOF / AddTaskCombinedHadronSpectra.C
CommitLineData
84626434 1AliAnalysisTask *AddTaskCombinedHadronSpectra(Bool_t isMC=kFALSE, Bool_t tpcOnly = kFALSE){
2 //get the current analysis manager
3 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
4 if (!mgr) {
5 Error("AddTask_akalweit_CombinedHadron", "No analysis manager found.");
6 return 0;
7 }
8 //============= Set Task Name ===================
9 TString taskName=("AliAnalysisCombinedHadronSpectra.cxx+g");
10 //===============================================
11 // Load the task
12 //gROOT->LoadMacro(taskName.Data());
13
14
15
16 //========= Add task to the ANALYSIS manager =====
17 AliAnalysisCombinedHadronSpectra *task = new AliAnalysisCombinedHadronSpectra("akalweitTaskCombinedHadron");
18 task->SelectCollisionCandidates(AliVEvent::kMB);
19
20
21 if (isMC) task->SetIsMCtrue();
22 if (tpcOnly) {
23 task->SetUseTPConlyTracks(kTRUE);
24 task->Initialize();
25 }
26
27 mgr->AddTask(task);
28
29
30 //================================================
31 // data containers
32 //================================================
33 // find input container
34 //below the trunk version
35 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
36
37 //dumm output container
38 AliAnalysisDataContainer *coutput0 =
39 mgr->CreateContainer("akalweit_tree",
40 TTree::Class(),
41 AliAnalysisManager::kExchangeContainer,
42 "akalweit_default");
43
44 //define output containers, please use 'username'_'somename'
45 AliAnalysisDataContainer *coutput1 =
46 mgr->CreateContainer("akalweit_CombinedHadron", TList::Class(),
47 AliAnalysisManager::kOutputContainer,"akalweit_CombinedHadron.root");
48
49 //connect containers
50 mgr->ConnectInput (task, 0, cinput );
51 mgr->ConnectOutput (task, 0, coutput0);
52 mgr->ConnectOutput (task, 1, coutput1);
53
54 return task;
55}