]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/AddTaskJetServices.C
new selection of good events on top of AlihyicsSelection, only loose vtx cuts by now
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskJetServices.C
1 AliAnalysisTaskJetServices *AddTaskJetServices()\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("AddTaskJetServices", "No analysis manager to connect to.");\r
8       return NULL;\r
9    }  \r
10    \r
11    // Check the analysis type using the event handlers connected to the analysis manager.\r
12    //==============================================================================\r
13    if (!mgr->GetInputEventHandler()) {\r
14      ::Error("AddTaskJetServices", "This task requires an input event handler");\r
15       return NULL;\r
16    }\r
17 \r
18    TString type = mgr->GetInputEventHandler()->GetDataType();\r
19    type.ToUpper();\r
20    // Create the task and configure it.\r
21    //===========================================================================\r
22    \r
23    AliAnalysisTaskJetServices* pwg4serv = new  AliAnalysisTaskJetServices("JetServices");\r
24       \r
25 \r
26    if(type == "AOD"){\r
27      pwg4serv->SetAODInput(kTRUE);\r
28    }\r
29    mgr->AddTask(pwg4serv);\r
30      \r
31    // Create ONLY the output containers for the data produced by the task.\r
32    // Get and connect other common input/output containers via the manager as below\r
33    //==============================================================================\r
34    AliAnalysisDataContainer *coutput1_Serv = mgr->CreateContainer("pwg4serv", TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWG4_services",AliAnalysisManager::GetCommonFileName()));\r
35 \r
36    mgr->ConnectInput  (pwg4serv, 0, mgr->GetCommonInputContainer());\r
37    mgr->ConnectOutput (pwg4serv, 0, mgr->GetCommonOutputContainer());\r
38    mgr->ConnectOutput (pwg4serv,  1, coutput1_Serv );\r
39    \r
40    return pwg4serv;\r
41 }\r