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