]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/macros/AddTaskEMCALPi0V2.C
changes from fzhou
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / macros / AddTaskEMCALPi0V2.C
1 // $Id: AddTaskEMCALPi0V2.C 56081 2012-05-01 08:57:08Z loizides $
2
3 AliAnalysisTask *AddTaskEMCALPi0V2()
4 {
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("AddTaskEMCALPi0V2", "No analysis manager to connect to.");
10     return NULL;
11   }  
12
13   if (!mgr->GetInputEventHandler()) {
14     ::Error("AddTaskEMCALPi0V2", "This task requires an input event handler");
15     return NULL;
16   }
17
18   // Create the task and configure it.
19   //===========================================================================
20   AliAnalysisTaskPi0V2* ana = new  AliAnalysisTaskPi0V2("Pi0v2Task");
21   
22   mgr->AddTask(ana);
23   
24   // Create ONLY the output containers for the data produced by the task.
25   // Get and connect other common input/output containers via the manager as below
26   //==============================================================================
27   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("histosEMCALP0v2", 
28                                                             TList::Class(),AliAnalysisManager::kOutputContainer,
29                                                             Form("%s_v2task", AliAnalysisManager::GetCommonFileName()));
30   
31   mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());
32   mgr->ConnectOutput (ana, 1, coutput1 );
33    
34   return ana;
35 }