]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/AddTaskThreeJets.C
Added tasks from Sona
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskThreeJets.C
1 AliAnalysisTaskThreeJets * AddTaskThreeJets()\r
2 {\r
3   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
4   if (!mgr) {\r
5     ::Error("AddTaskThreeJets", "No analysis manager to connect to.");\r
6     return NULL;\r
7   }  \r
8   \r
9   // Check the analysis type using the event handlers connected to the analysis manager.\r
10   //==============================================================================\r
11   if (!mgr->GetInputEventHandler()) {\r
12     ::Error("AddTaskThreeJets", "This task requires an input event handler");\r
13     return NULL;\r
14    }\r
15   \r
16   // Create the task and configure it.\r
17   //===========================================================================\r
18   \r
19   AliAnalysisTaskThreeJets * threeJets = new  AliAnalysisTaskThreeJets("Three Jet Analysis");\r
20   \r
21   threeJets->SetBranchGen("jetsMC"); \r
22   threeJets->SetBranchRec("jets");\r
23   threeJets->SetR(.5); \r
24   mgr->AddTask(threeJets);\r
25    \r
26 \r
27 \r
28       \r
29    // Create ONLY the output containers for the data produced by the task.\r
30    // Get and connect other common input/output containers via the manager as below\r
31    //==============================================================================\r
32    AliAnalysisDataContainer *coutput1_Corr = mgr->CreateContainer("threeJets", TList::Class(),AliAnalysisManager::kOutputContainer,"threeJets.root");\r
33 \r
34    mgr->ConnectInput  (threeJets, 0, mgr->GetCommonInputContainer());\r
35    mgr->ConnectOutput (threeJets, 0, mgr->GetCommonOutputContainer());\r
36    mgr->ConnectOutput (threeJets,  1, coutput1_Corr );\r
37    \r
38    return threeJets;\r
39 }\r
40 \r
41 \r
42 AliAnalysisTaskThreeJets * AddTaskJetCorrections(AliAnalysisManager* mgr,AliAnalysisDataContainer *cinput)\r
43 {\r
44   if (!mgr) {\r
45     ::Error("AddTaskJetSpectrum", "No analysis manager to connect to.");\r
46     return NULL;\r
47   }  \r
48   \r
49   // Check the analysis type using the event handlers connected to the analysis manager.\r
50   //==============================================================================\r
51   if (!mgr->GetInputEventHandler()) {\r
52     ::Error("AddTaskJetSpectrum", "This task requires an input event handler");\r
53     return NULL;\r
54    }\r
55   \r
56   AliAnalysisTaskThreeJets * threeJets = new  AliAnalysisTaskThreeJets("ThreeJetAnalysis");\r
57   \r
58   threeJets->SetBranchGen("jetsMC"); \r
59   threeJets->SetBranchRec("jets");\r
60   threeJets->SetR(.5); \r
61   mgr->AddTask(threeJets);\r
62 \r
63   AliAnalysisDataContainer * coutpu0 = mgr->CreateContainer("coutpu0", TTree::Class(),\r
64                                   AliAnalysisManager::kExchangeContainer);\r
65   AliAnalysisDataContainer *coutput1_threeJets = mgr->CreateContainer("threeJets", TList::Class(),AliAnalysisManager::kOutputContainer,"threeJets.root");\r
66 \r
67    mgr->ConnectInput  (threeJets, 0, cinput);\r
68    mgr->ConnectOutput (threeJets, 0, coutpu0);\r
69    mgr->ConnectOutput (threeJets,  1, coutput1_Corr );\r
70    \r
71    return threeJets;\r
72 }\r
73 \r