add jet trigger
[u/mrichter/AliRoot.git] / PWGHF / hfe / macros / AddTaskHFECal.C
CommitLineData
a7506fdf 1AliAnalysisTask *AddTaskHFECal()
2{
3 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
4 if (!mgr) {
5 Error("AddTaskHFEECal", "No analysis manager found.");
6 return NULL;
7 }
8
9 if (!mgr->GetInputEventHandler()) {
10 ::Error("AddTaskHFECal", "This task requires an input event handler");
11 return NULL;
12 }
13 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
14 if (type=="AOD"){
15 ::Error("AddTaskHFECal", "The tasks exits because AODs are in input");
16 return NULL;
17 }
18 Bool_t MCthere=kFALSE;
19 AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*>(mgr->GetMCtruthEventHandler());
20 if(!mcH){
21 MCthere=kFALSE;
22 }else{
23 MCthere=kTRUE;
24 }
25
26
27 //analysis task
28 gROOT->LoadMacro("$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/ConfigHFECal.C");
29
30 AliAnalysisTaskHFECal *hfetaskCent = ConfigHFECal(MCthere);
31 AliAnalysisTaskHFECal *hfetaskTrig= ConfigHFECal(MCthere);
aeec54aa 32 AliAnalysisTaskHFECal *hfetaskTrig2= ConfigHFECal(MCthere);
a7506fdf 33
34 mgr->AddTask(hfetaskCent);
35 mgr->AddTask(hfetaskTrig);
aeec54aa 36 mgr->AddTask(hfetaskTrig2);
a7506fdf 37
aeec54aa 38 // central trigger
a7506fdf 39 hfetaskCent->SelectCollisionCandidates(AliVEvent::kCentral);
40
41 TString containerName = mgr->GetCommonFileName();
42 containerName += ":PWGHF_hfeCalCentral";
43
44 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
45 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("HFE_Results_EMCalCentral", TList::Class(),AliAnalysisManager::kOutputContainer, containerName.Data());
46 mgr->ConnectInput(hfetaskCent, 0, cinput);
47 mgr->ConnectOutput(hfetaskCent, 1, coutput1);
48
49 //L1 gamma trigger
50 hfetaskTrig->SelectCollisionCandidates(AliVEvent::kEMCEGA);
51
52 TString containerName2 = mgr->GetCommonFileName();
53 containerName2 += ":PWGHF_hfeCalTrigEGA";
54
55 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
56 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("HFE_Results_EMCalTrigEGA", TList::Class(),AliAnalysisManager::kOutputContainer, containerName2.Data());
57 mgr->ConnectInput(hfetaskTrig, 0, cinput);
58 mgr->ConnectOutput(hfetaskTrig, 1, coutput1);
59
aeec54aa 60
61 //Jet trigger
62 hfetaskTrig2->SelectCollisionCandidates(AliVEvent::kEMCEJE);
63
64 TString containerName3 = mgr->GetCommonFileName();
65 containerName3 += ":PWGHF_hfeCalTrigEJE";
66
67 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
68 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("HFE_Results_EMCalTrigEJE", TList::Class(),AliAnalysisManager::kOutputContainer, containerName3.Data());
69 mgr->ConnectInput(hfetaskTrig2, 0, cinput);
70 mgr->ConnectOutput(hfetaskTrig2, 1, coutput1);
71
72
b12bc641 73 //if(MCthere)
74 //{
af8b0200 75 //MB trigger
76 AliAnalysisTaskHFECal *hfetaskMB = ConfigHFECal(MCthere);
77 mgr->AddTask(hfetaskMB);
78 hfetaskMB->SelectCollisionCandidates(AliVEvent::kMB);
79
80 TString containerName3 = mgr->GetCommonFileName();
81 containerName3 += ":PWGHF_hfeCalkMB";
82
83 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
84 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("HFE_Results_EMCalMB", TList::Class(),AliAnalysisManager::kOutputContainer, containerName3.Data());
85 mgr->ConnectInput(hfetaskMB, 0, cinput);
86 mgr->ConnectOutput(hfetaskMB, 1, coutput1);
b12bc641 87 //}
af8b0200 88
89
a7506fdf 90 return NULL;
91}