]>
Commit | Line | Data |
---|---|---|
110805a7 | 1 | AliAnalysisTask *AddTask_AntiHe4(){ |
2 | ||
3 | ||
4 | //get the current analysis manager | |
5 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
6 | if (!mgr) { | |
7 | Error("AddTask_AntiHe4", "No analysis manager found."); | |
8 | return 0; | |
9 | } | |
10 | ||
11 | // Check the analysis type using the event handlers connected to the analysis manager. | |
12 | //============================================================================== | |
13 | if (!mgr->GetInputEventHandler()) { | |
14 | ::Error("AddTask_AntiHe4", "This task requires an input event handler"); | |
15 | return NULL; | |
16 | } | |
17 | ||
18 | ||
19 | //========= Add task to the ANALYSIS manager ===== | |
20 | AliAnalysisTaskAntiHe4 *task = new AliAnalysisTaskAntiHe4("nmartinTaskAntiHe4"); | |
21 | ||
110805a7 | 22 | Int_t iResult = task->Initialize(); |
23 | if (!iResult) | |
24 | mgr->AddTask(task); | |
25 | else { | |
26 | //AliError("NO pt ranges specfied, not adding the task !!!"); | |
27 | return -1; | |
28 | } | |
29 | ||
30 | //mgr->AddTask(task); | |
31 | ||
32 | //================================================ | |
33 | // data containers | |
34 | //================================================ | |
35 | // find input container | |
36 | //below the trunk version | |
37 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
38 | ||
39 | //dumm output container | |
40 | AliAnalysisDataContainer *coutput0 = | |
41 | mgr->CreateContainer("nmartin_treeAntiHe4", | |
42 | TTree::Class(), | |
43 | AliAnalysisManager::kExchangeContainer, | |
44 | "nmartin_default"); | |
45 | ||
46 | //define output containers, please use 'username'_'somename' | |
47 | AliAnalysisDataContainer *coutput1 = | |
48 | mgr->CreateContainer("nmartin_AntiHe4", TObjArray::Class(),AliAnalysisManager::kOutputContainer,"nmartin_AntiHe4.root"); | |
49 | ||
50 | AliAnalysisDataContainer *coutput2 = | |
51 | mgr->CreateContainer("treeAntiHe4", TTree::Class(),AliAnalysisManager::kOutputContainer,"nmartin_AntiHe4Tree.root"); | |
52 | ||
53 | ||
54 | //connect containers | |
55 | mgr->ConnectInput (task, 0, cinput ); | |
56 | mgr->ConnectOutput (task, 0, coutput0); | |
57 | mgr->ConnectOutput (task, 1, coutput1); | |
58 | mgr->ConnectOutput (task, 2, coutput2); | |
59 | ||
60 | return task; | |
61 | } |