1 AliAnalysisTaskCentral* AddTaskCentral(){
3 // Get the pointer to the existing analysis manager via the static access method.
4 //==============================================================================
5 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
7 ::Error("AddTaskCentral", "No analysis manager to connect to!");
11 // Check the analysis type using the event handlers connected to the analysis manager.
12 //==============================================================================
13 if (!mgr->GetInputEventHandler()) {
14 ::Error("AddTaskCentral", "This task requires an input event handler!");
18 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
21 ::Error("AddTaskCentral", "This task is not tested for AOD analysis!");
25 // Create and configure the task
26 AliAnalysisTaskCentral *taskcentral = new AliAnalysisTaskCentral("TaskCentral");
27 mgr->AddTask(taskcentral);
29 // Create ONLY the output containers for the data produced by the task.
30 // Get and connect other common input/output containers via the manager as below
31 //==============================================================================
32 TString outputFileName = AliAnalysisManager::GetCommonFileName();
33 outputFileName += ":PWG2Central";
35 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("cobCentral",
37 AliAnalysisManager::kOutputContainer,
40 mgr->ConnectInput(taskcentral, 0, mgr->GetCommonInputContainer());
41 mgr->ConnectOutput(taskcentral, 0, coutput1);