]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG4/macros/AddTaskThreeJets.C
plotted delta pT for different cents
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskThreeJets.C
index 94019a14fadecc263220f37e9c6f0c763e626a70..5cbca109ebb35506d6101725db1ff7726af1a24d 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTaskThreeJets * AddTaskThreeJets()\r
+AliAnalysisTaskThreeJets * AddTaskThreeJets(char *bRec = "jets",char * bGen = "jetsAODMC_UA104")\r
 {\r
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
   if (!mgr) {\r
@@ -18,24 +18,37 @@ AliAnalysisTaskThreeJets * AddTaskThreeJets()
   \r
   AliAnalysisTaskThreeJets * threeJets = new  AliAnalysisTaskThreeJets("Three Jet Analysis");\r
   \r
-  threeJets->SetBranchGen("jetsMC"); \r
-  threeJets->SetBranchRec("jets");\r
+  threeJets->SetBranchRec(bRec);\r
+  threeJets->SetBranchGen(bGen); \r
+  //  threeJets->SetDebugLevel(10);\r
   threeJets->SetR(.5); \r
+  threeJets->SelectCollisionCandidates();\r
+  //  threeJets->SetUseMC(kFALSE); // explicitly switch of use of MC/search for MC Jets\r
+\r
+  \r
+  TString type = mgr->GetInputEventHandler()->GetDataType();\r
+  if(type == "AOD"){\r
+    threeJets->SetAODInput(kTRUE);\r
+  }\r
+  \r
+\r
+\r
   mgr->AddTask(threeJets);\r
    \r
+  \r
 \r
 \r
       \r
-   // Create ONLY the output containers for the data produced by the task.\r
-   // Get and connect other common input/output containers via the manager as below\r
-   //==============================================================================\r
-   AliAnalysisDataContainer *coutput1_Corr = mgr->CreateContainer("threeJets", TList::Class(),AliAnalysisManager::kOutputContainer,"threeJets.root");\r
+  // Create ONLY the output containers for the data produced by the task.\r
+  // Get and connect other common input/output containers via the manager as below\r
+  //==============================================================================\r
+  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
 \r
-   mgr->ConnectInput  (threeJets, 0, mgr->GetCommonInputContainer());\r
-   mgr->ConnectOutput (threeJets, 0, mgr->GetCommonOutputContainer());\r
-   mgr->ConnectOutput (threeJets,  1, coutput1_Corr );\r
-   \r
-   return threeJets;\r
+  mgr->ConnectInput  (threeJets, 0, mgr->GetCommonInputContainer());\r
+  mgr->ConnectOutput (threeJets, 0, mgr->GetCommonOutputContainer());\r
+  mgr->ConnectOutput (threeJets,  1, coutput1_Corr );\r
+  \r
+  return threeJets;\r
 }\r
 \r
 \r