]>
Commit | Line | Data |
---|---|---|
e2d2636c | 1 | AliAnalysisTask *AddTask_nmartin_LambdaNAOD(){ |
2 | ||
3 | ||
4 | //get the current analysis manager | |
5 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
6 | if (!mgr) { | |
7 | Error("AddTask_nmartin_LambdaNAOD", "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_nmartin_LambdaNAOD", "This task requires an input event handler"); | |
15 | return NULL; | |
16 | } | |
17 | ||
18 | ||
19 | //========= Add task to the ANALYSIS manager ===== | |
20 | AliAnalysisTaskLambdaNAOD *task = new AliAnalysisTaskLambdaNAOD("nmartinTaskLambdaNAOD"); | |
21 | ||
22 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
23 | task->SetAnalysisType (type); | |
24 | ||
25 | ||
26 | Int_t iResult = task->Initialize(); | |
27 | if (!iResult) | |
28 | mgr->AddTask(task); | |
29 | else { | |
30 | //AliError("NO pt ranges specfied, not adding the task !!!"); | |
31 | return -1; | |
32 | } | |
33 | ||
34 | //mgr->AddTask(task); | |
35 | ||
36 | //================================================ | |
37 | // data containers | |
38 | //================================================ | |
39 | // find input container | |
40 | //below the trunk version | |
41 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
42 | ||
43 | //dumm output container | |
44 | AliAnalysisDataContainer *coutput0 = | |
45 | mgr->CreateContainer("nmartin_treeLambdaN", | |
46 | TTree::Class(), | |
47 | AliAnalysisManager::kExchangeContainer, | |
48 | "nmartin_default"); | |
49 | ||
50 | //define output containers, please use 'username'_'somename' | |
51 | AliAnalysisDataContainer *coutput1 = | |
52 | mgr->CreateContainer("nmartin_LambdaNAOD", TObjArray::Class(),AliAnalysisManager::kOutputContainer,"nmartin_LambdaNAOD.root"); | |
53 | ||
54 | AliAnalysisDataContainer *coutput2 = | |
55 | mgr->CreateContainer("treeLambdaNAOD", TTree::Class(),AliAnalysisManager::kOutputContainer,"nmartin_TreeLambdaNAOD.root"); | |
56 | ||
57 | ||
58 | //connect containers | |
59 | mgr->ConnectInput (task, 0, cinput ); | |
60 | mgr->ConnectOutput (task, 0, coutput0); | |
61 | mgr->ConnectOutput (task, 1, coutput1); | |
62 | mgr->ConnectOutput (task, 2, coutput2); | |
63 | ||
64 | return task; | |
65 | } |