Typo fixed
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskDiJets.C
CommitLineData
ff3da4d6 1AliAnalysisTaskDiJets *AddTaskDiJets(Char_t *jb="jets")\r
0651dd18 2{\r
4e1c5c7c 3// Creates a dijet task, configures it and adds it to the analysis manager.\r
0651dd18 4\r
5 // Get the pointer to the existing analysis manager via the static access method.\r
6 //==============================================================================\r
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
8 if (!mgr) {\r
9c925459 9 ::Error("AddTaskDiJets", "No analysis manager to connect to.");\r
0651dd18 10 return NULL;\r
4e1c5c7c 11 }\r
12\r
0651dd18 13 // Check the analysis type using the event handlers connected to the analysis manager.\r
14 //==============================================================================\r
15 if (!mgr->GetInputEventHandler()) {\r
16 ::Error("AddTaskDiJets", "This task requires an input event handler");\r
17 return NULL;\r
18 }\r
19\r
20 // Create the task and configure it.\r
21 //===========================================================================\r
4e1c5c7c 22\r
7bb870ca 23 AliAnalysisTaskDiJets *dijetana = new AliAnalysisTaskDiJets(Form("DiJetAnalysis_%s",jb));\r
bebdac2c 24 dijetana->SetDebugLevel(0);\r
ec365e4a 25// dijetana->SetFillAOD(kTRUE);\r
7bb870ca 26 dijetana->SetJetBranch(jb);\r
0651dd18 27 mgr->AddTask(dijetana);\r
7bb870ca 28 \r
29 TString jbOut(jb);\r
ff3da4d6 30 jbOut = jbOut(4,jbOut.Sizeof());\r
7bb870ca 31 jbOut.ToLower();\r
4e1c5c7c 32\r
7bb870ca 33 AliAnalysisDataContainer *cout_dijet = mgr->CreateContainer(Form("dijets_%s",jbOut.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,\r
34 Form("%s:PWG4_DiJets_%s",AliAnalysisManager::GetCommonFileName(),jbOut.Data()));\r
4e1c5c7c 35\r
0651dd18 36 // Create ONLY the output containers for the data produced by the task.\r
37 // Get and connect other common input/output containers via the manager as below\r
38 //==============================================================================\r
39 mgr->ConnectInput (dijetana, 0, mgr->GetCommonInputContainer());\r
40 mgr->ConnectOutput (dijetana, 0, mgr->GetCommonOutputContainer());\r
4e1c5c7c 41 mgr->ConnectOutput (dijetana, 1, cout_dijet);\r
42\r
0651dd18 43 return dijetana;\r
44}\r