Addsupport for AOD /delta AOD, limit printouts and use different names for output...
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskThreeJets.C
CommitLineData
5010a3f7 1AliAnalysisTaskThreeJets * AddTaskThreeJets(char *bRec = "jets",char * bGen = "jetsAODMC_UA104")\r
95392a57 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
5010a3f7 21 threeJets->SetBranchRec(bRec);\r
22 threeJets->SetBranchGen(bGen); \r
6b7d2b7e 23 // threeJets->SetDebugLevel(10);\r
95392a57 24 threeJets->SetR(.5); \r
5010a3f7 25 \r
26 TString type = mgr->GetInputEventHandler()->GetDataType();\r
27 if(type == "AOD"){\r
28 threeJets->SetAODInput(kTRUE);\r
29 }\r
30\r
95392a57 31 mgr->AddTask(threeJets);\r
32 \r
5010a3f7 33 \r
95392a57 34\r
35\r
36 \r
5010a3f7 37 // Create ONLY the output containers for the data produced by the task.\r
38 // Get and connect other common input/output containers via the manager as below\r
39 //==============================================================================\r
40 AliAnalysisDataContainer *coutput1_Corr = mgr->CreateContainer(Form("threeJets_%s_%s",bRec,bGen), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWG4_threeJets_%s_%s",AliAnalysisManager::GetCommonFileName(),bRec,bGen));\r
95392a57 41\r
5010a3f7 42 mgr->ConnectInput (threeJets, 0, mgr->GetCommonInputContainer());\r
43 mgr->ConnectOutput (threeJets, 0, mgr->GetCommonOutputContainer());\r
44 mgr->ConnectOutput (threeJets, 1, coutput1_Corr );\r
45 \r
46 return threeJets;\r
95392a57 47}\r
48\r
49\r
50AliAnalysisTaskThreeJets * AddTaskJetCorrections(AliAnalysisManager* mgr,AliAnalysisDataContainer *cinput)\r
51{\r
52 if (!mgr) {\r
53 ::Error("AddTaskJetSpectrum", "No analysis manager to connect to.");\r
54 return NULL;\r
55 } \r
56 \r
57 // Check the analysis type using the event handlers connected to the analysis manager.\r
58 //==============================================================================\r
59 if (!mgr->GetInputEventHandler()) {\r
60 ::Error("AddTaskJetSpectrum", "This task requires an input event handler");\r
61 return NULL;\r
62 }\r
63 \r
64 AliAnalysisTaskThreeJets * threeJets = new AliAnalysisTaskThreeJets("ThreeJetAnalysis");\r
65 \r
66 threeJets->SetBranchGen("jetsMC"); \r
67 threeJets->SetBranchRec("jets");\r
68 threeJets->SetR(.5); \r
69 mgr->AddTask(threeJets);\r
70\r
71 AliAnalysisDataContainer * coutpu0 = mgr->CreateContainer("coutpu0", TTree::Class(),\r
72 AliAnalysisManager::kExchangeContainer);\r
73 AliAnalysisDataContainer *coutput1_threeJets = mgr->CreateContainer("threeJets", TList::Class(),AliAnalysisManager::kOutputContainer,"threeJets.root");\r
74\r
75 mgr->ConnectInput (threeJets, 0, cinput);\r
76 mgr->ConnectOutput (threeJets, 0, coutpu0);\r
77 mgr->ConnectOutput (threeJets, 1, coutput1_Corr );\r
78 \r
79 return threeJets;\r
80}\r
81\r