updated
[u/mrichter/AliRoot.git] / PWGHF / hfe / macros / AddTaskHFEemcQA.C
CommitLineData
76e813d0 1AliAnalysisTask *AddTaskHFEemcQA(Bool_t FillElecSparse=kFALSE){
824c6477 2 //get the current analysis manager
3 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
4 if (!mgr) {
5 Error("AddTaskHFE", "No analysis manager found.");
6 return NULL;
7 }
8 if (!mgr->GetInputEventHandler()) {
9 ::Error("AddTaskHFE", "This task requires an input event handler");
10 return NULL;
11 }
12 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
13
14 Bool_t MCthere=kFALSE;
15 AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*>(mgr->GetMCtruthEventHandler());
16 if(!mcH){
17 MCthere=kFALSE;
18 }else{
19 MCthere=kTRUE;
20 }
21
824c6477 22 // +++ EMCal MB
23 AliAnalysisTaskHFEemcQA *hfecalqa = new AliAnalysisTaskHFEemcQA("emcqa");
24 mgr->AddTask(hfecalqa);
25 hfecalqa->SelectCollisionCandidates(AliVEvent::kINT8);
76e813d0 26 hfecalqa->SetElecIDsparse(FillElecSparse);
27
824c6477 28 TString containerName = mgr->GetCommonFileName();
29 containerName += ":PWGHF_hfeHFEemcQAINT8";
30 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
31 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("HFEemcQAINT8", TList::Class(),AliAnalysisManager::kOutputContainer, containerName.Data());
32 mgr->ConnectInput(hfecalqa, 0, cinput);
33 mgr->ConnectOutput(hfecalqa, 1, coutput1);
824c6477 34
a68bbaf6 35 AliAnalysisTaskHFEemcQA *hfecalqa7 = new AliAnalysisTaskHFEemcQA("emcqa");
36 mgr->AddTask(hfecalqa7);
37 hfecalqa7->SelectCollisionCandidates(AliVEvent::kINT7);
76e813d0 38 hfecalqa7->SetElecIDsparse(FillElecSparse);
39
a68bbaf6 40 TString containerName7 = mgr->GetCommonFileName();
41 containerName7 += ":PWGHF_hfeHFEemcQAINT7";
42 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
43 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("HFEemcQAINT7", TList::Class(),AliAnalysisManager::kOutputContainer, containerName7.Data());
44 mgr->ConnectInput(hfecalqa7, 0, cinput);
45 mgr->ConnectOutput(hfecalqa7, 1, coutput1);
46
824c6477 47 // EMCal EGA
48 AliAnalysisTaskHFEemcQA *hfecalqaTrig0 = new AliAnalysisTaskHFEemcQA("emcqa");
49 mgr->AddTask(hfecalqaTrig0);
50 hfecalqaTrig0->SelectCollisionCandidates(AliVEvent::kEMCEGA);
76e813d0 51 hfecalqaTrig0->SetElecIDsparse(FillElecSparse);
52
824c6477 53 TString containerName1 = mgr->GetCommonFileName();
54 containerName1 += ":PWGHF_hfeHFEemcQATrigGA";
55 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
56 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("HFEemcQATrigGA", TList::Class(),AliAnalysisManager::kOutputContainer, containerName1.Data());
57 mgr->ConnectInput(hfecalqaTrig0, 0, cinput);
58 mgr->ConnectOutput(hfecalqaTrig0, 1, coutput1);
59
60
61 // EMCal EJE
62 AliAnalysisTaskHFEemcQA *hfecalqaTrig1 = new AliAnalysisTaskHFEemcQA("emcqa");
63 mgr->AddTask(hfecalqaTrig1);
64 hfecalqaTrig1->SelectCollisionCandidates(AliVEvent::kEMCEJE);
76e813d0 65 hfecalqaTrig1->SetElecIDsparse(FillElecSparse);
66
824c6477 67 TString containerName2 = mgr->GetCommonFileName();
a68bbaf6 68 containerName2 += ":PWGHF_hfeHFEemcQATrigJE";
824c6477 69 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
70 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("HFEemcQATrigJE", TList::Class(),AliAnalysisManager::kOutputContainer, containerName2.Data());
71 mgr->ConnectInput(hfecalqaTrig1, 0, cinput);
72 mgr->ConnectOutput(hfecalqaTrig1, 1, coutput1);
73
74 //return hfecalqa;
75 return NULL;
76}