]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/macros/AddTaskEMCALPi0V2ShSh.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / macros / AddTaskEMCALPi0V2ShSh.C
1 //astahlle
2 AliAnalysisTaskEMCALPi0V2ShSh *AddTaskEMCALPi0V2ShSh()
3 {
4
5   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
6   
7   if (!mgr)
8     {
9       ::Error("AddTaskEMCALPi0V2ShSh", "No analysis manager to connect to.");
10       return NULL;
11     }  
12   
13   if (!mgr->GetInputEventHandler())
14     {
15       ::Error("AddTaskEventplane", "This task requires an input event handler");
16       return NULL;
17     }           
18   TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
19   
20   Bool_t ismc=kFALSE;
21   ismc = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE; 
22   cout<<"AddTaskEMCALPi0V2ShSh - MC config is: "<<ismc<<endl;
23   
24   if (ismc) return 0;
25   
26   UInt_t physMB = 0;
27   UInt_t physJet = 0;
28   UInt_t physGam = 0;
29   UInt_t physEMC = 0; 
30   
31   TString sGeomName = AliEMCALGeometry::GetDefaultGeometryName();
32   
33   AliAnalysisTaskEMCALPi0V2ShSh *task = new AliAnalysisTaskEMCALPi0V2ShSh("EMCALPi0ShowerShV2");
34   
35   task->SelectCollisionCandidates(AliVEvent::kSemiCentral);
36   
37   if(!ismc)
38     {           
39       mgr->AddTask(task);
40       
41       AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("hist", TList::Class(),AliAnalysisManager::kOutputContainer, Form("%s",AliAnalysisManager::GetCommonFileName()));
42       
43       mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
44       mgr->ConnectOutput(task, 1, coutput1);
45       
46     }
47   return task;
48 }
49