1 AliAnalysisTaskStrange *AddTaskStrange(Short_t lCollidingSystems=0, /*0 = pp, 1 = AA*/,
2 TString lAnalysisCut="no" )
4 // Creates, configures and attaches to the train a strangeness task.
5 // Get the pointer to the existing analysis manager via the static access method.
6 //==============================================================================
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
9 ::Error("AddTaskStrange", "No analysis manager to connect to.");
13 // Check the analysis type using the event handlers connected to the analysis manager.
14 //==============================================================================
15 if (!mgr->GetInputEventHandler()) {
16 ::Error("AddTaskStrange", "This task requires an input event handler");
19 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
21 // Create and configure the task
22 AliAnalysisTaskStrange *taskstrange = new AliAnalysisTaskStrange("TaskStrange");
23 taskstrange->SetCollidingSystems(lCollidingSystems);
24 taskstrange->SetAnalysisType(type);
25 taskstrange->SetAnalysisCut(lAnalysisCut);
26 mgr->AddTask(taskstrange);
28 // Create ONLY the output containers for the data produced by the task.
29 // Get and connect other common input/output containers via the manager as below
30 //==============================================================================
31 TString outname = "PP";
32 if (lCollidingSystems) outname = "AA";
33 if (mgr->GetMCtruthEventHandler()) outname += "-MC-";
34 outname += "StrangeList.root";
35 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clistStrange",
37 AliAnalysisManager::kOutputContainer,
40 mgr->ConnectInput(taskstrange, 0, mgr->GetCommonInputContainer());
41 mgr->ConnectOutput(taskstrange, 1, coutput1);