Set init parameters from args
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AddTaskCentral.C
CommitLineData
6f791cc3 1/**
2 * @defgroup pwg2_forward_scripts Scripts used in the analysis
3 *
4 * @ingroup pwg2_forward
5 */
6/**
7 * @file
8 * @ingroup pwg2_forward_scripts
9 *
10 */
11/**
12 * This is the macro to include the Forward multiplicity in a train.
13 *
14 * @ingroup pwg2_forward_scripts
15 */
137cb554 16AliAnalysisTask* AddTaskCentral(UShort_t sys=1, UShort_t sNN=900, Short_t field=5)
6f791cc3 17{
18 gSystem->Load("libPWG2forward2");
19
20 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
21 if (!mgr) {
22 Error("AddTaskCentral", "No analysis manager to connect to.");
23 return NULL;
24 }
25
26 // --- Make the task and add it to the manager ---------------------
27 AliCentralMultiplicityTask* task = new AliCentralMultiplicityTask("Central");
137cb554 28 task->InitManager(sys, sNN, field);
6f791cc3 29 mgr->AddTask(task);
30
31 // --- Make the output container and connect it --------------------
32 TString outputfile = AliAnalysisManager::GetCommonFileName();
33
34 AliAnalysisDataContainer* histOut =
35 mgr->CreateContainer("Central", TList::Class(),
36 AliAnalysisManager::kOutputContainer,outputfile);
37 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
38 mgr->ConnectOutput(task, 1, histOut);
39
40 return task;
41}