]>
Commit | Line | Data |
---|---|---|
e3d13f79 | 1 | AliAnalysisTask *AddTaskHFECalSys(int sysID, int TPCclust, int TPCclustPID, int Nits, int ITSstat, int QAhist) |
84bf4656 | 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/ConfigHFECalSys.C"); | |
29 | ||
e3d13f79 | 30 | AliAnalysisTaskHFECal *hfetaskCent = ConfigHFECalSys(MCthere,TPCclust,TPCclustPID,Nits,ITSstat,QAhist); |
31 | AliAnalysisTaskHFECal *hfetaskTrig= ConfigHFECalSys(MCthere,TPCclust,TPCclustPID,Nits,ITSstat,QAhist); | |
84bf4656 | 32 | |
33 | mgr->AddTask(hfetaskCent); | |
34 | mgr->AddTask(hfetaskTrig); | |
35 | ||
36 | // Semi-central trigger | |
37 | hfetaskCent->SelectCollisionCandidates(AliVEvent::kCentral); | |
38 | ||
39 | TString Output1(TString::Format("HFE_Results_EMCALCentral%d",sysID)); | |
40 | TString containerName = mgr->GetCommonFileName(); | |
41 | TString appendix(TString::Format(":PWGHF_hfeCalCentral%d",sysID)); | |
42 | containerName += appendix; | |
43 | ||
44 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
45 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Output1, 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 Output2(TString::Format("HFE_Results_EMCalTrigEGA%d",sysID)); | |
53 | TString containerName2 = mgr->GetCommonFileName(); | |
54 | TString appendix(TString::Format(":PWGHF_hfeCalTrigEGA%d",sysID)); | |
55 | containerName2 += appendix; | |
56 | ||
57 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
58 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Output2, TList::Class(),AliAnalysisManager::kOutputContainer, containerName2.Data()); | |
59 | mgr->ConnectInput(hfetaskTrig, 0, cinput); | |
60 | mgr->ConnectOutput(hfetaskTrig, 1, coutput1); | |
61 | ||
62 | //MB trigger | |
e3d13f79 | 63 | AliAnalysisTaskHFECal *hfetaskMB = ConfigHFECalSys(MCthere,TPCclust,TPCclustPID,Nits,ITSstat,QAhist); |
84bf4656 | 64 | mgr->AddTask(hfetaskMB); |
65 | hfetaskMB->SelectCollisionCandidates(AliVEvent::kMB); | |
66 | ||
67 | TString Output3(TString::Format("HFE_Results_EMCalMB%d",sysID)); | |
68 | TString containerName3 = mgr->GetCommonFileName(); | |
69 | TString appendix(TString::Format(":PWGHF_hfeCalkMB%d",sysID)); | |
70 | containerName3 += appendix; | |
71 | ||
72 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
73 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Output3, TList::Class(),AliAnalysisManager::kOutputContainer, containerName3.Data()); | |
74 | mgr->ConnectInput(hfetaskMB, 0, cinput); | |
75 | mgr->ConnectOutput(hfetaskMB, 1, coutput1); | |
76 | ||
77 | ||
78 | return NULL; | |
79 | } |