]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/SPECTRA/macros/AddTaskPerformanceStrange.C
Removing deprecated linearization and MC rescaling (now part of the centrality framework)
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / macros / AddTaskPerformanceStrange.C
CommitLineData
20fadf64 1AliAnalysisTaskPerformanceStrange *AddTaskPerformanceStrange(Short_t lCollidingSystems = 0, // 0->pp, 1->AA
2 Short_t lAnalysisMC = 1, // 0->No MC or 1->MC analysis
3 TString lAnalysisCut = "no",
4 TString lAnalysisPidMode = "withoutPID" )
e2e56010 5{
6// Creates, configures and attaches to the train a strangeness task.
7 // Get the pointer to the existing analysis manager via the static access method.
8 //==============================================================================
9 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
10 if (!mgr) {
11 ::Error("AddTaskPerformanceStrange", "No analysis manager to connect to.");
12 return NULL;
13 }
14
15 // Check the analysis type using the event handlers connected to the analysis manager.
16 //==============================================================================
17 if (!mgr->GetInputEventHandler()) {
18 ::Error("AddTaskPerformanceStrange", "This task requires an input event handler");
19 return NULL;
20 }
21 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
22
23 // Create and configure the task
24 AliAnalysisTaskPerformanceStrange *taskperformancestrange = new AliAnalysisTaskPerformanceStrange("TaskPerformanceStrange");
25 taskperformancestrange->SetCollidingSystems(lCollidingSystems);
26 taskperformancestrange->SetAnalysisType(type);
20fadf64 27 taskperformancestrange->SetAnalysisMC(lAnalysisMC);
e2e56010 28 taskperformancestrange->SetAnalysisCut(lAnalysisCut);
637a7e52 29 taskperformancestrange->SetUsePID(lAnalysisPidMode);
e2e56010 30 mgr->AddTask(taskperformancestrange);
31
32 // Create ONLY the output containers for the data produced by the task.
33 // Get and connect other common input/output containers via the manager as below
34 //==============================================================================
35 TString outputFileName = AliAnalysisManager::GetCommonFileName();
36 outputFileName += ":PWG2Strange";
37 if (lCollidingSystems) outputFileName += "_AA";
38 else outputFileName += "_PP";
39 if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC";
40
41 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clistPerformanceStrange",
42 TList::Class(),
43 AliAnalysisManager::kOutputContainer,
44 outputFileName );
45
46 mgr->ConnectInput(taskperformancestrange, 0, mgr->GetCommonInputContainer());
47 mgr->ConnectOutput(taskperformancestrange, 1, coutput1);
48 return taskperformancestrange;
637a7e52 49}
50