]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/SPECTRA/macros/AddTaskStrange.C
Removing deprecated linearization and MC rescaling (now part of the centrality framework)
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / macros / AddTaskStrange.C
CommitLineData
95271782 1AliAnalysisTaskStrange *AddTaskStrange(Short_t lCollidingSystems=0, /*0 = pp, 1 = AA*/
043d4727 2 TString lAnalysisCut="no" )
cc1236ed 3{
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();
8 if (!mgr) {
9 ::Error("AddTaskStrange", "No analysis manager to connect to.");
10 return NULL;
11 }
12
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");
17 return NULL;
18 }
19 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
20
21 // Create and configure the task
043d4727 22 AliAnalysisTaskStrange *taskstrange = new AliAnalysisTaskStrange("TaskStrange");
cc1236ed 23 taskstrange->SetCollidingSystems(lCollidingSystems);
24 taskstrange->SetAnalysisType(type);
043d4727 25 taskstrange->SetAnalysisCut(lAnalysisCut);
cc1236ed 26 mgr->AddTask(taskstrange);
27
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 //==============================================================================
1ba92c7e 31 TString outputFileName = AliAnalysisManager::GetCommonFileName();
162aeefd 32 outputFileName += ":PWG2Strange";
1ba92c7e 33 if (lCollidingSystems) outputFileName += "_AA";
34 else outputFileName += "_PP";
35 if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC";
36
37 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clistStrange",
38 TList::Class(),
39 AliAnalysisManager::kOutputContainer,
40 outputFileName );
cc1236ed 41
043d4727 42 mgr->ConnectInput(taskstrange, 0, mgr->GetCommonInputContainer());
cc1236ed 43 mgr->ConnectOutput(taskstrange, 1, coutput1);
44 return taskstrange;
45}