]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/Correlations/macros/dphicorrelations/AddTaskPhiCorrelationsQA.C
moving addtask macros to PWGCF
[u/mrichter/AliRoot.git] / PWGCF / Correlations / macros / dphicorrelations / AddTaskPhiCorrelationsQA.C
1 AliPhiCorrelationsQATask *AddTaskPhiCorrelationsQA()\r
2 {\r
3   // Get the pointer to the existing analysis manager via the static access method.\r
4   //==============================================================================\r
5   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
6   if (!mgr) {\r
7     ::Error("AddTaskPhiCorrelations", "No analysis manager to connect to.");\r
8     return NULL;\r
9   }  \r
10   \r
11   // Create the task and configure it.\r
12   //===========================================================================\r
13   AliPhiCorrelationsQATask* ana = new  AliPhiCorrelationsQATask("");\r
14   \r
15   ana->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kUserDefined);\r
16   \r
17   Bool_t isMC = (mgr->GetMCtruthEventHandler() != NULL);\r
18   if (isMC)\r
19     ana->SetUseUncheckedCentrality();\r
20   \r
21   mgr->AddTask(ana);\r
22   \r
23   // Create ONLY the output containers for the data produced by the task.\r
24   // Get and connect other common input/output containers via the manager as below\r
25   //==============================================================================\r
26   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("histosPhiCorrelationsQA", TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s", AliAnalysisManager::GetCommonFileName()));\r
27   \r
28   mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());\r
29   mgr->ConnectOutput (ana, 1, coutput1 );\r
30    \r
31   return ana;\r
32 }\r