]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/macros/AddTaskThreeJets.C
AliTPCcalibCalib.cxx - use also alignmnet - not implemented yet
[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
3ae212a1 25 // threeJets->SetUseMC(kFALSE); // explicitly switch of use of MC/search for MC Jets\r
26\r
5010a3f7 27 \r
28 TString type = mgr->GetInputEventHandler()->GetDataType();\r
29 if(type == "AOD"){\r
30 threeJets->SetAODInput(kTRUE);\r
31 }\r
3ae212a1 32 \r
33\r
5010a3f7 34\r
95392a57 35 mgr->AddTask(threeJets);\r
36 \r
5010a3f7 37 \r
95392a57 38\r
39\r
40 \r
5010a3f7 41 // Create ONLY the output containers for the data produced by the task.\r
42 // Get and connect other common input/output containers via the manager as below\r
43 //==============================================================================\r
44 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 45\r
5010a3f7 46 mgr->ConnectInput (threeJets, 0, mgr->GetCommonInputContainer());\r
47 mgr->ConnectOutput (threeJets, 0, mgr->GetCommonOutputContainer());\r
48 mgr->ConnectOutput (threeJets, 1, coutput1_Corr );\r
49 \r
50 return threeJets;\r
95392a57 51}\r
52\r
53\r
54AliAnalysisTaskThreeJets * AddTaskJetCorrections(AliAnalysisManager* mgr,AliAnalysisDataContainer *cinput)\r
55{\r
56 if (!mgr) {\r
57 ::Error("AddTaskJetSpectrum", "No analysis manager to connect to.");\r
58 return NULL;\r
59 } \r
60 \r
61 // Check the analysis type using the event handlers connected to the analysis manager.\r
62 //==============================================================================\r
63 if (!mgr->GetInputEventHandler()) {\r
64 ::Error("AddTaskJetSpectrum", "This task requires an input event handler");\r
65 return NULL;\r
66 }\r
67 \r
68 AliAnalysisTaskThreeJets * threeJets = new AliAnalysisTaskThreeJets("ThreeJetAnalysis");\r
69 \r
70 threeJets->SetBranchGen("jetsMC"); \r
71 threeJets->SetBranchRec("jets");\r
72 threeJets->SetR(.5); \r
73 mgr->AddTask(threeJets);\r
74\r
75 AliAnalysisDataContainer * coutpu0 = mgr->CreateContainer("coutpu0", TTree::Class(),\r
76 AliAnalysisManager::kExchangeContainer);\r
77 AliAnalysisDataContainer *coutput1_threeJets = mgr->CreateContainer("threeJets", TList::Class(),AliAnalysisManager::kOutputContainer,"threeJets.root");\r
78\r
79 mgr->ConnectInput (threeJets, 0, cinput);\r
80 mgr->ConnectOutput (threeJets, 0, coutpu0);\r
81 mgr->ConnectOutput (threeJets, 1, coutput1_Corr );\r
82 \r
83 return threeJets;\r
84}\r
85\r