]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/hfe/macros/AddTaskHFEemcQA.C
changed output dir name
[u/mrichter/AliRoot.git] / PWGHF / hfe / macros / AddTaskHFEemcQA.C
1 AliAnalysisTask *AddTaskHFEemcQA(Bool_t UseTender=kTRUE, Bool_t FillElecSparse=kFALSE){
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   
22
23   // +++ EMCal MB
24   AliAnalysisTaskHFEemcQA *hfecalqa = new AliAnalysisTaskHFEemcQA("emcqa");
25   mgr->AddTask(hfecalqa);
26   hfecalqa->SelectCollisionCandidates(AliVEvent::kINT8);
27   hfecalqa->SetElecIDsparse(FillElecSparse);
28   hfecalqa->SetTenderSwitch(UseTender);
29
30   TString containerName = mgr->GetCommonFileName();
31   if(UseTender)
32      {
33       containerName += ":PWGHF_hfeHFEemcQAINT8_wTender";
34      }
35   else
36      {
37       containerName += ":PWGHF_hfeHFEemcQAINT8";
38      }
39   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
40   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("HFEemcQAINT8", TList::Class(),AliAnalysisManager::kOutputContainer, containerName.Data());
41   mgr->ConnectInput(hfecalqa, 0, cinput);
42   mgr->ConnectOutput(hfecalqa, 1, coutput1); 
43
44   AliAnalysisTaskHFEemcQA *hfecalqa7 = new AliAnalysisTaskHFEemcQA("emcqa");
45   mgr->AddTask(hfecalqa7);
46   hfecalqa7->SelectCollisionCandidates(AliVEvent::kINT7);
47   hfecalqa7->SetElecIDsparse(FillElecSparse);
48   hfecalqa7->SetTenderSwitch(UseTender);
49
50   TString containerName7 = mgr->GetCommonFileName();
51   if(UseTender)
52      {
53       containerName7 += ":PWGHF_hfeHFEemcQAINT7_wTender";
54      }
55   else
56      {
57       containerName7 += ":PWGHF_hfeHFEemcQAINT7";
58      }
59   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
60   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("HFEemcQAINT7", TList::Class(),AliAnalysisManager::kOutputContainer, containerName7.Data());
61   mgr->ConnectInput(hfecalqa7, 0, cinput);
62   mgr->ConnectOutput(hfecalqa7, 1, coutput1); 
63
64   // EMCal EGA
65   AliAnalysisTaskHFEemcQA *hfecalqaTrig0 = new AliAnalysisTaskHFEemcQA("emcqa");
66   mgr->AddTask(hfecalqaTrig0);
67   hfecalqaTrig0->SelectCollisionCandidates(AliVEvent::kEMCEGA);
68   hfecalqaTrig0->SetElecIDsparse(FillElecSparse);
69   hfecalqaTrig0->SetTenderSwitch(UseTender);
70
71   TString containerName1 = mgr->GetCommonFileName();
72   if(UseTender)
73      {
74       containerName1 += ":PWGHF_hfeHFEemcQATrigGA_wTender";
75      }
76   else
77      {
78       containerName1 += ":PWGHF_hfeHFEemcQATrigGA";
79      } 
80   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
81   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("HFEemcQATrigGA", TList::Class(),AliAnalysisManager::kOutputContainer, containerName1.Data());
82   mgr->ConnectInput(hfecalqaTrig0, 0, cinput);
83   mgr->ConnectOutput(hfecalqaTrig0, 1, coutput1); 
84
85  
86   // EMCal EJE
87   AliAnalysisTaskHFEemcQA *hfecalqaTrig1 = new AliAnalysisTaskHFEemcQA("emcqa");
88   mgr->AddTask(hfecalqaTrig1);
89   hfecalqaTrig1->SelectCollisionCandidates(AliVEvent::kEMCEJE);
90   hfecalqaTrig1->SetElecIDsparse(FillElecSparse);
91   hfecalqaTrig1->SetTenderSwitch(UseTender);
92
93   TString containerName2 = mgr->GetCommonFileName();
94   if(UseTender)
95      {
96       containerName2 += ":PWGHF_hfeHFEemcQATrigJE_wTender";
97      }
98   else
99      {
100       containerName2 += ":PWGHF_hfeHFEemcQATrigJE";
101      }
102
103   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer();
104   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("HFEemcQATrigJE", TList::Class(),AliAnalysisManager::kOutputContainer, containerName2.Data());
105   mgr->ConnectInput(hfecalqaTrig1, 0, cinput);
106   mgr->ConnectOutput(hfecalqaTrig1, 1, coutput1); 
107
108   //return hfecalqa;
109   return NULL;
110 }