Another histos for lumi
[u/mrichter/AliRoot.git] / PWGUD / UPC / AddTaskUpcPsi2s.C
CommitLineData
17c65770 1AliAnalysisTaskUpcPsi2s *AddTaskUpcPsi2s(Bool_t runTree = kTRUE,Bool_t runHist = kTRUE){
3d16cd00 2
3
4 //--- get the current analysis manager ---//
5 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
6 if (!mgr) {
7 Error("AddTask_UpcPsi2s", "No analysis manager found.");
8 return 0;
9 }
10
11 // Check the analysis type using the event handlers connected to the analysis manager.
12 //==============================================================================
13 if (!mgr->GetInputEventHandler()) {
14 Error("AddTask_UpcPsi2s", "This task requires an input event handler");
15 return 0;
16 }
17
18 TString inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
19
20 // Create tasks
21 AliAnalysisTaskUpcPsi2s *task = new AliAnalysisTaskUpcPsi2s(inputDataType.Data());
17c65770 22 task->SetRunTree(runTree);
23 task->SetRunHist(runHist);
353d9181 24 //task->SelectCollisionCandidates(AliVEvent::kAny);
3d16cd00 25 mgr->AddTask(task);
26
27
28 // Create containers for input/output
29 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
30 AliAnalysisDataContainer *coutput = mgr->CreateContainer("JPsiTree", TTree::Class(), AliAnalysisManager::kOutputContainer, Form("%s:UpcTree", AliAnalysisManager::GetCommonFileName()));
31 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("Psi2sTree", TTree::Class(), AliAnalysisManager::kOutputContainer, Form("%s:UpcTree", AliAnalysisManager::GetCommonFileName()));
f052ef6f 32 AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("ListTrig", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:UpcTree", AliAnalysisManager::GetCommonFileName()));
46e1d1dc 33 AliAnalysisDataContainer *coutput4 = mgr->CreateContainer("ListHist", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:UpcTree", AliAnalysisManager::GetCommonFileName()));
3d16cd00 34
35 // Connect input/output
36 mgr->ConnectInput(task, 0, cinput);
37 mgr->ConnectOutput(task, 1, coutput);
38 mgr->ConnectOutput(task, 2, coutput2);
39 mgr->ConnectOutput(task, 3, coutput3);
17c65770 40 mgr->ConnectOutput(task, 4, coutput4);
3d16cd00 41
42return task;
43}