]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/AddTaskCentralMult.C
b7d5d50545f617c453281ff558e75c5d3b448e80
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AddTaskCentralMult.C
1 /**
2  * @file   AddTaskCentralMult.C
3  * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
4  * @date   Wed Mar 23 12:13:25 2011
5  * 
6  * @brief  
7  * 
8  * 
9  * @ingroup pwg2_forward_scripts_tasks
10  */
11
12 /**
13  * This is the macro to include the Central multiplicity in a train.  
14  * 
15  * @ingroup pwg2_forward_aod
16  */
17 AliAnalysisTask* 
18 AddTaskCentralMult(UShort_t sys=0, UShort_t sNN=0, Short_t field=0)
19 {
20   gSystem->Load("libPWG2forward2");
21
22   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
23   if (!mgr) {
24     Error("AddTaskCentralMult", "No analysis manager to connect to.");
25     return NULL;
26   }   
27
28   // --- Make the task and add it to the manager ---------------------
29   AliCentralMultiplicityTask* task = new AliCentralMultiplicityTask("Central");
30   if(sys>0 && sNN > 0)
31     task->GetManager().Init(sys, sNN, field);
32   mgr->AddTask(task);
33   
34   // --- Make the output container and connect it --------------------
35   TString outputfile = AliAnalysisManager::GetCommonFileName();
36   
37   AliAnalysisDataContainer* histOut = 
38     mgr->CreateContainer("Central", TList::Class(), 
39                          AliAnalysisManager::kOutputContainer,outputfile);
40   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
41   mgr->ConnectOutput(task, 1, histOut);
42   
43   return task;
44 }
45 //
46 // EOF
47 //