]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/macros/AddTaskEmcalSetup.C
macro dir
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / macros / AddTaskEmcalSetup.C
1 // $Id$
2
3 AliEmcalSetupTask* AddTaskEmcalSetup()
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   {
10     ::Error("AddTaskEmcalSetup", "No analysis manager to connect to.");
11     return NULL;
12   }  
13   
14   // Check the analysis type using the event handlers connected to the analysis manager.
15   //==============================================================================
16   if (!mgr->GetInputEventHandler())
17   {
18     ::Error("AddTaskEmcalSetup", "This task requires an input event handler");
19     return NULL;
20   }
21   
22   //-------------------------------------------------------
23   // Init the task and do settings
24   //-------------------------------------------------------
25   AliEmcalSetupTask *eTask = new AliEmcalSetupTask("EmcalSetupTask");
26
27   //-------------------------------------------------------
28   // Final settings, pass to manager and set the containers
29   //-------------------------------------------------------
30
31   mgr->AddTask(eTask);
32   
33   // Create containers for input/output
34   AliAnalysisDataContainer *cinput1  = mgr->GetCommonInputContainer();
35   mgr->ConnectInput  (eTask, 0,  cinput1 );
36   return eTask;
37 }