]>
Commit | Line | Data |
---|---|---|
0f347e61 | 1 | AliAnalysisTask *AddTaskHFECalPbPbSys(int trigtype, int TPCclust, int Nits, double nSigMim, double Mimeop, double Maxeop, int PIDorder, int sysID){ |
97966e84 | 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 | if (type=="AOD"){ | |
14 | ::Error("AddTaskHFE", "The tasks exits because AODs are in input"); | |
15 | return NULL; | |
16 | } | |
17 | Bool_t MCthere=kFALSE; | |
18 | AliMCEventHandler *mcH = dynamic_cast<AliMCEventHandler*>(mgr->GetMCtruthEventHandler()); | |
19 | if(!mcH){ | |
20 | MCthere=kFALSE; | |
21 | }else{ | |
22 | MCthere=kTRUE; | |
23 | } | |
24 | cout<<"AddTaskHFE - MC config is: "<<MCthere<<endl; | |
25 | ||
26 | //============= Set Task Name =================== | |
27 | //TString taskName=("AliAnalysisTaskHFE.cxx+"); | |
28 | //=============================================== | |
29 | ||
30 | gROOT->LoadMacro("$ALICE_ROOT/PWGHF/hfe/macros/configs/PbPb/ConfigHFECalSys_PbPb.C"); | |
31 | ||
32 | AliAnalysisTaskHFE *hfetask = ConfigHFECalSys_PbPb(MCthere,TPCclust,Nits,nSigMim,Mimeop,Maxeop,PIDorder); | |
33 | //RequestMemory(hfetask, 250*1024); | |
34 | if(trigtype==0)hfetask->SelectCollisionCandidates(AliVEvent::kEMCEGA); | |
35 | if(trigtype==1)hfetask->SelectCollisionCandidates(AliVEvent::kCentral); | |
22f86afc | 36 | if(trigtype==2)hfetask->SelectCollisionCandidates(AliVEvent::kSemiCentral); |
37 | if(trigtype==3)hfetask->SelectCollisionCandidates(AliVEvent::kMB); | |
0f347e61 | 38 | if(trigtype==4)hfetask->SelectCollisionCandidates(AliVEvent::kEMCEJE); |
97966e84 | 39 | mgr->AddTask(hfetask); |
40 | ||
41 | int inSig = (int)(nSigMim*10.0); | |
42 | int iMimeop = (int)(Mimeop*10.0); | |
43 | int iMaxeop = (int)(Maxeop*10.0); | |
44 | ||
45 | //find input container | |
46 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
47 | TString containerName = mgr->GetCommonFileName(); | |
0f347e61 | 48 | TString appendix(TString::Format(":PWGHF_hfeCalPbPbTrig%dTPC%dITS%dnSig%dMimeop%dMaxeop%dPID%d",trigtype,TPCclust,Nits,inSig,iMimeop,iMaxeop,PIDorder)); |
49 | //if(trigtype==1)appendix(TString::Format(":PWGHF_hfeCentTPC%dITS%dnSig%dMimeop%dMaxeop%dPID%d",TPCclust,Nits,inSig,iMimeop,iMaxeop,PIDorder)); | |
50 | //if(trigtype==2)appendix(TString::Format(":PWGHF_hfeSemiTPC%dITS%dnSig%dMimeop%dMaxeop%dPID%d",TPCclust,Nits,inSig,iMimeop,iMaxeop,PIDorder)); | |
51 | //if(trigtype==3)appendix(TString::Format(":PWGHF_hfekMBTPC%dITS%dnSig%dMimeop%dMaxeop%dPID%d",TPCclust,Nits,inSig,iMimeop,iMaxeop,PIDorder)); | |
97966e84 | 52 | //containerName += ":PWGHF_hfeCalPbPbEGA"; |
53 | containerName += appendix; | |
54 | ||
0f347e61 | 55 | |
56 | TString Output1(TString::Format("HFE_Results_EMCALSys_SysID%d",sysID)); | |
57 | TString Output2(TString::Format("HFE_QA_EMCALSYS_SysID%d",sysID)); | |
58 | ||
59 | hfetask->ConnectOutput(1, mgr->CreateContainer(Output1, TList::Class(), | |
60 | AliAnalysisManager::kOutputContainer, containerName.Data())); | |
61 | hfetask->ConnectOutput(2, mgr->CreateContainer(Output2, TList::Class(), | |
62 | AliAnalysisManager::kOutputContainer, containerName.Data())); | |
63 | ||
64 | /* | |
97966e84 | 65 | hfetask->ConnectOutput(1, mgr->CreateContainer("HFE_Results_EMCALSys", TList::Class(), |
66 | AliAnalysisManager::kOutputContainer, containerName.Data())); | |
67 | hfetask->ConnectOutput(2, mgr->CreateContainer("HFE_QA_EMCALSys", TList::Class(), | |
68 | AliAnalysisManager::kOutputContainer, containerName.Data())); | |
0f347e61 | 69 | */ |
97966e84 | 70 | mgr->ConnectInput (hfetask, 0, cinput ); |
71 | ||
72 | /* | |
73 | //<--- task2 for central trigger | |
74 | ||
75 | AliAnalysisTaskHFE *hfetask2 = ConfigHFECalstandard_PbPb(MCthere,TPCclust); | |
76 | hfetask2->SelectCollisionCandidates(AliVEvent::kCentral); | |
77 | mgr->AddTask(hfetask2); | |
78 | ||
79 | //find input container | |
80 | TString containerName2 = mgr->GetCommonFileName(); | |
81 | containerName2 += ":PWGHF_hfeCalPbPbCent"; | |
82 | ||
83 | hfetask2->ConnectOutput(1, mgr->CreateContainer("HFE_Results_EMCALCent", TList::Class(), | |
84 | AliAnalysisManager::kOutputContainer, containerName2.Data())); | |
85 | hfetask2->ConnectOutput(2, mgr->CreateContainer("HFE_QA_EMCALCent", TList::Class(), | |
86 | AliAnalysisManager::kOutputContainer, containerName2.Data())); | |
87 | ||
88 | mgr->ConnectInput (hfetask2, 0, cinput ); | |
89 | */ | |
90 | ||
91 | /* | |
92 | AliAnalysisTaskHFE *trdtask = ConfigHFEtrd(MCthere); | |
93 | ||
94 | //---------------------- | |
95 | //create data containers | |
96 | //---------------------- | |
97 | ||
98 | trdtask->ConnectOutput(1, mgr->CreateContainer("HFE_Results", TList::Class(), | |
99 | AliAnalysisManager::kOutputContainer, containerName.Data())); | |
100 | trdtask->ConnectOutput(2, mgr->CreateContainer("HFE_QA", TList::Class(), | |
101 | AliAnalysisManager::kOutputContainer, containerName.Data())); | |
102 | mgr->ConnectInput (trdtask, 0, cinput ); | |
103 | */ | |
104 | ||
105 | //return hfetask; | |
106 | return NULL; | |
107 | } |